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 781142 - Seeking can be slow due to surface recreation
Seeking can be slow due to surface recreation
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
git master
Other Linux
: Normal normal
: 1.11.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-10 15:35 UTC by Jan Schmidt
Modified: 2017-06-15 12:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implement decoder reset on flush, rather than recreating (11.09 KB, patch)
2017-04-10 15:36 UTC, Jan Schmidt
committed Details | Review
h264 decoder: Implement reset() for faster flush (2.38 KB, patch)
2017-04-10 15:36 UTC, Jan Schmidt
committed Details | Review
vaapidecode: Don't renegotiate on every flush (1.27 KB, patch)
2017-04-10 15:36 UTC, Jan Schmidt
committed Details | Review

Description Jan Schmidt 2017-04-10 15:35:27 UTC
gstreamer-vaapi seeking in 1.x can be significantly slower than in 0.10 on some hardware (Z530) because the driver takes 40ms to create a surface. We didn't used to recreate the entire decoder and surface pool on a seek, but now do.

Attached patches make that faster by adding a reset() method the backend vaapi decoder that keeps the old surface pool around.
Comment 1 Jan Schmidt 2017-04-10 15:36:06 UTC
Created attachment 349617 [details] [review]
Implement decoder reset on flush, rather than recreating

Clear decoders out on a flush but keep the same instance,
rather than completely recreating them. That avoids
unecessarily freeing and recreating surface pools
and contexts, which can be quite expensive
Comment 2 Jan Schmidt 2017-04-10 15:36:11 UTC
Created attachment 349618 [details] [review]
h264 decoder: Implement reset() for faster flush

Implement a custom reset() function for faster flushes
that just clear the reference pictures but don't reallocate
the DPB or clear out SPS/PPS
Comment 3 Jan Schmidt 2017-04-10 15:36:18 UTC
Created attachment 349619 [details] [review]
vaapidecode: Don't renegotiate on every flush

If caps don't actually change, don't update the
decoder and don't set the do_renego flag forcing
downstream renegotiation
Comment 4 Víctor Manuel Jáquez Leal 2017-04-11 18:06:46 UTC
Thanks Jan!

As far as I can see, everything is alright.
Comment 5 Víctor Manuel Jáquez Leal 2017-04-11 18:07:06 UTC
Comment on attachment 349617 [details] [review]
Implement decoder reset on flush, rather than recreating

lgtm
Comment 6 Víctor Manuel Jáquez Leal 2017-04-11 18:07:23 UTC
Comment on attachment 349618 [details] [review]
h264 decoder: Implement reset() for faster flush

lgtm
Comment 7 Víctor Manuel Jáquez Leal 2017-04-11 18:07:41 UTC
Comment on attachment 349619 [details] [review]
vaapidecode: Don't renegotiate on every flush

lgtm
Comment 8 Víctor Manuel Jáquez Leal 2017-06-15 12:00:17 UTC
kk