Commit 203e2451 authored by Nicolas Dufresne's avatar Nicolas Dufresne Committed by Nicolas Dufresne

v4l2: better handle quirks activation

This way we can activate deactivate those quirks all at once at one
place.

https://bugzilla.gnome.org/show_bug.cgi?id=720568
parent 092e7605
......@@ -1830,11 +1830,7 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l2Object * v4l2object,
gint int_width = width;
gint int_height = height;
if (!strcmp ((char *) v4l2object->vcap.driver, "uvcvideo")) {
/*
* UVC devices are never interlaced, and doing VIDIOC_TRY_FMT on them
* causes expensive and slow USB IO, so don't probe them for interlaced
*/
if (v4l2object->never_interlaced) {
interlaced = FALSE;
} else {
/* Interlaced detection using VIDIOC_TRY/S_FMT */
......
......@@ -174,6 +174,10 @@ struct _GstV4l2Object {
GstV4l2GetInOutFunction get_in_out_func;
GstV4l2SetInOutFunction set_in_out_func;
GstV4l2UpdateFpsFunction update_fps_func;
/* Quirks */
/* Skips interlacing probes */
gboolean never_interlaced;
};
struct _GstV4l2ObjectClassHelper {
......
......@@ -581,6 +581,13 @@ gst_v4l2_open (GstV4l2Object * v4l2object)
if (v4l2object->extra_controls)
gst_v4l2_set_controls (v4l2object, v4l2object->extra_controls);
/* UVC devices are never interlaced, and doing VIDIOC_TRY_FMT on them
* causes expensive and slow USB IO, so don't probe them for interlaced
*/
if (!strcmp ((char *) v4l2object->vcap.driver, "uvcusb")) {
v4l2object->never_interlaced = TRUE;
}
return TRUE;
/* ERRORS */
......
Markdown is supported
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