camerauis/cameraxui/cxengine/src/cxevideocapturecontrolsymbian.cpp
changeset 28 3075d9b614e6
parent 19 d9aefe59d544
child 38 0f0b4c1d7744
child 43 0e652f8f1fbd
equal deleted inserted replaced
19:d9aefe59d544 28:3075d9b614e6
    28 #include "cxeerrormappingsymbian.h"
    28 #include "cxeerrormappingsymbian.h"
    29 #include "cxeviewfindercontrol.h"
    29 #include "cxeviewfindercontrol.h"
    30 #include "cxestillimagesymbian.h"
    30 #include "cxestillimagesymbian.h"
    31 #include "cxecameradevice.h"
    31 #include "cxecameradevice.h"
    32 #include "cxutils.h"
    32 #include "cxutils.h"
    33 #include "cxesysutil.h"
       
    34 #include "cxestate.h"
    33 #include "cxestate.h"
    35 #include "cxesettings.h"
    34 #include "cxesettings.h"
    36 #include "cxenamespace.h"
    35 #include "cxenamespace.h"
    37 #include "OstTraceDefinitions.h"
       
    38 #include "cxesoundplayersymbian.h"
    36 #include "cxesoundplayersymbian.h"
    39 #include "cxequalitypresetssymbian.h"
    37 #include "cxequalitypresetssymbian.h"
    40 #include "cxeviewfindercontrolsymbian.h"
    38 #include "cxeviewfindercontrolsymbian.h"
       
    39 #include "cxediskmonitor.h"
       
    40 
       
    41 #include "OstTraceDefinitions.h"
    41 #ifdef OST_TRACE_COMPILER_IN_USE
    42 #ifdef OST_TRACE_COMPILER_IN_USE
    42 #include "cxevideocapturecontrolsymbianTraces.h"
    43 #include "cxevideocapturecontrolsymbianTraces.h"
    43 #endif
    44 #endif
    44 
    45 
    45 
    46 
    46 // constants
    47 // constants
    47 const TInt64  KMinRequiredSpaceVideo       = 4000000;
    48 namespace
    48 const uint    KOneMillion                 = 1000000;
    49 {
    49 const qreal   KMetaDataCoeff              = 1.03;      // Coefficient to estimate metadata amount
    50     // Controller UId, can be used by the client to identify the controller, e.g. if the custom command can be used
    50 const uint    KCamCMaxClipDurationInSecs  = 5400;      // Maximun video clip duration in seconds
    51     const TUid KCamCControllerImplementationUid = {0x101F8503};
    51 const qreal   KCMRAvgVideoBitRateScaler   = 0.9;       // avg video bit rate scaler
    52     // TMMFEvent UIDs for Async stop
       
    53     const TUid KCamCControllerCCVideoRecordStopped = {0x2000E546};
       
    54     const TUid KCamCControllerCCVideoFileComposed = {0x2000E547};
       
    55 
       
    56     // Custom command for setting a new filename without closing & reopening the controller
       
    57     enum TCamCControllerCustomCommands
       
    58         {
       
    59         ECamCControllerCCNewFilename = 0,
       
    60         ECamCControllerCCVideoStopAsync
       
    61         };
       
    62 
       
    63     const TInt    KOneSecond                  = 1000000;
       
    64     const int     KMaintainAspectRatio        = false;
       
    65     const TInt64  KMinRequiredSpaceVideo      = 4000000;
       
    66     const uint    KOneMillion                 = 1000000;
       
    67     const qreal   KMetaDataCoeff              = 1.03;      // Coefficient to estimate metadata amount
       
    68     const uint    KCamCMaxClipDurationInSecs  = 5400;      // Maximun video clip duration in seconds
       
    69     const qreal   KCMRAvgVideoBitRateScaler   = 0.9;       // avg video bit rate scaler
       
    70 }
    52 
    71 
    53 
    72 
    54 /*!
    73 /*!
    55 * CxeVideoCaptureControlSymbian::CxeVideoCaptureControlSymbian
    74 * CxeVideoCaptureControlSymbian::CxeVideoCaptureControlSymbian
    56 */
    75 */
    57 CxeVideoCaptureControlSymbian::CxeVideoCaptureControlSymbian(CxeCameraDevice &cameraDevice,
    76 CxeVideoCaptureControlSymbian::CxeVideoCaptureControlSymbian(
    58                                                              CxeViewfinderControl &viewfinderControl,
    77     CxeCameraDevice &cameraDevice,
    59                                                              CxeCameraDeviceControl &cameraDeviceControl,
    78     CxeViewfinderControl &viewfinderControl,
    60                                                              CxeFilenameGenerator &nameGenerator,
    79     CxeCameraDeviceControl &cameraDeviceControl,
    61                                                              CxeSettings &settings,
    80     CxeFilenameGenerator &nameGenerator,
    62                                                              CxeQualityPresets &qualityPresets) :
    81     CxeSettings &settings,
    63     CxeStateMachine("CxeVideoCaptureControlSymbian"),
    82     CxeQualityPresets &qualityPresets,
    64     mVideoRecorder(NULL),
    83     CxeDiskMonitor &diskMonitor)
    65     mCameraDevice(cameraDevice),
    84     : CxeStateMachine("CxeVideoCaptureControlSymbian"),
    66     mCameraDeviceControl(cameraDeviceControl),
    85       mVideoRecorder(NULL),
    67     mViewfinderControl(viewfinderControl),
    86       mCameraDevice(cameraDevice),
    68     mFilenameGenerator(nameGenerator),
    87       mCameraDeviceControl(cameraDeviceControl),
    69     mSettings(settings),
    88       mViewfinderControl(viewfinderControl),
    70     mQualityPresets(qualityPresets),
    89       mFilenameGenerator(nameGenerator),
    71     mSnapshot(),
    90       mSettings(settings),
    72     mNewFileName(""),
    91       mQualityPresets(qualityPresets),
    73     mCurrentFilename("")
    92       mDiskMonitor(diskMonitor),
    74 {
    93       mSnapshot(),
    75     CX_DEBUG_ENTER_FUNCTION();
    94       mNewFileName(""),
       
    95       mCurrentFilename("")
       
    96 {
       
    97     CX_DEBUG_ENTER_FUNCTION();
       
    98     OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_CREATE_IN, "msg: e_CX_VIDEOCAPTURECONTROL_NEW 1");
    76 
    99 
    77     qRegisterMetaType<CxeVideoCaptureControl::State> ();
   100     qRegisterMetaType<CxeVideoCaptureControl::State> ();
    78     initializeStates();
   101     initializeStates();
       
   102 
    79     mVideoStopSoundPlayer = new
   103     mVideoStopSoundPlayer = new
    80              CxeSoundPlayerSymbian(CxeSoundPlayerSymbian::VideoCaptureStop);
   104              CxeSoundPlayerSymbian(CxeSoundPlayerSymbian::VideoCaptureStop);
    81     mVideoStartSoundPlayer = new
   105     mVideoStartSoundPlayer = new
    82              CxeSoundPlayerSymbian(CxeSoundPlayerSymbian::VideoCaptureStart);
   106              CxeSoundPlayerSymbian(CxeSoundPlayerSymbian::VideoCaptureStart);
    83 
   107 
       
   108     // If camera is already allocated, call the slot ourselves.
       
   109     if (mCameraDevice.camera()) {
       
   110         handleCameraAllocated(CxeError::None);
       
   111     }
       
   112 
       
   113     OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_CREATE_M1, "msg: e_CX_ENGINE_CONNECT_SIGNALS 1");
    84     // connect signals from cameraDevice, so we recieve events when camera reference changes
   114     // connect signals from cameraDevice, so we recieve events when camera reference changes
    85     connect(&cameraDevice, SIGNAL(prepareForCameraDelete()),
   115     connect(&cameraDevice, SIGNAL(prepareForCameraDelete()),
    86             this, SLOT(prepareForCameraDelete()));
   116             this, SLOT(prepareForCameraDelete()));
    87     connect(&cameraDevice, SIGNAL(prepareForRelease()),
   117     connect(&cameraDevice, SIGNAL(prepareForRelease()),
    88             this, SLOT(prepareForRelease()) );
   118             this, SLOT(prepareForRelease()) );
    94 
   124 
    95     // enabling setting change callbacks to videocapturecontrol
   125     // enabling setting change callbacks to videocapturecontrol
    96     connect(&mSettings, SIGNAL(settingValueChanged(const QString&,QVariant)),
   126     connect(&mSettings, SIGNAL(settingValueChanged(const QString&,QVariant)),
    97             this, SLOT(handleSettingValueChanged(const QString&,QVariant)));
   127             this, SLOT(handleSettingValueChanged(const QString&,QVariant)));
    98 
   128 
       
   129     connect(&mSettings, SIGNAL(sceneChanged(CxeScene&)), this, SLOT(handleSceneChanged(CxeScene&)));
       
   130 
       
   131     OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_CREATE_M2, "msg: e_CX_ENGINE_CONNECT_SIGNALS 0");
       
   132 
       
   133     OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_CREATE_OUT, "msg: e_CX_VIDEOCAPTURECONTROL_NEW 0");
    99     CX_DEBUG_EXIT_FUNCTION();
   134     CX_DEBUG_EXIT_FUNCTION();
   100 }
   135 }
   101 
   136 
   102 
   137 
   103 /*!
   138 /*!
   142 * Releases all resources
   177 * Releases all resources
   143 */
   178 */
   144 void CxeVideoCaptureControlSymbian::deinit()
   179 void CxeVideoCaptureControlSymbian::deinit()
   145 {
   180 {
   146     CX_DEBUG_ENTER_FUNCTION();
   181     CX_DEBUG_ENTER_FUNCTION();
   147     OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_DEINIT, "msg: e_CX_VIDEO_CAPCONT_DEINIT 1" );
       
   148 
   182 
   149     if(state() == Idle) {
   183     if(state() == Idle) {
   150         // nothing to do
   184         // nothing to do
   151         return;
   185         return;
   152     }
   186     }
       
   187 
       
   188     OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_DEINIT, "msg: e_CX_VIDEO_CAPCONT_DEINIT 1" );
   153 
   189 
   154     // first stop viewfinder
   190     // first stop viewfinder
   155     mViewfinderControl.stop();
   191     mViewfinderControl.stop();
   156 
   192 
   157     // stop video-recording in-case if its ongoing.
   193     // stop video-recording in-case if its ongoing.
   336     }
   372     }
   337 
   373 
   338     CX_DEBUG(("Video resoulution (%d,%d)", mCurrentVideoDetails.mWidth,
   374     CX_DEBUG(("Video resoulution (%d,%d)", mCurrentVideoDetails.mWidth,
   339                                            mCurrentVideoDetails.mHeight));
   375                                            mCurrentVideoDetails.mHeight));
   340     CX_DEBUG(("Video bitrate = %d)", mCurrentVideoDetails.mVideoBitRate));
   376     CX_DEBUG(("Video bitrate = %d)", mCurrentVideoDetails.mVideoBitRate));
   341     CX_DEBUG(("Video frame rate = %f)", mCurrentVideoDetails.mVideoFrameRate));
       
   342 
   377 
   343     OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_PREPARE, "msg: e_CX_VIDCAPCONT_PREPARE 1");
   378     OstTrace0(camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_PREPARE, "msg: e_CX_VIDCAPCONT_PREPARE 1");
   344     TSize frameSize;
   379     TSize frameSize;
   345     frameSize.SetSize(mCurrentVideoDetails.mWidth, mCurrentVideoDetails.mHeight);
   380     frameSize.SetSize(mCurrentVideoDetails.mWidth, mCurrentVideoDetails.mHeight);
   346 
   381 
   347     int muteSetting = 0; // audio enabled
   382     int muteSetting = 0; // audio enabled
   348     mSettings.get(CxeSettingIds::VIDEO_MUTE_SETTING, muteSetting);
   383     mSettings.get(CxeSettingIds::VIDEO_MUTE_SETTING, muteSetting);
   349 
   384 
       
   385     // Check if scene defines frame rate.
       
   386     // Use generic frame rate defined in video details, if no value is set in scene.
       
   387     int frameRate = 0;
       
   388     mSettings.get(CxeSettingIds::FRAME_RATE, frameRate);
       
   389     if (frameRate <= 0) {
       
   390         frameRate = mCurrentVideoDetails.mVideoFrameRate;
       
   391     }
       
   392 
       
   393     CX_DEBUG(("Video frame rate = %d)", frameRate));
       
   394 
   350     TRAPD(err,
   395     TRAPD(err,
   351               {
   396               {
   352               mVideoRecorder->SetVideoFrameSizeL(frameSize);
   397               mVideoRecorder->SetVideoFrameSizeL(frameSize);
   353               mVideoRecorder->SetVideoFrameRateL(mCurrentVideoDetails.mVideoFrameRate);
   398               mVideoRecorder->SetVideoFrameRateL(frameRate);
   354               mVideoRecorder->SetVideoBitRateL(mCurrentVideoDetails.mVideoBitRate);
   399               mVideoRecorder->SetVideoBitRateL(mCurrentVideoDetails.mVideoBitRate);
   355               mVideoRecorder->SetAudioEnabledL(muteSetting == 0);
   400               mVideoRecorder->SetAudioEnabledL(muteSetting == 0);
   356               // "No limit" value is handled in video recorder wrapper.
   401               // "No limit" value is handled in video recorder wrapper.
   357               mVideoRecorder->SetMaxClipSizeL(mCurrentVideoDetails.mMaximumSizeInBytes);
   402               mVideoRecorder->SetMaxClipSizeL(mCurrentVideoDetails.mMaximumSizeInBytes);
   358               }
   403               }
   629 {
   674 {
   630     CX_DEBUG_ENTER_FUNCTION();
   675     CX_DEBUG_ENTER_FUNCTION();
   631 
   676 
   632     setState(CxeVideoCaptureControl::Paused);
   677     setState(CxeVideoCaptureControl::Paused);
   633     TRAPD(pauseErr, mVideoRecorder->PauseL());
   678     TRAPD(pauseErr, mVideoRecorder->PauseL());
       
   679     // play the sound, but not changing the state
       
   680     mVideoStopSoundPlayer->play();
   634     if (pauseErr) {
   681     if (pauseErr) {
   635         CX_DEBUG(("[WARNING] Error %d pausing!", pauseErr));
   682         CX_DEBUG(("[WARNING] Error %d pausing!", pauseErr));
   636         //pause operation failed, report it
   683         //pause operation failed, report it
   637         emit videoComposed(CxeErrorHandlingSymbian::map(pauseErr), filename());
   684         emit videoComposed(CxeErrorHandlingSymbian::map(pauseErr), filename());
   638         // release resources.
   685         // release resources.
   716 
   763 
   717     if (state() == Preparing) {
   764     if (state() == Preparing) {
   718         if (!aError) {
   765         if (!aError) {
   719             setState(CxeVideoCaptureControl::Ready);
   766             setState(CxeVideoCaptureControl::Ready);
   720             mViewfinderControl.start();
   767             mViewfinderControl.start();
       
   768             OstTrace0( camerax_performance, CXEVIDEOCAPTURECONTROLSYMBIAN_GOTOVIDEO, "msg: e_CX_GO_TO_VIDEO_MODE 0" );
   721         } else {
   769         } else {
   722             deinit();
   770             deinit();
   723             // report error to interested parties
   771             // report error to interested parties
   724             CxeError::Id err = CxeErrorHandlingSymbian::map(KErrNotReady);
   772             CxeError::Id err = CxeErrorHandlingSymbian::map(KErrNotReady);
   725             emit videoPrepareComplete(CxeErrorHandlingSymbian::map(err));
   773             emit videoPrepareComplete(CxeErrorHandlingSymbian::map(err));
   978 /*!
  1026 /*!
   979 * slot called when state is changed.
  1027 * slot called when state is changed.
   980 */
  1028 */
   981 void CxeVideoCaptureControlSymbian::handleStateChanged(int newStateId, CxeError::Id error)
  1029 void CxeVideoCaptureControlSymbian::handleStateChanged(int newStateId, CxeError::Id error)
   982 {
  1030 {
       
  1031     switch (newStateId) {
       
  1032     case Ready:
       
  1033         if (error == CxeError::None && !mDiskMonitor.isMonitoring()) {
       
  1034             mDiskMonitor.start();
       
  1035             connect(&mDiskMonitor, SIGNAL(diskSpaceChanged()), this, SLOT(handleDiskSpaceChanged()));
       
  1036         }
       
  1037         break;
       
  1038     default:
       
  1039         // Stop monitoring when video mode is released.
       
  1040         // Same goes during recording, as video times come from recorder.
       
  1041         if (mDiskMonitor.isMonitoring()) {
       
  1042             mDiskMonitor.stop();
       
  1043             disconnect(&mDiskMonitor, SIGNAL(diskSpaceChanged()), this, SLOT(handleDiskSpaceChanged()));
       
  1044         }
       
  1045         break;
       
  1046     }
   983     emit stateChanged(static_cast<State> (newStateId), error);
  1047     emit stateChanged(static_cast<State> (newStateId), error);
   984 }
  1048 }
   985 
  1049 
   986 
  1050 
   987 /*!
  1051 /*!
  1025 */
  1089 */
  1026 void CxeVideoCaptureControlSymbian::remainingTime(int &time)
  1090 void CxeVideoCaptureControlSymbian::remainingTime(int &time)
  1027 {
  1091 {
  1028     CX_DEBUG_ENTER_FUNCTION();
  1092     CX_DEBUG_ENTER_FUNCTION();
  1029 
  1093 
  1030     if (state() == CxeVideoCaptureControl::Recording) {
  1094     if (state() == CxeVideoCaptureControl::Recording ||
       
  1095         state() == CxeVideoCaptureControl::Paused) {
  1031         TTimeIntervalMicroSeconds remaining = 0;
  1096         TTimeIntervalMicroSeconds remaining = 0;
  1032         remaining = mVideoRecorder->RecordTimeAvailable();
  1097         remaining = mVideoRecorder->RecordTimeAvailable();
  1033         time = remaining.Int64() * 1.0 / KOneSecond;
  1098         time = remaining.Int64() * 1.0 / KOneSecond;
  1034         CX_DEBUG(( "timeRemaining2: %d", time ));
  1099         CX_DEBUG(( "timeRemaining2: %d", time ));
  1035     } else {
  1100     } else {
  1036         calculateRemainingTime(mCurrentVideoDetails, time);
  1101         // Check if we need to recalculate the remaining time.
       
  1102         if (mCurrentVideoDetails.mRemainingTime == CxeVideoDetails::UNKNOWN) {
       
  1103             calculateRemainingTime(mCurrentVideoDetails, mCurrentVideoDetails.mRemainingTime);
       
  1104         }
       
  1105         time = mCurrentVideoDetails.mRemainingTime;
  1037     }
  1106     }
  1038 
  1107 
  1039     CX_DEBUG_EXIT_FUNCTION();
  1108     CX_DEBUG_EXIT_FUNCTION();
  1040 }
  1109 }
  1041 
  1110 
  1052 
  1121 
  1053     TTimeIntervalMicroSeconds remaining = 0;
  1122     TTimeIntervalMicroSeconds remaining = 0;
  1054 
  1123 
  1055     // get available space in the drive selected in the settings
  1124     // get available space in the drive selected in the settings
  1056     // for storing videos
  1125     // for storing videos
  1057     qint64 availableSpace = CxeSysUtil::spaceAvailable(CCoeEnv::Static()->FsSession(), mSettings);
  1126     qint64 availableSpace = mDiskMonitor.free();
  1058 
  1127 
  1059     availableSpace = availableSpace - KMinRequiredSpaceVideo;
  1128     availableSpace = availableSpace - KMinRequiredSpaceVideo;
  1060 
  1129 
  1061     // Maximum clip size may be limited for mms quality.
  1130     // Maximum clip size may be limited for mms quality.
  1062     // If mMaximumSizeInBytes == 0, no limit is specified.
  1131     // If mMaximumSizeInBytes == 0, no limit is specified.
  1118 {
  1187 {
  1119     CX_DEBUG_ENTER_FUNCTION();
  1188     CX_DEBUG_ENTER_FUNCTION();
  1120 
  1189 
  1121     TTimeIntervalMicroSeconds timeElapsed = 0;
  1190     TTimeIntervalMicroSeconds timeElapsed = 0;
  1122     bool ok = false;
  1191     bool ok = false;
  1123     if (state() == CxeVideoCaptureControl::Recording) {
  1192     if (state() == CxeVideoCaptureControl::Recording ||
       
  1193         state() == CxeVideoCaptureControl::Paused) {
  1124         TRAPD( err, timeElapsed = mVideoRecorder->DurationL() );
  1194         TRAPD( err, timeElapsed = mVideoRecorder->DurationL() );
  1125         if (!err) {
  1195         if (!err) {
  1126             time = timeElapsed.Int64() * 1.0 / KOneSecond;
  1196             time = timeElapsed.Int64() * 1.0 / KOneSecond;
  1127             CX_DEBUG(("timeElapsed2: %d", time));
  1197             CX_DEBUG(("timeElapsed2: %d", time));
  1128             ok = true;
  1198             ok = true;
  1142     CX_DEBUG_ENTER_FUNCTION();
  1212     CX_DEBUG_ENTER_FUNCTION();
  1143 
  1213 
  1144     // start recording, if we were playing capture sound
  1214     // start recording, if we were playing capture sound
  1145     if (state() == CxeVideoCaptureControl::PlayingStartSound) {
  1215     if (state() == CxeVideoCaptureControl::PlayingStartSound) {
  1146         setState(CxeVideoCaptureControl::Recording);
  1216         setState(CxeVideoCaptureControl::Recording);
       
  1217 
  1147         mVideoRecorder->Record();
  1218         mVideoRecorder->Record();
  1148     }
  1219     }
  1149 
  1220 
  1150     // in case of video capture stop sound playing, nothing needs to be done
  1221     // in case of video capture stop sound playing, nothing needs to be done
  1151     // meaning the state set elsewhere, and the video capture has been stopped already
  1222     // meaning the state set elsewhere, and the video capture has been stopped already
  1166     if (mCameraDeviceControl.mode() == Cxe::VideoMode) {
  1237     if (mCameraDeviceControl.mode() == Cxe::VideoMode) {
  1167         if (settingId == CxeSettingIds::VIDEO_QUALITY) {
  1238         if (settingId == CxeSettingIds::VIDEO_QUALITY) {
  1168             // re-prepare for video
  1239             // re-prepare for video
  1169             if (state() == Ready) {
  1240             if (state() == Ready) {
  1170                 // release resources
  1241                 // release resources
  1171          	    deinit();
  1242                 deinit();
  1172                 // initialize video recording again
  1243                 // initialize video recording again
  1173            	    init();
  1244                 init();
  1174            	}
  1245             }
  1175         } else if (settingId == CxeSettingIds::VIDEO_MUTE_SETTING) {
  1246         } else if (settingId == CxeSettingIds::VIDEO_MUTE_SETTING) {
  1176             // mute setting changed, apply the new setting and re-prepare.
  1247             // mute setting changed, apply the new setting and re-prepare.
  1177             setState(Preparing);
  1248             setState(Preparing);
  1178             prepare();
  1249             prepare();
       
  1250         } else if (settingId == CxeSettingIds::FRAME_RATE){
       
  1251             // Frame rate setting changed. Need to re-prepare if we are prepared already.
       
  1252             // Otherwise can wait for next init call.
       
  1253             if (state() == Ready) {
       
  1254                 setState(Preparing);
       
  1255                 prepare();
       
  1256             }
  1179         } else {
  1257         } else {
  1180             // Setting not relevant to video mode
  1258             // Setting not relevant to video mode
  1181         }
  1259         }
  1182     }
  1260     }
  1183 
  1261 
  1184     CX_DEBUG_EXIT_FUNCTION();
  1262     CX_DEBUG_EXIT_FUNCTION();
  1185 }
  1263 }
  1186 
  1264 
       
  1265 /*!
       
  1266  * Scene mode changed. We need to know about it because frame rate
       
  1267  * might have changed.
       
  1268  */
       
  1269 void CxeVideoCaptureControlSymbian::handleSceneChanged(CxeScene& scene)
       
  1270 {
       
  1271     CX_DEBUG_ENTER_FUNCTION();
       
  1272 
       
  1273     // make sure we are in video mode
       
  1274     if (mCameraDeviceControl.mode() == Cxe::VideoMode) {
       
  1275         // Frame rate setting might have changed so re-prepare.
       
  1276         if (state() == Ready) {
       
  1277             setState(Preparing);
       
  1278             prepare();
       
  1279         }
       
  1280 
       
  1281     }
       
  1282     CX_DEBUG_EXIT_FUNCTION();
       
  1283 }
       
  1284 
       
  1285 /*!
       
  1286 * Disk space changed.
       
  1287 * Emit remaining time changed signal, if space change affects it.
       
  1288 */
       
  1289 void CxeVideoCaptureControlSymbian::handleDiskSpaceChanged()
       
  1290 {
       
  1291     CX_DEBUG_ENTER_FUNCTION();
       
  1292 
       
  1293     // Ignore updates on preparing phase.
       
  1294     if (state() == CxeVideoCaptureControl::Ready) {
       
  1295 
       
  1296         int time(0);
       
  1297         calculateRemainingTime(mCurrentVideoDetails, time);
       
  1298 
       
  1299         if (time !=  mCurrentVideoDetails.mRemainingTime) {
       
  1300             mCurrentVideoDetails.mRemainingTime = time;
       
  1301             emit remainingTimeChanged();
       
  1302         }
       
  1303     }
       
  1304 
       
  1305     CX_DEBUG_EXIT_FUNCTION();
       
  1306 }
  1187 
  1307 
  1188 /*!
  1308 /*!
  1189 * Returns QList of all supported video quality details based on the camera index
  1309 * Returns QList of all supported video quality details based on the camera index
  1190 * (primary/secondary).
  1310 * (primary/secondary).
  1191 */
  1311 */