add mutex for capture viewfinder request.
authorMarko Ollonen <marko.ollonen@ixonos.com>
Wed, 9 Jan 2013 15:03:12 +0000 (17:03 +0200)
committerMarko Ollonen <marko.ollonen@ixonos.com>
Wed, 9 Jan 2013 15:14:49 +0000 (17:14 +0200)
Change-Id: Ica2ed9e3f0809933bf5be3e6ff28377546e2388e

gst-libs/gst/camera/gstmfldcameracontroliface.c
gst-libs/gst/camera/gstmfldcamerasrc.c
packaging/mfldv4l2camsrc.changes

index 4130259..0a992e9 100644 (file)
@@ -689,9 +689,10 @@ gst_camerasrc_camera_control_set_capture_command( GstCameraSrc* camerasrc,
      g_mutex_unlock (camerasrc->state_lock);
   }
   else {
-         // TODO check state_lock usage.
+    g_mutex_lock (camerasrc->state_lock);
     camerasrc->capture_mode = GST_CAMERA_SRC_CAPTURE_MODE_VIEWFINDER;
-    camerasrc->capture_counter = 0;
+    camerasrc->capture_counter = 1;
     bclass->set_capture_mode (camerasrc, camerasrc->capture_mode);
+    g_mutex_unlock (camerasrc->state_lock);
   }
 }
index dcb1bb0..a97a476 100644 (file)
@@ -1868,6 +1868,7 @@ start_over:
                                         NULL);
 
       GST_LOG_OBJECT (camerasrc, "CALL: capture callback");
+      g_mutex_unlock (camerasrc->state_lock);
       g_signal_emit( G_OBJECT (camerasrc),
                gst_camerasrc_signals[SIGNAL_STILL_CAPTURE],
                0,
@@ -1875,6 +1876,7 @@ start_over:
                NULL,
                NULL );
       GST_LOG_OBJECT (camerasrc, "RETURN: capture callback");
+      g_mutex_lock (camerasrc->state_lock);
 
 
        if(--camerasrc->capture_counter > 0) {
index 7bda35d..21c6c8e 100644 (file)
@@ -1,3 +1,6 @@
+* Wed Jan 09 2013 Marko Ollonen <marko.ollonen@ixonos.com> submit/trunk/20130109.131903@db0f587
+- add mutex for capture viewfinder request, TZSP-4698.
+
 * Wed Jan 09 2013 Timo Toikkanen <timo.toikkanen@ixonos.com> submit/trunk/20130109.064257@a4488ba
 - AF status update fix TZSP-2985