From bdcc0390aff2b91ceb48fb169e7c155f3e84f4ba Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Fri, 29 Aug 2014 15:07:58 +0200 Subject: [PATCH] interleave: Fix the example by setting channel-masks in the sink pads The current example does not work, it fails with: ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstWavParse:wavparse0: Internal data flow error. gstwavparse.c(2178): gst_wavparse_loop (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstWavParse:wavparse0: streaming task paused, reason not-negotiated (-4) This is because negotiation with wavenc gets messed up by the missing channel positions configuration. The proper way to define the channel layout when using the interleave element in code would be to set the channel-positions property, but gst-launch-1.0 does not know how to deal with arrays; so the example pipeline works around the issue by setting the channel-masks in the sink pads. Also fix a repetition in the deinterleave example description https://bugzilla.gnome.org/show_bug.cgi?id=735673 --- gst/interleave/interleave.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gst/interleave/interleave.c b/gst/interleave/interleave.c index f27591a..45d72f9 100644 --- a/gst/interleave/interleave.c +++ b/gst/interleave/interleave.c @@ -49,11 +49,14 @@ * |[ * gst-launch-1.0 filesrc location=file.mp3 ! decodebin ! audioconvert ! "audio/x-raw,channels=2" ! deinterleave name=d interleave name=i ! audioconvert ! wavenc ! filesink location=test.wav d.src_0 ! queue ! audioconvert ! i.sink_1 d.src_1 ! queue ! audioconvert ! i.sink_0 * ]| Decodes and deinterleaves a Stereo MP3 file into separate channels and - * then interleaves the channels again to a WAV file with the channel with the - * channels exchanged. + * then interleaves the channels again to a WAV file with the channels + * exchanged. * |[ - * gst-launch-1.0 interleave name=i ! audioconvert ! wavenc ! filesink location=file.wav filesrc location=file1.wav ! decodebin ! audioconvert ! "audio/x-raw,channels=1" ! queue ! i.sink_0 filesrc location=file2.wav ! decodebin ! audioconvert ! "audio/x-raw,channels=1" ! queue ! i.sink_1 - * ]| Interleaves two Mono WAV files to a single Stereo WAV file. + * gst-launch-1.0 interleave name=i ! audioconvert ! wavenc ! filesink location=file.wav filesrc location=file1.wav ! decodebin ! audioconvert ! "audio/x-raw,channels=1,channel-mask=(bitmask)0x1" ! queue ! i.sink_0 filesrc location=file2.wav ! decodebin ! audioconvert ! "audio/x-raw,channels=1,channel-mask=(bitmask)0x2" ! queue ! i.sink_1 + * ]| Interleaves two Mono WAV files to a single Stereo WAV file. Having + * channel-masks defined in the sink pads ensures a sane mapping of the mono + * streams into the stereo stream. NOTE: the proper way to map channels in + * code is by using the channel-positions property of the interleave element. * */ -- 2.7.4