*/
int legacy_camera_attr_get_display_roi_area(camera_h camera, int *display_roi_area);
+/**
+ * @brief Sets the manual focus level.
+ * @since_tizen 6.5
+ * @remarks The auto focusing will be stopped when legacy_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 legacy_camera_attr_get_focus_level()
+ * @see legacy_camera_attr_get_focus_level_range()
+ */
+int legacy_camera_attr_set_focus_level(camera_h camera, int level);
+
+/**
+ * @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 legacy_camera_attr_set_focus_level()
+ * @see legacy_camera_attr_get_focus_level_range()
+ */
+int legacy_camera_attr_get_focus_level(camera_h camera, int *level);
+
+/**
+ * @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 legacy_camera_attr_set_focus_level()
+ * @see legacy_camera_attr_get_focus_level()
+ */
+int legacy_camera_attr_get_focus_level_range(camera_h camera, int *min, int *max);
+
+/**
+ * @}
+ */
+
bool legacy_camera_is_used(camera_h camera);
bool legacy_camera_wait(camera_h camera, unsigned int timeout);
void legacy_camera_lock(camera_h camera, bool is_lock);
SLOGD("[V] "format, ##args); \
} while (0)
-/**
- * @}
- */
#ifdef __cplusplus
}
#endif
if (code != MM_ERROR_NONE)
CAM_LOG_ERROR("[%s] [%s][0x%x] : core frameworks error code[0x%x]",
func ? func : "NULL_FUNC", errorstr, ret, code);
+ else
+ CAM_LOG_INFO("[%s] done", func ? func : "NULL_FUNC");
return ret;
}
}
+int legacy_camera_attr_set_focus_level(camera_h camera, int level)
+{
+ int ret = MM_ERROR_NONE;
+ int current_mode = MM_CAMCORDER_FOCUS_MODE_NONE;
+ camera_s *handle = (camera_s *)camera;
+
+ camera_return_val_if_fail(handle, CAMERA_ERROR_INVALID_PARAMETER);
+
+ CAM_LOG_INFO("level[%d]", level);
+
+ ret = mm_camcorder_get_attributes(handle->mm_handle, NULL,
+ MMCAM_CAMERA_FOCUS_MODE, ¤t_mode,
+ NULL);
+ camera_return_val_if_fail(ret == MM_ERROR_NONE, __convert_camera_error_code(__func__, ret));
+
+ if (current_mode != MM_CAMCORDER_FOCUS_MODE_MANUAL) {
+ CAM_LOG_INFO("set focus mode from[%d] to MANUAL", current_mode);
+
+ ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+ MMCAM_CAMERA_FOCUS_MODE, MM_CAMCORDER_FOCUS_MODE_MANUAL,
+ NULL);
+ camera_return_val_if_fail(ret == MM_ERROR_NONE, __convert_camera_error_code(__func__, ret));
+ }
+
+ ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+ MMCAM_CAMERA_FOCUS_LEVEL, level,
+ NULL);
+
+ return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_focus_level(camera_h camera, int *level)
+{
+ int ret = MM_ERROR_NONE;
+ camera_s *handle = (camera_s *)camera;
+
+ camera_return_val_if_fail(handle, CAMERA_ERROR_INVALID_PARAMETER);
+ camera_return_val_if_fail(level, CAMERA_ERROR_INVALID_PARAMETER);
+
+ ret = mm_camcorder_get_focus_level(handle->mm_handle, level);
+
+ return __convert_camera_error_code(__func__, ret);
+}
+
+
+int legacy_camera_attr_get_focus_level_range(camera_h camera, int *min, int *max)
+{
+ int ret = MM_ERROR_NONE;
+ camera_s *handle = (camera_s *)camera;
+ MMCamAttrsInfo ainfo;
+
+ camera_return_val_if_fail(handle && min && max, CAMERA_ERROR_INVALID_PARAMETER);
+
+ ret = mm_camcorder_get_attribute_info(handle->mm_handle, MMCAM_CAMERA_FOCUS_LEVEL, &ainfo);
+ if (ret == MM_ERROR_NONE) {
+ *min = ainfo.int_range.min;
+ *max = ainfo.int_range.max;
+ }
+
+ return __convert_camera_error_code(__func__, ret);
+}
+
+
int legacy_camera_get_log_level(void)
{
return mm_camcorder_get_log_level();
MUSE_CAMERA_API_UNSET_MEDIA_BRIDGE,
MUSE_CAMERA_API_SET_EXTRA_PREVIEW_CB, /* 160 */
MUSE_CAMERA_API_UNSET_EXTRA_PREVIEW_CB,
+ MUSE_CAMERA_API_ATTR_SET_FOCUS_LEVEL,
+ MUSE_CAMERA_API_ATTR_GET_FOCUS_LEVEL,
+ MUSE_CAMERA_API_ATTR_GET_FOCUS_LEVEL_RANGE,
MUSE_CAMERA_API_MAX
} muse_camera_api_e;
MUSE_CAMERA_GET_INT_ENCODED_PREVIEW_GOP_INTERVAL,
MUSE_CAMERA_GET_INT_HUE,
MUSE_CAMERA_GET_INT_FLASH_BRIGHTNESS,
+ MUSE_CAMERA_GET_INT_FOCUS_LEVEL,
MUSE_CAMERA_GET_INT_NUM
} muse_camera_get_int_e;
MUSE_CAMERA_GET_INT_PAIR_TILT_RANGE,
MUSE_CAMERA_GET_INT_PAIR_HUE_RANGE,
MUSE_CAMERA_GET_INT_PAIR_FLASH_BRIGHTNESS_RANGE,
+ MUSE_CAMERA_GET_INT_PAIR_FOCUS_LEVEL_RANGE,
MUSE_CAMERA_GET_INT_PAIR_NUM
} muse_camera_get_int_pair_e;
}
+int camera_dispatcher_attr_set_focus_level(muse_module_h module)
+{
+ int ret = CAMERA_ERROR_NONE;
+ muse_camera_handle_s *muse_camera = NULL;
+ int level;
+ muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_FOCUS_LEVEL;
+ muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
+
+ muse_camera = (muse_camera_handle_s *)muse_server_ipc_get_handle(module);
+
+ muse_camera_msg_get(level, muse_server_module_get_msg(module));
+
+ CAM_LOG_INFO("handle[%p], level[%d]", muse_camera, level);
+
+ ret = legacy_camera_attr_set_focus_level(muse_camera->camera_handle, level);
+
+ CAM_LOG_INFO("ret[0x%x]", ret);
+
+ muse_camera_msg_return(api, class, ret, module);
+
+ return MUSE_CAMERA_ERROR_NONE;
+}
+
+int camera_dispatcher_attr_get_focus_level(muse_module_h module)
+{
+ int ret = CAMERA_ERROR_NONE;
+ muse_camera_handle_s *muse_camera = NULL;
+ int get_value = 0;
+ muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FOCUS_LEVEL;
+ muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
+
+ muse_camera = (muse_camera_handle_s *)muse_server_ipc_get_handle(module);
+
+ CAM_LOG_INFO("handle[%p]", muse_camera);
+
+ ret = legacy_camera_attr_get_focus_level(muse_camera->camera_handle, &get_value);
+ if (ret == CAMERA_ERROR_NONE)
+ muse_camera_msg_return1(api, class, ret, module, MUSE_CAMERA_GET_TYPE_INT,
+ MUSE_CAMERA_GET_INT_FOCUS_LEVEL, "get_value", get_value, NULL);
+ else
+ muse_camera_msg_return(api, class, ret, module);
+
+ return MUSE_CAMERA_ERROR_NONE;
+}
+
+
+int camera_dispatcher_attr_get_focus_level_range(muse_module_h module)
+{
+ int ret = CAMERA_ERROR_NONE;
+ muse_camera_handle_s *muse_camera = NULL;
+ int get_value0 = 0;
+ int get_value1 = 0;
+ muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FOCUS_LEVEL_RANGE;
+ muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
+ muse_camera_get_type_e get_type = MUSE_CAMERA_GET_TYPE_INT_PAIR;
+ muse_camera_get_int_pair_e index = MUSE_CAMERA_GET_INT_PAIR_FOCUS_LEVEL_RANGE;
+
+ muse_camera = (muse_camera_handle_s *)muse_server_ipc_get_handle(module);
+
+ CAM_LOG_INFO("handle[%p]", muse_camera);
+
+ ret = legacy_camera_attr_get_focus_level_range(muse_camera->camera_handle, &get_value0, &get_value1);
+ if (ret == CAMERA_ERROR_NONE)
+ muse_camera_msg_return2(api, class, ret, module, get_type, index, get_value0, get_value1);
+ else
+ muse_camera_msg_return(api, class, ret, module);
+
+ return MUSE_CAMERA_ERROR_NONE;
+}
+
+
static tbm_bo __camera_normal_buffer_bo_new(MMCamcorderVideoStreamDataType *stream, tbm_bufmgr bufmgr)
{
int data_size[3] = {0, 0, 0};
camera_dispatcher_set_media_bridge, /* MUSE_CAMERA_API_SET_MEDIA_BRIDGE */
camera_dispatcher_unset_media_bridge, /* MUSE_CAMERA_API_UNSET_MEDIA_BRIDGE */
camera_dispatcher_set_extra_preview_cb, /* MUSE_CAMERA_API_SET_EXTRA_PREVIEW_CB, */
- camera_dispatcher_unset_extra_preview_cb /* MUSE_CAMERA_API_UNSET_EXTRA_PREVIEW_CB, */
+ camera_dispatcher_unset_extra_preview_cb, /* MUSE_CAMERA_API_UNSET_EXTRA_PREVIEW_CB, */
+ camera_dispatcher_attr_set_focus_level, /* MUSE_CAMERA_API_ATTR_SET_FOCUS_LEVEL */
+ camera_dispatcher_attr_get_focus_level, /* MUSE_CAMERA_API_ATTR_GET_FOCUS_LEVEL */
+ camera_dispatcher_attr_get_focus_level_range /* MUSE_CAMERA_API_ATTR_GET_FOCUS_LEVEL_RANGE */
};
Name: mmsvc-camera
Summary: A Camera module for muse server
-Version: 0.3.42
+Version: 0.3.43
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0