camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp
changeset 60 a289dde0a1d6
parent 56 01e205c615b9
equal deleted inserted replaced
56:01e205c615b9 60:a289dde0a1d6
   157     OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_INIT, "msg: e_CX_VIDEO_CAPCONT_INIT 1" );
   157     OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_INIT, "msg: e_CX_VIDEO_CAPCONT_INIT 1" );
   158 
   158 
   159     if (state() == Idle) {
   159     if (state() == Idle) {
   160         // start initializing resources for video capture
   160         // start initializing resources for video capture
   161         initVideoRecorder();
   161         initVideoRecorder();
       
   162         // inform zoom control to prepare zoom.
       
   163         emit prepareZoomForVideo();
   162     } else if (state() == Initialized) {
   164     } else if (state() == Initialized) {
   163         // video recorder already initalized. Continue to prepare video reocording.
   165         // video recorder already initalized. Continue to prepare video reocording.
   164         open();
   166         open();
   165     }
   167     }
   166 
   168 
   327         mVideoRecorder->setVideoMaxSize(mCurrentVideoDetails.mMaximumSizeInBytes);
   329         mVideoRecorder->setVideoMaxSize(mCurrentVideoDetails.mMaximumSizeInBytes);
   328 
   330 
   329         // Settings have been applied successfully, start to prepare.
   331         // Settings have been applied successfully, start to prepare.
   330         mVideoRecorder->prepare();
   332         mVideoRecorder->prepare();
   331 
   333 
   332         // Prepare zoom only when there are no errors during prepare.
   334         // Inform client
   333         emit prepareZoomForVideo();
       
   334         emit videoPrepareComplete(CxeError::None);
   335         emit videoPrepareComplete(CxeError::None);
   335     } catch (const std::exception &e) {
   336     } catch (const std::exception &e) {
   336         // Handle error.
   337         // Handle error.
   337         handlePrepareFailed();
   338         handlePrepareFailed();
   338     }
   339     }
   442 * Pauses video recording.
   443 * Pauses video recording.
   443 */
   444 */
   444 void CxeVideoCaptureControlSymbian::pause()
   445 void CxeVideoCaptureControlSymbian::pause()
   445 {
   446 {
   446     CX_DEBUG_ENTER_FUNCTION();
   447     CX_DEBUG_ENTER_FUNCTION();
   447     try {
   448 
   448         mVideoRecorder->pause();
   449     if (state() == Recording) {
   449         setState(CxeVideoCaptureControl::Paused);
   450         try {
   450         // play the sound, but not changing the state
   451             mVideoRecorder->pause();
   451         mVideoStopSoundPlayer->play();
   452             setState(CxeVideoCaptureControl::Paused);
   452     } catch (const std::exception &e) {
   453             // play the sound, but not changing the state
   453         handleComposeFailed(qt_symbian_exception2Error(e));
   454             mVideoStopSoundPlayer->play();
   454     }
   455         } catch (const std::exception &e) {
       
   456             handleComposeFailed(qt_symbian_exception2Error(e));
       
   457         }
       
   458     }
       
   459 
   455     CX_DEBUG_EXIT_FUNCTION();
   460     CX_DEBUG_EXIT_FUNCTION();
   456 }
   461 }
   457 
   462 
   458 /*!
   463 /*!
   459 * Stops video recording.
   464 * Stops video recording.