videodecoder: set decode only flag by decode only buffer

This is used for optimize frame drop issue. Some video streams such as av1
contains decode-only frames. These frames are handled by decoder but not show
by display, which will cause input frame count unmatch the output frame count.
After collecting more decoder only frame, it will cause error report "so many
frame droped". So attach the flag GST_BUFFER_FLAG_DECODE_ONLY with the input
buffer, the v4l2videodecoder can further handle the decode-only buffer in
output list.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8142>
This commit is contained in:
Dean Zhang (张安迪) 2024-12-13 10:07:58 +08:00 committed by GStreamer Marge Bot
parent 2d92a2ee54
commit 58696d57f9

View file

@ -2439,6 +2439,9 @@ gst_video_decoder_chain_forward (GstVideoDecoder * decoder,
priv->input_offset += gst_buffer_get_size (buf);
if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DECODE_ONLY))
GST_VIDEO_CODEC_FRAME_SET_DECODE_ONLY (priv->current_frame);
if (priv->packetized) {
GstVideoCodecFrame *frame;
gboolean was_keyframe = FALSE;