summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2016-11-03 16:08:58 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2016-11-03 16:08:58 +0900
commit0ed7202aa2b6829c32a9c53abb99a23e3022ce47 (patch)
tree2d34b600e8b008092be3e7338afae1b159b60a87
parentc7c5cfc62a4a5402b45e6bfa148023a60a0e8955 (diff)
downloadcamera-0ed7202aa2b6829c32a9c53abb99a23e3022ce47.tar.gz
camera-0ed7202aa2b6829c32a9c53abb99a23e3022ce47.tar.bz2
camera-0ed7202aa2b6829c32a9c53abb99a23e3022ce47.zip
Bug fix - sometimes, could not get values from received message
[Version] 0.2.81 [Profile] Common [Issue Type] Bug fix [Dependency module] N/A [Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-mobile_20161101.3] Change-Id: I4443801e0883f82f3aee626f1dce7612907d1b18 Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r--include/camera_private.h7
-rw-r--r--packaging/capi-media-camera.spec2
-rw-r--r--src/camera.c559
3 files changed, 232 insertions, 336 deletions
diff --git a/include/camera_private.h b/include/camera_private.h
index 747b6c4..1dc339d 100644
--- a/include/camera_private.h
+++ b/include/camera_private.h
@@ -154,6 +154,13 @@ typedef struct _camera_cb_info_s {
GMutex evas_mutex;
#endif /* TIZEN_FEATURE_EVAS_RENDERER */
gboolean run_evas_render;
+
+ /* get values */
+ gint get_int[MUSE_CAMERA_GET_INT_NUM];
+ gint get_int_pair[MUSE_CAMERA_GET_INT_PAIR_NUM][2];
+ gchar get_string[MUSE_CAMERA_GET_STRING_NUM][MUSE_CAMERA_MSG_MAX_LENGTH];
+ gdouble get_geotag[3];
+ gint get_display_roi_area[4];
} camera_cb_info_s;
typedef struct _camera_message_s {
diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec
index ed21092..62b774a 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.2.80
+Version: 0.2.81
Release: 0
Group: Multimedia/API
License: Apache-2.0
diff --git a/src/camera.c b/src/camera.c
index 5dabe2c..696b5a5 100644
--- a/src/camera.c
+++ b/src/camera.c
@@ -1814,14 +1814,128 @@ static void __camera_add_msg_to_queue(camera_cb_info_s *cb_info, int api, int ev
}
+static void __camera_process_msg(camera_cb_info_s *cb_info, char *msg)
+{
+ int ret = CAMERA_ERROR_NONE;
+ int api = -1;
+ int api_class = -1;
+ int event = -1;
+ int event_class = -1;
+ int get_type = -1;
+ int get_index = -1;
+
+ if (!cb_info || !msg) {
+ LOGE("invalid ptr %p %p", cb_info, msg);
+ return;
+ }
+
+ LOGD("msg [%s]", msg);
+
+ if (!muse_camera_msg_get(api, msg)) {
+ LOGE("failed to get camera api");
+ return;
+ }
+
+ if (api == MUSE_CAMERA_CB_EVENT) {
+ if (!muse_camera_msg_get(event, msg) ||
+ !muse_camera_msg_get(event_class, msg)) {
+ LOGE("failed to get camera event or event_class [%s]", msg);
+ return;
+ }
+ } else {
+ if (!muse_camera_msg_get(api_class, msg)) {
+ LOGE("failed to get camera api_class [%s]", msg);
+ return;
+ }
+ }
+
+ if (api_class == MUSE_CAMERA_API_CLASS_IMMEDIATE) {
+ if (api >= MUSE_CAMERA_API_MAX) {
+ LOGE("invalid api %d", api);
+ return;
+ }
+
+ g_mutex_lock(&cb_info->api_mutex[api]);
+
+ if (!muse_camera_msg_get(ret, msg)) {
+ LOGE("failed to get camera ret");
+ g_mutex_unlock(&cb_info->api_mutex[api]);
+ return;
+ }
+
+ cb_info->api_ret[api] = ret;
+ cb_info->api_activating[api] = 1;
+
+ switch (api) {
+ case MUSE_CAMERA_API_CREATE:
+ if (ret != CAMERA_ERROR_NONE) {
+ g_atomic_int_set(&cb_info->msg_recv_running, 0);
+ LOGE("camera create error 0x%x. close client cb handler", ret);
+ }
+ break;
+ case MUSE_CAMERA_API_DESTROY:
+ if (ret == CAMERA_ERROR_NONE) {
+ g_atomic_int_set(&cb_info->msg_recv_running, 0);
+ LOGD("camera destroy done. close client cb handler");
+ }
+ break;
+ default:
+ muse_camera_msg_get(get_type, msg);
+ if (get_type != MUSE_CAMERA_GET_TYPE_NONE) {
+ if (get_type != MUSE_CAMERA_GET_TYPE_ARRAY)
+ muse_camera_msg_get(get_index, msg);
+
+ switch (get_type) {
+ case MUSE_CAMERA_GET_TYPE_INT:
+ muse_core_msg_json_deserialize("get_value", msg, NULL, &cb_info->get_int[get_index], NULL, MUSE_TYPE_INT);
+ break;
+ case MUSE_CAMERA_GET_TYPE_INT_PAIR:
+ muse_core_msg_json_deserialize("get_value0", msg, NULL, &cb_info->get_int_pair[get_index][0], NULL, MUSE_TYPE_INT);
+ muse_core_msg_json_deserialize("get_value1", msg, NULL, &cb_info->get_int_pair[get_index][1], NULL, MUSE_TYPE_INT);
+ break;
+ case MUSE_CAMERA_GET_TYPE_ARRAY:
+ if (api == MUSE_CAMERA_API_GET_DISPLAY_ROI_AREA) {
+ muse_core_msg_json_deserialize("get_value",
+ msg, NULL, cb_info->get_display_roi_area, NULL, MUSE_TYPE_ARRAY);
+ LOGD("get display roi %d,%d,%dx%d",
+ cb_info->get_display_roi_area[0],
+ cb_info->get_display_roi_area[1],
+ cb_info->get_display_roi_area[2],
+ cb_info->get_display_roi_area[3]);
+ } else {
+ muse_core_msg_json_deserialize("get_value",
+ msg, NULL, cb_info->get_geotag, NULL, MUSE_TYPE_ARRAY);
+ LOGD("get geotag %lf, %lf, %lf",
+ cb_info->get_geotag[0], cb_info->get_geotag[1], cb_info->get_geotag[2]);
+ }
+ break;
+ case MUSE_CAMERA_GET_TYPE_STRING:
+ muse_core_msg_json_deserialize("get_value", msg, NULL, cb_info->get_string[get_index], NULL, MUSE_TYPE_STRING);
+ break;
+ default:
+ LOGW("unknown type %d", get_type);
+ break;
+ }
+ }
+ break;
+ }
+
+ g_cond_signal(&cb_info->api_cond[api]);
+ g_mutex_unlock(&cb_info->api_mutex[api]);
+ } else if (api_class == MUSE_CAMERA_API_CLASS_THREAD_SUB || api == MUSE_CAMERA_CB_EVENT) {
+ __camera_add_msg_to_queue(cb_info, api, event, event_class, msg);
+ } else {
+ LOGW("unknown camera api %d, class %d", api, api_class);
+ }
+
+ return;
+}
+
+
static void *_camera_msg_recv_func(gpointer data)
{
int i = 0;
int ret = 0;
- int api = 0;
- int api_class = 0;
- int event = 0;
- int event_class = 0;
int num_token = 0;
int str_pos = 0;
int prev_pos = 0;
@@ -1896,78 +2010,9 @@ static void *_camera_msg_recv_func(gpointer data)
/*LOGD("num_token : %d", num_token);*/
- /* Re-construct to the useful single msg. */
- for (i = 0; i < num_token; i++) {
- if (i >= CAMERA_PARSED_STRING_NUM_MAX) {
- LOGE("invalid token index %d", i);
- break;
- }
-
- api = -1;
- api_class = -1;
- event = -1;
- event_class = -1;
-
- if (!muse_camera_msg_get(api, parse_str[i])) {
- LOGE("failed to get camera api");
- continue;
- }
-
- if (api == MUSE_CAMERA_CB_EVENT) {
- if (!muse_camera_msg_get(event, parse_str[i]) ||
- !muse_camera_msg_get(event_class, parse_str[i])) {
- LOGE("failed to get camera event or event_class [%s]", parse_str[i]);
- continue;
- }
- } else {
- if (!muse_camera_msg_get(api_class, parse_str[i])) {
- LOGE("failed to get camera api_class [%s]", parse_str[i]);
- continue;
- }
- }
-
- if (api_class == MUSE_CAMERA_API_CLASS_IMMEDIATE) {
- if (api >= MUSE_CAMERA_API_MAX) {
- LOGE("invalid api %d", api);
- continue;
- }
-
- g_mutex_lock(&cb_info->api_mutex[api]);
-
- if (!muse_camera_msg_get(ret, parse_str[i])) {
- LOGE("failed to get camera ret");
- g_mutex_unlock(&cb_info->api_mutex[api]);
- continue;
- }
-
- cb_info->api_ret[api] = ret;
- cb_info->api_activating[api] = 1;
-
- if (api == MUSE_CAMERA_API_CREATE) {
- if (ret != CAMERA_ERROR_NONE) {
- g_atomic_int_set(&cb_info->msg_recv_running, 0);
- LOGE("camera create error 0x%x. close client cb handler", ret);
- }
- } else if (api == MUSE_CAMERA_API_DESTROY) {
- if (ret == CAMERA_ERROR_NONE) {
- g_atomic_int_set(&cb_info->msg_recv_running, 0);
- LOGD("camera destroy done. close client cb handler");
- }
- } else if (api == MUSE_CAMERA_API_GET_FLASH_STATE ||
- api == MUSE_CAMERA_API_GET_DEVICE_STATE) {
- g_atomic_int_set(&cb_info->msg_recv_running, 0);
- LOGD("get flash or device state done. close client cb handler");
- }
-
- g_cond_signal(&cb_info->api_cond[api]);
- g_mutex_unlock(&cb_info->api_mutex[api]);
- } else if (api_class == MUSE_CAMERA_API_CLASS_THREAD_SUB || api == MUSE_CAMERA_CB_EVENT) {
- __camera_add_msg_to_queue(cb_info, api, event, event_class, parse_str[i]);
- } else {
- LOGW("unknown camera api %d, class %d", api, api_class);
- }
- }
-
+ /* process each message */
+ for (i = 0; i < num_token; i++)
+ __camera_process_msg(cb_info, parse_str[i]);
}
LOGD("client cb exit - server connected %d", cb_info->is_server_connected);
@@ -2824,7 +2869,6 @@ int camera_get_device_count(camera_h camera, int *device_count)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_GET_DEVICE_COUNT;
- int get_device_count = 0;
if (!pc || !pc->cb_info) {
LOGE("NULL handle");
@@ -2835,10 +2879,8 @@ int camera_get_device_count(camera_h camera, int *device_count)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_device_count, pc->cb_info->recv_msg);
- *device_count = get_device_count;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *device_count = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_DEVICE_COUNT];
LOGD("ret : 0x%x", ret);
@@ -2893,7 +2935,6 @@ int camera_get_state(camera_h camera, camera_state_e *state)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_GET_STATE;
- int get_state = CAMERA_STATE_NONE;
if (!pc || !pc->cb_info || !state) {
LOGE("NULL pointer %p %p", pc, state);
@@ -2904,10 +2945,8 @@ int camera_get_state(camera_h camera, camera_state_e *state)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_state, pc->cb_info->recv_msg);
- *state = (camera_state_e)get_state;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *state = (camera_state_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_STATE];
LOGD("ret : 0x%x", ret);
@@ -3243,8 +3282,6 @@ int camera_get_preview_resolution(camera_h camera, int *width, int *height)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_RESOLUTION;
- int get_width = 0;
- int get_height = 0;
if (!pc || !pc->cb_info || !width || !height) {
LOGE("NULL pointer %p %p %p", pc, width, height);
@@ -3256,10 +3293,8 @@ int camera_get_preview_resolution(camera_h camera, int *width, int *height)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_width, pc->cb_info->recv_msg);
- muse_camera_msg_get(get_height, pc->cb_info->recv_msg);
- *width = get_width;
- *height = get_height;
+ *width = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_PREVIEW_RESOLUTION] >> 16;
+ *height = 0x0000ffff & pc->cb_info->get_int[MUSE_CAMERA_GET_INT_PREVIEW_RESOLUTION];
}
LOGD("ret : 0x%x", ret);
@@ -3306,7 +3341,6 @@ int camera_set_display_rotation(camera_h camera, camera_rotation_e rotation)
int camera_get_display_rotation(camera_h camera, camera_rotation_e *rotation)
{
int ret = CAMERA_ERROR_NONE;
- int get_rotation = CAMERA_ROTATION_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
if (!pc || !pc->cb_info || !rotation) {
@@ -3316,10 +3350,8 @@ int camera_get_display_rotation(camera_h camera, camera_rotation_e *rotation)
_camera_msg_send(MUSE_CAMERA_API_GET_DISPLAY_ROTATION, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_rotation, pc->cb_info->recv_msg);
- *rotation = (camera_rotation_e)get_rotation;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *rotation = (camera_rotation_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_DISPLAY_ROTATION];
return ret;
}
@@ -3363,7 +3395,6 @@ int camera_set_display_flip(camera_h camera, camera_flip_e flip)
int camera_get_display_flip(camera_h camera, camera_flip_e *flip)
{
int ret = CAMERA_ERROR_NONE;
- int get_flip = CAMERA_FLIP_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
if (!pc || !pc->cb_info || !flip) {
@@ -3373,10 +3404,8 @@ int camera_get_display_flip(camera_h camera, camera_flip_e *flip)
_camera_msg_send(MUSE_CAMERA_API_GET_DISPLAY_FLIP, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_flip, pc->cb_info->recv_msg);
- *flip = (camera_flip_e)get_flip;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *flip = (camera_flip_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_DISPLAY_FLIP];
return ret;
}
@@ -3420,7 +3449,6 @@ int camera_set_display_visible(camera_h camera, bool visible)
int camera_is_display_visible(camera_h camera, bool *visible)
{
int ret = CAMERA_ERROR_NONE;
- int get_visible = true;
camera_cli_s *pc = (camera_cli_s *)camera;
if (!pc || !pc->cb_info || !visible) {
@@ -3430,10 +3458,8 @@ int camera_is_display_visible(camera_h camera, bool *visible)
_camera_msg_send(MUSE_CAMERA_API_IS_DISPLAY_VISIBLE, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_visible, pc->cb_info->recv_msg);
- *visible = (bool)get_visible;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *visible = (bool)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_DISPLAY_VISIBLE];
return ret;
}
@@ -3477,7 +3503,6 @@ int camera_set_display_mode(camera_h camera, camera_display_mode_e mode)
int camera_get_display_mode(camera_h camera, camera_display_mode_e *mode)
{
int ret = CAMERA_ERROR_NONE;
- int get_mode = CAMERA_DISPLAY_MODE_LETTER_BOX;
camera_cli_s *pc = (camera_cli_s *)camera;
if (!pc || !pc->cb_info || !mode) {
@@ -3487,10 +3512,8 @@ int camera_get_display_mode(camera_h camera, camera_display_mode_e *mode)
_camera_msg_send(MUSE_CAMERA_API_GET_DISPLAY_MODE, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_mode, pc->cb_info->recv_msg);
- *mode = (camera_display_mode_e)get_mode;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *mode = (camera_display_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_DISPLAY_MODE];
return ret;
}
@@ -3521,7 +3544,6 @@ int camera_set_display_reuse_hint(camera_h camera, bool hint)
int camera_get_display_reuse_hint(camera_h camera, bool *hint)
{
int ret = CAMERA_ERROR_NONE;
- int get_hint = 0;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_REUSE_HINT;
@@ -3533,9 +3555,7 @@ int camera_get_display_reuse_hint(camera_h camera, bool *hint)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_hint, pc->cb_info->recv_msg);
- *hint = (bool)get_hint;
-
+ *hint = (bool)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_DISPLAY_REUSE_HINT];
LOGD("display reuse hint %d", *hint);
}
@@ -3548,8 +3568,6 @@ int camera_get_capture_resolution(camera_h camera, int *width, int *height)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_RESOLUTION;
- int get_width = 0;
- int get_height = 0;
if (!pc || !pc->cb_info || !width || !height) {
LOGE("NULL pointer %p %p %p", pc, width, height);
@@ -3561,10 +3579,8 @@ int camera_get_capture_resolution(camera_h camera, int *width, int *height)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_width, pc->cb_info->recv_msg);
- muse_camera_msg_get(get_height, pc->cb_info->recv_msg);
- *width = get_width;
- *height = get_height;
+ *width = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_CAPTURE_RESOLUTION] >> 16;
+ *height = 0x0000ffff & pc->cb_info->get_int[MUSE_CAMERA_GET_INT_CAPTURE_RESOLUTION];
}
LOGD("ret : 0x%x", ret);
@@ -3578,7 +3594,6 @@ int camera_get_capture_format(camera_h camera, camera_pixel_format_e *format)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_GET_CAPTURE_FORMAT;
- int get_format = 0;
if (!pc || !pc->cb_info || !format) {
LOGE("NULL pointer %p %p", pc, format);
@@ -3589,10 +3604,8 @@ int camera_get_capture_format(camera_h camera, camera_pixel_format_e *format)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_format, pc->cb_info->recv_msg);
- *format = (camera_pixel_format_e)get_format;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *format = (camera_pixel_format_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_CAPTURE_FORMAT];
LOGD("ret : 0x%x", ret);
@@ -3605,7 +3618,6 @@ int camera_get_preview_format(camera_h camera, camera_pixel_format_e *format)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_GET_PREVIEW_FORMAT;
- int get_format = 0;
if (!pc || !pc->cb_info || !format) {
LOGE("NULL pointer %p %p", pc, format);
@@ -3616,10 +3628,8 @@ int camera_get_preview_format(camera_h camera, camera_pixel_format_e *format)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_format, pc->cb_info->recv_msg);
- *format = (camera_pixel_format_e)get_format;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *format = (camera_pixel_format_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_PREVIEW_FORMAT];
LOGD("ret : 0x%x", ret);
@@ -3632,7 +3642,6 @@ int camera_get_facing_direction(camera_h camera, camera_facing_direction_e *faci
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_GET_FACING_DIRECTION;
- int get_facing_direction = 0;
if (!pc || !pc->cb_info || !facing_direction) {
LOGE("NULL pointer %p %p", pc, facing_direction);
@@ -3643,10 +3652,8 @@ int camera_get_facing_direction(camera_h camera, camera_facing_direction_e *faci
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_facing_direction, pc->cb_info->recv_msg);
- *facing_direction = (camera_facing_direction_e)get_facing_direction;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *facing_direction = (camera_facing_direction_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_FACING_DIRECTION];
LOGD("ret : 0x%x", ret);
@@ -4068,8 +4075,6 @@ int camera_get_recommended_preview_resolution(camera_h camera, int *width, int *
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_GET_RECOMMENDED_PREVIEW_RESOLUTION;
- int get_width = 0;
- int get_height = 0;
if (!pc || !pc->cb_info || !width || !height) {
LOGE("NULL pointer %p %p %p", pc, width, height);
@@ -4080,10 +4085,8 @@ int camera_get_recommended_preview_resolution(camera_h camera, int *width, int *
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_width, pc->cb_info->recv_msg);
- muse_camera_msg_get(get_height, pc->cb_info->recv_msg);
- *width = get_width;
- *height = get_height;
+ *width = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_RECOMMENDED_PREVIEW_RESOLUTION] >> 16;
+ *height = 0x0000ffff & pc->cb_info->get_int[MUSE_CAMERA_GET_INT_RECOMMENDED_PREVIEW_RESOLUTION];
}
LOGD("ret : 0x%x", ret);
@@ -4097,7 +4100,6 @@ int camera_attr_get_lens_orientation(camera_h camera, int *angle)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_LENS_ORIENTATION;
- int get_angle = 0;
if (!pc || !pc->cb_info || !angle) {
LOGE("NULL pointer %p %p", pc, angle);
@@ -4108,10 +4110,8 @@ int camera_attr_get_lens_orientation(camera_h camera, int *angle)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_angle, pc->cb_info->recv_msg);
- *angle = get_angle;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *angle = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_LENS_ORIENTATION];
LOGD("ret : 0x%x", ret);
@@ -4149,7 +4149,6 @@ int camera_attr_get_theater_mode(camera_h camera, camera_attr_theater_mode_e *mo
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_THEATER_MODE;
- int get_mode = 0;
if (!pc || !pc->cb_info || !mode) {
LOGE("NULL pointer %p %p", pc, mode);
@@ -4160,10 +4159,8 @@ int camera_attr_get_theater_mode(camera_h camera, camera_attr_theater_mode_e *mo
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_mode, pc->cb_info->recv_msg);
- *mode = (camera_attr_theater_mode_e)get_mode;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *mode = (camera_attr_theater_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_THEATER_MODE];
LOGD("ret : 0x%x", ret);
@@ -4249,7 +4246,6 @@ int camera_attr_get_preview_fps(camera_h camera, camera_attr_fps_e *fps)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_PREVIEW_FPS;
- int get_fps = 0;
if (!pc || !pc->cb_info || !fps) {
LOGE("NULL pointer %p %p", pc, fps);
@@ -4260,10 +4256,8 @@ int camera_attr_get_preview_fps(camera_h camera, camera_attr_fps_e *fps)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_fps, pc->cb_info->recv_msg);
- *fps = (camera_attr_fps_e)get_fps;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *fps = (camera_attr_fps_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_PREVIEW_FPS];
LOGD("ret : 0x%x", ret);
@@ -4276,7 +4270,6 @@ int camera_attr_get_image_quality(camera_h camera, int *quality)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_IMAGE_QUALITY;
- int get_quality = 0;
if (!pc || !pc->cb_info || !quality) {
LOGE("NULL pointer %p %p", pc, quality);
@@ -4287,10 +4280,8 @@ int camera_attr_get_image_quality(camera_h camera, int *quality)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_quality, pc->cb_info->recv_msg);
- *quality = get_quality;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *quality = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_IMAGE_QUALITY];
LOGD("ret : 0x%x", ret);
@@ -4303,7 +4294,6 @@ int camera_attr_get_encoded_preview_bitrate(camera_h camera, int *bitrate)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ENCODED_PREVIEW_BITRATE;
- int get_bitrate = 0;
if (!pc || !pc->cb_info || !bitrate) {
LOGE("NULL pointer %p %p", pc, bitrate);
@@ -4314,10 +4304,8 @@ int camera_attr_get_encoded_preview_bitrate(camera_h camera, int *bitrate)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_bitrate, pc->cb_info->recv_msg);
- *bitrate = get_bitrate;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *bitrate = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ENCODED_PREVIEW_BITRATE];
LOGD("ret : 0x%x", ret);
@@ -4355,7 +4343,6 @@ int camera_attr_get_encoded_preview_gop_interval(camera_h camera, int *interval)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ENCODED_PREVIEW_GOP_INTERVAL;
- int get_gop_interval = 0;
if (!pc || !pc->cb_info || !interval) {
LOGE("NULL pointer %p %p", pc, interval);
@@ -4366,10 +4353,8 @@ int camera_attr_get_encoded_preview_gop_interval(camera_h camera, int *interval)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_gop_interval, pc->cb_info->recv_msg);
- *interval = get_gop_interval;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *interval = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ENCODED_PREVIEW_GOP_INTERVAL];
LOGD("ret : 0x%x", ret);
@@ -4891,7 +4876,6 @@ int camera_attr_get_zoom(camera_h camera, int *zoom)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ZOOM;
- int get_zoom = 0;
if (!pc || !pc->cb_info || !zoom) {
LOGE("NULL pointer %p %p", pc, zoom);
@@ -4902,10 +4886,8 @@ int camera_attr_get_zoom(camera_h camera, int *zoom)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_zoom, pc->cb_info->recv_msg);
- *zoom = get_zoom;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *zoom = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ZOOM];
LOGD("ret : 0x%x", ret);
@@ -4918,8 +4900,6 @@ 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;
- int get_min = 0;
- int get_max = 0;
if (!pc || !pc->cb_info || !min || !max) {
LOGE("NULL pointer %p %p %p", pc, min, max);
@@ -4931,10 +4911,8 @@ int camera_attr_get_zoom_range(camera_h camera, int *min, int *max)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_min, pc->cb_info->recv_msg);
- muse_camera_msg_get(get_max, pc->cb_info->recv_msg);
- *min = get_min;
- *max = get_max;
+ *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];
}
LOGD("ret : 0x%x", ret);
@@ -4948,7 +4926,6 @@ int camera_attr_get_af_mode(camera_h camera, camera_attr_af_mode_e *mode)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_AF_MODE;
- int get_mode = 0;
if (!pc || !pc->cb_info || !mode) {
LOGE("NULL pointer %p %p", pc, mode);
@@ -4959,10 +4936,8 @@ int camera_attr_get_af_mode(camera_h camera, camera_attr_af_mode_e *mode)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_mode, pc->cb_info->recv_msg);
- *mode = (camera_attr_af_mode_e)get_mode;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *mode = (camera_attr_af_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_AF_MODE];
LOGD("ret : 0x%x", ret);
@@ -4975,7 +4950,6 @@ int camera_attr_get_exposure_mode(camera_h camera, camera_attr_exposure_mode_e *
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE_MODE;
- int get_mode = 0;
if (!pc || !pc->cb_info || !mode) {
LOGE("NULL pointer %p %p", pc, mode);
@@ -4986,10 +4960,8 @@ int camera_attr_get_exposure_mode(camera_h camera, camera_attr_exposure_mode_e *
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_mode, pc->cb_info->recv_msg);
- *mode = (camera_attr_exposure_mode_e)get_mode;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *mode = (camera_attr_exposure_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_EXPOSURE_MODE];
LOGD("ret : 0x%x", ret);
@@ -5002,7 +4974,6 @@ int camera_attr_get_exposure(camera_h camera, int *value)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EXPOSURE;
- int get_value = 0;
if (!pc || !pc->cb_info || !value) {
LOGE("NULL pointer %p %p", pc, value);
@@ -5013,10 +4984,8 @@ int camera_attr_get_exposure(camera_h camera, int *value)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_value, pc->cb_info->recv_msg);
- *value = get_value;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *value = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_EXPOSURE];
LOGD("ret : 0x%x", ret);
@@ -5029,8 +4998,6 @@ 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;
- int get_min = 0;
- int get_max = 0;
if (!pc || !pc->cb_info || !min || !max) {
LOGE("NULL pointer %p %p %p", pc, min, max);
@@ -5042,10 +5009,8 @@ int camera_attr_get_exposure_range(camera_h camera, int *min, int *max)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_min, pc->cb_info->recv_msg);
- muse_camera_msg_get(get_max, pc->cb_info->recv_msg);
- *min = get_min;
- *max = get_max;
+ *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];
}
LOGD("ret : 0x%x", ret);
@@ -5059,7 +5024,6 @@ int camera_attr_get_iso(camera_h camera, camera_attr_iso_e *iso)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_ISO;
- int get_iso = 0;
if (!pc || !pc->cb_info || !iso) {
LOGE("NULL pointer %p %p", pc, iso);
@@ -5070,10 +5034,8 @@ int camera_attr_get_iso(camera_h camera, camera_attr_iso_e *iso)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_iso, pc->cb_info->recv_msg);
- *iso = (camera_attr_iso_e)get_iso;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *iso = (camera_attr_iso_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ISO];
LOGD("ret : 0x%x", ret);
@@ -5086,7 +5048,6 @@ 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;
- int get_level = 0;
if (!pc || !pc->cb_info || !level) {
LOGE("NULL pointer %p %p", pc, level);
@@ -5097,10 +5058,8 @@ int camera_attr_get_brightness(camera_h camera, int *level)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_level, pc->cb_info->recv_msg);
- *level = get_level;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *level = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_BRIGHTNESS];
LOGD("ret : 0x%x", ret);
@@ -5113,8 +5072,6 @@ 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;
- int get_min = 0;
- int get_max = 0;
if (!pc || !pc->cb_info || !min || !max) {
LOGE("NULL pointer %p %p %p", pc, min, max);
@@ -5126,10 +5083,8 @@ int camera_attr_get_brightness_range(camera_h camera, int *min, int *max)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_min, pc->cb_info->recv_msg);
- muse_camera_msg_get(get_max, pc->cb_info->recv_msg);
- *min = get_min;
- *max = get_max;
+ *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];
}
LOGD("ret : 0x%x", ret);
@@ -5143,7 +5098,6 @@ 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;
- int get_level = 0;
if (!pc || !pc->cb_info || !level) {
LOGE("NULL pointer %p %p", pc, level);
@@ -5154,10 +5108,8 @@ int camera_attr_get_contrast(camera_h camera, int *level)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_level, pc->cb_info->recv_msg);
- *level = get_level;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *level = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_CONTRAST];
LOGD("ret : 0x%x", ret);
@@ -5170,8 +5122,6 @@ 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;
- int get_min = 0;
- int get_max = 0;
if (!pc || !pc->cb_info || !min || !max) {
LOGE("NULL pointer %p %p %p", pc, min, max);
@@ -5183,10 +5133,9 @@ int camera_attr_get_contrast_range(camera_h camera, int *min, int *max)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_min, pc->cb_info->recv_msg);
- muse_camera_msg_get(get_max, pc->cb_info->recv_msg);
- *min = get_min;
- *max = get_max;
+ *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];
+ LOGD("min %d, max %d", *min, *max);
}
LOGD("ret : 0x%x", ret);
@@ -5200,7 +5149,6 @@ int camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *wb
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_WHITEBALANCE;
- int get_wb = 0;
if (!pc || !pc->cb_info || !wb) {
LOGE("NULL pointer %p %p", pc, wb);
@@ -5211,10 +5159,8 @@ int camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *wb
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_wb, pc->cb_info->recv_msg);
- *wb = (camera_attr_whitebalance_e)get_wb;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *wb = (camera_attr_whitebalance_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_WHITE_BALANCE];
LOGD("ret : 0x%x", ret);
@@ -5227,7 +5173,6 @@ int camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_EFFECT;
- int get_effect = 0;
if (!pc || !pc->cb_info || !effect) {
LOGE("NULL pointer %p %p", pc, effect);
@@ -5238,10 +5183,8 @@ int camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_effect, pc->cb_info->recv_msg);
- *effect = (camera_attr_effect_mode_e)get_effect;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *effect = (camera_attr_effect_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_EFFECT];
LOGD("ret : 0x%x", ret);
@@ -5254,7 +5197,6 @@ int camera_attr_get_scene_mode(camera_h camera, camera_attr_scene_mode_e *mode)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_SCENE_MODE;
- int get_mode = 0;
if (!pc || !pc->cb_info || !mode) {
LOGE("NULL pointer %p %p", pc, mode);
@@ -5265,10 +5207,8 @@ int camera_attr_get_scene_mode(camera_h camera, camera_attr_scene_mode_e *mode)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_mode, pc->cb_info->recv_msg);
- *mode = (camera_attr_scene_mode_e)get_mode;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *mode = (camera_attr_scene_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_SCENE_MODE];
LOGD("ret : 0x%x", ret);
@@ -5281,7 +5221,6 @@ int camera_attr_is_enabled_tag(camera_h camera, bool *enable)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_TAG;
- int get_enabled = 0;
if (!pc || !pc->cb_info || !enable) {
LOGE("NULL pointer %p %p", pc, enable);
@@ -5292,10 +5231,8 @@ int camera_attr_is_enabled_tag(camera_h camera, bool *enable)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_enabled, pc->cb_info->recv_msg);
- *enable = (bool)get_enabled;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *enable = (bool)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ENABLED_TAG];
LOGD("ret : 0x%x", ret);
@@ -5308,7 +5245,6 @@ int camera_attr_get_tag_image_description(camera_h camera, char **description)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_IMAGE_DESCRIPTION;
- char get_description[MUSE_CAMERA_MSG_MAX_LENGTH] = {0, };
if (!pc || !pc->cb_info || !description) {
LOGE("NULL pointer %p %p", pc, description);
@@ -5319,10 +5255,8 @@ int camera_attr_get_tag_image_description(camera_h camera, char **description)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get_string(get_description, pc->cb_info->recv_msg);
- *description = strdup(get_description);
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *description = strdup(pc->cb_info->get_string[MUSE_CAMERA_GET_STRING_TAG_IMAGE_DESCRIPTION]);
LOGD("ret : 0x%x", ret);
@@ -5335,7 +5269,6 @@ int camera_attr_get_tag_orientation(camera_h camera, camera_attr_tag_orientation
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_ORIENTATION;
- int get_orientation = 0;
if (!pc || !pc->cb_info || !orientation) {
LOGE("NULL pointer %p %p", pc, orientation);
@@ -5346,10 +5279,8 @@ int camera_attr_get_tag_orientation(camera_h camera, camera_attr_tag_orientation
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_orientation, pc->cb_info->recv_msg);
- *orientation = (camera_attr_tag_orientation_e)get_orientation;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *orientation = (camera_attr_tag_orientation_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_TAG_ORIENTATION];
LOGD("ret : 0x%x", ret);
@@ -5362,7 +5293,6 @@ int camera_attr_get_tag_software(camera_h camera, char **software)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TAG_SOFTWARE;
- char get_software[MUSE_CAMERA_MSG_MAX_LENGTH] = {0, };
if (!pc || !pc->cb_info || !software) {
LOGE("NULL pointer %p %p", pc, software);
@@ -5373,10 +5303,8 @@ int camera_attr_get_tag_software(camera_h camera, char **software)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get_string(get_software, pc->cb_info->recv_msg);
- *software = strdup(get_software);
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *software = strdup(pc->cb_info->get_string[MUSE_CAMERA_GET_STRING_TAG_SOFTWARE]);
LOGD("ret : 0x%x", ret);
@@ -5389,7 +5317,6 @@ int camera_attr_get_geotag(camera_h camera, double *latitude, double *longitude,
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_GEOTAG;
- double get_geotag[3] = {0.0, };
if (!pc || !pc->cb_info || !latitude || !longitude || !altitude) {
LOGE("NULL pointer %p %p %p %p", pc, latitude, longitude, altitude);
@@ -5401,10 +5328,9 @@ int camera_attr_get_geotag(camera_h camera, double *latitude, double *longitude,
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get_array(get_geotag, pc->cb_info->recv_msg);
- *latitude = get_geotag[0];
- *longitude = get_geotag[1];
- *altitude = get_geotag[2];
+ *latitude = pc->cb_info->get_geotag[0];
+ *longitude = pc->cb_info->get_geotag[1];
+ *altitude = pc->cb_info->get_geotag[2];
}
LOGD("ret : 0x%x", ret);
@@ -5418,7 +5344,6 @@ int camera_attr_get_flash_mode(camera_h camera, camera_attr_flash_mode_e *mode)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_FLASH_MODE;
- int get_mode = 0;
if (!pc || !pc->cb_info || !mode) {
LOGE("NULL pointer %p %p", pc, mode);
@@ -5429,10 +5354,8 @@ int camera_attr_get_flash_mode(camera_h camera, camera_attr_flash_mode_e *mode)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_mode, pc->cb_info->recv_msg);
- *mode = (camera_attr_flash_mode_e)get_mode;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *mode = (camera_attr_flash_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_FLASH_MODE];
LOGD("ret : 0x%x", ret);
@@ -5763,7 +5686,6 @@ int camera_attr_get_stream_rotation(camera_h camera, camera_rotation_e *rotation
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_ROTATION;
- int get_rotation = 0;
if (!pc || !pc->cb_info || !rotation) {
LOGE("NULL pointer %p %p", pc, rotation);
@@ -5774,10 +5696,8 @@ int camera_attr_get_stream_rotation(camera_h camera, camera_rotation_e *rotation
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_rotation, pc->cb_info->recv_msg);
- *rotation = (camera_rotation_e)get_rotation;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *rotation = (camera_rotation_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_STREAM_ROTATION];
LOGD("ret : 0x%x", ret);
@@ -5815,7 +5735,6 @@ int camera_attr_get_stream_flip(camera_h camera, camera_flip_e *flip)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_STREAM_FLIP;
- int get_flip = 0;
if (!pc || !pc->cb_info || !flip) {
LOGE("NULL pointer %p %p", pc, flip);
@@ -5826,10 +5745,8 @@ int camera_attr_get_stream_flip(camera_h camera, camera_flip_e *flip)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_flip, pc->cb_info->recv_msg);
- *flip = (camera_flip_e)get_flip;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *flip = (camera_flip_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_STREAM_FLIP];
LOGD("ret : 0x%x", ret);
@@ -5866,7 +5783,6 @@ int camera_attr_get_hdr_mode(camera_h camera, camera_attr_hdr_mode_e *mode)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_HDR_MODE;
- int get_mode = 0;
if (!pc || !pc->cb_info || !mode) {
LOGE("NULL pointer %p %p", pc, mode);
@@ -5877,10 +5793,8 @@ int camera_attr_get_hdr_mode(camera_h camera, camera_attr_hdr_mode_e *mode)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_mode, pc->cb_info->recv_msg);
- *mode = (camera_attr_hdr_mode_e)get_mode;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *mode = (camera_attr_hdr_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_HDR_MODE];
LOGD("ret : 0x%x", ret);
@@ -6002,7 +5916,6 @@ int camera_attr_is_enabled_anti_shake(camera_h camera, bool *enabled)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_ANTI_SHAKE;
- int get_enabled = 0;
if (!pc || !pc->cb_info || !enabled) {
LOGE("NULL pointer %p %p", pc, enabled);
@@ -6013,10 +5926,8 @@ int camera_attr_is_enabled_anti_shake(camera_h camera, bool *enabled)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_enabled, pc->cb_info->recv_msg);
- *enabled = (bool)get_enabled;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *enabled = (bool)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ENABLED_ANTI_SHAKE];
LOGD("ret : 0x%x", ret);
@@ -6080,7 +5991,6 @@ int camera_attr_is_enabled_video_stabilization(camera_h camera, bool *enabled)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_VIDEO_STABILIZATION;
- int get_enabled = 0;
if (!pc || !pc->cb_info || !enabled) {
LOGE("NULL pointer %p %p", pc, enabled);
@@ -6091,10 +6001,8 @@ int camera_attr_is_enabled_video_stabilization(camera_h camera, bool *enabled)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_enabled, pc->cb_info->recv_msg);
- *enabled = (bool)get_enabled;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *enabled = (bool)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ENABLED_VIDEO_STABILIZATION];
LOGD("ret : 0x%x", ret);
@@ -6158,7 +6066,6 @@ int camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_IS_ENABLED_AUTO_CONTRAST;
- int get_enabled = 0;
if (!pc || !pc->cb_info || !enabled) {
LOGE("NULL pointer %p %p", pc, enabled);
@@ -6169,10 +6076,8 @@ int camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_enabled, pc->cb_info->recv_msg);
- *enabled = (bool)get_enabled;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *enabled = (bool)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ENABLED_AUTO_CONTRAST];
LOGD("ret : 0x%x", ret);
@@ -6263,7 +6168,6 @@ int camera_attr_get_pan(camera_h camera, int *pan_step)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_PAN;
- int get_pan_step = 0;
if (!pc || !pc->cb_info || !pan_step) {
LOGE("NULL pointer %p %p", pc, pan_step);
@@ -6274,10 +6178,8 @@ int camera_attr_get_pan(camera_h camera, int *pan_step)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_pan_step, pc->cb_info->recv_msg);
- *pan_step = get_pan_step;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *pan_step = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_PAN];
LOGD("ret : 0x%x", ret);
@@ -6290,8 +6192,6 @@ 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;
- int get_min = 0;
- int get_max = 0;
if (!pc || !pc->cb_info || !min || !max) {
LOGE("NULL pointer %p %p", pc, min, max);
@@ -6303,10 +6203,8 @@ int camera_attr_get_pan_range(camera_h camera, int *min, int *max)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_min, pc->cb_info->recv_msg);
- muse_camera_msg_get(get_max, pc->cb_info->recv_msg);
- *min = get_min;
- *max = get_max;
+ *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];
}
LOGD("ret : 0x%x", ret);
@@ -6347,7 +6245,6 @@ int camera_attr_get_tilt(camera_h camera, int *tilt_step)
int ret = CAMERA_ERROR_NONE;
camera_cli_s *pc = (camera_cli_s *)camera;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_GET_TILT;
- int get_tilt_step = 0;
if (!pc || !pc->cb_info || !tilt_step) {
LOGE("NULL pointer %p %p", pc, tilt_step);
@@ -6358,10 +6255,8 @@ int camera_attr_get_tilt(camera_h camera, int *tilt_step)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
- if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_tilt_step, pc->cb_info->recv_msg);
- *tilt_step = get_tilt_step;
- }
+ if (ret == CAMERA_ERROR_NONE)
+ *tilt_step = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_TILT];
LOGD("ret : 0x%x", ret);
@@ -6374,8 +6269,6 @@ 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;
- int get_min = 0;
- int get_max = 0;
if (!pc || !pc->cb_info || !min || !max) {
LOGE("NULL pointer %p %p %p", pc, min, max);
@@ -6387,10 +6280,8 @@ int camera_attr_get_tilt_range(camera_h camera, int *min, int *max)
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get(get_min, pc->cb_info->recv_msg);
- muse_camera_msg_get(get_max, pc->cb_info->recv_msg);
- *min = get_min;
- *max = get_max;
+ *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];
}
LOGD("ret : 0x%x", ret);
@@ -6516,7 +6407,6 @@ int camera_attr_get_display_roi_area(camera_h camera, int *x, int *y, int *width
{
camera_cli_s *pc = (camera_cli_s *)camera;
int ret = CAMERA_ERROR_NONE;
- int get_display_roi_area[4] = {0,};
muse_camera_api_e api = MUSE_CAMERA_API_GET_DISPLAY_ROI_AREA;
if (!pc || !pc->cb_info || !x || !y || !width || !height) {
@@ -6529,11 +6419,10 @@ int camera_attr_get_display_roi_area(camera_h camera, int *x, int *y, int *width
_camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
if (ret == CAMERA_ERROR_NONE) {
- muse_camera_msg_get_array(get_display_roi_area, pc->cb_info->recv_msg);
- *x = get_display_roi_area[0];
- *y = get_display_roi_area[1];
- *width = get_display_roi_area[2];
- *height = get_display_roi_area[3];
+ *x = pc->cb_info->get_display_roi_area[0];
+ *y = pc->cb_info->get_display_roi_area[1];
+ *width = pc->cb_info->get_display_roi_area[2];
+ *height = pc->cb_info->get_display_roi_area[3];
}
LOGD("ret : 0x%x", ret);