v4l2src: make this work more than once in a row
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 25 Aug 2011 22:37:47 +0000 (23:37 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 26 Aug 2011 08:33:10 +0000 (10:33 +0200)
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

index 9627dfa..bfa5589 100644 (file)
@@ -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;