From: Hans de Goede Date: Fri, 8 Jun 2012 18:38:34 +0000 (+0200) Subject: v4l2object: Don't probe UVC devices for being interlaced X-Git-Tag: 1.19.3~509^2~6965 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9676944bbd5a5503d3abed856b606acb886e91a;p=platform%2Fupstream%2Fgstreamer.git v4l2object: Don't probe UVC devices for being interlaced 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. This shaves 2 seconds of the startup time of cheese with a Logitech Webcam Pro 9000. Signed-off-by: Hans de Goede Fixes https://bugzilla.gnome.org/show_bug.cgi?id=677722 --- diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 1e1f9c9..2704f53 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -1589,10 +1589,18 @@ gst_v4l2_object_probe_caps_for_format_and_size (GstV4l2Object * v4l2object, gint int_width = width; gint int_height = height; - /* interlaced detection using VIDIOC_TRY/S_FMT */ - if (!gst_v4l2_object_get_nearest_size (v4l2object, pixelformat, - &int_width, &int_height, &interlaced)) - return NULL; + 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 + */ + interlaced = FALSE; + } else { + /* Interlaced detection using VIDIOC_TRY/S_FMT */ + if (!gst_v4l2_object_get_nearest_size (v4l2object, pixelformat, + &int_width, &int_height, &interlaced)) + return NULL; + } memset (&ival, 0, sizeof (struct v4l2_frmivalenum)); ival.index = 0;