summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2017-09-06 11:25:53 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2017-09-06 11:33:53 -0400
commit05a5ab0e5571faefd2571f0d4c6903c4d9f709c8 (patch)
tree9a2e0f14422b2e3ce925cd14dd561ca0e2e145ae /sys
parentd191584531dcc24f6042ccfbe6f76304d6770149 (diff)
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/gstv4l2src.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index b445e5c2f..e98cb7985 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;