From fd720fbf641b2c4b07bd4249563b95b2949b313f Mon Sep 17 00:00:00 2001 From: Ming Qian Date: Tue, 22 Aug 2023 09:57:14 +0800 Subject: [PATCH] v4l2object: clear format lists if source change event is received If decoder notify a source change event when the capture format is changed, not the resolution changed. then gst_v4l2_object_acquire_format will retuen false due to unsupported format. we need to clear the format lists in the source change flow, and reenumerate format list Part-of: --- subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c index ea5e1c9ff2..62a812d145 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c @@ -5709,6 +5709,9 @@ again: goto again; } + if (v4l2object->formats) + gst_v4l2_object_clear_format_list (v4l2object); + return GST_V4L2_FLOW_RESOLUTION_CHANGE; }