Added OUT_OF_STORAGE error in videorecorder
authorrahul varna <rahul.varna@samsung.com>
Wed, 29 May 2013 08:33:58 +0000 (14:03 +0530)
committerrahul varna <rahul.varna@samsung.com>
Wed, 29 May 2013 08:33:58 +0000 (14:03 +0530)
Signed-off-by: rahul varna <rahul.varna@samsung.com>
project/src/Recorder/VideoRecorderForm.cpp
project/src/Recorder/VideoRecorderForm.h

index 8a31306..7881d66 100644 (file)
@@ -4588,10 +4588,38 @@ VideoRecorderForm::OnVideoRecorderEndReached(Tizen::Media::RecordingEndCondition
        __pProgress->Show();
 }
 
+result
+VideoRecorderForm::ConvertRecorderErrorToError(Tizen::Media::RecorderErrorReason r)
+{
+       result res = E_SUCCESS;
+       switch (r)
+       {
+               case RECORDER_ERROR_OUT_OF_STORAGE:
+                       //fall through
+               case RECORDER_ERROR_STORAGE_FAILED:
+                       res = E_STORAGE_FULL;
+                       break;
+               default:
+                       break;
+       }
+
+       return res;
+}
+
 void
 VideoRecorderForm::OnVideoRecorderErrorOccurred(Tizen::Media::RecorderErrorReason r)
 {
        AppLog("OnVideoRecorderErrorOccurred");
+       result res = E_SUCCESS;
+
+       res = ConvertRecorderErrorToError(r);
+       if (res == E_STORAGE_FULL)
+       {
+               __cameraError =  CAMERA_ERROR_OUT_OF_MEMORY;
+               __pCamera->StopPreview();
+               ShowErrorResult(res, METHOD_FILE_LINENO);
+               return;
+       }
        __pVideoRecorder->Close();
        __pTimer->Cancel();
 
index 890839c..ca79fe5 100644 (file)
@@ -195,6 +195,7 @@ private:
        bool ConvertPixelFormatToString(Tizen::Graphics::PixelFormat &pixFormat, String& strString);
 
        bool IsBatteryLevelLow(void);
+       result ConvertRecorderErrorToError(Tizen::Media::RecorderErrorReason r);
 
 private:
        //Do not change the order of the e-nums, if a new e-num is to be added add it at the end