[ACR-1754] Add new APIs for camera settings
[platform/core/api/camera.git] / src / camera.c
index 5bc1b69..121ba32 100644 (file)
@@ -274,6 +274,88 @@ _DONE:
 }
 
 
+static void __camera_preview_cb_monitoring_info_sub_reset(monitoring_info_sub_s *info_sub)
+{
+       if (!info_sub) {
+               CAM_LOG_ERROR("NULL info_sub");
+               return;
+       }
+
+       info_sub->frame_count = 0;
+       info_sub->elapsed_sec_accum = 0.0;
+       info_sub->elapsed_sec_peak = 0.0;
+}
+
+
+static void __camera_preview_cb_monitoring_info_reset(camera_preview_cb_monitoring_info_s *info)
+{
+       if (!info) {
+               CAM_LOG_ERROR("NULL info");
+               return;
+       }
+
+       __camera_preview_cb_monitoring_info_sub_reset(info->total);
+       __camera_preview_cb_monitoring_info_sub_reset(info->interval);
+}
+
+
+static void __camera_preview_cb_monitoring_info_start(camera_preview_cb_monitoring_info_s *info)
+{
+       if (!info) {
+               CAM_LOG_ERROR("NULL info");
+               return;
+       }
+
+       g_timer_start(info->timer_calling);
+
+       if (info->interval->frame_count == 0)
+               g_timer_start(info->timer_interval);
+}
+
+
+static void __camera_preview_cb_monitoring_info_sub_update(monitoring_info_sub_s *info_sub, gdouble elapsed_sec)
+{
+       if (!info_sub) {
+               CAM_LOG_ERROR("NULL info_sub");
+               return;
+       }
+
+       info_sub->frame_count++;
+       info_sub->elapsed_sec_accum += elapsed_sec;
+
+       if (info_sub->elapsed_sec_peak < elapsed_sec)
+               info_sub->elapsed_sec_peak = elapsed_sec;
+}
+
+
+static void __camera_preview_cb_monitoring_info_end(camera_preview_cb_monitoring_info_s *info)
+{
+       gdouble elapsed_sec = 0.0;
+       gdouble elapsed_sec_interval = 0.0;
+
+       if (!info) {
+               CAM_LOG_ERROR("NULL info");
+               return;
+       }
+
+       elapsed_sec = g_timer_elapsed(info->timer_calling, NULL);
+       elapsed_sec_interval = g_timer_elapsed(info->timer_interval, NULL);
+
+       __camera_preview_cb_monitoring_info_sub_update(info->total, elapsed_sec);
+       __camera_preview_cb_monitoring_info_sub_update(info->interval, elapsed_sec);
+
+       if (elapsed_sec_interval >= 1.0) {
+               CAM_LOG_INFO("id[%d], frame count[t:%llu,i:%llu], elapsed - avg[t:%dms,i:%dms], peak[t:%dms,i:%dms]",
+                       info->stream_id, info->total->frame_count, info->interval->frame_count,
+                       (int)((info->total->elapsed_sec_accum / (gdouble)info->total->frame_count) * 1000),
+                       (int)((info->interval->elapsed_sec_accum / (gdouble)info->interval->frame_count) * 1000),
+                       (int)(info->total->elapsed_sec_peak * 1000), (int)(info->interval->elapsed_sec_peak * 1000));
+
+               __camera_preview_cb_monitoring_info_sub_reset(info->interval);
+       }
+}
+
+
 static void __camera_event_handler_preview(camera_cb_info_s *cb_info, char *recv_msg, int *tfd)
 {
        int i = 0;
@@ -295,6 +377,7 @@ static void __camera_event_handler_preview(camera_cb_info_s *cb_info, char *recv
        MMCamcorderVideoStreamDataType *stream = NULL;
        camera_media_packet_data *mp_data = NULL;
        media_packet_h pkt = NULL;
+       camera_preview_cb_monitoring_info_s *monitoring_info = NULL;
 
        /* tfd[0]: MMCamcorderVideoStreamDataType
           tfd[1]: data_bo or zero copy bo[0]
@@ -373,15 +456,23 @@ static void __camera_event_handler_preview(camera_cb_info_s *cb_info, char *recv
                cb_info->stream_data = stream;
 
                if (stream->extra_stream_id < 0) {
+                       monitoring_info = cb_info->monitoring_info_preview;
+                       __camera_preview_cb_monitoring_info_start(monitoring_info);
+
                        if (cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW])
                                ((camera_preview_cb)cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_PREVIEW])(&frame,
                                        cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_PREVIEW]);
                } else {
+                       monitoring_info = cb_info->monitoring_info_preview_ex[stream->extra_stream_id];
+                       __camera_preview_cb_monitoring_info_start(monitoring_info);
+
                        if (cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_EXTRA_PREVIEW])
                                ((camera_extra_preview_cb)cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_EXTRA_PREVIEW])(&frame,
                                        stream->extra_stream_id, cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_EXTRA_PREVIEW]);
                }
 
+               __camera_preview_cb_monitoring_info_end(monitoring_info);
+
                cb_info->stream_data = NULL;
        }
 
@@ -414,8 +505,14 @@ static void __camera_event_handler_preview(camera_cb_info_s *cb_info, char *recv
        /* 1. media packet preview callback */
        if (cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW]) {
                media_packet_ref(pkt);
+
+               monitoring_info = cb_info->monitoring_info_preview_mp;
+               __camera_preview_cb_monitoring_info_start(monitoring_info);
+
                ((camera_media_packet_preview_cb)cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW])(pkt,
                        cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW]);
+
+               __camera_preview_cb_monitoring_info_end(monitoring_info);
        }
 
        /* 2. call evas renderer */
@@ -2284,10 +2381,42 @@ static void __camera_mutex_cond_clear(camera_cb_info_s *cb_info)
 }
 
 
+static camera_preview_cb_monitoring_info_s *__camera_preview_cb_monitoring_info_create(int stream_id)
+{
+       camera_preview_cb_monitoring_info_s *new_info = g_new0(camera_preview_cb_monitoring_info_s, 1);
+
+       new_info->stream_id = stream_id;
+       new_info->total = g_new0(monitoring_info_sub_s, 1);
+       new_info->interval = g_new0(monitoring_info_sub_s, 1);
+       new_info->timer_calling = g_timer_new();
+       new_info->timer_interval = g_timer_new();
+
+       CAM_LOG_INFO("create preview cb monitoring info[%p]", new_info);
+
+       return new_info;
+}
+
+
+static void __camera_preview_cb_monitoring_info_destroy(camera_preview_cb_monitoring_info_s *info)
+{
+       if (!info)
+               return;
+
+       g_timer_destroy(info->timer_calling);
+       g_timer_destroy(info->timer_interval);
+       g_free(info->total);
+       g_free(info->interval);
+
+       CAM_LOG_INFO("destroy preview cb monitoring info[%p]", info);
+
+       g_free(info);
+}
+
+
 static camera_cb_info_s *__camera_client_callback_new(gint sockfd)
 {
+       int i = 0;
        camera_cb_info_s *cb_info = NULL;
-       gint i = 0;
 
        g_return_val_if_fail(sockfd > 0, NULL);
 
@@ -2332,6 +2461,11 @@ static camera_cb_info_s *__camera_client_callback_new(gint sockfd)
 
        cb_info->is_server_connected = TRUE;
 
+       cb_info->monitoring_info_preview = __camera_preview_cb_monitoring_info_create(CAMERA_MONITORING_INFO_STREAM_ID_PREVIEW);
+       cb_info->monitoring_info_preview_mp = __camera_preview_cb_monitoring_info_create(CAMERA_MONITORING_INFO_STREAM_ID_PREVIEW_MP);
+       for (i = 0 ; i < MM_CAMCORDER_EXTRA_PREVIEW_STREAM_MAX ; i++)
+               cb_info->monitoring_info_preview_ex[i] = __camera_preview_cb_monitoring_info_create(i);
+
        return cb_info;
 //LCOV_EXCL_START
 ErrorExit:
@@ -2352,6 +2486,8 @@ ErrorExit:
 
 static void __camera_client_callback_destroy(camera_cb_info_s *cb_info)
 {
+       int i = 0;
+
        if (!cb_info) {
                CAM_LOG_ERROR("NULL cb_info");
                return;
@@ -2390,6 +2526,11 @@ static void __camera_client_callback_destroy(camera_cb_info_s *cb_info)
                cb_info->dp_interface = NULL;
        }
 
+       __camera_preview_cb_monitoring_info_destroy(cb_info->monitoring_info_preview);
+       __camera_preview_cb_monitoring_info_destroy(cb_info->monitoring_info_preview_mp);
+       for (i = 0 ; i < MM_CAMCORDER_EXTRA_PREVIEW_STREAM_MAX ; i++)
+               __camera_preview_cb_monitoring_info_destroy(cb_info->monitoring_info_preview_ex[i]);
+
        g_free(cb_info);
 }
 
@@ -2743,6 +2884,7 @@ int camera_destroy(camera_h camera)
 
 int camera_start_preview(camera_h camera)
 {
+       int i = 0;
        int ret = CAMERA_ERROR_NONE;
        int *fds = NULL;
        muse_camera_api_e api = MUSE_CAMERA_API_START_PREVIEW;
@@ -2768,6 +2910,11 @@ int camera_start_preview(camera_h camera)
        }
 
        if (current_state == CAMERA_STATE_CREATED) {
+               __camera_preview_cb_monitoring_info_reset(pc->cb_info->monitoring_info_preview);
+               __camera_preview_cb_monitoring_info_reset(pc->cb_info->monitoring_info_preview_mp);
+               for (i = 0 ; i < MM_CAMCORDER_EXTRA_PREVIEW_STREAM_MAX ; i++)
+                       __camera_preview_cb_monitoring_info_reset(pc->cb_info->monitoring_info_preview_ex[i]);
+
                if (!__create_msg_handler_thread(&pc->cb_info->preview_cb_info,
                                CAMERA_MESSAGE_HANDLER_TYPE_PREVIEW_CB, "cam:preview_cb", pc->cb_info)) {
                        CAM_LOG_ERROR("preview_cb_info failed");
@@ -2790,7 +2937,7 @@ int camera_start_preview(camera_h camera)
 #ifdef TIZEN_FEATURE_NO_TIMEOUT_FOR_PREVIEW
                CAMERA_CB_NO_TIMEOUT);
 #else
-               (pc->cb_info->is_network ? CAMERA_CB_NETWORK_PREVIEW_TIMEOUT : CAMERA_CB_TIMEOUT));
+               CAMERA_CB_TIMEOUT_FOR_PREVIEW);
 #endif
        if (ret != CAMERA_ERROR_NONE)
                goto _START_FAILED;
@@ -4588,6 +4735,27 @@ int camera_attr_set_iso(camera_h camera, camera_attr_iso_e iso)
 }
 
 
+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, &param, CAMERA_CB_TIMEOUT);
+
+       CAM_LOG_INFO("ret : 0x%x", ret);
+
+       return ret;
+}
+
+
 int camera_attr_set_brightness(camera_h camera, int level)
 {
        int ret = CAMERA_ERROR_NONE;
@@ -4651,6 +4819,48 @@ int camera_attr_set_hue(camera_h camera, int 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, &param, CAMERA_CB_TIMEOUT);
+
+       CAM_LOG_INFO("ret : 0x%x", ret);
+
+       return ret;
+}
+
+
+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, &param, CAMERA_CB_TIMEOUT);
+
+       CAM_LOG_INFO("ret : 0x%x", ret);
+
+       return ret;
+}
+
+
 int camera_attr_set_whitebalance(camera_h camera, camera_attr_whitebalance_e wb)
 {
        int ret = CAMERA_ERROR_NONE;
@@ -4673,6 +4883,27 @@ int camera_attr_set_whitebalance(camera_h camera, camera_attr_whitebalance_e wb)
 }
 
 
+int camera_attr_set_whitebalance_temperature(camera_h camera, int temperature)
+{
+       int ret = CAMERA_ERROR_NONE;
+       camera_cli_s *pc = (camera_cli_s *)camera;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_WHITEBALANCE_TEMPERATURE;
+       camera_msg_param param;
+
+       CAMERA_CHECK_HANDLE_RETURN_VAL(pc, CAMERA_ERROR_INVALID_PARAMETER);
+
+       CAM_LOG_INFO("Enter");
+
+       CAMERA_MSG_PARAM_SET(param, INT, temperature);
+
+       _camera_msg_send_param1(api, pc->cb_info, &ret, &param, CAMERA_CB_TIMEOUT);
+
+       CAM_LOG_INFO("ret : 0x%x", ret);
+
+       return ret;
+}
+
+
 int camera_attr_set_effect(camera_h camera, camera_attr_effect_mode_e effect)
 {
        int ret = CAMERA_ERROR_NONE;
@@ -4999,6 +5230,80 @@ int camera_attr_get_iso(camera_h camera, camera_attr_iso_e *iso)
 }
 
 
+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;
+}
+
+
+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;
+}
+
+
+int camera_attr_get_gain_step(camera_h camera, int *step)
+{
+       int ret = CAMERA_ERROR_NONE;
+       camera_cli_s *pc = (camera_cli_s *)camera;
+       muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_GAIN_STEP;
+
+       if (!pc || !pc->cb_info || !step) {
+               CAM_LOG_ERROR("NULL pointer %p %p", pc, step);
+               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)
+               *step = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_GAIN_STEP];
+
+       CAM_LOG_INFO("ret : 0x%x", ret);
+
+       return ret;
+}
+
+
 int camera_attr_get_brightness(camera_h camera, int *level)
 {
        int ret = CAMERA_ERROR_NONE;
@@ -5151,6 +5456,108 @@ int camera_attr_get_hue_range(camera_h camera, int *min, int *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;
+}
+
+
+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;
+}
+
+
+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;
+}
+
+
+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;
+}
+
+
 int camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *wb)
 {
        int ret = CAMERA_ERROR_NONE;
@@ -5175,6 +5582,80 @@ int camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *wb
 }
 
 
+int camera_attr_get_whitebalance_temperature(camera_h camera, int *temperature)
+{
+       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;
+
+       if (!pc || !pc->cb_info || !temperature) {
+               CAM_LOG_ERROR("NULL pointer %p %p", pc, temperature);
+               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)
+               *temperature = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_WHITE_BALANCE_TEMPERATURE];
+
+       CAM_LOG_INFO("ret : 0x%x", ret);
+
+       return ret;
+}
+
+
+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;
+}
+
+
+int camera_attr_get_whitebalance_temperature_step(camera_h camera, int *step)
+{
+       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_STEP;
+
+       if (!pc || !pc->cb_info || !step) {
+               CAM_LOG_ERROR("NULL pointer %p %p", pc, step);
+               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)
+               *step = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_WHITE_BALANCE_TEMPERATURE_STEP];
+
+       CAM_LOG_INFO("ret : 0x%x", ret);
+
+       return ret;
+}
+
+
 int camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect)
 {
        int ret = CAMERA_ERROR_NONE;