v4l2videodec: Fix alternative output format support

Some decoder have the ability to output multiple formats.
This has been supported for a while but stopped working
after commit 77744c3d638. Restore this functionality
by replacing acquired_caps with the new caps.

Fixes #4528

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8674>
This commit is contained in:
Haihua Hu 2025-03-25 17:22:41 +09:00 committed by GStreamer Marge Bot
parent 24dcc0a009
commit 4e7df779df

View File

@ -510,9 +510,10 @@ gst_v4l2_video_dec_negotiate (GstVideoDecoder * decoder)
GST_DEBUG_OBJECT (self, "Chosen decoded caps: %" GST_PTR_FORMAT, caps);
/* Try to set negotiated format, on success replace acquired format */
if (gst_v4l2_object_set_format (self->v4l2capture, caps, &error))
if (gst_v4l2_object_set_format (self->v4l2capture, caps, &error)) {
gst_caps_replace (&acquired_caps, caps);
info = self->v4l2capture->info;
else
} else
gst_v4l2_clear_error (&error);
use_acquired_caps: