Fix TCT failure #2 86/316586/1 accepted/tizen/unified/20240826.233020 accepted/tizen/unified/dev/20240828.023752 accepted/tizen/unified/x/20240827.053123
authorJeongmo Yang <jm80.yang@samsung.com>
Fri, 23 Aug 2024 07:00:55 +0000 (16:00 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Fri, 23 Aug 2024 07:03:20 +0000 (16:03 +0900)
1. Native UTC/ITC - camera_change_device() in emulator
 : In emulator, the supported device count is 2,
   but, actual device node is 1 only.
   It caused the preview format setting failure when create handle.

[Version] 1.2.3
[Issue Type] Bug fix

Change-Id: I71a8ca2778b2bea48bb9b2025bfa3b8a336ddf37
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/libmm-camcorder.spec
src/mm_camcorder_capability.c

index 12b5869..adcd731 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       libmm-camcorder
 Summary:    Camera and recorder library
-Version:    1.2.2
+Version:    1.2.3
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index b97f705..f9e5e15 100644 (file)
@@ -236,18 +236,26 @@ int _mmcamcorder_capability_init(MMHandleType handle)
        ret = hal_camera_get_device_capability_list(new_mmcam_capability->hal_handle, &new_mmcam_capability->list);
        if (ret != CAMERA_ERROR_NONE) {
                MMCAM_LOG_WARNING("failed to get capability from camera HAL");
-
-               if (hal_camera_deinit(new_mmcam_capability->hal_handle) != CAMERA_ERROR_NONE)
-                       MMCAM_LOG_WARNING("failed to deinit HAL handle");
-
-               return MM_ERROR_CAMCORDER_NOT_SUPPORTED;
+               goto _RETURN_NOT_SUPPORTED;
        }
 
        __mmcamcorder_capability_check(new_mmcam_capability);
 
+       if (hcamcorder->device_type >= new_mmcam_capability->list.device_count) {
+               MMCAM_LOG_WARNING("device[%d] is not supported by capability[count:%d]",
+                       hcamcorder->device_type, new_mmcam_capability->list.device_count);
+               goto _RETURN_NOT_SUPPORTED;
+       }
+
        hcamcorder->mmcam_capability = g_steal_pointer(&new_mmcam_capability);
 
        return MM_ERROR_NONE;
+
+_RETURN_NOT_SUPPORTED:
+       if (hal_camera_deinit(new_mmcam_capability->hal_handle) != CAMERA_ERROR_NONE)
+               MMCAM_LOG_WARNING("failed to deinit HAL handle");
+
+       return MM_ERROR_CAMCORDER_NOT_SUPPORTED;
 }