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
This commit is contained in:
Dimitrios Katsaros 2015-07-24 15:10:05 +02:00 committed by Nicolas Dufresne
parent 7917bea855
commit a55b9060f8
2 changed files with 6 additions and 6 deletions

View file

@ -1336,7 +1336,7 @@ gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc)
gst_structure_set (template, gst_structure_set (template,
"width", GST_TYPE_INT_RANGE, 1, GST_V4L2_MAX_SIZE, "width", GST_TYPE_INT_RANGE, 1, GST_V4L2_MAX_SIZE,
"height", 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; break;
} }
@ -1369,7 +1369,7 @@ gst_v4l2_object_get_caps_helper (GstV4L2FormatFlags flags)
gst_structure_set (structure, gst_structure_set (structure,
"width", GST_TYPE_INT_RANGE, 1, GST_V4L2_MAX_SIZE, "width", GST_TYPE_INT_RANGE, 1, GST_V4L2_MAX_SIZE,
"height", 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) { switch (gst_v4l2_formats[i].format) {
@ -2146,8 +2146,8 @@ return_data:
gst_structure_take_value (s, "framerate", &rates); gst_structure_take_value (s, "framerate", &rates);
} else if (v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE || } else if (v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE ||
v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
gst_structure_set (s, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, gst_structure_set (s, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, G_MAXINT,
NULL); 1, NULL);
} }
return s; return s;
@ -2444,7 +2444,7 @@ default_frame_sizes:
v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
/* if norm can't be used, copy the template framerate */ /* if norm can't be used, copy the template framerate */
gst_structure_set (tmp, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, gst_structure_set (tmp, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
100, 1, NULL); G_MAXINT, 1, NULL);
} }
if (min_w == max_w) if (min_w == max_w)

View file

@ -270,7 +270,7 @@ gst_v4l2src_fixate (GstBaseSrc * basesrc, GstCaps * caps)
if (gst_structure_has_field (structure, "framerate")) if (gst_structure_has_field (structure, "framerate"))
gst_structure_fixate_field_nearest_fraction (structure, "framerate", gst_structure_fixate_field_nearest_fraction (structure, "framerate",
G_MAXINT, 1); 100, 1);
if (gst_structure_has_field (structure, "format")) if (gst_structure_has_field (structure, "format"))
gst_structure_fixate_field (structure, "format"); gst_structure_fixate_field (structure, "format");