[gst-devel] Channel positioning - redux

Iain * iaingnome at gmail.com
Tue May 16 04:42:45 CEST 2006


I've been trying out some stuff with setting channel-positions in caps
and I came across this fun bit of code in

 * It also adds some hacks that 0.8.x needs for compatibility:
 *  - if channels == 1, are we really mono?
 *  - if channels == 2, are we really stereo?

  /* 0.8.x evilry */
  if ((channels == 1 && pos[0] != GST_AUDIO_CHANNEL_POSITION_FRONT_MONO) ||
      (channels == 2 && (pos[0] != GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT ||
              pos[1] != GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT))) {
    g_warning ("0.8.x: channels=1 implies mono; channels=2 implies stereo");
    return FALSE;


What I'm doing in my 0.10 port of the deinterleaver is setting the
channel-position on the single channel output stream based on its
position in the multi-channel input stream. So for a stereo stream the
first srcpad on the deinterleaver would be a mono stream with
channel-position set as FRONT_LEFT, the second pad would get

With the code above in place, it doesn't work. I'm guessing from the
error and comments still saying 0.8 that no-one else has tried to do

Is it safe to remove this code, or is the 1 channel == mono, 2 channel
== stereo assumption still in place in 0.10.

If it is still in place, is there any way I can do what I'm wanting to do?


More information about the gstreamer-devel mailing list