v4l2: Allow framerate to be large then 100pfs
authorDimitrios Katsaros <patcherwork@gmail.com>
Fri, 24 Jul 2015 13:10:05 +0000 (15:10 +0200)
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Sat, 25 Jul 2015 14:40:51 +0000 (10:40 -0400)
This limit was arbitrary. We still fixate near 100pfs for compatibility.

https://bugzilla.gnome.org/show_bug.cgi?id=752825

sys/v4l2/gstv4l2object.c
sys/v4l2/gstv4l2src.c

index d60a665..17847e6 100644 (file)
@@ -1336,7 +1336,7 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
       gst_structure_set (template,
           "width", GST_TYPE_INT_RANGE, 1, GST_V4L2_MAX_SIZE,
           "height", GST_TYPE_INT_RANGE, 1, GST_V4L2_MAX_SIZE,
-          "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, NULL);
+          "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
     }
     break;
   }
@@ -1369,7 +1369,7 @@ gst_v4l2_object_get_caps_helper (GstV4L2FormatFlags flags)
         gst_structure_set (structure,
             "width", GST_TYPE_INT_RANGE, 1, GST_V4L2_MAX_SIZE,
             "height", GST_TYPE_INT_RANGE, 1, GST_V4L2_MAX_SIZE,
-            "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, NULL);
+            "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT, 1, NULL);
       }
 
       switch (gst_v4l2_formats[i].format) {
@@ -2146,8 +2146,8 @@ return_data:
     gst_structure_take_value (s, "framerate", &rates);
   } else if (v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE ||
       v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
-    gst_structure_set (s, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1,
-        NULL);
+    gst_structure_set (s, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT,
+        1, NULL);
   }
   return s;
 
@@ -2444,7 +2444,7 @@ default_frame_sizes:
         v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
       /* if norm can't be used, copy the template framerate */
       gst_structure_set (tmp, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
-          100, 1, NULL);
+          G_MAXINT, 1, NULL);
     }
 
     if (min_w == max_w)
index 633e46f..e8bfb18 100644 (file)
@@ -270,7 +270,7 @@ gst_v4l2src_fixate (GstBaseSrc * basesrc, GstCaps * caps)
 
     if (gst_structure_has_field (structure, "framerate"))
       gst_structure_fixate_field_nearest_fraction (structure, "framerate",
-          G_MAXINT, 1);
+          100, 1);
 
     if (gst_structure_has_field (structure, "format"))
       gst_structure_fixate_field (structure, "format");