GNOME Bugzilla – Bug 704285
playbin: incorrect sorting of decoders when autoplugging
Last modified: 2013-07-16 10:22:15 UTC
I've got the following plugins available on my system for mpeg4 decoding: hwviddec_mpeg4 (Codec/Decoder/Video, rank 257) hwvidsink (Sink/Video, rank 256) avdec_mpeg4 (Codec/Decoder/Video, rank 256) When using playbin, avdec_mpeg4 gets plugged in instead of hwviddec_mpeg4. When using decodebin only, hwviddec_mpeg4 is plugged in, so there is an issue in the factories sorting in playbin.
What are the caps on the sinkpad of the sink and the srcpad of the decoder?
The problem is in the autoplug_factories callback. The libav decoder is prepended to the dec_list directly without being sorted against the hw elements. Only decoders which are in a GstAVElement are compared in rank, but since there is no sink in libav, it's not included in the GstAVElement list. I'm not sure I understand why there is a separation between plugins with a decoder/sink couple and plugins with only a decoder.
This should fix it commit 5ee98c146e5d0329b2af5b28a98b784b95d1892f Author: Sebastian Dröge <slomo@circular-chaos.org> Date: Tue Jul 16 09:30:33 2013 +0200 playbin: Fix sorting for decoder factories for which we didn't find a compatible sink They might just need some converters for raw audio/video. https://bugzilla.gnome.org/show_bug.cgi?id=704285 However there seems to be another bug here. Can you please paste the gst-inspect-1.0 output on your decoder and sink and avdec_mpeg4? Also do you have any other sinks on that system, e.g. ximagesink or xvimagesink? The gst-inspect-1.0 output of them would be interesting too.
Created attachment 249259 [details] gst-inspect output On my system there are only 2 video sinks, both in the same plugin with the mpeg4 hw decoder. One of the sinks is a bin containing the other one and a postprocessor element.
Ok, this should fix that other bug too :) commit 4cfda00120406d161b0f88414836e21216b97766 Author: Sebastian Dröge <slomo@circular-chaos.org> Date: Tue Jul 16 11:22:35 2013 +0200 playbin: Also consider possible converters for raw streams when selecting compatible sink/source combinations https://bugzilla.gnome.org/show_bug.cgi?id=704285
Thanks, it works now. From your patch I see that a decoder with a sink would come before one without a sink, even if the rank of the second one is higher. Is that really a good choice ?
Thinking more about it... no :) commit 432b09224701aac969b2c161109fddcc664e572d Author: Sebastian Dröge <slomo@circular-chaos.org> Date: Tue Jul 16 12:21:44 2013 +0200 playbin: Don't prefer decoders for which we found a matching sink It doesn't make much sense.