From a55b9060f8956fd41b6400d18fbda77c99260c66 Mon Sep 17 00:00:00 2001 From: Dimitrios Katsaros Date: Fri, 24 Jul 2015 15:10:05 +0200 Subject: [PATCH] v4l2: Allow framerate to be large then 100pfs This limit was arbitrary. We still fixate near 100pfs for compatibility. https://bugzilla.gnome.org/show_bug.cgi?id=752825 --- sys/v4l2/gstv4l2object.c | 10 +++++----- sys/v4l2/gstv4l2src.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index d60a665..17847e6 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -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) diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index 633e46f..e8bfb18 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -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"); -- 2.7.4