GNOME Bugzilla – Bug 666886
gst_audio_info_to_caps sets channel count to 64 for multichannel audio
Last modified: 2012-01-14 12:40:51 UTC
Created attachment 204241 [details] [review] fix MAX should have been MIN
I have replaced this code in my 0.11 branch already with something completely different and will push these changes soon: http://cgit.collabora.com/git/user/slomo/gst-plugins-base.git/log/?h=audio-multichannel
This might not be the best place to ask, but I looked at the branch and it seems that the channel orders are now fixed and decoders are responsible for reordering the audio data? I don't think I've seen any function to simply reorder data from custom order to gstreamer default order, is there one? Also will baseaudiodecoder/encoder do this?
There's a function to reorder from one to another order. It would probably make sense to add a function that gives the GStreamer order when given a random order.
It would be convenient. Also what happens if I add channels to GstAudioInfo in different order than default gstreamer order and then convert it to caps?
That's a programming error and you'll get a g_return_val_if_fail() and NULL caps
I might be nitpicking here but I don't get why is there an array then instead of just a bit mask if the developer is required to fill in the array in certain order anyway. It just doesn't seem very intuitive.
Irrelevant with latest channel layout changes in gstreamer
Thanks for closing this bug. Is there still anything that needs clarification, anything you see that should be changed or could be improved? To answer your question, the bitmask is only used in the caps to simplify negotiation (handling the GstArray array in the caps was really troublesome) and when parsing the caps you get a C array of the channel positions because this makes it easier to handle from C (and if you look at the plugins that use this, it allows you to transform between different channel orders, etc quite easily in C).
I already ported my decoders and encoders to new API; The change was simple and it made the code much cleaner.
Thanks, that's good to know :)