{
result r = E_SUCCESS;
- int tempVal = INIT;
- int index = 0;
- int count = 0;
- char* pTemp;
- Dimension tempDimension(INIT, INIT);
- CodecType tempAudioCodecType = CODEC_NONE;
- CodecType tempVideoCodecType = CODEC_NONE;
- MediaContainerType tempContainerType = MEDIA_CONTAINER_NONE;
- PixelFormat pixFormat = PIXEL_FORMAT_YCbCr420_PLANAR;
-
AppLog("VideoRecorderForm::Activate enter CAM TYPE = %d", __camType);
__cameraError = CAMERA_ERROR_NONE;
__previewByCallback = __pConfig->GetInt(1, SECTION_NAME, String(L"previewByCallback"));
AppLog("Camera __bPreviewByCallback is = %d", __previewByCallback);
- tempVal = (__camType == CAMERA_PRIMARY) ? __pConfig->GetInt(INIT, SECTION_NAME, String(L"framerate")) : __pConfig->GetInt(-1, SECTION_NAME, String(L"framerateSec"));
- if (tempVal == INIT)
- {
- tempVal = __pCamera->GetPreviewFrameRate();
- }
-
- count = __pPreviewFrameRateList->GetCount();
-
- for (index = 0; index < count; index++)
- {
- int object = INIT;
- r = __pPreviewFrameRateList->GetAt(index, object);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pPreviewFrameRateList->GetAt", GetErrorMessage(r));
-
- if (tempVal == object)
- {
- (__camType == CAMERA_PRIMARY) ? __frameRateIndex = index : __frameRateIndexSec = index;
- break;
- }
- }
-
- if (index >= count)
- {
- ShowError(E_FAILURE, METHOD_FILE_LINENO);
- goto CATCH;
- }
-
- tempVal = __pConfig->GetInt(INIT, SECTION_NAME, String(L"PreviewFormat"));
- if (tempVal == INIT)
- {
- tempVal = __pCamera->GetPreviewFormat();
- }
-
- count = __pPreviewFormatList->GetCount();
-
- for (index = 0; index < count; index++)
- {
- PixelFormat object = __pCamera->GetPreviewFormat();
- r = __pPreviewFormatList->GetAt(index, object);
- TryCatch(__pPreviewFormatList != null, ShowError(r, METHOD_FILE_LINENO), " __pPreviewFormatList is empty");
-
- if (tempVal == object)
- {
- __previewFormatIndex = index;
- break;
- }
- }
-
- TryCatch(index < count, ShowError(E_FAILURE, METHOD_FILE_LINENO),"index >= count failed");
-
- tempDimension.width = (__camType == CAMERA_PRIMARY) ? __pConfig->GetInt(INIT, SECTION_NAME, String(L"resolutionWidth")) : __pConfig->GetInt(INIT, SECTION_NAME, String(L"resolutionWidthSec"));
- tempDimension.height = (__camType == CAMERA_PRIMARY) ? __pConfig->GetInt(INIT, SECTION_NAME, String(L"resolutionHeight")) : __pConfig->GetInt(INIT, SECTION_NAME, String(L"resolutionHeightSec"));
- if ((tempDimension.width == INIT) || (tempDimension.height == INIT))
- {
- tempDimension = __pVideoRecorder->GetRecordingResolution();
- }
-
- count = __pRecordingResolutionList->GetCount();
-
- for (index = 0; index < count; index++)
- {
- Dimension* pDimention = null;
- pDimention = static_cast< Dimension* >(__pRecordingResolutionList->GetAt(index));
- TryCatch(pDimention != null, ShowErrorResult(E_FAILURE, METHOD_FILE_LINENO), "[%s] __pRecordingResolutionList->GetAt", GetErrorMessage(r));
-
- if (*pDimention == tempDimension)
- {
- (__camType == CAMERA_PRIMARY) ? __resolutionIndex = index : __resolutionIndexSec = index;
- break;
- }
- }
-
- if (index >= count)
- {
- ShowError(E_FAILURE, METHOD_FILE_LINENO);
- goto CATCH;
- }
-
- tempVal = __pConfig->GetInt(INIT, SECTION_NAME, String(L"videocodec"));
- if (tempVal == INIT)
- {
- r = __pVideoRecorder->GetFormat(tempAudioCodecType, tempVideoCodecType, tempContainerType);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pVideoRecorder->GetFormat", GetErrorMessage(r));
- }
- else
- {
- tempVideoCodecType = static_cast< CodecType >(tempVal);
- }
-
- count = __pRecorderVideoCodecList->GetCount();
-
- for (index = 0; index < count; index++)
- {
- CodecType codec = CODEC_NONE;
- r = __pRecorderVideoCodecList->GetAt(index, codec);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pRecorderVideoCodecList->GetAt", GetErrorMessage(r));
-
- if (tempVideoCodecType == codec)
- {
- __videoCodecIndex = index;
- break;
- }
- }
-
- if (index >= count)
- {
- ShowError(E_FAILURE, METHOD_FILE_LINENO);
- goto CATCH;
- }
-
- tempVal = __pConfig->GetInt(INIT, SECTION_NAME, String(L"audiocodec"));
-
- if (tempVal == INIT)
- {
- r = __pVideoRecorder->GetFormat(tempAudioCodecType, tempVideoCodecType, tempContainerType);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] _pVideoRecorder->GetFormat", GetErrorMessage(r));
- }
- else
- {
- tempAudioCodecType = static_cast< CodecType >(tempVal);
- }
-
- count = __pRecorderAudioCodecList->GetCount();
-
- for (index = 0; index < count; index++)
- {
- CodecType codec = CODEC_NONE;
- r = __pRecorderAudioCodecList->GetAt(index, codec);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pRecorderAudioCodecList->GetAt", GetErrorMessage(r));
-
- if (codec == tempAudioCodecType)
- {
- __audioCodecIndex = index;
- break;
- }
- }
-
- if (index >= count)
- {
- ShowError(E_FAILURE, METHOD_FILE_LINENO);
- goto CATCH;
- }
-
- tempVal = __pConfig->GetInt(INIT, SECTION_NAME, String(L"fileformat"));
- if (tempVal == INIT)
- {
- r = __pVideoRecorder->GetFormat(tempAudioCodecType, tempVideoCodecType, tempContainerType);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pVideoRecorder->GetFormat", GetErrorMessage(r));
- }
- else
- {
- tempContainerType = static_cast< MediaContainerType >(tempVal);
- }
-
- pTemp = (char*) &tempContainerType;
-
- AppLog("codec type %c %c %c %c", pTemp[0], pTemp[1], pTemp[2], pTemp[3]);
-
- count = __pRecorderVideoContainerList->GetCount();
-
- for (index = 0; index < count; index++)
- {
- MediaContainerType container = MEDIA_CONTAINER_NONE;
- r = __pRecorderVideoContainerList->GetAt(index, container);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pRecorderVideoContainerList->GetAt", GetErrorMessage(r));
-
- pTemp = (char*) &container;
- AppLog("[index = %d] codec type %c %c %c %c", index, pTemp[0], pTemp[1], pTemp[2], pTemp[3]);
- if (tempContainerType == container)
- {
- if (__formatIndex == INIT)
- {
- __formatIndex = index;
- }
- break;
- }
- }
-
- if (index >= count)
- {
- ShowError(E_FAILURE, METHOD_FILE_LINENO);
- goto CATCH;
- }
-
- __qualityIndex = __pConfig->GetInt(INIT, SECTION_NAME, String(L"quality"));
- if (__qualityIndex == INIT)
- {
- r = __pVideoRecorder->SetQuality(RECORDING_QUALITY_HIGH);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pVideoRecorder->SetQuality", GetErrorMessage(r));
- __qualityIndex = __pVideoRecorder->GetQuality();
- }
- AppLog("quality index = %d", __qualityIndex);
-
- if (__audioStreamCallbackIndex == INIT)
- {
- __audioStreamCallbackIndex = DISABLE_AUDIO_STREAM;
- __isAudioStreamCallback = false;
- }
-
- if (__videoStreamCallbackIndex == INIT)
- {
- __videoStreamCallbackIndex = DISABLE_AUDIO_STREAM;
- __isVideoStreamCallback = false;
- }
-
- if (__isVideoStreamCallback == true)
- {
- r = __pCamera->AddVideoStreamFilter(*this);
- TryCatch(r == E_SUCCESS || r == E_OBJ_ALREADY_EXIST, ShowError(r, METHOD_FILE_LINENO),"[%s] __pVideoRecorder->AddVideoStreamListener", GetErrorMessage(r));
- }
- else
- {
- r = __pCamera->RemoveVideoStreamFilter(*this);
- TryCatch(r == E_SUCCESS || r == E_OBJ_NOT_FOUND, ShowError(r, METHOD_FILE_LINENO),"[%s] __pVideoRecorder->RemoveVideoStreamListener", GetErrorMessage(r));
- }
-
- r = __pOverlay->GetBackgroundBufferInfo(__bufferInfo);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pOverlay->GetBackgroundBufferInfo", GetErrorMessage(r));
-
- r = __pPreviewFrameRateList->GetAt((CAMERA_PRIMARY == __camType) ? __frameRateIndex : __frameRateIndexSec, tempVal);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pPreviewFrameRateList->GetAt", GetErrorMessage(r));
-
- tempDimension = *(Dimension*) __pRecordingResolutionList->GetAt((CAMERA_PRIMARY == __camType) ? __resolutionIndex : __resolutionIndexSec);
-
- r = __pCamera->SetPreviewResolution(tempDimension);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pCamera->SetPreviewResolution", GetErrorMessage(r));
-
- r = __pPreviewFormatList->GetAt(__previewFormatIndex, pixFormat);
- TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO), "[%s] __pPreviewFormatList->GetAt", GetErrorMessage(r));
-
- r = __pCamera->SetPreviewFormat(pixFormat);
- TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pCamera->SetPreviewFormat", GetErrorMessage(r));
-
- r = __pCamera->SetPreviewFrameRate(tempVal);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pCamera->SetPreviewFrameRate", GetErrorMessage(r));
-
- if ( __sceneModeIndex == INIT)
- {
- __sceneModeValue = __pCamera->GetSceneMode();
- }
-
- r = __pCamera->SetSceneMode(__sceneModeValue);
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO),"[%s] __pCamera->SetSceneMode", GetErrorMessage(r));
-
- r = ReloadAllConfiguration();
- TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] ReloadAllConfiguration", GetErrorMessage(r));
+ r = LoadDefaultConfiguration();
+ TryCatch((r == E_SUCCESS || r == E_OBJ_ALREADY_EXIST || r == E_OBJ_NOT_FOUND || r == E_UNSUPPORTED_OPERATION), , "[%s] LoadDefaultConfiguration", GetErrorMessage(r));
if (__previewByCallback == 1)
{
}
result
-VideoRecorderForm::ReloadAllConfiguration(void)
+VideoRecorderForm::LoadDefaultConfiguration(void)
{
result r = E_SUCCESS;
+ CodecType tempAudioCodecType = CODEC_NONE;
+ CodecType tempVideoCodecType = CODEC_NONE;
+ MediaContainerType tempContainerType = MEDIA_CONTAINER_NONE;
- if (__brightnessSliderValue != INIT)
- {
- AppLog("SetBrightness __brightnessSliderValue %d",__brightnessSliderValue);
- r = __pCamera->SetBrightness(__brightnessSliderValue);
- TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pCamera->SetBrightness", GetErrorMessage(r));
- }
+ __audioStreamCallbackIndex = DISABLE_AUDIO_STREAM;
+ __isAudioStreamCallback = false;
- if (__contrastSliderValue != INIT)
+ __videoStreamCallbackIndex = DISABLE_AUDIO_STREAM;
+ __isVideoStreamCallback = false;
+
+ if (__isVideoStreamCallback == true)
{
- r = __pCamera->SetContrast(__contrastSliderValue);
- TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pCamera->SetContrast", GetErrorMessage(r));
+ r = __pCamera->AddVideoStreamFilter(*this);
+ TryReturn(r == E_SUCCESS || r == E_OBJ_ALREADY_EXIST, ShowErrorResult(r, METHOD_FILE_LINENO),"[%s] __pVideoRecorder->AddVideoStreamListener", GetErrorMessage(r));
}
-
- if (__exposureSliderValue != INIT)
+ else
{
- r = __pCamera->SetExposure(__exposureSliderValue);
- TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pCamera->SetExposure", GetErrorMessage(r));
+ r = __pCamera->RemoveVideoStreamFilter(*this);
+ TryReturn(r == E_SUCCESS || r == E_OBJ_NOT_FOUND, ShowErrorResult(r, METHOD_FILE_LINENO),"[%s] __pVideoRecorder->RemoveVideoStreamListener", GetErrorMessage(r));
}
+ r = __pOverlay->GetBackgroundBufferInfo(__bufferInfo);
+ TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pOverlay->GetBackgroundBufferInfo", GetErrorMessage(r));
+
+ r = __pCamera->SetPreviewResolution(__pCamera->GetPreviewResolution());
+ TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pCamera->SetPreviewResolution", GetErrorMessage(r));
+
+ r = __pCamera->SetPreviewFormat(__pCamera->GetPreviewFormat());
+ TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO),"[%s] __pCamera->SetPreviewFormat", GetErrorMessage(r));
+
+ r = __pCamera->SetPreviewFrameRate(__pCamera->GetPreviewFrameRate());
+ TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pCamera->SetPreviewFrameRate", GetErrorMessage(r));
+
+ r = __pCamera->SetSceneMode(__pCamera->GetSceneMode());
+ TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO),"[%s] __pCamera->SetSceneMode", GetErrorMessage(r));
+
+ __isSceneModeSet = (__pCamera->GetSceneMode() == CAMERA_SCENE_OFF)? false:true;
+
+ r = __pCamera->SetBrightness(__pCamera->GetBrightness());
+ TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pCamera->SetBrightness", GetErrorMessage(r));
+
+ r = __pCamera->SetContrast(__pCamera->GetContrast());
+ TryReturn(r == E_SUCCESS || r == E_UNSUPPORTED_OPERATION, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pCamera->SetContrast", GetErrorMessage(r));
+
+ r = __pCamera->SetExposure(__pCamera->GetExposure());
+ TryReturn(r == E_SUCCESS || r == E_UNSUPPORTED_OPERATION, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pCamera->SetExposure", GetErrorMessage(r));
+
+ r = __pVideoRecorder->GetFormat(tempAudioCodecType, tempVideoCodecType, tempContainerType);
+ TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pCamera->GetFormat", GetErrorMessage(r));
+
+ __audioCodecIndex = GetIndexFromValue(__pRecorderAudioCodecList, tempAudioCodecType);
+ __videoCodecIndex = GetIndexFromValue(__pRecorderVideoCodecList, tempVideoCodecType);
+ __formatIndex = GetIndexFromValue(__pRecorderVideoContainerList, tempContainerType);
+
+
return r;
}
bool retVal = true;
CodecType audioCodec = CODEC_NONE;
CodecType videoCodec = CODEC_NONE;
- Tizen::Graphics::Dimension* pResolution = null;
MediaContainerType container = MEDIA_CONTAINER_NONE;
String strFileFormat;
RecordingRotation rotate = RECORDING_ROTATION_NONE;
__filePath.Append(__pConfig->GetString(SECTION_NAME, String(L"filename")));
__filePath.Append(L".");
- pResolution = static_cast< Dimension* >(__pRecordingResolutionList->GetAt((__camType == CAMERA_PRIMARY) ? __resolutionIndex : __resolutionIndexSec));
- TryCatch(pResolution != null, ShowErrorResult(E_FAILURE, METHOD_FILE_LINENO), "__pRecordingResolutionList->GetAt failed");
-
- r = __pVideoRecorder->SetRecordingResolution(*pResolution);
+ r = __pVideoRecorder->SetRecordingResolution(__pVideoRecorder->GetRecordingResolution());
TryCatch(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] __pVideoRecorder->SetRecordingResolution", GetErrorMessage(r));
r = __pRecorderVideoCodecList->GetAt(__videoCodecIndex, videoCodec);
ReadAudioPreProcessedFile(String(L"PreProcessedAudioPCM"));
}
- r = __pVideoRecorder->SetQuality(static_cast< RecordingQuality >(__qualityIndex));
+ r = __pVideoRecorder->SetQuality(__pVideoRecorder->GetQuality());
TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO), "[%s] __pVideoRecorder->SetQuality", GetErrorMessage(r));
__maxRecordingTime = __pConfig->GetInt(DEFAULT_MAXTIME, SECTION_NAME, String(L"maxtime"));
TryCatch(r == E_SUCCESS || r == E_OBJ_NOT_FOUND, ShowError(r, METHOD_FILE_LINENO),"[%s] __pVideoRecorder->RemoveAudioStreamListener", GetErrorMessage(r));
}
+ if (__isVideoStreamCallback == true)
+ {
+ __pCamera->AddVideoStreamFilter(*this);
+ }
+ else
+ {
+ __pCamera->RemoveVideoStreamFilter(*this);
+ }
+
r = __pVideoRecorder->Record();
TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO), "[%s] __pVideoRecorder->Record", GetErrorMessage(r));
TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pListViewFrameRate->SetItemChecked", GetErrorMessage(r));
(__camType == CAMERA_PRIMARY) ? __frameRateIndex = index : __frameRateIndexSec = index;
- (__camType == CAMERA_PRIMARY) ? __pConfig->SetValue(SECTION_NAME, String(L"framerate"), tempVal) : __pConfig->SetValue(SECTION_NAME, String(L"framerateSec"), tempVal); //
}
else if (&source == __pListViewRecordingResolution)
{
r = __pCamera->SetPreviewResolution(*pResolution);
TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pCamera->SetPreviewResolution", GetErrorMessage(r));
+ r = __pVideoRecorder->SetRecordingResolution(*pResolution);
+ TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pVideoRecorder->SetRecordingResolution", GetErrorMessage(r));
+
r = __pOverlay->GetBackgroundBufferInfo(__bufferInfo);
TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pOverlay->GetBackgroundBufferInfo", GetErrorMessage(r));
TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pListViewRecordingResolution->SetItemChecked", GetErrorMessage(r));
(__camType == CAMERA_PRIMARY) ? __resolutionIndex = index : __resolutionIndexSec = index;
- (__camType == CAMERA_PRIMARY) ? __pConfig->SetValue(SECTION_NAME, String(L"resolutionWidth"), pResolution->width) : __pConfig->SetValue(SECTION_NAME, String(L"resolutionWidthSec"), pResolution->width); //
- (__camType == CAMERA_PRIMARY) ? __pConfig->SetValue(SECTION_NAME, String(L"resolutionHeight"), pResolution->height) : __pConfig->SetValue(SECTION_NAME, String(L"resolutionHeightSec"), pResolution->height); //
}
else if (&source == __pListPreviewFormat)
{
TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pListPreviewFormat->SetItemChecked", GetErrorMessage(r));
__previewFormatIndex = index;
- __pConfig->SetValue(SECTION_NAME, String(L"PreviewFormat"), tempVal);
}
else if (&source == __pListViewQuality)
{
TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pListViewQuality->SetItemChecked", GetErrorMessage(r));
__qualityIndex = index;
- __pConfig->SetValue(SECTION_NAME, String(L"quality"), __qualityIndex);
+ __pVideoRecorder->SetQuality((RecordingQuality) __qualityIndex);
}
else if (&source == __pListViewAudioStreamCallback)
{
__videoCodecIndex = index;
r = __pRecorderVideoCodecList->GetAt(__videoCodecIndex, videoCodec);
TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pRecorderVideoCodecList->GetAt", GetErrorMessage(r));
-
- __pConfig->SetValue(SECTION_NAME, String(L"videocodec"), videoCodec);
}
else if (&source == __pListViewAudioCodec)
{
__audioCodecIndex = index;
r = __pRecorderAudioCodecList->GetAt(__audioCodecIndex, audioCodec);
TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pRecorderAudioCodecList->GetAt", GetErrorMessage(r));
-
- __pConfig->SetValue(SECTION_NAME, String(L"audiocodec"), audioCodec);
}
else if (&source == __pListViewFileFormat)
{
__formatIndex = index;
r = __pRecorderVideoContainerList->GetAt(__formatIndex, container);
TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pRecorderVideoContainerList->GetAt", GetErrorMessage(r));
-
- __pConfig->SetValue(SECTION_NAME, String(L"fileformat"), container);
}
else if (&source == __pListViewFlipType)
{
ShowPopUp(__pPopupRecordingResolution);
__pListViewRecordingResolution->Draw();
__pListViewRecordingResolution->Show();
+ recordingdim = __pVideoRecorder->GetRecordingResolution();
if (__camType == CAMERA_PRIMARY)
{
+ __resolutionIndex = GetIndexFromValue(__pRecordingResolutionList, recordingdim);
__pListViewRecordingResolution->SetItemChecked(__resolutionIndex, true);
}
else
{
+ __resolutionIndexSec = GetIndexFromValue(__pRecordingResolutionList, recordingdim);
__pListViewRecordingResolution->SetItemChecked(__resolutionIndexSec, true);
}
__pListViewRecordingResolution->Draw();
TryCatch(r == E_SUCCESS, ,"[%s] AddButton - Preview Format", GetErrorMessage(r));
}
+ __previewFormatIndex = GetIndexFromValue(__pPreviewFormatList, __pCamera->GetPreviewFormat());
TryCatch(__previewFormatIndex != INIT, ,"__previewFormatIndex value is wrong");
ShowPopUp(__pPopupPreviewFormat);
TryCatch(r == E_SUCCESS, ,"[%s] AddButton - Recording Quality", GetErrorMessage(r));
}
+ __qualityIndex = (int) __pVideoRecorder->GetQuality();
TryCatch(__qualityIndex != INIT, ,"GetIndexFromValue - __qualityIndex");
ShowPopUp(__pPopupRecordingQuality);
exposure = __pCamera->GetExposure();
- if (__exposureSliderValue != exposure &&
- __exposureSliderValue != INIT)
- {
- exposure = __exposureSliderValue;
- }
-
__pExposureSlider->SetValue(exposure);
strTemp.Format(50, L"Exposure : %d", exposure);
__pExposureSlider->SetTitleText(strTemp);
brightness = __pCamera->GetBrightness();
- if (__brightnessSliderValue != brightness &&
- __brightnessSliderValue != INIT)
- {
- brightness = __brightnessSliderValue;
- }
-
__pBrightnessSlider->SetValue(brightness);
strTemp.Format(50, L"Brightness : %d", brightness);
__pBrightnessSlider->SetTitleText(strTemp);
}
contrast = __pCamera->GetContrast();
-
- if (__contrastSliderValue != contrast &&
- __contrastSliderValue != INIT)
- {
- contrast = __contrastSliderValue;
- }
-
__pContrastSlider->SetValue(contrast);
strTemp.Format(50, L"Contrast : %d", contrast);
__pContrastSlider->SetTitleText(strTemp);
}
int
+VideoRecorderForm::GetIndexFromValue(Tizen::Base::Collection::IListT< Tizen::Media::CodecType >* pList, int value) const
+{
+ int count = pList->GetCount();
+ result r = E_SUCCESS;
+ Tizen::Media::CodecType valueInList = CODEC_NONE;
+ for (int index = 0; index < count; index++)
+ {
+ r = pList->GetAt(index, valueInList);
+ if (r == E_SUCCESS && value == valueInList)
+ {
+ AppLog("matching found at index = %d for value = %d", index, value);
+ return index;
+ }
+ }
+ AppLog("no matching for value = %d", value);
+ return INIT;
+}
+
+int
+VideoRecorderForm::GetIndexFromValue(Tizen::Base::Collection::IListT< Tizen::Graphics::PixelFormat >* pList, int value) const
+{
+ int count = pList->GetCount();
+ result r = E_SUCCESS;
+ Tizen::Graphics::PixelFormat valueInList = PIXEL_FORMAT_YCbCr420_PLANAR;
+ for (int index = 0; index < count; index++)
+ {
+ r = pList->GetAt(index, valueInList);
+ if (r == E_SUCCESS && value == valueInList)
+ {
+ AppLog("matching found at index = %d for value = %d", index, value);
+ return index;
+ }
+ }
+ AppLog("no matching for value = %d", value);
+ return INIT;
+}
+
+int
+VideoRecorderForm::GetIndexFromValue(Tizen::Base::Collection::IListT< Tizen::Media::MediaContainerType >* pList, int value) const
+{
+ int count = pList->GetCount();
+ result r = E_SUCCESS;
+ Tizen::Media::MediaContainerType valueInList = MEDIA_CONTAINER_NONE;
+ for (int index = 0; index < count; index++)
+ {
+ r = pList->GetAt(index, valueInList);
+ if (r == E_SUCCESS && value == valueInList)
+ {
+ AppLog("matching found at index = %d for value = %d", index, value);
+ return index;
+ }
+ }
+ AppLog("no matching for value = %d", value);
+ return INIT;
+}
+
+int
VideoRecorderForm::GetIndexFromValue(Tizen::Base::Collection::IList* pList, Tizen::Graphics::Dimension& value) const
{
int count = pList->GetCount();