From 99ffbec3a9b4244302ecdc83fd1cdf16c651573c Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Thu, 8 Jun 2023 11:33:46 +0900 Subject: [PATCH] [ACR-1768] Add new APIs for focus level [Version] 0.4.111 [Issue Type] New feature Change-Id: I09fd6119f081389d0706782c97e63d1d94b0f777 Signed-off-by: Jeongmo Yang --- include/camera.h | 51 ++++++++++++++++++++++++++++++++++++++++ include/camera_internal.h | 51 ---------------------------------------- packaging/capi-media-camera.spec | 2 +- src/camera.c | 24 +++++++++++++++++++ src/camera_internal.c | 24 ------------------- 5 files changed, 76 insertions(+), 76 deletions(-) diff --git a/include/camera.h b/include/camera.h index b8e5b79..77c0dd5 100644 --- a/include/camera.h +++ b/include/camera.h @@ -3630,6 +3630,57 @@ int camera_attr_get_sharpness(camera_h camera, int *level); int camera_attr_get_sharpness_range(camera_h camera, int *min, int *max); /** + * @brief Sets the manual focus level. + * @since_tizen 8.0 + * @remarks The auto focusing will be stopped when camera_attr_set_focus_level() is called. + * @param[in] camera The handle to the camera + * @param[in] level The manual focus level + * @return @c 0 on success, otherwise a negative error value + * @retval #CAMERA_ERROR_NONE Successful + * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported + * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error + * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected + * @see camera_attr_get_focus_level() + * @see camera_attr_get_focus_level_range() + */ +int camera_attr_set_focus_level(camera_h camera, int level); + +/** + * @brief Gets the manual focus level. + * @since_tizen 8.0 + * @param[in] camera The handle to the camera + * @param[out] level The manual focus level + * @return @c 0 on success, otherwise a negative error value + * @retval #CAMERA_ERROR_NONE Successful + * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported + * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error + * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected + * @see camera_attr_set_focus_level() + * @see camera_attr_get_focus_level_range() + */ +int camera_attr_get_focus_level(camera_h camera, int *level); + +/** + * @brief Gets lower limit and upper limit for manual focus level. + * @since_tizen 8.0 + * @remarks If the min value is greater than the max value, it means that this feature is not supported. + * @param[in] camera The handle to the camera + * @param[out] min The lower limit for manual focus level + * @param[out] max The upper limit for manual focus level + * @return @c 0 on success, otherwise a negative error value + * @retval #CAMERA_ERROR_NONE Successful + * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported + * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error + * @retval #CAMERA_ERROR_SERVICE_DISCONNECTED The socket to multimedia server is disconnected + * @see camera_attr_set_focus_level() + * @see camera_attr_get_focus_level() + */ +int camera_attr_get_focus_level_range(camera_h camera, int *min, int *max); + +/** * @} */ diff --git a/include/camera_internal.h b/include/camera_internal.h index 556d46e..a7ad9e9 100644 --- a/include/camera_internal.h +++ b/include/camera_internal.h @@ -182,57 +182,6 @@ int camera_attr_get_flash_brightness_range(camera_h camera, int *min, int *max); /** * @internal - * @brief Sets the manual focus level. - * @since_tizen 6.5 - * @remarks The auto focusing will be stopped when camera_attr_set_focus_level() is called. - * @param[in] camera The handle to the camera - * @param[in] level The manual focus level - * @return @c 0 on success, otherwise a negative error value - * @retval #CAMERA_ERROR_NONE Successful - * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error - * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported - * @see camera_attr_get_focus_level() - * @see camera_attr_get_focus_level_range() - */ -int camera_attr_set_focus_level(camera_h camera, int level); - -/** - * @internal - * @brief Gets the manual focus level. - * @since_tizen 6.5 - * @param[in] camera The handle to the camera - * @param[out] level The manual focus level - * @return @c 0 on success, otherwise a negative error value - * @retval #CAMERA_ERROR_NONE Successful - * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error - * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported - * @see camera_attr_set_focus_level() - * @see camera_attr_get_focus_level_range() - */ -int camera_attr_get_focus_level(camera_h camera, int *level); - -/** - * @internal - * @brief Gets lower limit and upper limit for manual focus level. - * @since_tizen 6.5 - * @remarks If the min value is greater than the max value, it means that this feature is not supported. - * @param[in] camera The handle to the camera - * @param[out] min The lower limit for manual focus level - * @param[out] max The upper limit for manual focus level - * @return @c 0 on success, otherwise a negative error value - * @retval #CAMERA_ERROR_NONE Successful - * @retval #CAMERA_ERROR_INVALID_OPERATION Internal error - * @retval #CAMERA_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #CAMERA_ERROR_NOT_SUPPORTED The feature is not supported - * @see camera_attr_set_focus_level() - * @see camera_attr_get_focus_level() - */ -int camera_attr_get_focus_level_range(camera_h camera, int *min, int *max); - -/** - * @internal * @brief Sets device for the extra preview stream. * @since_tizen 7.0 * @param[in] camera The handle to the camera diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index e4a8e42..1ec8a93 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -1,6 +1,6 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.4.110 +Version: 0.4.111 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/camera.c b/src/camera.c index f061b94..c5494f5 100644 --- a/src/camera.c +++ b/src/camera.c @@ -6842,6 +6842,30 @@ int camera_attr_get_preview_frame_rotation(camera_h camera, camera_rotation_e *r } +int camera_attr_set_focus_level(camera_h camera, int level) +{ + return _camera_attr_set_level(camera, MUSE_CAMERA_API_ATTR_SET_FOCUS_LEVEL, level); +} + + +int camera_attr_get_focus_level(camera_h camera, int *level) +{ + return _camera_attr_get_level(camera, + MUSE_CAMERA_API_ATTR_GET_FOCUS_LEVEL, + MUSE_CAMERA_GET_INT_FOCUS_LEVEL, + level); +} + + +int camera_attr_get_focus_level_range(camera_h camera, int *min, int *max) +{ + return _camera_attr_get_range(camera, + MUSE_CAMERA_API_ATTR_GET_FOCUS_LEVEL_RANGE, + MUSE_CAMERA_GET_INT_PAIR_FOCUS_LEVEL_RANGE, + min, max); +} + + int _camera_get_log_level(void) { return g_camera_log_level; diff --git a/src/camera_internal.c b/src/camera_internal.c index 8222451..9e624d3 100644 --- a/src/camera_internal.c +++ b/src/camera_internal.c @@ -248,30 +248,6 @@ int camera_attr_get_flash_brightness_range(camera_h camera, int *min, int *max) } -int camera_attr_set_focus_level(camera_h camera, int level) -{ - return _camera_attr_set_level(camera, MUSE_CAMERA_API_ATTR_SET_FOCUS_LEVEL, level); -} - - -int camera_attr_get_focus_level(camera_h camera, int *level) -{ - return _camera_attr_get_level(camera, - MUSE_CAMERA_API_ATTR_GET_FOCUS_LEVEL, - MUSE_CAMERA_GET_INT_FOCUS_LEVEL, - level); -} - - -int camera_attr_get_focus_level_range(camera_h camera, int *min, int *max) -{ - return _camera_attr_get_range(camera, - MUSE_CAMERA_API_ATTR_GET_FOCUS_LEVEL_RANGE, - MUSE_CAMERA_GET_INT_PAIR_FOCUS_LEVEL_RANGE, - min, max); -} - - int camera_set_extra_preview_device(camera_h camera, int stream_id, camera_device_e device) { int ret = CAMERA_ERROR_NONE; -- 2.7.4