From 05a5ab0e5571faefd2571f0d4c6903c4d9f709c8 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 6 Sep 2017 11:25:53 -0400 Subject: [PATCH] v4l2src: Check if caps have changed after try_fmt try_fmt will update the caps colorimetry and interlace-mode. Before this call, those field are missing. The caps equality check was always failing when a spurious reconfigure event was received. --- sys/v4l2/gstv4l2src.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index b445e5c2f4..e98cb79857 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -412,10 +412,6 @@ gst_v4l2src_fixate (GstBaseSrc * basesrc, GstCaps * caps, GstStructure * pref_s) fcaps = gst_caps_copy_nth (caps, i); - /* make sure the caps changed before doing anything */ - if (gst_v4l2_object_caps_equal (obj, fcaps)) - break; - if (GST_V4L2_IS_ACTIVE (obj)) { /* Just check if the format is acceptable, once we know * no buffers should be outstanding we try S_FMT. @@ -424,6 +420,10 @@ gst_v4l2src_fixate (GstBaseSrc * basesrc, GstCaps * caps, GstStructure * pref_s) * should indirectly reclaim buffers, after that we can * set the format and then configure our pool */ if (gst_v4l2_object_try_format (obj, fcaps, &error)) { + /* make sure the caps changed before doing anything */ + if (gst_v4l2_object_caps_equal (obj, fcaps)) + break; + v4l2src->renegotiation_adjust = v4l2src->offset + 1; v4l2src->pending_set_fmt = TRUE; break;