Blame SOURCES/0004-v4l2object-Don-t-probe-UVC-devices-for-being-interla.patch

860d70
From fefa084bde0850447ca5ed84775c094fcf0b2351 Mon Sep 17 00:00:00 2001
860d70
From: Hans de Goede <hdegoede@redhat.com>
860d70
Date: Fri, 8 Jun 2012 20:38:34 +0200
860d70
Subject: [PATCH] v4l2object: Don't probe UVC devices for being interlaced
860d70
860d70
UVC devices are never interlaced, and doing VIDIOC_TRY_FMT on them
860d70
causes expensive and slow USB IO, so don't probe them for interlaced.
860d70
860d70
This shaves 2 seconds of the startup time of cheese with a Logitech
860d70
Webcam Pro 9000.
860d70
860d70
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
860d70
---
860d70
 sys/v4l2/gstv4l2object.c |   16 ++++++++++++----
860d70
 1 file changed, 12 insertions(+), 4 deletions(-)
860d70
860d70
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
860d70
index 6564b91..ce52547 100644
860d70
--- a/sys/v4l2/gstv4l2object.c
860d70
+++ b/sys/v4l2/gstv4l2object.c
860d70
@@ -1561,10 +1561,18 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l2Object * v4l2object,
860d70
   gint int_width = width;
860d70
   gint int_height = height;
860d70
 
860d70
-  /* interlaced detection using VIDIOC_TRY/S_FMT */
860d70
-  if (!gst_v4l2_object_get_nearest_size (v4l2object, pixelformat,
860d70
-          &int_width, &int_height, &interlaced))
860d70
-    return NULL;
860d70
+  if (!strcmp((char *)v4l2object->vcap.driver, "uvcvideo")) {
860d70
+    /*
860d70
+     * UVC devices are never interlaced, and doing VIDIOC_TRY_FMT on them
860d70
+     * causes expensive and slow USB IO, so don't probe them for interlaced
860d70
+     */
860d70
+     interlaced = FALSE;
860d70
+  } else {
860d70
+    /* Interlaced detection using VIDIOC_TRY/S_FMT */
860d70
+    if (!gst_v4l2_object_get_nearest_size (v4l2object, pixelformat,
860d70
+            &int_width, &int_height, &interlaced))
860d70
+      return NULL;
860d70
+  }
860d70
 
860d70
   memset (&ival, 0, sizeof (struct v4l2_frmivalenum));
860d70
   ival.index = 0;
860d70
-- 
860d70
1.7.10.2
860d70