[Release version 0.2.45] 1. Remove unused macro, 2. Update code for 2 parameter APIs 34/85134/1 accepted/tizen/common/20160824.154742 accepted/tizen/ivi/20160825.050411 accepted/tizen/mobile/20160825.050226 accepted/tizen/tv/20160825.050323 accepted/tizen/wearable/20160825.050346 submit/tizen/20160824.052737
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 24 Aug 2016 02:10:55 +0000 (11:10 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Wed, 24 Aug 2016 02:10:55 +0000 (11:10 +0900)
Change-Id: Ibce3b4549bdec9ac670b56431a8bd0877bb23cf6
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
muse/include/muse_camera.h
muse/include/muse_camera_msg.h
muse/src/muse_camera_dispatcher.c
packaging/mmsvc-camera.spec

index 32c8205..1150a1e 100644 (file)
@@ -282,11 +282,6 @@ typedef enum {
  */
 #define CALLBACK_TIME_OUT 5
 
-/**
- * @brief Definition for the long wait time of the ipc callback.
- */
-#define CALLBACK_TIME_OUT_LONG 8
-
 
 #ifdef __cplusplus
 }
index d285583..cecd91a 100644 (file)
@@ -149,243 +149,6 @@ typedef const char* STRING;
        muse_core_msg_json_deserialize(#param, buf, NULL, &param, &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.
index 97ae158..1004f26 100644 (file)
@@ -1182,31 +1182,16 @@ int camera_dispatcher_start_capture(muse_module_h module)
 {
        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);
@@ -1238,17 +1223,20 @@ int camera_dispatcher_start_continuous_capture(muse_module_h 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,
@@ -1516,17 +1504,20 @@ int camera_dispatcher_set_preview_resolution(muse_module_h module)
 {
        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);
 
@@ -1539,15 +1530,18 @@ int camera_dispatcher_set_capture_resolution(muse_module_h module)
 {
        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);
 
@@ -2536,17 +2530,20 @@ int camera_dispatcher_attr_set_af_area(muse_module_h module)
 {
        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);
 
@@ -3564,15 +3561,18 @@ int camera_dispatcher_attr_foreach_supported_fps_by_resolution(muse_module_h mod
        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,
@@ -4139,19 +4139,22 @@ int camera_dispatcher_attr_set_pan(muse_module_h module)
 {
        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);
 
@@ -4209,19 +4212,22 @@ int camera_dispatcher_attr_set_tilt(muse_module_h module)
 {
        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);
 
index b838800..bf82de9 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-camera
 Summary:    A Camera module for muse server
-Version:    0.2.45
+Version:    0.2.46
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0