[cheese/camerabin2: 21/24] cheese-camera: stop-capture is asynchronous in camerabin2



commit db212f73b2bd13c77f27b3c8625cdbc8f8477aff
Author: Thiago Santos <thiago sousa santos collabora com>
Date:   Fri Nov 25 21:12:31 2011 -0300

    cheese-camera: stop-capture is asynchronous in camerabin2
    
    Wait for video-done message to signal that capture is over

 libcheese/cheese-camera.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
index 66f734f..880455b 100644
--- a/libcheese/cheese-camera.c
+++ b/libcheese/cheese-camera.c
@@ -276,6 +276,11 @@ cheese_camera_bus_message_cb (GstBus *bus, GstMessage *message, CheeseCamera *ca
             g_signal_emit (camera, camera_signals[PHOTO_SAVED], 0);
           }
         }
+        else if (strcmp (gst_structure_get_name (structure), "video-done") == 0)
+        {
+          g_signal_emit (camera, camera_signals[VIDEO_SAVED], 0);
+          priv->is_recording = FALSE;
+        }
       }
       break;
     }
@@ -1059,8 +1064,6 @@ cheese_camera_stop_video_recording (CheeseCamera *camera)
   if (state == GST_STATE_PLAYING)
   {
     g_signal_emit_by_name (priv->camerabin, "stop-capture", 0);
-    g_signal_emit (camera, camera_signals[VIDEO_SAVED], 0);
-    priv->is_recording = FALSE;
   }
   else
   {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]