camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp
changeset 55 0da2a5b56583
parent 52 7e18d488ac5f
--- a/camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp	Mon Aug 23 13:50:05 2010 +0300
+++ b/camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp	Fri Sep 03 11:00:58 2010 +0300
@@ -159,6 +159,8 @@
     if (state() == Idle) {
         // start initializing resources for video capture
         initVideoRecorder();
+        // inform zoom control to prepare zoom.
+        emit prepareZoomForVideo();
     } else if (state() == Initialized) {
         // video recorder already initalized. Continue to prepare video reocording.
         open();
@@ -329,8 +331,7 @@
         // Settings have been applied successfully, start to prepare.
         mVideoRecorder->prepare();
 
-        // Prepare zoom only when there are no errors during prepare.
-        emit prepareZoomForVideo();
+        // Inform client
         emit videoPrepareComplete(CxeError::None);
     } catch (const std::exception &e) {
         // Handle error.
@@ -444,14 +445,18 @@
 void CxeVideoCaptureControlSymbian::pause()
 {
     CX_DEBUG_ENTER_FUNCTION();
-    try {
-        mVideoRecorder->pause();
-        setState(CxeVideoCaptureControl::Paused);
-        // play the sound, but not changing the state
-        mVideoStopSoundPlayer->play();
-    } catch (const std::exception &e) {
-        handleComposeFailed(qt_symbian_exception2Error(e));
+
+    if (state() == Recording) {
+        try {
+            mVideoRecorder->pause();
+            setState(CxeVideoCaptureControl::Paused);
+            // play the sound, but not changing the state
+            mVideoStopSoundPlayer->play();
+        } catch (const std::exception &e) {
+            handleComposeFailed(qt_symbian_exception2Error(e));
+        }
     }
+
     CX_DEBUG_EXIT_FUNCTION();
 }