int camera_attr_set_gain(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_GAIN;
- camera_msg_param param;
-
- CAMERA_CHECK_HANDLE_RETURN_VAL(pc, 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;
+ return _camera_attr_set_level(camera, MUSE_CAMERA_API_ATTR_SET_GAIN, level);
}
int camera_attr_set_brightness(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_BRIGHTNESS;
- camera_msg_param param;
-
- CAMERA_CHECK_HANDLE_RETURN_VAL(pc, 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;
+ return _camera_attr_set_level(camera, MUSE_CAMERA_API_ATTR_SET_BRIGHTNESS, level);
}
int camera_attr_set_contrast(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_CONTRAST;
- camera_msg_param param;
-
- CAMERA_CHECK_HANDLE_RETURN_VAL(pc, 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;
+ return _camera_attr_set_level(camera, MUSE_CAMERA_API_ATTR_SET_CONTRAST, level);
}
int camera_attr_set_hue(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_HUE;
- camera_msg_param param;
-
- CAMERA_CHECK_HANDLE_RETURN_VAL(pc, 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;
+ return _camera_attr_set_level(camera, MUSE_CAMERA_API_ATTR_SET_HUE, level);
}
int camera_attr_set_saturation(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_SATURATION;
- camera_msg_param param;
-
- CAMERA_CHECK_HANDLE_RETURN_VAL(pc, 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;
+ return _camera_attr_set_level(camera, MUSE_CAMERA_API_ATTR_SET_SATURATION, level);
}
int camera_attr_set_sharpness(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_SHARPNESS;
- camera_msg_param param;
-
- CAMERA_CHECK_HANDLE_RETURN_VAL(pc, 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;
+ return _camera_attr_set_level(camera, MUSE_CAMERA_API_ATTR_SET_SHARPNESS, level);
}
int camera_attr_get_zoom_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_ZOOM_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_ZOOM_RANGE][0];
- *max = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_ZOOM_RANGE][1];
- }
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_range(camera,
+ MUSE_CAMERA_API_ATTR_GET_ZOOM_RANGE,
+ MUSE_CAMERA_GET_INT_PAIR_ZOOM_RANGE,
+ min, max);
}
int camera_attr_get_exposure_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_EXPOSURE_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_EXPOSURE_RANGE][0];
- *max = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_EXPOSURE_RANGE][1];
- }
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_range(camera,
+ MUSE_CAMERA_API_ATTR_GET_EXPOSURE_RANGE,
+ MUSE_CAMERA_GET_INT_PAIR_EXPOSURE_RANGE,
+ min, max);
}
int camera_attr_get_gain(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_GAIN;
-
- 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_GAIN];
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_level(camera,
+ MUSE_CAMERA_API_ATTR_GET_GAIN,
+ MUSE_CAMERA_GET_INT_GAIN,
+ level);
}
int camera_attr_get_gain_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_GAIN_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_GAIN_RANGE][0];
- *max = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_GAIN_RANGE][1];
- }
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_range(camera,
+ MUSE_CAMERA_API_ATTR_GET_GAIN_RANGE,
+ MUSE_CAMERA_GET_INT_PAIR_GAIN_RANGE,
+ min, max);
}
int camera_attr_get_brightness(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_BRIGHTNESS;
-
- 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_BRIGHTNESS];
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_level(camera,
+ MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS,
+ MUSE_CAMERA_GET_INT_BRIGHTNESS,
+ level);
}
int camera_attr_get_brightness_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_BRIGHTNESS_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_BRIGHTNESS_RANGE][0];
- *max = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_BRIGHTNESS_RANGE][1];
- }
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_range(camera,
+ MUSE_CAMERA_API_ATTR_GET_BRIGHTNESS_RANGE,
+ MUSE_CAMERA_GET_INT_PAIR_BRIGHTNESS_RANGE,
+ min, max);
}
int camera_attr_get_contrast(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_CONTRAST;
-
- 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_CONTRAST];
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_level(camera,
+ MUSE_CAMERA_API_ATTR_GET_CONTRAST,
+ MUSE_CAMERA_GET_INT_CONTRAST,
+ level);
}
int camera_attr_get_contrast_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_CONTRAST_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_CONTRAST_RANGE][0];
- *max = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_CONTRAST_RANGE][1];
- CAM_LOG_INFO("min %d, max %d", *min, *max);
- }
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_range(camera,
+ MUSE_CAMERA_API_ATTR_GET_CONTRAST_RANGE,
+ MUSE_CAMERA_GET_INT_PAIR_CONTRAST_RANGE,
+ min, max);
}
int camera_attr_get_hue(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_HUE;
-
- 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_HUE];
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_level(camera,
+ MUSE_CAMERA_API_ATTR_GET_HUE,
+ MUSE_CAMERA_GET_INT_HUE,
+ level);
}
int camera_attr_get_hue_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_HUE_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_HUE_RANGE][0];
- *max = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_HUE_RANGE][1];
- CAM_LOG_INFO("min %d, max %d", *min, *max);
- }
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_range(camera,
+ MUSE_CAMERA_API_ATTR_GET_HUE_RANGE,
+ MUSE_CAMERA_GET_INT_PAIR_HUE_RANGE,
+ min, max);
}
int camera_attr_get_saturation(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_SATURATION;
-
- 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_SATURATION];
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_level(camera,
+ MUSE_CAMERA_API_ATTR_GET_SATURATION,
+ MUSE_CAMERA_GET_INT_SATURATION,
+ level);
}
int camera_attr_get_saturation_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_SATURATION_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_SATURATION_RANGE][0];
- *max = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_SATURATION_RANGE][1];
- CAM_LOG_INFO("min %d, max %d", *min, *max);
- }
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_range(camera,
+ MUSE_CAMERA_API_ATTR_GET_SATURATION_RANGE,
+ MUSE_CAMERA_GET_INT_PAIR_SATURATION_RANGE,
+ min, max);
}
int camera_attr_get_sharpness(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_SHARPNESS;
-
- 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_SHARPNESS];
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_level(camera,
+ MUSE_CAMERA_API_ATTR_GET_SHARPNESS,
+ MUSE_CAMERA_GET_INT_SHARPNESS,
+ level);
}
int camera_attr_get_sharpness_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_SHARPNESS_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_SHARPNESS_RANGE][0];
- *max = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_SHARPNESS_RANGE][1];
- CAM_LOG_INFO("min %d, max %d", *min, *max);
- }
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_range(camera,
+ MUSE_CAMERA_API_ATTR_GET_SHARPNESS_RANGE,
+ MUSE_CAMERA_GET_INT_PAIR_SHARPNESS_RANGE,
+ min, max);
}
int camera_attr_get_whitebalance_temperature_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_WHITEBALANCE_TEMPERATURE_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_WHITE_BALANCE_TEMPERATURE_RANGE][0];
- *max = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_WHITE_BALANCE_TEMPERATURE_RANGE][1];
- }
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_range(camera,
+ MUSE_CAMERA_API_ATTR_GET_WHITEBALANCE_TEMPERATURE_RANGE,
+ MUSE_CAMERA_GET_INT_PAIR_WHITE_BALANCE_TEMPERATURE_RANGE,
+ min, max);
}
int camera_attr_get_pan_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_PAN_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_PAN_RANGE][0];
- *max = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_PAN_RANGE][1];
- }
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_range(camera,
+ MUSE_CAMERA_API_ATTR_GET_PAN_RANGE,
+ MUSE_CAMERA_GET_INT_PAIR_PAN_RANGE,
+ min, max);
}
int camera_attr_get_tilt_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_TILT_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_TILT_RANGE][0];
- *max = pc->cb_info->get_int_pair[MUSE_CAMERA_GET_INT_PAIR_TILT_RANGE][1];
- }
-
- CAM_LOG_INFO("ret : 0x%x", ret);
-
- return ret;
+ return _camera_attr_get_range(camera,
+ MUSE_CAMERA_API_ATTR_GET_TILT_RANGE,
+ MUSE_CAMERA_GET_INT_PAIR_TILT_RANGE,
+ min, max);
}
{
return g_camera_log_level;
}
+
+
+int _camera_attr_set_level(camera_h camera, muse_camera_api_e api, int level)
+{
+ int ret = CAMERA_ERROR_NONE;
+ camera_cli_s *pc = (camera_cli_s *)camera;
+ camera_msg_param param;
+
+ if (!pc || !pc->cb_info) {
+ CAM_LOG_ERROR("api[%d] NULL handle", api);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ CAM_LOG_INFO("api[%d] Enter - level[%d]", api, level);
+
+ CAMERA_MSG_PARAM_SET(param, INT, level);
+
+ _camera_msg_send_param1(api, pc->cb_info, &ret, ¶m, CAMERA_CB_TIMEOUT);
+
+ CAM_LOG_INFO("api[%d] ret[0x%x]", api, ret);
+
+ return ret;
+}
+
+
+int _camera_attr_get_level(camera_h camera, muse_camera_api_e api, muse_camera_get_int_e get_index, int *level)
+{
+ int ret = CAMERA_ERROR_NONE;
+ camera_cli_s *pc = (camera_cli_s *)camera;
+
+ if (!pc || !pc->cb_info || !level) {
+ CAM_LOG_ERROR("api[%d] NULL param[%p,%p]", api, pc, level);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (get_index >= MUSE_CAMERA_GET_INT_NUM) {
+ CAM_LOG_ERROR("api[%d] INVALID index[%d]", api, get_index);
+ return CAMERA_ERROR_INVALID_OPERATION;
+ }
+
+ CAM_LOG_INFO("api[%d] Enter", api);
+
+ _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+
+ if (ret == CAMERA_ERROR_NONE) {
+ *level = pc->cb_info->get_int[get_index];
+ CAM_LOG_INFO("api[%d] level[%d]", api, *level);
+ }
+
+ CAM_LOG_INFO("api[%d] ret[0x%x]", api, ret);
+
+ return ret;
+}
+
+
+int _camera_attr_get_range(camera_h camera, muse_camera_api_e api, muse_camera_get_int_pair_e get_index, int *min, int *max)
+{
+ int ret = CAMERA_ERROR_NONE;
+ camera_cli_s *pc = (camera_cli_s *)camera;
+
+ if (!pc || !pc->cb_info || !min || !max) {
+ CAM_LOG_ERROR("api[%d] NULL param[%p,%p,%p]", api, pc, min, max);
+ return CAMERA_ERROR_INVALID_PARAMETER;
+ }
+
+ if (get_index >= MUSE_CAMERA_GET_INT_PAIR_NUM) {
+ CAM_LOG_ERROR("api[%d] INVALID index[%d]", api, get_index);
+ return CAMERA_ERROR_INVALID_OPERATION;
+ }
+
+ CAM_LOG_INFO("api[%d] Enter", api);
+
+ _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+
+ if (ret == CAMERA_ERROR_NONE) {
+ *min = pc->cb_info->get_int_pair[get_index][0];
+ *max = pc->cb_info->get_int_pair[get_index][1];
+ CAM_LOG_INFO("api[%d] min[%d], max[%d]", api, *min, *max);
+ }
+
+ CAM_LOG_INFO("api[%d] ret[0x%x]", api, ret);
+
+ return ret;
+}