After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 666886 - gst_audio_info_to_caps sets channel count to 64 for multichannel audio
gst_audio_info_to_caps sets channel count to 64 for multichannel audio
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.11.x
Other All
: Normal major
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-12-27 02:08 UTC by Matej Knopp
Modified: 2012-01-14 12:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix (981 bytes, patch)
2011-12-27 02:08 UTC, Matej Knopp
none Details | Review

Description Matej Knopp 2011-12-27 02:08:28 UTC
Created attachment 204241 [details] [review]
fix

MAX should have been MIN
Comment 1 Sebastian Dröge (slomo) 2011-12-27 13:16:42 UTC
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
Comment 2 Matej Knopp 2011-12-27 14:41:05 UTC
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?
Comment 3 Sebastian Dröge (slomo) 2011-12-28 10:16:30 UTC
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.
Comment 4 Matej Knopp 2011-12-28 13:57:56 UTC
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?
Comment 5 Sebastian Dröge (slomo) 2011-12-28 14:33:32 UTC
That's a programming error and you'll get a g_return_val_if_fail() and NULL caps
Comment 6 Matej Knopp 2011-12-28 15:04:14 UTC
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.
Comment 7 Matej Knopp 2012-01-13 22:53:56 UTC
Irrelevant with latest channel layout  changes in gstreamer
Comment 8 Sebastian Dröge (slomo) 2012-01-14 11:44:59 UTC
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).
Comment 9 Matej Knopp 2012-01-14 11:50:04 UTC
I already ported my decoders and encoders to new API; The change was simple and it made the code much cleaner.
Comment 10 Sebastian Dröge (slomo) 2012-01-14 12:40:51 UTC
Thanks, that's good to know :)