muse_core_msg_json_deserialize(#param, buf, NULL, ¶m, &e, MUSE_TYPE_ANY)
/**
- * @brief Send the message from proxy to module via ipc.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[out] ret The delivered return value from the module to proxy side.
- */
-#define muse_camera_msg_send(api, fd, cb_info, ret) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = CAMERA_ERROR_INVALID_OPERATION; \
- } else \
- ret = _client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT); \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
- * @brief Send the message from proxy to module via ipc.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- */
-#define muse_camera_msg_send_no_return(api, fd, cb_info) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- } \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
- * @brief Send the message from proxy to module via ipc, waits more period of time for the ack.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[out] ret The delivered return value from the module to proxy side.
- */
-#define muse_camera_msg_send_longtime(api, fd, cb_info, ret) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = CAMERA_ERROR_INVALID_OPERATION; \
- } else \
- ret = _client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT_LONG); \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
- * @brief Send the message from proxy to module via ipc, adding 1 more parameter.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[out] ret The delivered return value from the module to proxy side.
- * @param[in] type The data type of the parameter.
- * @param[in] param A single parameter to be included in the message.
- */
-#define muse_camera_msg_send1(api, fd, cb_info, ret, type, param) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- type __value__ = (type)param; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_##type, #param, __value__, \
- 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = CAMERA_ERROR_INVALID_OPERATION; \
- } else \
- ret = _client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT); \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
- * @brief Send the message from proxy to module via ipc, adding 1 more parameter.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[in] type The data type of the parameter.
- * @param[in] param A single parameter to be included in the message.
- */
-#define muse_camera_msg_send1_no_return(api, fd, cb_info, type, param) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- type __value__ = (type)param; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_##type, #param, __value__, \
- 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- } \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
- * @brief Send the message from proxy to module via ipc, adding 2 more parameters.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[out] ret The delivered return value from the module to proxy side.
- * @param[in] type1 The data type of the parameter.
- * @param[in] param1 The first parameter to be included in the message.
- * @param[in] type2 The data type of the parameter.
- * @param[in] param2 The 2nd parameter to be included in the message.
- */
-#define muse_camera_msg_send2(api, fd, cb_info, ret, type1, param1, type2, param2) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- type1 __value1__ = (type1)param1; \
- type2 __value2__ = (type2)param2; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_##type1, #param1, __value1__, \
- MUSE_TYPE_##type2, #param2, __value2__, \
- 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = CAMERA_ERROR_INVALID_OPERATION; \
- } else \
- ret = _client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT); \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
- * @brief Send the message from proxy to module via ipc, adding 3 more parameters.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[out] ret The delivered return value from the module to proxy side.
- * @param[in] type1 The data type of the parameter.
- * @param[in] param1 The first parameter to be included in the message.
- * @param[in] type2 The data type of the parameter.
- * @param[in] param2 The 2nd parameter to be included in the message.
- * @param[in] type3 The data type of the parameter.
- * @param[in] param3 The 3rd parameter to be included in the message.
- */
-#define muse_camera_msg_send3(api, fd, cb_info, ret, type1, param1, type2, param2, type3, param3) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- type1 __value1__ = (type1)param1; \
- type2 __value2__ = (type2)param2; \
- type3 __value3__ = (type3)param3; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_##type1, #param1, __value1__, \
- MUSE_TYPE_##type2, #param2, __value2__, \
- MUSE_TYPE_##type3, #param3, __value3__, \
- 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = CAMERA_ERROR_INVALID_OPERATION; \
- } else \
- ret = _client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT); \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
- * @brief Send the message from proxy to module via ipc, adding an array data.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[out] ret The delivered return value from the module to proxy side.
- * @param[in] param The array data parameter to be included in the message.
- * @param[in] length The length of the array.
- * @param[in] datum_size The size of the array.
- */
-#define muse_camera_msg_send_array(api, fd, cb_info, ret, param, length, datum_size) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- int *__value__ = (int *)param; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_ARRAY, #param, \
- datum_size == sizeof(int) ? length / sizeof(int) : \
- length / sizeof(int) + (length % sizeof(int) ? 1 : 0), \
- __value__, \
- 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = CAMERA_ERROR_INVALID_OPERATION; \
- } else \
- ret = _client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT); \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
- * @brief Send the message from proxy to module via ipc, adding an array data and value.
- * @param[in] api The enumeration of the corresponding api.
- * @param[in] fd The socket fd that connected to the module via ipc.
- * @param[in] cb_info The callback information, waiting for the ack from the module.
- * @param[out] ret The delivered return value from the module to proxy side.
- * @param[in] param The array data parameter to be included in the message.
- * @param[in] length The length of the array.
- * @param[in] datum_size The size of the array.
- * @param[in] type The data type of the parameter.
- * @param[in] param2 The 2rd parameter to be included in the message.
- */
-#define muse_camera_msg_send_array_and_value(api, fd, cb_info, ret, param, length, datum_size, type, param2) \
- do { \
- char *__sndMsg__; \
- int __len__; \
- int *__value__ = (int *)param; \
- type __value2__ = (type)param2; \
- __sndMsg__ = muse_core_msg_json_factory_new(api, \
- MUSE_TYPE_##type, #param2, __value2__, \
- MUSE_TYPE_ARRAY, #param, \
- datum_size == sizeof(int) ? length / sizeof(int) : \
- length / sizeof(int) + (length % sizeof(int) ? 1 : 0), \
- __value__, \
- 0); \
- __len__ = muse_core_ipc_send_msg(fd, __sndMsg__); \
- if (__len__ <= 0) { \
- LOGE("sending message failed"); \
- ret = CAMERA_ERROR_INVALID_OPERATION; \
- } else \
- ret = _client_wait_for_cb_return(api, cb_info, CALLBACK_TIME_OUT); \
- muse_core_msg_json_factory_free(__sndMsg__); \
- } while (0)
-
-/**
* @brief Returning the ack message from the server to client side.
* @param[in] api The enumeration of the corresponding api.
* @param[in] class The enumeration of the api class.
{
int ret = CAMERA_ERROR_NONE;
muse_camera_handle_s *muse_camera = NULL;
- int is_capturing_cb = 0;
- int is_completed_cb = 0;
- void *capturing_cb = NULL;
- void *completed_cb = NULL;
muse_camera_api_e api = MUSE_CAMERA_API_START_CAPTURE;
muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
muse_camera = (muse_camera_handle_s *)muse_core_ipc_get_handle(module);
- muse_camera_msg_get(is_capturing_cb, muse_core_client_get_msg(module));
- muse_camera_msg_get(is_completed_cb, muse_core_client_get_msg(module));
-
- LOGD("Enter, handle : %p, module : %p, capturing_cb %d, completed_cb %d",
- muse_camera, module, is_capturing_cb, is_completed_cb);
-
- if (is_capturing_cb) {
- capturing_cb = _camera_dispatcher_capturing_cb;
- }
- if (is_completed_cb) {
- completed_cb = _camera_dispatcher_capture_completed_cb;
- }
+ LOGD("Enter, handle : %p, module : %p", muse_camera, module);
ret = legacy_camera_start_capture(muse_camera->camera_handle,
- (camera_capturing_cb)capturing_cb,
- (camera_capture_completed_cb)completed_cb,
+ (camera_capturing_cb)_camera_dispatcher_capturing_cb,
+ (camera_capture_completed_cb)_camera_dispatcher_capture_completed_cb,
(void *)module);
muse_camera_msg_return(api, class, ret, module);
{
int ret = CAMERA_ERROR_NONE;
muse_camera_handle_s *muse_camera = NULL;
- int count;
- int interval;
+ int value = 0;
+ int count = 0;
+ int interval = 0;
muse_camera_api_e api = MUSE_CAMERA_API_START_CONTINUOUS_CAPTURE;
muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
muse_camera = (muse_camera_handle_s *)muse_core_ipc_get_handle(module);
- muse_camera_msg_get(count, muse_core_client_get_msg(module));
- muse_camera_msg_get(interval, muse_core_client_get_msg(module));
+ muse_camera_msg_get(value, muse_core_client_get_msg(module));
+
+ count = value >> 16;
+ interval = 0x0000ffff & value;
- LOGD("Enter, handle : %p, module : %p", muse_camera, module);
+ LOGD("Enter - count %d, interval %d", count, interval);
ret = legacy_camera_start_continuous_capture(muse_camera->camera_handle,
count,
{
int ret = CAMERA_ERROR_NONE;
muse_camera_handle_s *muse_camera = NULL;
- int width;
- int height;
+ int value = 0;
+ int width = 0;
+ int height = 0;
muse_camera_api_e api = MUSE_CAMERA_API_SET_PREVIEW_RESOLUTION;
muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
muse_camera = (muse_camera_handle_s *)muse_core_ipc_get_handle(module);
- muse_camera_msg_get(width, muse_core_client_get_msg(module));
- muse_camera_msg_get(height, muse_core_client_get_msg(module));
+ muse_camera_msg_get(value, muse_core_client_get_msg(module));
+
+ width = value >> 16;
+ height = 0x0000ffff & value;
- LOGD("handle : 0x%x, set_width : %d, set_height : 0x%x", muse_camera, width, height);
+ LOGD("0x%x -> %dx%d", value, width, height);
ret = legacy_camera_set_preview_resolution(muse_camera->camera_handle, width, height);
{
int ret = CAMERA_ERROR_NONE;
muse_camera_handle_s *muse_camera = NULL;
- int width;
- int height;
+ int value = 0;
+ int width = 0;
+ int height = 0;
muse_camera_api_e api = MUSE_CAMERA_API_SET_CAPTURE_RESOLUTION;
muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
muse_camera = (muse_camera_handle_s *)muse_core_ipc_get_handle(module);
- muse_camera_msg_get(width, muse_core_client_get_msg(module));
- muse_camera_msg_get(height, muse_core_client_get_msg(module));
+ muse_camera_msg_get(value, muse_core_client_get_msg(module));
+
+ width = value >> 16;
+ height = 0x0000ffff & value;
LOGD("handle : 0x%x, set_width : %d, set_height : %d", muse_camera, width, height);
{
int ret = CAMERA_ERROR_NONE;
muse_camera_handle_s *muse_camera = NULL;
- int x;
- int y;
+ int value = 0;
+ int x = 0;
+ int y = 0;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_AF_AREA;
muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
muse_camera = (muse_camera_handle_s *)muse_core_ipc_get_handle(module);
- muse_camera_msg_get(x, muse_core_client_get_msg(module));
- muse_camera_msg_get(y, muse_core_client_get_msg(module));
+ muse_camera_msg_get(value, muse_core_client_get_msg(module));
+
+ x = value >> 16;
+ y = 0x0000ffff & value;
- LOGD("handle : %p", muse_camera);
+ LOGD("AF area - %d, %d", x, y);
ret = legacy_camera_attr_set_af_area(muse_camera->camera_handle, x, y);
muse_camera_handle_s *muse_camera = NULL;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_FOREACH_SUPPORTED_FPS_BY_RESOLUTION;
muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_THREAD_SUB;
- int width;
- int height;
+ int value = 0;
+ int width = 0;
+ int height = 0;
muse_camera = (muse_camera_handle_s *)muse_core_ipc_get_handle(module);
- muse_camera_msg_get(width, muse_core_client_get_msg(module));
- muse_camera_msg_get(height, muse_core_client_get_msg(module));
+ muse_camera_msg_get(value, muse_core_client_get_msg(module));
- LOGD("handle : %p", muse_camera);
+ width = value >> 16;
+ height = 0x0000ffff & value;
+
+ LOGD("handle : %p - %dx%d", muse_camera, width, height);
ret = legacy_camera_attr_foreach_supported_fps_by_resolution(muse_camera->camera_handle,
width, height,
{
int ret = CAMERA_ERROR_NONE;
muse_camera_handle_s *muse_camera = NULL;
- int set_move_type = 0;
- int set_pan_step = 0;
+ int value = 0;
+ int type = 0;
+ int step = 0;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_PAN;
muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
muse_camera = (muse_camera_handle_s *)muse_core_ipc_get_handle(module);
- muse_camera_msg_get(set_move_type, muse_core_client_get_msg(module));
- muse_camera_msg_get(set_pan_step, muse_core_client_get_msg(module));
+ muse_camera_msg_get(value, muse_core_client_get_msg(module));
- LOGD("handle : 0x%x", muse_camera);
+ type = value >> 16;
+ step = 0x0000ffff & value;
+
+ LOGD("handle : 0x%x - type %d, step %d", muse_camera, type, step);
- ret = legacy_camera_attr_set_pan(muse_camera->camera_handle, set_move_type, set_pan_step);
+ ret = legacy_camera_attr_set_pan(muse_camera->camera_handle, type, step);
LOGD("ret : 0x%x", ret);
{
int ret = CAMERA_ERROR_NONE;
muse_camera_handle_s *muse_camera = NULL;
- int set_move_type = 0;
- int set_tilt_step = 0;
+ int value = 0;
+ int type = 0;
+ int step = 0;
muse_camera_api_e api = MUSE_CAMERA_API_ATTR_SET_TILT;
muse_camera_api_class_e class = MUSE_CAMERA_API_CLASS_IMMEDIATE;
muse_camera = (muse_camera_handle_s *)muse_core_ipc_get_handle(module);
- muse_camera_msg_get(set_move_type, muse_core_client_get_msg(module));
- muse_camera_msg_get(set_tilt_step, muse_core_client_get_msg(module));
+ muse_camera_msg_get(value, muse_core_client_get_msg(module));
- LOGD("handle : 0x%x", muse_camera);
+ type = value >> 16;
+ step = 0x0000ffff & value;
+
+ LOGD("handle : 0x%x - type %d, step %d", muse_camera, type, step);
- ret = legacy_camera_attr_set_tilt(muse_camera->camera_handle, set_move_type, set_tilt_step);
+ ret = legacy_camera_attr_set_tilt(muse_camera->camera_handle, type, step);
LOGD("ret : 0x%x", ret);