From 3968dc7688021cdf1d1c52e6d7838668bdccb2e1 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Thu, 25 Aug 2011 23:37:47 +0100 Subject: [PATCH] v4l2src: make this work more than once in a row We used to skip frame rate setup if the camera was already setup with the requested frame rate. This breaks some cameras though, causing them to not output data (several models of Thinkpad cameras have this problem at least). So, don't skip. https://bugzilla.gnome.org/show_bug.cgi?id=638300 --- sys/v4l2/v4l2src_calls.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/v4l2/v4l2src_calls.c b/sys/v4l2/v4l2src_calls.c index 9627dfa766..bfa5589601 100644 --- a/sys/v4l2/v4l2src_calls.c +++ b/sys/v4l2/v4l2src_calls.c @@ -236,13 +236,11 @@ gst_v4l2src_set_capture (GstV4l2Src * v4l2src, guint32 pixelformat, goto done; } - /* Note: V4L2 provides the frame interval, we have the frame rate */ - if (gst_util_fraction_compare (stream.parm.capture.timeperframe.numerator, - stream.parm.capture.timeperframe.denominator, fps_d, fps_n) == 0) { - - GST_DEBUG_OBJECT (v4l2src, "Desired framerate already set"); - goto already_set; - } + /* We used to skip frame rate setup if the camera was already setup + with the requested frame rate. This breaks some cameras though, + causing them to not output data (several models of Thinkpad cameras + have this problem at least). + So, don't skip. */ /* We want to change the frame rate, so check whether we can. Some cheap USB * cameras don't have the capability */ @@ -265,8 +263,6 @@ gst_v4l2src_set_capture (GstV4l2Src * v4l2src, guint32 pixelformat, goto done; } -already_set: - v4l2src->fps_n = fps_n; v4l2src->fps_d = fps_d;