v4l2object: clear format lists if source change event is received
authorMing Qian <ming.qian@nxp.com>
Tue, 22 Aug 2023 01:57:14 +0000 (09:57 +0800)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 22 Aug 2023 22:59:10 +0000 (23:59 +0100)
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5223>

subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c

index 65b637986caea4d4f9cd95e96354d0ff07520905..1d214b98c7784d2ba660695628001cd09fa66357 100644 (file)
@@ -5575,6 +5575,9 @@ again:
       goto again;
     }
 
+    if (v4l2object->formats)
+      gst_v4l2_object_clear_format_list (v4l2object);
+
     return GST_V4L2_FLOW_RESOLUTION_CHANGE;
   }