int camera_unset_extra_preview_cb(camera_h camera);
/**
+ * @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);
+
+/**
* @}
*/
#ifdef __cplusplus
Name: capi-media-camera
Summary: A Camera API
-Version: 0.4.55
+Version: 0.4.56
Release: 0
Group: Multimedia/API
License: Apache-2.0
}
+int camera_attr_set_focus_level(camera_h camera, int level)
+{
+ int ret = CAMERA_ERROR_NONE;
+ camera_cli_s *pc = (camera_cli_s *)camera;
+ muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_FOCUS_LEVEL;
+ camera_msg_param param;
+
+ if (!pc || !pc->cb_info) {
+ CAM_LOG_ERROR("NULL handle");
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ CAM_LOG_INFO("Enter");
+
+ CAMERA_MSG_PARAM_SET(param, INT, level);
+
+ _camera_msg_send_param1(api, pc->cb_info, &ret, ¶m, CAMERA_CB_TIMEOUT);
+
+ CAM_LOG_INFO("ret : 0x%x", ret);
+
+ return ret;
+}
+
+
+int camera_attr_get_focus_level(camera_h camera, int *level)
+{
+ int ret = CAMERA_ERROR_NONE;
+ camera_cli_s *pc = (camera_cli_s *)camera;
+ muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FOCUS_LEVEL;
+
+ if (!pc || !pc->cb_info || !level) {
+ CAM_LOG_ERROR("NULL pointer %p %p", pc, level);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ CAM_LOG_INFO("Enter");
+
+ _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+
+ if (ret == CAMERA_ERROR_NONE)
+ *level = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_FOCUS_LEVEL];
+
+ CAM_LOG_INFO("ret : 0x%x", ret);
+
+ return ret;
+}
+
+
+int camera_attr_get_focus_level_range(camera_h camera, int *min, int *max)
+{
+ int ret = CAMERA_ERROR_NONE;
+ camera_cli_s *pc = (camera_cli_s *)camera;
+ muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FOCUS_LEVEL_RANGE;
+
+ if (!pc || !pc->cb_info || !min || !max) {
+ CAM_LOG_ERROR("NULL pointer %p %p %p", pc, min, max);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ CAM_LOG_INFO("Enter");
+
+ _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+
+ if (ret == CAMERA_ERROR_NONE) {
+ *min = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_FOCUS_LEVEL_RANGE][0];
+ *max = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_FOCUS_LEVEL_RANGE][1];
+ }
+
+ CAM_LOG_INFO("ret : 0x%x", ret);
+
+ return ret;
+}
+
+
int camera_set_extra_preview_cb(camera_h camera, camera_extra_preview_cb callback, void *user_data)
{
int ret = CAMERA_ERROR_NONE;
g_print("\t '6' Exposure value \n");
g_print("\t '7' F number \n");
g_print("\t '8' Display reuse hint \n");
+ g_print("\t '9' Manual Focus \n");
g_print("\t 'i' ISO \n");
g_print("\t 'r' Rotate camera input \n");
g_print("\t 'f' Flip camera input \n");
g_print("set display reuse hint result : 0x%x\n", err);
}
break;
+ case '9': /* Setting > Manual focus */
+ g_print("*Manual focus !\n");
+ camera_attr_get_focus_level_range(hcamcorder->camera, &min, &max);
+ if (min > max) {
+ g_print("\n\tManual focus is NOT SUPPORTED\n");
+ break;
+ }
+ camera_attr_get_focus_level(hcamcorder->camera, &idx);
+ g_print("\tCurrent focus level (%d)\n", idx);
+ g_print("\tSelect focus level min(%d) - max(%d) > ", min, max);
+ err = scanf("%d", &idx);
+ flush_stdin();
+ bret = camera_attr_set_focus_level(hcamcorder->camera, idx);
+ idx = -1;
+ if (bret == CAMERA_ERROR_NONE) {
+ bret = camera_attr_get_focus_level(hcamcorder->camera, &idx);
+ g_print("\tfocus level[%d] after set\n", idx);
+ } else {
+ g_print("\tset focus level failed[0x%x]\n", bret);
+ }
+ break;
case 'i': /* Setting > ISO */
g_print("*ISO !\n");
camera_attr_foreach_supported_iso(hcamcorder->camera, iso_mode_cb, NULL);