From: Jeongmo Yang Date: Thu, 31 May 2018 06:53:32 +0000 (+0900) Subject: [ACR-1231] New restriction is added to camera_set_display X-Git-Tag: accepted/tizen/unified/20180619.110337^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a689f52729841552e12e9efc11fee631ba529270;p=platform%2Fcore%2Fapi%2Fcamera.git [ACR-1231] New restriction is added to camera_set_display [Version] 0.4.8 [Profile] Common [Issue Type] Update [Dependency module] N/A Change-Id: Id511ffc082be9db2a525a0584c8c2abbaa18871b Signed-off-by: Jeongmo Yang --- diff --git a/include/camera.h b/include/camera.h index e795032..da87370 100644 --- a/include/camera.h +++ b/include/camera.h @@ -1057,6 +1057,11 @@ int camera_cancel_focusing(camera_h camera); * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks This function must be called before previewing (see camera_start_preview()). * In Custom ROI display mode, camera_attr_set_display_roi_area() function must be called before calling this function. + * @remarks This function must be called in main thread of the application. + * Otherwise, it will return #CAMERA_ERROR_INVALID_OPERATION by internal restriction. + * To avoid #CAMERA_ERROR_INVALID_OPERATION in sub thread, ecore_thread_main_loop_begin() and + * ecore_thread_main_loop_end() can be used, but deadlock can occur if the main thread is busy. + * So, it's not recommended to use them. (Since 5.0) * @param[in] camera The handle to the camera * @param[in] type The display type * @param[in] display The display handle from #GET_DISPLAY @@ -1072,6 +1077,8 @@ int camera_cancel_focusing(camera_h camera); * * @see camera_start_preview() * @see #GET_DISPLAY + * @see ecore_thread_main_loop_begin() + * @see ecore_thread_main_loop_end() */ int camera_set_display(camera_h camera, camera_display_type_e type, camera_display_h display); diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index b903548..030fe49 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -1,6 +1,6 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.4.7 +Version: 0.4.8 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera.c b/src/camera.c index f2e5df9..488f841 100644 --- a/src/camera.c +++ b/src/camera.c @@ -2994,7 +2994,12 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ } ret = mm_display_interface_set_display(cb_info->dp_interface, type, display, &cb_info->parent_id); - if (ret == MM_ERROR_NONE && type == CAMERA_DISPLAY_TYPE_EVAS) { + if (ret != MM_ERROR_NONE) { + LOGE("[INVALID_OPERATION] set display failed[0x%x]", ret); + return CAMERA_ERROR_INVALID_OPERATION; + } + + if (type == CAMERA_DISPLAY_TYPE_EVAS) { camera_flip_e flip = CAMERA_FLIP_NONE; camera_display_mode_e mode = CAMERA_DISPLAY_MODE_LETTER_BOX; camera_rotation_e rotation = CAMERA_ROTATION_NONE;