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 721400 - playbin: query allocation always sent twice
playbin: query allocation always sent twice
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-01-03 15:19 UTC by Julien Isorce
Modified: 2018-11-03 11:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
videodecoder: add some debug about pool negotiation (3.21 KB, patch)
2014-01-03 15:19 UTC, Julien Isorce
reviewed Details | Review
logs with patches from https://bugzilla.gnome.org/show_bug.cgi?id=757653 and latest master (344.49 KB, text/plain)
2015-12-11 15:23 UTC, Julien Isorce
  Details

Description Julien Isorce 2014-01-03 15:19:07 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 1 Sebastian Dröge (slomo) 2014-01-08 09:45:07 UTC
Comment on attachment 265222 [details] [review]
videodecoder: add some debug about pool negotiation

The non-g_print lines look good to be committed :)
Comment 2 Sebastian Dröge (slomo) 2014-01-08 09:48:22 UTC
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 3 Julien Isorce 2014-01-08 18:37:52 UTC
Comment on attachment 265222 [details] [review]
videodecoder: add some debug about pool negotiation

added here https://bugzilla.gnome.org/show_bug.cgi?id=720597
Comment 4 Sebastian Dröge (slomo) 2014-01-08 19:03:52 UTC
Is anything still needed here after the other bug?
Comment 5 Sebastian Dröge (slomo) 2014-05-26 16:12:40 UTC
Julien?
Comment 6 Julien Isorce 2015-12-11 05:22:15 UTC
Would be good to check if this is still happening on latest master after #757653 and #742924 .
Comment 7 Julien Isorce 2015-12-11 15:23:39 UTC
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.
Comment 8 Sebastian Dröge (slomo) 2015-12-14 10:31:40 UTC
Where does the second query come from?
Comment 9 Edward Hervey 2018-05-05 16:01:47 UTC
ping ? Julien ?
Comment 10 Julien Isorce 2018-05-15 02:55:30 UTC
(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!
Comment 11 GStreamer system administrator 2018-11-03 11:27:38 UTC
-- 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.