Move code to initialize mm-display-interface 84/313784/1 accepted/tizen/unified/20240704.075716 accepted/tizen/unified/dev/20240708.001433 accepted/tizen/unified/x/20240705.012356
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 2 Jul 2024 02:18:54 +0000 (11:18 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 2 Jul 2024 02:18:54 +0000 (11:18 +0900)
- It's moved from camera_create() to camera_set_display().
- It can reduce the function calling time to create new handle
  in case of CAMERA_DISPLAY_TYPE_NONE.

[Version] 1.1.2
[Issue Type] Optimization

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

index ea82674..8a17051 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-camera
 Summary:    A Camera API
-Version:    1.1.1
+Version:    1.1.2
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index e1cf445..e38382c 100644 (file)
@@ -2790,10 +2790,6 @@ int _camera_create_private(camera_device_e device, bool is_network, camera_h *ca
                }
 
                *camera = (camera_h)pc;
-
-               /* get display interface handle */
-               if (mm_display_interface_init(&pc->cb_info->dp_interface) != MM_ERROR_NONE)
-                       CAM_LOG_WARNING("display interface init failed");
        } else {
                goto ErrorExit;
        }
@@ -3308,10 +3304,12 @@ int _camera_set_display(camera_h camera, mm_display_type_e type, void *display)
        CAM_LOG_INFO("Enter - type : %d, display : %p", type, display);
 
        if (type != MM_DISPLAY_TYPE_NONE) {
-               /* check display interface handle */
+               /* initialize mm_display_interface if it's NULL. */
                if (!cb_info->dp_interface) {
-                       CAM_LOG_ERROR("display interface not supported");
-                       return CAMERA_ERROR_NOT_SUPPORTED;
+                       if (mm_display_interface_init(&cb_info->dp_interface) != MM_ERROR_NONE) {
+                               CAM_LOG_ERROR("display interface init failed");
+                               return CAMERA_ERROR_NOT_SUPPORTED;
+                       }
                }
 
                mm_ret = mm_display_interface_set_display(cb_info->dp_interface, type, display, &dp_info->parent_id);