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 745962 - don't destroy and create decoder for each seek
don't destroy and create decoder for each seek
Status: RESOLVED NOTABUG
Product: gstreamer-vaapi
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-03-10 12:31 UTC by Víctor Manuel Jáquez Leal
Modified: 2015-06-19 09:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vaapidecode: drop queued frames when flush() (4.69 KB, patch)
2015-03-10 12:48 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecode: drop queued frames when flush() (5.32 KB, patch)
2015-03-11 11:56 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecode: drop queued frames when flush() (5.40 KB, patch)
2015-03-11 13:09 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecode: don't destroy and create decoder at flush (6.84 KB, patch)
2015-04-21 08:42 UTC, Víctor Manuel Jáquez Leal
none Details | Review
decoder: vc1: ignore broken surfaces (1.63 KB, patch)
2015-04-21 08:42 UTC, Víctor Manuel Jáquez Leal
none Details | Review

Description Víctor Manuel Jáquez Leal 2015-03-10 12:31:35 UTC
The purpose of flush() vmethod is to remove the internal buffers in the decoder, but the configuration of the decoder remains equal. Hence there's no need to create and destroy the decoder.
Comment 1 Víctor Manuel Jáquez Leal 2015-03-10 12:48:21 UTC
Created attachment 298985 [details] [review]
vaapidecode: drop queued frames when flush()

The flush operation intent to discard all remaining data from the decoder
without pushing it downstream. This implies discard all the queued frames in
the decoder.

This patch drop all the frames in processing queue. This makes, in general,
the seek operation faster. In the case of playback rate increasing or
decreasing, the first frame to play will depend on the demuxer, because some
will repeat some buffers already played.

* The vmethod flush() is now the old method internal_flush().
* The vmethod finish() is modified to use decoder's flush, not the new vmethod.
* The method reset_full() is modified since hard parameter is not used.
Comment 2 Víctor Manuel Jáquez Leal 2015-03-11 11:56:56 UTC
Created attachment 299092 [details] [review]
vaapidecode: drop queued frames when flush()

The flush operation intent to discard all remaining data from the decoder
without pushing it downstream. This implies discard all the queued frames in
the decoder.

This patch drop all the frames in processing queue. This makes, in general,
the seek operation faster. In the case of playback rate increasing or
decreasing, the first frame to play will depend on the demuxer, because some
will repeat some buffers already played.

* The vmethod flush() is now the old method internal_flush().
* The vmethod finish() is modified to use decoder's flush, not the new vmethod.
* The method reset_full() is modified since hard parameter is not used.

v2: 1) call gst_video_decoder_have_frame() in finish() vmethod and refactor it
       improving readability
Comment 3 Víctor Manuel Jáquez Leal 2015-03-11 13:09:36 UTC
Created attachment 299095 [details] [review]
vaapidecode: drop queued frames when flush()

The flush operation intent to discard all remaining data from the decoder
without pushing it downstream. This implies discard all the queued frames in
the decoder.

This patch drop all the frames in processing queue. This makes, in general,
the seek operation faster. In the case of playback rate increasing or
decreasing, the first frame to play will depend on the demuxer, because some
will repeat some buffers already played.

* The vmethod flush() is now the old method internal_flush().
* The vmethod finish() is modified to use decoder's flush, not the new vmethod.
* The method reset_full() is modified since hard parameter is not used.

v2: 1) call gst_video_decoder_have_frame() in finish() vmethod and refactor it
       improving readability
Comment 4 Víctor Manuel Jáquez Leal 2015-04-21 08:42:41 UTC
Created attachment 302053 [details] [review]
vaapidecode: don't destroy and create decoder at flush

The flush operation intent to discard all remaining data from the decoder
without pushing it downstream. This implies discard all the queued frames in
the decoder.

This patch drop all the frames in processing queue, but avoids the destruction
of the decoder. This makes, in general, the seek operation faster. In the case
of playback rate increasing or decreasing, the first frame to play will depend
on the demuxer, because some will repeat some buffers already played.

* The vmethod flush() is now the old method internal_flush().
* The vmethod finish() is modified to use decoder's flush, not the new vmethod.
* The method reset_full() is modified since hard parameter is not used.

v2: 1) call gst_video_decoder_have_frame() in finish() vmethod and refactor it
       improving readability
v3: 1) rebased, 2) use the method gst_vaapidecode_purge(), 3) verify the return
       of gst_video_decoder_have_frame()
Comment 5 Víctor Manuel Jáquez Leal 2015-04-21 08:42:46 UTC
Created attachment 302054 [details] [review]
decoder: vc1: ignore broken surfaces

This patch is required since at flushing some broken surfaces
appear.
Comment 6 Víctor Manuel Jáquez Leal 2015-04-21 08:46:02 UTC
Though I have worked a lot in these patches, I have realized that, particularly for VC1 decoding, the decoder must be recreated at when flushing, otherwise there are horrible artifacts.

Perhaps something can be done in the lower levels, but it is not a big issue right now.

Hence, I'll reject these patches, closing this report as NOT A BUG.