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 768652 - vaapidecode: improvements for flush and drain
vaapidecode: improvements for flush and drain
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
unspecified
Other All
: Normal normal
: 1.9.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 742922
 
 
Reported: 2016-07-11 08:40 UTC by Víctor Manuel Jáquez Leal
Modified: 2016-07-11 17:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vaapidecode: call purge at flush() (1.59 KB, patch)
2016-07-11 08:40 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapidecode: flush output adapter at drain() (2.29 KB, patch)
2016-07-11 08:40 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapidecode: remove gst_vaapidecode_internal_flush() (2.12 KB, patch)
2016-07-11 08:40 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapidecode: unref output frame earlier (2.21 KB, patch)
2016-07-11 08:40 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Víctor Manuel Jáquez Leal 2016-07-11 08:40:12 UTC
several improvements for flush and drain vmethods
Comment 1 Víctor Manuel Jáquez Leal 2016-07-11 08:40:18 UTC
Created attachment 331187 [details] [review]
vaapidecode: call purge at flush()

Calling flush() vmethod means "to flush all remaining data from the decoder
without pushing it downstream".

Nonetheless flush() is calling gst_vaapidecode_internal_flush(), which calls
gst_video_decoder_have_frame() if there is still something in the input
adapter, which may push buffers to downstream by calling handle_frame().

This patch changes this behavior by calling gst_vaapidecode_purge() rather
than gst_vaapidecode_internal_flush(), which does what we want: flushes the VA
decoder and releases all the rest of decoded frames.
Comment 2 Víctor Manuel Jáquez Leal 2016-07-11 08:40:25 UTC
Created attachment 331188 [details] [review]
vaapidecode: flush output adapter at drain()

Calling drain() vmethod means "decode any data it can at this point, but that
more data may arrive after". Hence, vaapidecode should check if there is data
in the output adapter and process them, without destroying the decoded picture
buffer (dpb).

Since this operation is done by gst_vaapidecode_internal_flush(), the operation
was refactored into a new function gst_vaapidecode_flush_output_adapter().
Comment 3 Víctor Manuel Jáquez Leal 2016-07-11 08:40:30 UTC
Created attachment 331189 [details] [review]
vaapidecode: remove gst_vaapidecode_internal_flush()

As gst_vaapidecode_finish() is the only callee of
gst_vaapidecode_internal_flush(), it is better to inline it.
Comment 4 Víctor Manuel Jáquez Leal 2016-07-11 08:40:35 UTC
Created attachment 331190 [details] [review]
vaapidecode: unref output frame earlier

The queue in GstVaapiDecode adds an extra reference to the frames. This patch
unref that extra reference earlier making the code simpler to follow.
Comment 5 Víctor Manuel Jáquez Leal 2016-07-11 17:11:19 UTC
Attachment 331187 [details] pushed as 03e85bb - vaapidecode: call purge at flush()
Attachment 331188 [details] pushed as b392b4f - vaapidecode: flush output adapter at drain()
Attachment 331189 [details] pushed as cb0ec6b - vaapidecode: remove gst_vaapidecode_internal_flush()
Attachment 331190 [details] pushed as c9a5801 - vaapidecode: unref output frame earlier