v4l2: caps negotiate wrong as interlace feature
[platform/upstream/gstreamer.git] / sys / v4l2 / gstv4l2object.c
index da64ec0..c6d1f5f 100644 (file)
@@ -1644,10 +1644,11 @@ static GstCaps *
 gst_v4l2_object_get_caps_helper (GstV4L2FormatFlags flags)
 {
   GstStructure *structure;
-  GstCaps *caps;
+  GstCaps *caps, *caps_interlaced;
   guint i;
 
   caps = gst_caps_new_empty ();
+  caps_interlaced = gst_caps_new_empty ();
   for (i = 0; i < GST_V4L2_FORMAT_COUNT; i++) {
 
     if ((gst_v4l2_formats[i].flags & flags) == 0)
@@ -1680,14 +1681,19 @@ gst_v4l2_object_get_caps_helper (GstV4L2FormatFlags flags)
 
       gst_caps_append_structure (caps, structure);
 
-      if (alt_s)
+      if (alt_s) {
         gst_caps_append_structure (caps, alt_s);
+        add_alternate_variant (NULL, caps_interlaced, alt_s);
+      }
 
-      add_alternate_variant (NULL, caps, structure);
+      add_alternate_variant (NULL, caps_interlaced, structure);
     }
   }
 
-  return gst_caps_simplify (caps);
+  caps = gst_caps_simplify (caps);
+  caps_interlaced = gst_caps_simplify (caps_interlaced);
+
+  return gst_caps_merge (caps, caps_interlaced);
 }
 
 GstCaps *