Commit dfe8d582 authored by William M. Brack's avatar William M. Brack Committed by Wim Taymans
Browse files

sys/v4l2/v4l2src_calls.c: If we fail to get the frame intervals, simply don't...

sys/v4l2/v4l2src_calls.c: If we fail to get the frame intervals, simply don't touch the framerates on the template ca...

Original commit message from CVS:
Patch by: William M. Brack <wbrack at mmm dot com dot hk>
* sys/v4l2/v4l2src_calls.c:
(gst_v4l2src_probe_caps_for_format_and_size):
If we fail to get the frame intervals, simply don't touch the framerates
on the template caps instead of discarding the format. See #520092.
parent c3bde2dc
2008-05-26 Wim Taymans <wim.taymans@collabora.co.uk>
Patch by: William M. Brack <wbrack at mmm dot com dot hk>
* sys/v4l2/v4l2src_calls.c:
(gst_v4l2src_probe_caps_for_format_and_size):
If we fail to get the frame intervals, simply don't touch the framerates
on the template caps instead of discarding the format. See #520092.
2008-05-26 Wim Taymans <wim.taymans@collabora.co.uk> 2008-05-26 Wim Taymans <wim.taymans@collabora.co.uk>
   
Patch by: William M. Brack <wbrack at mmm dot com dot hk> Patch by: William M. Brack <wbrack at mmm dot com dot hk>
......
...@@ -690,11 +690,9 @@ gst_v4l2src_probe_caps_for_format_and_size (GstV4l2Src * v4l2src, ...@@ -690,11 +690,9 @@ gst_v4l2src_probe_caps_for_format_and_size (GstV4l2Src * v4l2src,
} }
} }
if (!added) { if (!added) {
/* no range was added, make a default range */ /* no range was added, leave the default range from the template */
GST_WARNING_OBJECT (v4l2src, "no range added, setting 0/1 to 100/1"); GST_WARNING_OBJECT (v4l2src, "no range added, leaving default");
g_value_unset (&rates); g_value_unset (&rates);
g_value_init (&rates, GST_TYPE_FRACTION_RANGE);
gst_value_set_fraction_range_full (&rates, 0, 1, 100, 1);
} }
} else if (ival.type == V4L2_FRMIVAL_TYPE_CONTINUOUS) { } else if (ival.type == V4L2_FRMIVAL_TYPE_CONTINUOUS) {
guint32 maxnum, maxdenom; guint32 maxnum, maxdenom;
...@@ -723,25 +721,30 @@ gst_v4l2src_probe_caps_for_format_and_size (GstV4l2Src * v4l2src, ...@@ -723,25 +721,30 @@ gst_v4l2src_probe_caps_for_format_and_size (GstV4l2Src * v4l2src,
goto unknown_type; goto unknown_type;
} }
return_data:
s = gst_structure_copy (template); s = gst_structure_copy (template);
gst_structure_set (s, "width", G_TYPE_INT, (gint) width, gst_structure_set (s, "width", G_TYPE_INT, (gint) width,
"height", G_TYPE_INT, (gint) height, NULL); "height", G_TYPE_INT, (gint) height, NULL);
gst_structure_set_value (s, "framerate", &rates);
g_value_unset (&rates);
if (G_IS_VALUE (&rates)) {
/* only change the framerate on the template when we have a valid probed new
* value */
gst_structure_set_value (s, "framerate", &rates);
g_value_unset (&rates);
}
return s; return s;
/* ERRORS */ /* ERRORS */
enum_frameintervals_failed: enum_frameintervals_failed:
{ {
GST_DEBUG_OBJECT (v4l2src, GST_DEBUG_OBJECT (v4l2src,
"Failed to enumerate frame sizes for %" GST_FOURCC_FORMAT "@%ux%u", "Unable to enumerate intervals for %" GST_FOURCC_FORMAT "@%ux%u",
GST_FOURCC_ARGS (pixelformat), width, height); GST_FOURCC_ARGS (pixelformat), width, height);
return NULL; goto return_data;
} }
unknown_type: unknown_type:
{ {
/* I don't see how this is actually an error */ /* I don't see how this is actually an error, we ignore the format then */
GST_WARNING_OBJECT (v4l2src, GST_WARNING_OBJECT (v4l2src,
"Unknown frame interval type at %" GST_FOURCC_FORMAT "@%ux%u: %u", "Unknown frame interval type at %" GST_FOURCC_FORMAT "@%ux%u: %u",
GST_FOURCC_ARGS (pixelformat), width, height, ival.type); GST_FOURCC_ARGS (pixelformat), width, height, ival.type);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment