[ACR-1231] New restriction is added to camera_set_display 08/180608/3 accepted/tizen/unified/20180619.110337 submit/tizen/20180615.051115
authorJeongmo Yang <jm80.yang@samsung.com>
Thu, 31 May 2018 06:53:32 +0000 (15:53 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Mon, 11 Jun 2018 05:33:07 +0000 (14:33 +0900)
[Version] 0.4.8
[Profile] Common
[Issue Type] Update
[Dependency module] N/A

Change-Id: Id511ffc082be9db2a525a0584c8c2abbaa18871b
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
include/camera.h
packaging/capi-media-camera.spec
src/camera.c

index e795032..da87370 100644 (file)
@@ -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);
 
index b903548..030fe49 100644 (file)
@@ -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
index f2e5df9..488f841 100644 (file)
@@ -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;