[gst-devel] multi-channel, try#2

Benjamin Otte in7y118 at public.uni-hamburg.de
Fri Apr 30 05:25:01 CEST 2004


On Thu, 29 Apr 2004, Ronald S. Bultje wrote:

> So, I do a new proposal: GstCaps carries a "channel_positions" property,
> which is an array of strings of size gst_structure_get_int ("channels").
> The strings indicate channel positions. Those could also be enums
> (defined in gst/audio/audio.h), I don't really care. We'd have enums
> like in faad.h, so left-front, right-front, center, left-side,
> right-side, left-rear, right-rear, back, LFE. Think of it as your keypad
> keys, you're the 5 and all numbers around you are possible channel
> positions.
>

<dump what="brain">
1) use a different mime type to make sure plugins that carelessly exported
more than 2 channels don't mess up our pipelines. Use something like
"audio/x-raw-int-positioned" or something.
2) use the same caps as audio/x-raw-int apart from the channels property.
3) Channels are coded as follows (there's multiple ideas, I'm not sure
exactly how I'd do it):
3a) make a property for each channel, like "channel1=LF,channel2=RF".
Maybe make sure the list is terminated, like
"channel1=LF,channel2=RF,channel3=''". Or use numbers instead of strings.
3b) make the channels property an encoded string with 2 letters for every
channel, like "channels=LFRF".
3c) invent a new caps type (that'd require quite some work for
serialization, intersection and such) for an array. Put the strings in an
array.

The problem with 3 is that we must be able to specify fixed caps and
ranges. There might be elements that allow any subset of a channel setup
in their caps and this must be available in a serializable and
intersectable form so the caps system doesn't screw up.
The following elements must all be possible to specify and correctly
intersect:
1) ALSA takes 4 channels or 6 channels as "LF RF LR RR (CF LFE)"
2) a xine wrapper takes 4 channels as "LF RF LR RR", 5 channels as "LF RF
LR RR empty LFE" or "LF RF LR RR CF empty" and 6 channels as "LF RF LR RR
CF LFE"
3) a base drum adder takes anything without LFE and adds an LFE channel
4) audioconvert takes some list of formats and spits out any other format
from this same list.

So I'm not really sure how to do it best.
Maybe we should just write down template caps for those elements as
strings and then write down desired intersections and then code something
that does exactly that.
</dump>

Benjamin





More information about the gstreamer-devel mailing list