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
This commit is contained in:
Antonio Ospite 2014-08-29 15:07:58 +02:00 committed by Tim-Philipp Müller
parent 205565ccd9
commit bdcc0390af

View file

@ -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.
* </refsect2>
*/