v4l2codecs: Fix holding of reference picture buffer
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 6 Apr 2021 20:24:39 +0000 (16:24 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 7 Apr 2021 19:00:21 +0000 (19:00 +0000)
commit24eda30bd7bed0500b20ea87d1f1f11e4271c658
tree3d3e5ceda2ccaa05fd46dfe1ef8768a3bd92ddee
parent81d4ccdc44445e832f51d02bcc4950b9bef71214
v4l2codecs: Fix holding of reference picture buffer

The picture buffer (V4L2 CAPTURE buffer) was being released immediatly
when the request was done. This was problematic since even after the
request is done, the picture buffer might still be used as a reference
and should not be reused for further decoding yet.

This change effectively bind the picture buffer lifetime to the request.
So that if the picture is never showned (decode only frame) or the request
queue is full before the buffer is displayed, the picture buffer will
remain alive.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2142>
sys/v4l2codecs/gstv4l2decoder.c