From 8e544e93707997f9a65e8108de71c34bc7e48ca9 Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Fri, 16 Aug 2024 19:04:52 +0900 Subject: [PATCH] Fix TCT failure 1. Native UTC - recorder : Check invalid parameter for attribute of resolutions. 2. CSharp - Tizen.Camera.Tests : Exclude FPS which is not described in native camera API. [Version] 1.2.2 [Issue Type] Bug fix Change-Id: I62c2ebaad1a707ab65154b56f7c18689990db242 Signed-off-by: Jeongmo Yang --- packaging/libmm-camcorder.spec | 2 +- src/mm_camcorder_attribute.c | 3 +++ src/mm_camcorder_capability.c | 44 ++++++++++++++++++++++++++++++---- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/packaging/libmm-camcorder.spec b/packaging/libmm-camcorder.spec index 4dd4746..12b5869 100755 --- a/packaging/libmm-camcorder.spec +++ b/packaging/libmm-camcorder.spec @@ -1,6 +1,6 @@ Name: libmm-camcorder Summary: Camera and recorder library -Version: 1.2.1 +Version: 1.2.2 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 diff --git a/src/mm_camcorder_attribute.c b/src/mm_camcorder_attribute.c index 74ba10b..6a346f7 100644 --- a/src/mm_camcorder_attribute.c +++ b/src/mm_camcorder_attribute.c @@ -5335,6 +5335,9 @@ static int __mmcamcorder_check_valid_pair(MMHandleType handle, char **err_attr_n } } + if (check_pair_value[i][0] <= 0 || check_pair_value[i][1] <= 0) + return MM_ERROR_CAMCORDER_INVALID_ARGUMENT; + return MM_ERROR_CAMCORDER_NOT_SUPPORTED; } diff --git a/src/mm_camcorder_capability.c b/src/mm_camcorder_capability.c index bb44ebb..b97f705 100644 --- a/src/mm_camcorder_capability.c +++ b/src/mm_camcorder_capability.c @@ -131,12 +131,32 @@ static camera_device_capability_s *__mmcamcorder_capability_get_capability(mmcam } -static void __mmcamcorder_capability_dump(mmcam_device_capability_s *mmcam_capability) +static bool __mmcamcorder_capability_is_fps_valid(int fps) +{ + int i = 0; + int valid_fps[] = {0, 7, 8, 15, 20, 24, 25, 30, 60, 90, 120}; /* supported FPS list by native API */ + + for (i = 0 ; i < G_N_ELEMENTS(valid_fps) ; i++) { + if (valid_fps[i] == fps) { + MMCAM_LOG_DEBUG("valid FPS[%d]", fps); + return true; + } + } + + MMCAM_LOG_DEBUG("invalid FPS[%d]", fps); + + return false; +} + + +static void __mmcamcorder_capability_check(mmcam_device_capability_s *mmcam_capability) { int device_index = 0; int format_index = 0; int resolution_index = 0; + int fps = 0; int fps_index = 0; + int fps_valid_count = 0; camera_device_capability_s *_capability = NULL; camera_device_capability_format_s *_format = NULL; camera_device_capability_resolution_s *_resolution = NULL; @@ -172,9 +192,23 @@ static void __mmcamcorder_capability_dump(mmcam_device_capability_s *mmcam_capab MMCAM_LOG_DEBUG(" resolution[%02d] %04d x %04d, fps count[%d]", resolution_index, _resolution->width, _resolution->height, _resolution->fps_list.count); - for (fps_index = 0 ; fps_index < _resolution->fps_list.count ; fps_index++) { - MMCAM_LOG_DEBUG(" fps[%02d] %d", fps_index, - _resolution->fps_list.fps[fps_index]); + for (fps_index = 0, fps_valid_count = 0 ; fps_index < _resolution->fps_list.count ; fps_index++) { + fps = _resolution->fps_list.fps[fps_index]; + if (__mmcamcorder_capability_is_fps_valid(fps)) { + MMCAM_LOG_DEBUG(" fps[%02d<-%02d] %d", fps_valid_count, fps_index, fps); + _resolution->fps_list.fps[fps_valid_count++] = fps; + } else { + MMCAM_LOG_DEBUG(" invalid fps[%02d] %d", fps_index, fps); + } + } + + if (_resolution->fps_list.count != fps_valid_count) { + if (fps_valid_count != 0) { + MMCAM_LOG_DEBUG(" Update FPS count [%d] -> [%d]", _resolution->fps_list.count, fps_valid_count); + _resolution->fps_list.count = fps_valid_count; + } else { + MMCAM_LOG_DEBUG(" invalid fps found, but not updated.(no valid fps)"); + } } } } @@ -209,7 +243,7 @@ int _mmcamcorder_capability_init(MMHandleType handle) return MM_ERROR_CAMCORDER_NOT_SUPPORTED; } - __mmcamcorder_capability_dump(new_mmcam_capability); + __mmcamcorder_capability_check(new_mmcam_capability); hcamcorder->mmcam_capability = g_steal_pointer(&new_mmcam_capability); -- 2.34.1