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 704285 - playbin: incorrect sorting of decoders when autoplugging
playbin: incorrect sorting of decoders when autoplugging
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.1.2
Other Linux
: Normal normal
: 1.1.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-15 18:37 UTC by Arnaud Vrac
Modified: 2013-07-16 10:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gst-inspect output (8.63 KB, text/plain)
2013-07-16 08:09 UTC, Arnaud Vrac
Details

Description Arnaud Vrac 2013-07-15 18:37:03 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.
Comment 1 Sebastian Dröge (slomo) 2013-07-15 19:53:44 UTC
What are the caps on the sinkpad of the sink and the srcpad of the decoder?
Comment 2 Arnaud Vrac 2013-07-15 20:17:09 UTC
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.
Comment 3 Sebastian Dröge (slomo) 2013-07-16 07:33:35 UTC
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.
Comment 4 Arnaud Vrac 2013-07-16 08:09:56 UTC
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.
Comment 5 Sebastian Dröge (slomo) 2013-07-16 09:23:36 UTC
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
Comment 6 Arnaud Vrac 2013-07-16 10:12:56 UTC
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 ?
Comment 7 Sebastian Dröge (slomo) 2013-07-16 10:22:15 UTC
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.