{
PROP_0,
PROP_OUTPUT_BUFFER_DURATION,
+ PROP_OUTPUT_BUFFER_SIZE,
PROP_ALIGNMENT_THRESHOLD,
PROP_DISCONT_WAIT,
PROP_STRICT_BUFFER_SIZE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
GST_PARAM_MUTABLE_READY));
+ /**
+ * GstAudioBufferSplit:output-buffer-size
+ *
+ * Allow specifying a buffer size for splitting. Zero by default.
+ * Takes precedence over output-buffer-duration when set to a
+ * non zero value else will not be in effect.
+ *
+ * Since: 1.20
+ */
+ g_object_class_install_property (gobject_class, PROP_OUTPUT_BUFFER_SIZE,
+ g_param_spec_uint ("output-buffer-size", "Output buffer size",
+ "Output block size in bytes, takes precedence over "
+ "buffer duration when set to non zero", 0, G_MAXINT, 0,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
+ GST_PARAM_MUTABLE_READY));
+
g_object_class_install_property (gobject_class, PROP_ALIGNMENT_THRESHOLD,
g_param_spec_uint64 ("alignment-threshold", "Alignment Threshold",
"Timestamp alignment threshold in nanoseconds", 0,
self->output_buffer_duration_d = DEFAULT_OUTPUT_BUFFER_DURATION_D;
self->strict_buffer_size = DEFAULT_STRICT_BUFFER_SIZE;
self->gapless = DEFAULT_GAPLESS;
+ self->output_buffer_size = 0;
self->adapter = gst_adapter_new ();
goto out;
}
+ if (self->output_buffer_size) {
+ self->output_buffer_duration_n = GST_AUDIO_INFO_BPF (&self->info);
+ self->output_buffer_duration_d = self->output_buffer_size;
+ }
+
self->samples_per_buffer =
(((guint64) GST_AUDIO_INFO_RATE (&self->info)) *
self->output_buffer_duration_n) / self->output_buffer_duration_d;
gst_value_get_fraction_denominator (value);
gst_audio_buffer_split_update_samples_per_buffer (self);
break;
+ case PROP_OUTPUT_BUFFER_SIZE:
+ self->output_buffer_size = g_value_get_uint (value);
+ gst_audio_buffer_split_update_samples_per_buffer (self);
+ break;
case PROP_ALIGNMENT_THRESHOLD:
GST_OBJECT_LOCK (self);
gst_audio_stream_align_set_alignment_threshold (self->stream_align,
gst_value_set_fraction (value, self->output_buffer_duration_n,
self->output_buffer_duration_d);
break;
+ case PROP_OUTPUT_BUFFER_SIZE:
+ g_value_set_uint (value, self->output_buffer_size);
+ break;
case PROP_ALIGNMENT_THRESHOLD:
GST_OBJECT_LOCK (self);
g_value_set_uint64 (value,