diff options
author | Sebastian Dröge <slomo@circular-chaos.org> | 2008-05-16 21:56:24 +0000 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2008-05-16 21:56:24 +0000 |
commit | 8c254cffdc2ac425fd807c563fab7634ccffaf82 (patch) | |
tree | 6301b592703c7f70ca72f9e94f305d89036c3f1e /tests | |
parent | e9370329dd317230bb2832b2f5f73434f2074e87 (diff) |
gst/interleave/: Add support for all raw audio formats and provide better negotiation if the caps are changing.
Original commit message from CVS:
* gst/interleave/Makefile.am:
* gst/interleave/deinterleave.c: (deinterleave_24),
(gst_deinterleave_finalize), (gst_deinterleave_base_init),
(gst_deinterleave_class_init), (gst_deinterleave_init),
(gst_deinterleave_add_new_pads), (gst_deinterleave_set_pads_caps),
(gst_deinterleave_set_process_function),
(gst_deinterleave_sink_setcaps), (__remove_channels),
(__set_channels), (gst_deinterleave_getcaps),
(gst_deinterleave_process), (gst_deinterleave_chain),
(gst_deinterleave_sink_activate_push):
* gst/interleave/deinterleave.h:
Add support for all raw audio formats and provide better negotiation
if the caps are changing.
Don't allow changes of the channel positions and set the position of
the corresponding channel on the src pad caps.
General cleanup and smaller bugfixes.
* tests/check/elements/deinterleave.c: (float_buffer_check_probe):
Check the channel positions on the output buffer caps.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/elements/deinterleave.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/check/elements/deinterleave.c b/tests/check/elements/deinterleave.c index 22ac0842..c22acaca 100644 --- a/tests/check/elements/deinterleave.c +++ b/tests/check/elements/deinterleave.c @@ -55,7 +55,7 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-float, " "width = (int) 32, " - "channels = (int) 2, " + "channels = (int) { 2, 3 }, " "rate = (int) {32000, 48000}, " "endianness = (int) BYTE_ORDER")); #define CAPS_32khz \ @@ -417,14 +417,30 @@ float_buffer_check_probe (GstPad * pad, GstBuffer * buf, gpointer userdata) gfloat *data; guint padnum, numpads; guint num, i; + GstCaps *caps; + GstStructure *s; + GstAudioChannelPosition *pos; + gint channels; fail_unless_equals_int (sscanf (GST_PAD_NAME (pad), "src%u", &padnum), 1); numpads = pads_created; + /* Check caps */ + caps = GST_BUFFER_CAPS (buf); + fail_unless (caps != NULL); + s = gst_caps_get_structure (caps, 0); + fail_unless (gst_structure_get_int (s, "channels", &channels)); + fail_unless_equals_int (channels, 1); + fail_unless (gst_structure_has_field (s, "channel-positions")); + pos = gst_audio_get_channel_positions (s); + fail_unless (pos != NULL && pos[0] == GST_AUDIO_CHANNEL_POSITION_NONE); + g_free (pos); + data = (gfloat *) GST_BUFFER_DATA (buf); num = GST_BUFFER_SIZE (buf) / sizeof (gfloat); + /* Check buffer content */ for (i = 0; i < num; ++i) { guint val, rest; |