legacy_recorder_get_state((recorder_h)handle, (recorder_state_e*)&handle->state);
mm_camcorder_get_attributes(handle->mm_handle, NULL,
- MMCAM_CAMERA_FORMAT, &preview_format,
+ MMCAM_CAMERA_FORMAT, &handle->origin_preview_format,
NULL);
- handle->origin_preview_format = preview_format;
mm_camcorder_get_attributes(handle->mm_handle, NULL,
MMCAM_RECOMMEND_PREVIEW_FORMAT_FOR_RECORDING, &preview_format,
_camera_set_use(camera, true);
legacy_camera_lock(camera, false);
- if (handle->state == RECORDER_STATE_CREATED) {
+ if (handle->state == RECORDER_STATE_CREATED &&
+ preview_format != handle->origin_preview_format) {
ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
MMCAM_CAMERA_FORMAT, preview_format,
NULL);
+
if (ret == MM_ERROR_NONE)
handle->changed_preview_format = preview_format;
}
+
*recorder = (recorder_h)handle;
return RECORDER_ERROR_NONE;
NULL);
/* preview format was changed? */
- if (ret == MM_ERROR_NONE && preview_format == handle->changed_preview_format) {
+ if (ret == MM_ERROR_NONE &&
+ preview_format == handle->changed_preview_format &&
+ preview_format != handle->origin_preview_format) {
ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
MMCAM_CAMERA_FORMAT, handle->origin_preview_format,
NULL);