v4l2camerasrc: Fix image capture
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Mon, 29 Nov 2010 15:57:21 +0000 (12:57 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Wed, 8 Dec 2010 18:38:27 +0000 (15:38 -0300)
Once a image is captured, v4l2camerasrc should return to the
preview mode and stop capturing.

gst/camerabin2/gstv4l2camerasrc.c

index d475c8c..d13e148 100644 (file)
@@ -147,8 +147,15 @@ gst_v4l2_camera_src_imgsrc_probe (GstPad * pad, GstBuffer * buffer,
     gpointer data)
 {
   GstV4l2CameraSrc *self = GST_V4L2_CAMERA_SRC (data);
+  gboolean ret;
   GST_DEBUG_OBJECT (self, "pass buffer: %d", self->mode == MODE_IMAGE);
-  return self->mode == MODE_IMAGE;
+
+  ret = self->mode == MODE_IMAGE;
+  if (ret) {
+    self->mode = MODE_PREVIEW;
+    g_object_notify (G_OBJECT (self), "mode");
+  }
+  return ret;
 }
 
 /**