GNOME Bugzilla – Bug 721400
playbin: query allocation always sent twice
Last modified: 2018-11-03 11:27:38 UTC
Created attachment 265222 [details] [review] videodecoder: add some debug about pool negotiation * steps to reproduce: GST_DEBUG=*videodecoder*:5,2 gst-launch-1.0 playbin uri=http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4 * actual result: 2 allocation queries. During the second one, the decoder decides the same pool instance as previously and fails to set the config because already active. But the caps didn't changed so no really a big problem. Also at the end it inactivate it and then reactivate the same pool. This is just weird and not optimal. Maybe the decoder should call "gst_video_decoder_reset (decoder, TRUE, TRUE);" before to send the query again, just like when going from paused to ready state. Another solution would be to also call "gst_pad_check_reconfigure (decoder->srcpad);" in "done" label of "gst_video_decoder_negotiate_pool". After all if the first negotiate succeded, why not clear the reconfigure flag. What do you think ? :) * log with the attached patch that add debug and GST_DEBUG=*videodecoder*:5,2 : 0:00:00.073061995 31870 0x1b356d0 DEBUG videodecoder gstvideodecoder.c:3122:gst_video_decoder_negotiate_pool:<avdec_h264-0> about to query allocation 0:00:00.146459932 31870 0x1b356d0 DEBUG videodecoder gstvideodecoder.c:3080:gst_video_decoder_decide_allocation_default:<avdec_h264-0> setting config <xvimagebufferpool0> 0:00:00.146623625 31870 0x1b356d0 DEBUG videodecoder gstvideodecoder.c:3132:gst_video_decoder_negotiate_pool:<avdec_h264-0> ALLOCATION (1) params: allocation query 0:00:00.187834955 31870 0x1b356d0 DEBUG videodecoder gstvideodecoder.c:3122:gst_video_decoder_negotiate_pool:<avdec_h264-0> about to query allocation 0:00:00.188163056 31870 0x1b356d0 DEBUG videodecoder gstvideodecoder.c:3080:gst_video_decoder_decide_allocation_default:<avdec_h264-0> setting config <xvimagebufferpool0> 0:00:00.188183331 31870 0x1b356d0 WARN bufferpool gstbufferpool.c:632:gst_buffer_pool_set_config:<xvimagebufferpool0> can't change config, we are active 0:00:00.188215961 31870 0x1b356d0 WARN bufferpool gstbufferpool.c:632:gst_buffer_pool_set_config:<xvimagebufferpool0> can't change config, we are active 0:00:00.188225047 31870 0x1b356d0 DEBUG videodecoder gstvideodecoder.c:3132:gst_video_decoder_negotiate_pool:<avdec_h264-0> ALLOCATION (1) params: allocation query 0:00:00.188289928 31870 0x1b356d0 DEBUG videodecoder gstvideodecoder.c:3162:gst_video_decoder_negotiate_pool:<avdec_h264-0> inactivate pool <xvimagebufferpool0> 0:00:00.189572092 31870 0x1b356d0 DEBUG videodecoder gstvideodecoder.c:3169:gst_video_decoder_negotiate_pool:<avdec_h264-0> activate pool <xvimagebufferpool0> * other infos: (In reply to comment #15 of https://bugzilla.gnome.org/show_bug.cgi?id=720597) > I think it's correct that > another ALLOCATION query happens if one happened before and then things are > relinked (e.g. because decodebin exposes the pads, or because it continues > autoplugging). Doing two ALLOCATION queries just because and if nothing has > changed is not ideal though, but is this happening here?
Comment on attachment 265222 [details] [review] videodecoder: add some debug about pool negotiation The non-g_print lines look good to be committed :)
Can you describe what exactly is happening here step by step, and who is involved and why? Why is the decoder doing another allocation, why is the reconfigure flag still set, who has set it and why?
Comment on attachment 265222 [details] [review] videodecoder: add some debug about pool negotiation added here https://bugzilla.gnome.org/show_bug.cgi?id=720597
Is anything still needed here after the other bug?
Julien?
Would be good to check if this is still happening on latest master after #757653 and #742924 .
Created attachment 317214 [details] logs with patches from https://bugzilla.gnome.org/show_bug.cgi?id=757653 and latest master On the pipeline mentioned in comment #1 I still see 2 "do query ALLOCATION" in the generated log (with GST_DEBUG=*videodecoder*:6) Same with link http://www.w3schools.com/html/mov_bbb.ogg (just to trigger a different decoder) Same result with patches from https://bugzilla.gnome.org/show_bug.cgi?id=757653 Not sure if these patches are supposed to avoid any of the two queries.
Where does the second query come from?
ping ? Julien ?
(In reply to Edward Hervey from comment #9) > ping ? Julien ? Still happens with playbin3 too. Just run: GST_DEBUG=*videodecoder*:5 gst-launch-1.0 playbin uri=http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4 and see "do query ALLOCATION" appears twice in the logs. (In reply to Sebastian Dröge (slomo) from comment #8) > Where does the second query come from? Both from the same line of code https://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/gst-libs/gst/video/gstvideodecoder.c#n3706 I did an initial analysis in the bug description. If you are interested in optimizing it please feel free to go ahead otherwise you can close this bug, thx!
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/101.