Support user buffer fd 24/200224/7 accepted/tizen/unified/20190415.132549 submit/tizen/20190412.070842
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 20 Feb 2019 08:37:44 +0000 (17:37 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 9 Apr 2019 02:40:42 +0000 (11:40 +0900)
[Version] 0.4.23
[Profile] Common
[Issue Type] Update

Change-Id: Ie5b6f7c0853534741b7649770cd6c1c6a01b0dec
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
include/camera_private.h
packaging/capi-media-camera.spec
src/camera.c

index e3603de..8ec8061 100644 (file)
@@ -140,6 +140,9 @@ typedef struct _camera_cb_info_s {
 
        /* tbm */
        tbm_bufmgr bufmgr;
+       gboolean user_buffer_supported;
+       tbm_bo bos[MUSE_NUM_FD];
+       tbm_fd fds[MUSE_NUM_FD];
 
        /* media packet */
        media_format_h pkt_fmt;
index b8846a9..0d54446 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-camera
 Summary:    A Camera API
-Version:    0.4.22
+Version:    0.4.23
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 1971fe6..eb1124e 100644 (file)
@@ -44,7 +44,7 @@ static GDBusConnection *g_cam_dev_state_changed_cb_conn;
 static guint g_cam_dev_state_changed_cb_subscribe_id;
 static GMutex g_cam_idle_event_lock;
 
-static void _camera_msg_send(int api, camera_cb_info_s *cb_info,
+static void _camera_msg_send(int api, int *fds, camera_cb_info_s *cb_info,
        int *ret, int timeout);
 static void _camera_msg_send_param1(int api, camera_cb_info_s *cb_info,
        int *ret, camera_msg_param *param, int timeout);
@@ -60,6 +60,126 @@ static int _camera_media_packet_create(camera_cb_info_s *cb_info, camera_stream_
 static int _camera_media_packet_data_create(int ret_fd, int *tfd, int num_buffer_fd, tbm_bo bo,
        tbm_bo *buffer_bo, tbm_bo data_bo, camera_media_packet_data **mp_data);
 static void _camera_media_packet_data_release(camera_media_packet_data *mp_data, camera_cb_info_s *cb_info);
+static gboolean _camera_allocate_preview_buffer(camera_h camera);
+static void _camera_release_preview_buffer(camera_h camera);
+
+
+static gboolean _camera_allocate_preview_buffer(camera_h camera)
+{
+       int i = 0;
+       int ret = CAMERA_ERROR_NONE;
+       int format = CAMERA_PIXEL_FORMAT_INVALID;
+       int width = 0;
+       int height = 0;
+       int buffer_size = 0;
+       camera_cli_s *pc = (camera_cli_s *)camera;
+       camera_cb_info_s *cb_info = NULL;
+
+       if (!pc || !pc->cb_info) {
+               LOGE("invalid pointer %p %p", pc, pc ? pc->cb_info : NULL);
+               return FALSE;
+       }
+
+       cb_info = pc->cb_info;
+
+       LOGD("Enter");
+
+       /* get preview info and calculate size */
+       ret = camera_get_preview_format(camera, &format);
+       if (ret != CAMERA_ERROR_NONE) {
+               LOGE("get preview format failed 0x%x", ret);
+               return FALSE;
+       }
+
+       ret = camera_get_preview_resolution(camera, &width, &height);
+       if (ret != CAMERA_ERROR_NONE) {
+               LOGE("get preview resolution failed 0x%x", ret);
+               return FALSE;
+       }
+
+       LOGD("preview %dx%d, format %d", width, height, format);
+
+       switch (format) {
+       case CAMERA_PIXEL_FORMAT_INVZ:
+               buffer_size = width * height;
+               break;
+       case CAMERA_PIXEL_FORMAT_NV12:
+       case CAMERA_PIXEL_FORMAT_I420:
+               buffer_size = (width * height * 3) >> 1;
+               break;
+       case CAMERA_PIXEL_FORMAT_YUYV:
+       case CAMERA_PIXEL_FORMAT_UYVY:
+               buffer_size = width * height * 2;
+               break;
+       default:
+               LOGE("unhandled format %d", format);
+               goto _ALLOCATE_PREVIEW_BUFFER_FAILED;
+       }
+
+       LOGD("buffer size %d, num %d", buffer_size, MUSE_NUM_FD);
+
+       for (i = 0 ; i < MUSE_NUM_FD ; i++) {
+               cb_info->bos[i] = tbm_bo_alloc(cb_info->bufmgr, buffer_size, TBM_BO_DEFAULT);
+               if (!cb_info->bos[i]) {
+                       LOGE("bo alloc failed [%d,i:%d]", buffer_size, i);
+                       goto _ALLOCATE_PREVIEW_BUFFER_FAILED;
+               }
+
+               cb_info->fds[i] = tbm_bo_export_fd(cb_info->bos[i]);
+               if (cb_info->fds[i] < 0) {
+                       LOGE("export fd failed [%d,i:%d] errno %d", buffer_size, i, errno);
+                       goto _ALLOCATE_PREVIEW_BUFFER_FAILED;
+               }
+
+               LOGD("bo %p, fd %d", cb_info->bos[i], cb_info->fds[i]);
+       }
+
+       LOGD("Done");
+
+       return TRUE;
+
+_ALLOCATE_PREVIEW_BUFFER_FAILED:
+       _camera_release_preview_buffer(camera);
+       return FALSE;
+}
+
+
+static void _camera_release_preview_buffer(camera_h camera)
+{
+       int i = 0;
+       camera_cli_s *pc = (camera_cli_s *)camera;
+       camera_cb_info_s *cb_info = NULL;
+
+       if (!pc || !pc->cb_info) {
+               LOGE("invalid pointer %p %p", pc, pc ? pc->cb_info : NULL);
+               return;
+       }
+
+       LOGD("Enter");
+
+       cb_info = pc->cb_info;
+
+       /* close exported fd and bos */
+       for (i = 0 ; i < MUSE_NUM_FD ; i++) {
+               LOGD("unref bo %p, close fd %d", cb_info->bos[i], cb_info->fds[i]);
+
+               if (cb_info->bos[i]) {
+                       tbm_bo_unref(cb_info->bos[i]);
+                       cb_info->bos[i] = NULL;
+               } else {
+                       break;
+               }
+
+               if (cb_info->fds[i] >= 0) {
+                       close(cb_info->fds[i]);
+                       cb_info->fds[i] = -1;
+               }
+       }
+
+       LOGD("Done");
+
+       return;
+}
 
 
 static void __camera_update_api_waiting(camera_cb_info_s *cb_info, int api, int value)
@@ -262,7 +382,7 @@ static void __camera_event_handler_preview(camera_cb_info_s *cb_info, char *recv
 
        /* send message for preview callback return */
        if (!CHECK_PREVIEW_CB(cb_info, PREVIEW_CB_TYPE_EVAS))
-               _camera_msg_send(MUSE_CAMERA_API_PREVIEW_CB_RETURN, cb_info, NULL, 0);
+               _camera_msg_send(MUSE_CAMERA_API_PREVIEW_CB_RETURN, NULL, cb_info, NULL, 0);
 
 _PREVIEW_CB_HANDLER_DONE:
        if (mp_data == NULL) {
@@ -560,7 +680,7 @@ static int _camera_client_wait_for_cb_return(muse_camera_api_e api, camera_cb_in
 }
 
 
-static void _camera_msg_send(int api, camera_cb_info_s *cb_info,
+static void _camera_msg_send(int api, int *fds, camera_cb_info_s *cb_info,
        int *ret, int timeout)
 {
        int send_ret = 0;
@@ -591,7 +711,7 @@ static void _camera_msg_send(int api, camera_cb_info_s *cb_info,
                __camera_update_api_waiting(cb_info, api, 1);
 
                g_mutex_lock(&cb_info->fd_lock);
-               send_ret = muse_core_msg_send(cb_info->fd, msg);
+               send_ret = muse_core_msg_send_fd(cb_info->fd, fds, msg);
                g_mutex_unlock(&cb_info->fd_lock);
        }
 
@@ -2111,6 +2231,10 @@ static camera_cb_info_s *_camera_client_callback_new(gint sockfd)
                goto ErrorExit;
        }
 
+       /* initialize fd */
+       for (i = 0 ; i < MUSE_NUM_FD ; i++)
+               cb_info->fds[i] = -1;
+
        cb_info->is_server_connected = TRUE;
 
        return cb_info;
@@ -2413,6 +2537,8 @@ int camera_create(camera_device_e device, camera_h *camera)
        pc->cb_info->api_waiting[MUSE_CAMERA_API_CREATE] = 0;
 
        if (ret == CAMERA_ERROR_NONE) {
+               int preview_format = CAMERA_PIXEL_FORMAT_INVALID;
+               int user_buffer_supported = 0;
                intptr_t handle = 0;
 
                muse_camera_msg_get_pointer(handle, pc->cb_info->recv_msg);
@@ -2422,28 +2548,23 @@ int camera_create(camera_device_e device, camera_h *camera)
                        goto ErrorExit;
                }
 
+               muse_camera_msg_get(preview_format, pc->cb_info->recv_msg);
+               muse_camera_msg_get(user_buffer_supported, pc->cb_info->recv_msg);
+
                pc->remote_handle = handle;
                pc->cb_info->bufmgr = bufmgr;
+               pc->cb_info->preview_format = preview_format;
+               pc->cb_info->dp_type = CAMERA_DISPLAY_TYPE_NONE;
+               pc->cb_info->user_buffer_supported = (gboolean)user_buffer_supported;
 
-               ret = camera_set_display((camera_h)pc, CAMERA_DISPLAY_TYPE_NONE, NULL);
-               if (ret != CAMERA_ERROR_NONE) {
-                       LOGE("init display failed 0x%x", ret);
-                       goto ErrorExit;
-               }
-
-               LOGD("camera create 0x%td", pc->remote_handle);
+               LOGD("default preview format %d, user buffer %d",
+                       preview_format, user_buffer_supported);
 
                *camera = (camera_h)pc;
 
                /* get display interface handle */
                if (mm_display_interface_init(&pc->cb_info->dp_interface) != MM_ERROR_NONE)
                        LOGW("display interface init failed");
-
-               /* get default preview format */
-               if (camera_get_preview_format(*camera, &pc->cb_info->preview_format) != CAMERA_ERROR_NONE) {
-                       LOGW("get default preview format failed");
-                       pc->cb_info->preview_format = CAMERA_PIXEL_FORMAT_INVALID;
-               }
        } else {
                goto ErrorExit;
        }
@@ -2530,7 +2651,7 @@ int camera_destroy(camera_h camera)
        LOGD("Enter");
 
        if (pc->cb_info->is_server_connected)
-               _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+               _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
        else
                LOGW("server disconnected. release resource without send message.");
 
@@ -2553,6 +2674,7 @@ int camera_start_preview(camera_h camera)
        int ret = CAMERA_ERROR_NONE;
        muse_camera_api_e api = MUSE_CAMERA_API_START_PREVIEW;
        camera_cli_s *pc = (camera_cli_s *)camera;
+       camera_state_e current_state = CAMERA_STATE_NONE;
 
        if (!pc || !pc->cb_info) {
                LOGE("NULL handle");
@@ -2562,6 +2684,12 @@ int camera_start_preview(camera_h camera)
        LOGD("Enter : preview format %d, display type %d",
                pc->cb_info->preview_format, pc->cb_info->dp_type);
 
+       ret = camera_get_state(camera, &current_state);
+       if (ret != CAMERA_ERROR_NONE) {
+               LOGE("failed to get current state 0x%x", ret);
+               return ret;
+       }
+
        if (pc->cb_info->preview_format == CAMERA_PIXEL_FORMAT_INVZ &&
                pc->cb_info->dp_type != CAMERA_DISPLAY_TYPE_NONE) {
                LOGE("CAMERA_DISPLAY_TYPE_NONE[current %d] should be set with INVZ format",
@@ -2569,12 +2697,20 @@ int camera_start_preview(camera_h camera)
                return CAMERA_ERROR_INVALID_OPERATION;
        }
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_NO_TIMEOUT);
+       if (current_state == CAMERA_STATE_CREATED && pc->cb_info->user_buffer_supported) {
+               if (!_camera_allocate_preview_buffer(camera))
+                       return CAMERA_ERROR_INVALID_OPERATION;
+
+               _camera_msg_send(api, pc->cb_info->fds, pc->cb_info, &ret, CAMERA_CB_NO_TIMEOUT);
+       } else {
+               _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_NO_TIMEOUT);
+       }
+
        if (ret == CAMERA_ERROR_NONE && CHECK_PREVIEW_CB(pc->cb_info, PREVIEW_CB_TYPE_EVAS)) {
                ret = _camera_start_evas_rendering(camera);
                if (ret != CAMERA_ERROR_NONE) {
                        LOGE("stop preview because of error");
-                       _camera_msg_send(MUSE_CAMERA_API_STOP_PREVIEW, pc->cb_info, NULL, 0);
+                       _camera_msg_send(MUSE_CAMERA_API_STOP_PREVIEW, NULL, pc->cb_info, NULL, 0);
                }
        }
 
@@ -2613,10 +2749,12 @@ int camera_stop_preview(camera_h camera)
        }
 
        /* send stop preview message */
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
-       if (ret != CAMERA_ERROR_NONE &&
-               current_state == CAMERA_STATE_PREVIEW) {
+       if (ret == CAMERA_ERROR_NONE) {
+               if (pc->cb_info->user_buffer_supported)
+                       _camera_release_preview_buffer(camera);
+       } else if (current_state == CAMERA_STATE_PREVIEW) {
                LOGW("restart evas rendering");
                _camera_start_evas_rendering(camera);
        }
@@ -2646,7 +2784,7 @@ int camera_start_capture(camera_h camera, camera_capturing_cb capturing_cb, came
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = completed_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_CAPTURE_COMPLETE] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -2667,7 +2805,7 @@ bool camera_is_supported_continuous_capture(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret < 0) {
                LOGE("error is occurred 0x%x", ret);
@@ -2725,7 +2863,7 @@ int camera_stop_continuous_capture(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -2746,7 +2884,7 @@ bool camera_is_supported_face_detection(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret < 0) {
                LOGE("error is occurred 0x%x", ret);
@@ -2772,7 +2910,7 @@ bool camera_is_supported_zero_shutter_lag(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret < 0) {
                LOGE("error is occurred 0x%x", ret);
@@ -2798,7 +2936,7 @@ bool camera_is_supported_media_packet_preview_cb(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret < 0) {
                LOGE("error is occurred 0x%x", ret);
@@ -2823,7 +2961,7 @@ int camera_get_device_count(camera_h camera, int *device_count)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *device_count = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_DEVICE_COUNT];
@@ -2846,7 +2984,7 @@ int camera_start_face_detection(camera_h camera, camera_face_detected_cb callbac
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION]);
@@ -2875,7 +3013,7 @@ int camera_stop_face_detection(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_FACE_DETECTION]);
@@ -2904,7 +3042,7 @@ int camera_get_state(camera_h camera, camera_state_e *state)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *state = (camera_state_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_STATE];
@@ -2951,7 +3089,7 @@ int camera_cancel_focusing(camera_h camera)
 
        LOGD("Enter, remote_handle : %td", pc->remote_handle);
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -3168,7 +3306,7 @@ int camera_set_preview_format(camera_h camera, camera_pixel_format_e format)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       LOGD("Enter - capture_format %d", set_format);
+       LOGD("Enter - format %d", set_format);
 
        CAMERA_MSG_PARAM_SET(param, INT, set_format);
 
@@ -3196,7 +3334,7 @@ int camera_get_preview_resolution(camera_h camera, int *width, int *height)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                *width = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_PREVIEW_RESOLUTION] >> 16;
@@ -3247,7 +3385,7 @@ int camera_get_display_rotation(camera_h camera, camera_rotation_e *rotation)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       _camera_msg_send(MUSE_CAMERA_API_GET_DISPLAY_ROTATION, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(MUSE_CAMERA_API_GET_DISPLAY_ROTATION, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *rotation = (camera_rotation_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_DISPLAY_ROTATION];
@@ -3294,7 +3432,7 @@ int camera_get_display_flip(camera_h camera, camera_flip_e *flip)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       _camera_msg_send(MUSE_CAMERA_API_GET_DISPLAY_FLIP, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(MUSE_CAMERA_API_GET_DISPLAY_FLIP, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *flip = (camera_flip_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_DISPLAY_FLIP];
@@ -3341,7 +3479,7 @@ int camera_is_display_visible(camera_h camera, bool *visible)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       _camera_msg_send(MUSE_CAMERA_API_IS_DISPLAY_VISIBLE, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(MUSE_CAMERA_API_IS_DISPLAY_VISIBLE, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *visible = (bool)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_DISPLAY_VISIBLE];
@@ -3388,7 +3526,7 @@ int camera_get_display_mode(camera_h camera, camera_display_mode_e *mode)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       _camera_msg_send(MUSE_CAMERA_API_GET_DISPLAY_MODE, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(MUSE_CAMERA_API_GET_DISPLAY_MODE, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *mode = (camera_display_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_DISPLAY_MODE];
@@ -3430,7 +3568,7 @@ int camera_get_display_reuse_hint(camera_h camera, bool *hint)
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                *hint = (bool)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_DISPLAY_REUSE_HINT];
@@ -3454,7 +3592,7 @@ int camera_get_capture_resolution(camera_h camera, int *width, int *height)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                *width = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_CAPTURE_RESOLUTION] >> 16;
@@ -3480,7 +3618,7 @@ int camera_get_capture_format(camera_h camera, camera_pixel_format_e *format)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *format = (camera_pixel_format_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_CAPTURE_FORMAT];
@@ -3504,7 +3642,7 @@ int camera_get_preview_format(camera_h camera, camera_pixel_format_e *format)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *format = (camera_pixel_format_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_PREVIEW_FORMAT];
@@ -3528,7 +3666,7 @@ int camera_get_facing_direction(camera_h camera, camera_facing_direction_e *faci
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *facing_direction = (camera_facing_direction_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_FACING_DIRECTION];
@@ -3552,7 +3690,7 @@ int camera_set_preview_cb(camera_h camera, camera_preview_cb callback, void *use
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_PREVIEW]);
@@ -3584,7 +3722,7 @@ int camera_unset_preview_cb(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_PREVIEW]);
@@ -3626,7 +3764,7 @@ int camera_set_media_packet_preview_cb(camera_h camera, camera_media_packet_prev
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW]);
@@ -3656,7 +3794,7 @@ int camera_unset_media_packet_preview_cb(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_MEDIA_PACKET_PREVIEW]);
@@ -3686,7 +3824,7 @@ int camera_set_state_changed_cb(camera_h camera, camera_state_changed_cb callbac
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE]);
@@ -3716,7 +3854,7 @@ int camera_unset_state_changed_cb(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_STATE_CHANGE]);
@@ -3746,7 +3884,7 @@ int camera_set_interrupted_cb(camera_h camera, camera_interrupted_cb callback, v
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED]);
@@ -3776,7 +3914,7 @@ int camera_unset_interrupted_cb(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_INTERRUPTED]);
@@ -3806,7 +3944,7 @@ int camera_set_interrupt_started_cb(camera_h camera, camera_interrupt_started_cb
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_INTERRUPT_STARTED]);
@@ -3836,7 +3974,7 @@ int camera_unset_interrupt_started_cb(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_INTERRUPT_STARTED]);
@@ -3866,7 +4004,7 @@ int camera_set_focus_changed_cb(camera_h camera, camera_focus_changed_cb callbac
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE]);
@@ -3896,7 +4034,7 @@ int camera_unset_focus_changed_cb(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_FOCUS_CHANGE]);
@@ -3926,7 +4064,7 @@ int camera_set_error_cb(camera_h camera, camera_error_cb callback, void *user_da
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_ERROR]);
@@ -3956,7 +4094,7 @@ int camera_unset_error_cb(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_ERROR]);
@@ -3989,7 +4127,7 @@ int camera_foreach_supported_preview_resolution(camera_h camera, camera_supporte
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_RESOLUTION] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -4013,7 +4151,7 @@ int camera_foreach_supported_capture_resolution(camera_h camera, camera_supporte
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_RESOLUTION] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -4037,7 +4175,7 @@ int camera_foreach_supported_capture_format(camera_h camera, camera_supported_ca
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_CAPTURE_FORMAT] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -4061,7 +4199,7 @@ int camera_foreach_supported_preview_format(camera_h camera, camera_supported_pr
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PREVIEW_FORMAT] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -4081,7 +4219,7 @@ int camera_get_recommended_preview_resolution(camera_h camera, int *width, int *
        }
 
        LOGD("Enter");
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                *width = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_RECOMMENDED_PREVIEW_RESOLUTION] >> 16;
@@ -4107,7 +4245,7 @@ int camera_attr_get_lens_orientation(camera_h camera, int *angle)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *angle = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_LENS_ORIENTATION];
@@ -4156,7 +4294,7 @@ int camera_attr_get_theater_mode(camera_h camera, camera_attr_theater_mode_e *mo
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *mode = (camera_attr_theater_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_THEATER_MODE];
@@ -4183,7 +4321,7 @@ int camera_attr_foreach_supported_theater_mode(camera_h camera, camera_attr_supp
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_THEATER_MODE] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("Finish, return :%x", ret);
 
@@ -4253,7 +4391,7 @@ int camera_attr_get_preview_fps(camera_h camera, camera_attr_fps_e *fps)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *fps = (camera_attr_fps_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_PREVIEW_FPS];
@@ -4277,7 +4415,7 @@ int camera_attr_get_image_quality(camera_h camera, int *quality)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *quality = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_IMAGE_QUALITY];
@@ -4301,7 +4439,7 @@ int camera_attr_get_encoded_preview_bitrate(camera_h camera, int *bitrate)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *bitrate = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ENCODED_PREVIEW_BITRATE];
@@ -4350,7 +4488,7 @@ int camera_attr_get_encoded_preview_gop_interval(camera_h camera, int *interval)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *interval = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ENCODED_PREVIEW_GOP_INTERVAL];
@@ -4472,7 +4610,7 @@ int camera_attr_clear_af_area(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -4865,7 +5003,7 @@ int camera_attr_remove_geotag(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -4911,7 +5049,7 @@ int camera_attr_get_zoom(camera_h camera, int *zoom)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *zoom = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ZOOM];
@@ -4935,7 +5073,7 @@ int camera_attr_get_zoom_range(camera_h camera, int *min, int *max)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _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];
@@ -4961,7 +5099,7 @@ int camera_attr_get_af_mode(camera_h camera, camera_attr_af_mode_e *mode)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *mode = (camera_attr_af_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_AF_MODE];
@@ -4985,7 +5123,7 @@ int camera_attr_get_exposure_mode(camera_h camera, camera_attr_exposure_mode_e *
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *mode = (camera_attr_exposure_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_EXPOSURE_MODE];
@@ -5009,7 +5147,7 @@ int camera_attr_get_exposure(camera_h camera, int *value)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *value = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_EXPOSURE];
@@ -5033,7 +5171,7 @@ int camera_attr_get_exposure_range(camera_h camera, int *min, int *max)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _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];
@@ -5059,7 +5197,7 @@ int camera_attr_get_iso(camera_h camera, camera_attr_iso_e *iso)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *iso = (camera_attr_iso_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ISO];
@@ -5083,7 +5221,7 @@ int camera_attr_get_brightness(camera_h camera, int *level)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _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];
@@ -5107,7 +5245,7 @@ int camera_attr_get_brightness_range(camera_h camera, int *min, int *max)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _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];
@@ -5133,7 +5271,7 @@ int camera_attr_get_contrast(camera_h camera, int *level)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _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];
@@ -5157,7 +5295,7 @@ int camera_attr_get_contrast_range(camera_h camera, int *min, int *max)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _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];
@@ -5184,7 +5322,7 @@ int camera_attr_get_hue(camera_h camera, int *level)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _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];
@@ -5208,7 +5346,7 @@ int camera_attr_get_hue_range(camera_h camera, int *min, int *max)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _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];
@@ -5235,7 +5373,7 @@ int camera_attr_get_whitebalance(camera_h camera, camera_attr_whitebalance_e *wb
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *wb = (camera_attr_whitebalance_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_WHITE_BALANCE];
@@ -5259,7 +5397,7 @@ int camera_attr_get_effect(camera_h camera, camera_attr_effect_mode_e *effect)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *effect = (camera_attr_effect_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_EFFECT];
@@ -5283,7 +5421,7 @@ int camera_attr_get_scene_mode(camera_h camera, camera_attr_scene_mode_e *mode)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *mode = (camera_attr_scene_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_SCENE_MODE];
@@ -5307,7 +5445,7 @@ int camera_attr_is_enabled_tag(camera_h camera, bool *enable)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *enable = (bool)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ENABLED_TAG];
@@ -5331,7 +5469,7 @@ int camera_attr_get_tag_image_description(camera_h camera, char **description)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *description = strdup(pc->cb_info->get_string[MUSE_CAMERA_GET_STRING_TAG_IMAGE_DESCRIPTION]);
@@ -5355,7 +5493,7 @@ int camera_attr_get_tag_orientation(camera_h camera, camera_attr_tag_orientation
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *orientation = (camera_attr_tag_orientation_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_TAG_ORIENTATION];
@@ -5379,7 +5517,7 @@ int camera_attr_get_tag_software(camera_h camera, char **software)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *software = strdup(pc->cb_info->get_string[MUSE_CAMERA_GET_STRING_TAG_SOFTWARE]);
@@ -5403,7 +5541,7 @@ int camera_attr_get_geotag(camera_h camera, double *latitude, double *longitude,
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                *latitude = pc->cb_info->get_geotag[0];
@@ -5430,7 +5568,7 @@ int camera_attr_get_flash_mode(camera_h camera, camera_attr_flash_mode_e *mode)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *mode = (camera_attr_flash_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_FLASH_MODE];
@@ -5481,7 +5619,7 @@ int camera_attr_foreach_supported_af_mode(camera_h camera, camera_attr_supported
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_AF_MODE] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -5505,7 +5643,7 @@ int camera_attr_foreach_supported_exposure_mode(camera_h camera, camera_attr_sup
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EXPOSURE_MODE] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -5529,7 +5667,7 @@ int camera_attr_foreach_supported_iso(camera_h camera, camera_attr_supported_iso
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_ISO] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -5553,7 +5691,7 @@ int camera_attr_foreach_supported_whitebalance(camera_h camera, camera_attr_supp
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_WHITEBALANCE] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -5577,7 +5715,7 @@ int camera_attr_foreach_supported_effect(camera_h camera, camera_attr_supported_
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_EFFECT] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -5601,7 +5739,7 @@ int camera_attr_foreach_supported_scene_mode(camera_h camera, camera_attr_suppor
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_SCENE_MODE] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -5625,7 +5763,7 @@ int camera_attr_foreach_supported_flash_mode(camera_h camera, camera_attr_suppor
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FLASH_MODE] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -5649,7 +5787,7 @@ int camera_attr_foreach_supported_fps(camera_h camera, camera_attr_supported_fps
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_FPS] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("Enter, handle :%td", pc->remote_handle);
 
@@ -5702,7 +5840,7 @@ int camera_attr_foreach_supported_stream_flip(camera_h camera, camera_attr_suppo
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_FLIP] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -5726,7 +5864,7 @@ int camera_attr_foreach_supported_stream_rotation(camera_h camera, camera_attr_s
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_STREAM_ROTATION] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -5772,7 +5910,7 @@ int camera_attr_get_stream_rotation(camera_h camera, camera_rotation_e *rotation
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *rotation = (camera_rotation_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_STREAM_ROTATION];
@@ -5821,7 +5959,7 @@ int camera_attr_get_stream_flip(camera_h camera, camera_flip_e *flip)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *flip = (camera_flip_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_STREAM_FLIP];
@@ -5869,7 +6007,7 @@ int camera_attr_get_hdr_mode(camera_h camera, camera_attr_hdr_mode_e *mode)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *mode = (camera_attr_hdr_mode_e)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_HDR_MODE];
@@ -5893,7 +6031,7 @@ bool camera_attr_is_supported_hdr_capture(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret < 0) {
                LOGE("error is occurred 0x%x", ret);
@@ -5929,7 +6067,7 @@ int camera_attr_set_hdr_capture_progress_cb(camera_h camera, camera_attr_hdr_pro
                return CAMERA_ERROR_INVALID_PARAMETER;
        }
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS]);
@@ -5959,7 +6097,7 @@ int camera_attr_unset_hdr_capture_progress_cb(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                g_mutex_lock(&pc->cb_info->user_cb_mutex[MUSE_CAMERA_EVENT_TYPE_HDR_PROGRESS]);
@@ -6014,7 +6152,7 @@ int camera_attr_is_enabled_anti_shake(camera_h camera, bool *enabled)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *enabled = (bool)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ENABLED_ANTI_SHAKE];
@@ -6038,7 +6176,7 @@ bool camera_attr_is_supported_anti_shake(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret < 0) {
                LOGE("error is occurred 0x%x", ret);
@@ -6089,7 +6227,7 @@ int camera_attr_is_enabled_video_stabilization(camera_h camera, bool *enabled)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *enabled = (bool)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ENABLED_VIDEO_STABILIZATION];
@@ -6113,7 +6251,7 @@ bool camera_attr_is_supported_video_stabilization(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret < 0) {
                LOGE("error is occurred 0x%x", ret);
@@ -6164,7 +6302,7 @@ int camera_attr_is_enabled_auto_contrast(camera_h camera, bool *enabled)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *enabled = (bool)pc->cb_info->get_int[MUSE_CAMERA_GET_INT_ENABLED_AUTO_CONTRAST];
@@ -6188,7 +6326,7 @@ bool camera_attr_is_supported_auto_contrast(camera_h camera)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret < 0) {
                LOGE("error is occurred 0x%x", ret);
@@ -6266,7 +6404,7 @@ int camera_attr_get_pan(camera_h camera, int *pan_step)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *pan_step = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_PAN];
@@ -6290,7 +6428,7 @@ int camera_attr_get_pan_range(camera_h camera, int *min, int *max)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _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];
@@ -6343,7 +6481,7 @@ int camera_attr_get_tilt(camera_h camera, int *tilt_step)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE)
                *tilt_step = pc->cb_info->get_int[MUSE_CAMERA_GET_INT_TILT];
@@ -6367,7 +6505,7 @@ int camera_attr_get_tilt_range(camera_h camera, int *min, int *max)
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _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];
@@ -6421,7 +6559,7 @@ int camera_attr_foreach_supported_ptz_type(camera_h camera, camera_attr_supporte
        pc->cb_info->user_cb[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PTZ_TYPE] = foreach_cb;
        pc->cb_info->user_data[MUSE_CAMERA_EVENT_TYPE_FOREACH_SUPPORTED_PTZ_TYPE] = user_data;
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        LOGD("ret : 0x%x", ret);
 
@@ -6503,7 +6641,7 @@ int camera_attr_get_display_roi_area(camera_h camera, int *x, int *y, int *width
 
        LOGD("Enter");
 
-       _camera_msg_send(api, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
+       _camera_msg_send(api, NULL, pc->cb_info, &ret, CAMERA_CB_TIMEOUT);
 
        if (ret == CAMERA_ERROR_NONE) {
                *x = pc->cb_info->get_display_roi_area[0];