Move initialization of display handle 67/178967/1 accepted/tizen/unified/20180516.065519 submit/tizen/20180515.072459
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 15 May 2018 06:14:59 +0000 (15:14 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 15 May 2018 06:14:59 +0000 (15:14 +0900)
- from camera_create to camera_set_display for headless device

[Version] 0.4.7
[Profile] Common
[Issue Type] Update
[Dependency module] N/A
[Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-unified_20180514.1]

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

index c519c31..b903548 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-camera
 Summary:    A Camera API
-Version:    0.4.6
+Version:    0.4.7
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 59825aa..f2e5df9 100644 (file)
@@ -2075,12 +2075,6 @@ static camera_cb_info_s *_camera_client_callback_new(gint sockfd)
                goto ErrorExit;
        }
 
-       /* display interface handle */
-       if (mm_display_interface_init(&cb_info->dp_interface) != MM_ERROR_NONE) {
-               LOGE("display interface init failed");
-               goto ErrorExit;
-       }
-
        cb_info->api_waiting[MUSE_CAMERA_API_CREATE] = 1;
 
        for (i = 0 ; i < MUSE_CAMERA_API_MAX ; i++) {
@@ -2152,11 +2146,6 @@ ErrorExit:
                        g_cond_clear(&cb_info->api_cond[i]);
                }
 
-               if (cb_info->dp_interface) {
-                       mm_display_interface_deinit(cb_info->dp_interface);
-                       cb_info->dp_interface = NULL;
-               }
-
                g_free(cb_info);
                cb_info = NULL;
        }
@@ -2996,6 +2985,14 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ
        if (type == CAMERA_DISPLAY_TYPE_NONE) {
                LOGD("display type NONE");
        } else {
+               /* display interface handle */
+               if (!cb_info->dp_interface) {
+                       if (mm_display_interface_init(&cb_info->dp_interface) != MM_ERROR_NONE) {
+                               LOGE("display interface init failed");
+                               return CAMERA_ERROR_NOT_SUPPORTED;
+                       }
+               }
+
                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) {
                        camera_flip_e flip = CAMERA_FLIP_NONE;