diff options
author | Jeongmo Yang <jm80.yang@samsung.com> | 2017-09-27 14:20:20 +0900 |
---|---|---|
committer | Jeongmo Yang <jm80.yang@samsung.com> | 2017-09-27 18:42:55 +0900 |
commit | 8a5a10591f1e5fe33dc3241d4e547af2fe72f43e (patch) | |
tree | 5162cab35c42df9aad9b495371bae1c4e7d9f4d7 | |
parent | 3aaa3dcd087e79230b6ba1894ab0ac9a9971b3a1 (diff) | |
parent | b6288ba3e3eb999742c2f5f5970644979f25b762 (diff) | |
download | camera-8a5a10591f1e5fe33dc3241d4e547af2fe72f43e.tar.gz camera-8a5a10591f1e5fe33dc3241d4e547af2fe72f43e.tar.bz2 camera-8a5a10591f1e5fe33dc3241d4e547af2fe72f43e.zip |
Merge branch 'tizen' into tizen_line_coverage
Change-Id: I86f3050a497bff08b3ec6998401877b2a7703484
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | packaging/capi-media-camera.spec | 4 | ||||
-rw-r--r-- | src/camera.c | 89 |
3 files changed, 49 insertions, 48 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 75c5ab4..0f903ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,9 +10,9 @@ SET(submodule "camera") # for package file IF(TIZEN_FEATURE_EVAS_RENDERER) -SET(dependents "glib-2.0 gio-2.0 libtbm dlog mm-common capi-base-common capi-media-tool ecore elementary mmsvc-camera tizen-extension-client mm-evas-renderer") +SET(dependents "glib-2.0 gio-2.0 libtbm dlog mm-common capi-base-common capi-media-tool ecore elementary mmsvc-camera tizen-extension-client mm-evas-renderer muse-client") ELSE(TIZEN_FEATURE_EVAS_RENDERER) -SET(dependents "glib-2.0 gio-2.0 libtbm dlog mm-common capi-base-common capi-media-tool ecore elementary mmsvc-camera tizen-extension-client") +SET(dependents "glib-2.0 gio-2.0 libtbm dlog mm-common capi-base-common capi-media-tool ecore elementary mmsvc-camera tizen-extension-client muse-client") ENDIF(TIZEN_FEATURE_EVAS_RENDERER) SET(pc_dependents "capi-base-common capi-media-tool libtbm evas ecore elementary") SET(fw_name "${project_prefix}-${service}-${submodule}") diff --git a/packaging/capi-media-camera.spec b/packaging/capi-media-camera.spec index 8df44b2..2367835 100644 --- a/packaging/capi-media-camera.spec +++ b/packaging/capi-media-camera.spec @@ -1,6 +1,6 @@ Name: capi-media-camera Summary: A Camera API -Version: 0.3.3 +Version: 0.3.6 Release: 0 Group: Multimedia/API License: Apache-2.0 @@ -9,7 +9,7 @@ BuildRequires: cmake BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gio-2.0) -BuildRequires: pkgconfig(mused) +BuildRequires: pkgconfig(muse-client) BuildRequires: pkgconfig(mm-common) BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(mmsvc-camera) diff --git a/src/camera.c b/src/camera.c index e61714c..44d8f78 100644 --- a/src/camera.c +++ b/src/camera.c @@ -23,10 +23,9 @@ #include <camera.h> #include <muse_camera.h> #include <muse_camera_msg.h> -#include <muse_core_ipc.h> -#include <muse_core_module.h> #include <camera_private.h> #include <muse_core.h> +#include <muse_client.h> #include <dlog.h> #include <Elementary.h> #include <tbm_surface_internal.h> @@ -138,6 +137,8 @@ int _camera_get_wl_info(Evas_Object *obj, camera_wl_info_s *wl_info) goto _DONE; } + ecore_wl_window_video_has(window, EINA_TRUE); + surface = (struct wl_surface *)ecore_wl_window_surface_get(window); if (!surface) { LOGE("failed to get wayland surface"); @@ -452,7 +453,7 @@ static void _camera_msg_send(int api, camera_cb_info_s *cb_info, return; } - msg = muse_core_msg_json_factory_new(api, NULL); + msg = muse_core_msg_new(api, NULL); if (!msg) { LOGE("msg failed: api %d", api); @@ -468,7 +469,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_ipc_send_msg(cb_info->fd, msg); + send_ret = muse_core_msg_send(cb_info->fd, msg); g_mutex_unlock(&cb_info->fd_lock); } @@ -483,7 +484,7 @@ static void _camera_msg_send(int api, camera_cb_info_s *cb_info, __camera_update_api_waiting(cb_info, api, -1); - muse_core_msg_json_factory_free(msg); + muse_core_msg_free(msg); return; } @@ -508,12 +509,12 @@ static void _camera_msg_send_param1(int api, camera_cb_info_s *cb_info, switch (param->type) { case MUSE_TYPE_INT: - msg = muse_core_msg_json_factory_new(api, + msg = muse_core_msg_new(api, param->type, param->name, param->value.value_INT, NULL); break; case MUSE_TYPE_STRING: - msg = muse_core_msg_json_factory_new(api, + msg = muse_core_msg_new(api, param->type, param->name, param->value.value_STRING, NULL); break; @@ -537,7 +538,7 @@ static void _camera_msg_send_param1(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_ipc_send_msg(cb_info->fd, msg); + send_ret = muse_core_msg_send(cb_info->fd, msg); g_mutex_unlock(&cb_info->fd_lock); } @@ -553,7 +554,7 @@ static void _camera_msg_send_param1(int api, camera_cb_info_s *cb_info, __camera_update_api_waiting(cb_info, api, -1); - muse_core_msg_json_factory_free(msg); + muse_core_msg_free(msg); return; } @@ -1958,30 +1959,30 @@ static void __camera_process_msg(camera_cb_info_s *cb_info, char *msg) switch (get_type) { case MUSE_CAMERA_GET_TYPE_INT: - muse_core_msg_json_deserialize("get_value", msg, NULL, &cb_info->get_int[get_index], NULL, MUSE_TYPE_INT); + muse_core_msg_deserialize("get_value", msg, NULL, NULL, MUSE_TYPE_INT, &cb_info->get_int[get_index]); break; case MUSE_CAMERA_GET_TYPE_INT_PAIR: - muse_core_msg_json_deserialize("get_value0", msg, NULL, &cb_info->get_int_pair[get_index][0], NULL, MUSE_TYPE_INT); - muse_core_msg_json_deserialize("get_value1", msg, NULL, &cb_info->get_int_pair[get_index][1], NULL, MUSE_TYPE_INT); + muse_core_msg_deserialize("get_value0", msg, NULL, NULL, MUSE_TYPE_INT, &cb_info->get_int_pair[get_index][0]); + muse_core_msg_deserialize("get_value1", msg, NULL, NULL, MUSE_TYPE_INT, &cb_info->get_int_pair[get_index][1]); break; case MUSE_CAMERA_GET_TYPE_ARRAY: if (api == MUSE_CAMERA_API_GET_DISPLAY_ROI_AREA) { - muse_core_msg_json_deserialize("get_value", - msg, NULL, cb_info->get_display_roi_area, NULL, MUSE_TYPE_ARRAY); + muse_core_msg_deserialize("get_value", + msg, NULL, NULL, MUSE_TYPE_ARRAY, cb_info->get_display_roi_area); LOGD("get display roi %d,%d,%dx%d", cb_info->get_display_roi_area[0], cb_info->get_display_roi_area[1], cb_info->get_display_roi_area[2], cb_info->get_display_roi_area[3]); } else { - muse_core_msg_json_deserialize("get_value", - msg, NULL, cb_info->get_geotag, NULL, MUSE_TYPE_ARRAY); + muse_core_msg_deserialize("get_value", + msg, NULL, NULL, MUSE_TYPE_ARRAY, cb_info->get_geotag); LOGD("get geotag %lf, %lf, %lf", cb_info->get_geotag[0], cb_info->get_geotag[1], cb_info->get_geotag[2]); } break; case MUSE_CAMERA_GET_TYPE_STRING: - muse_core_msg_json_deserialize("get_value", msg, NULL, cb_info->get_string[get_index], NULL, MUSE_TYPE_STRING); + muse_core_msg_deserialize("get_value", msg, NULL, NULL, MUSE_TYPE_STRING, cb_info->get_string[get_index]); break; default: LOGW("unknown type %d", get_type); @@ -2040,7 +2041,7 @@ static void *_camera_msg_recv_func(gpointer data) recv_msg = cb_info->recv_msg; while (g_atomic_int_get(&cb_info->msg_recv_running)) { - recv_length = muse_core_ipc_recv_msg(cb_info->fd, recv_msg); + recv_length = muse_core_msg_recv(cb_info->fd, recv_msg); if (recv_length <= 0) { cb_info->is_server_connected = FALSE; LOGE("receive msg failed - server disconnected"); @@ -2118,7 +2119,7 @@ static void *_camera_msg_recv_func(gpointer data) if (!cb_info->is_server_connected) { /* send error msg for server disconnection */ - char *error_msg = muse_core_msg_json_factory_new(MUSE_CAMERA_CB_EVENT, + char *error_msg = muse_core_msg_new(MUSE_CAMERA_CB_EVENT, MUSE_TYPE_INT, "error", CAMERA_ERROR_SERVICE_DISCONNECTED, MUSE_TYPE_INT, "current_state", CAMERA_STATE_NONE, NULL); @@ -2134,7 +2135,7 @@ static void *_camera_msg_recv_func(gpointer data) MUSE_CAMERA_EVENT_CLASS_THREAD_MAIN, error_msg); - muse_core_msg_json_factory_free(error_msg); + muse_core_msg_free(error_msg); error_msg = NULL; LOGE("add error msg for service disconnection done"); @@ -2365,7 +2366,7 @@ static void _camera_client_callback_destroy(camera_cb_info_s *cb_info) } if (cb_info->fd > -1) { - muse_core_connection_close(cb_info->fd); + muse_client_close(cb_info->fd); cb_info->fd = -1; } @@ -2478,13 +2479,13 @@ int _camera_independent_request(int api, int device_type, const char *key, int * return CAMERA_ERROR_INVALID_PARAMETER; } - sock_fd = muse_core_client_new(); + sock_fd = muse_client_new(); if (sock_fd < 0) { - LOGE("muse_core_client_new failed"); + LOGE("muse_client_new failed"); return CAMERA_ERROR_INVALID_OPERATION; } - msg = muse_core_msg_json_factory_new(api, + msg = muse_core_msg_new(api, MUSE_TYPE_INT, "module", MUSE_CAMERA, MUSE_TYPE_INT, PARAM_DEVICE_TYPE, device_type, 0); @@ -2494,9 +2495,9 @@ int _camera_independent_request(int api, int device_type, const char *key, int * goto _REQUEST_EXIT; } - ret = muse_core_ipc_send_msg(sock_fd, msg); + ret = muse_core_msg_send(sock_fd, msg); - muse_core_msg_json_factory_free(msg); + muse_core_msg_free(msg); msg = NULL; if (ret < 0) { @@ -2505,7 +2506,7 @@ int _camera_independent_request(int api, int device_type, const char *key, int * goto _REQUEST_EXIT; } - ret = muse_core_ipc_recv_msg(sock_fd, recv_msg); + ret = muse_core_msg_recv(sock_fd, recv_msg); if (ret <= 0) { LOGE("recv msg failed %d", errno); ret = CAMERA_ERROR_INVALID_OPERATION; @@ -2519,13 +2520,13 @@ int _camera_independent_request(int api, int device_type, const char *key, int * } if (ret == CAMERA_ERROR_NONE) - muse_core_msg_json_deserialize(key, recv_msg, NULL, value, NULL, MUSE_TYPE_ANY); + muse_core_msg_deserialize(key, recv_msg, NULL, NULL, MUSE_TYPE_ANY, value); LOGD("api %d - value %d", api, *value); _REQUEST_EXIT: if (sock_fd > -1) { - muse_core_connection_close(sock_fd); + muse_client_close(sock_fd); sock_fd = -1; } @@ -2552,16 +2553,16 @@ int camera_create(camera_device_e device, camera_h *camera) return CAMERA_ERROR_INVALID_PARAMETER; } - sock_fd = muse_core_client_new(); + sock_fd = muse_client_new(); if (sock_fd < 0) { - LOGE("muse_core_client_new failed - returned fd %d", sock_fd); + LOGE("muse_client_new failed - returned fd %d", sock_fd); ret = CAMERA_ERROR_INVALID_OPERATION; goto ErrorExit; } pid = getpid(); - send_msg = muse_core_msg_json_factory_new(api, + send_msg = muse_core_msg_new(api, MUSE_TYPE_INT, "module", muse_module, MUSE_TYPE_INT, PARAM_DEVICE_TYPE, device_type, MUSE_TYPE_INT, "pid", pid, @@ -2573,9 +2574,9 @@ int camera_create(camera_device_e device, camera_h *camera) goto ErrorExit; } - send_ret = muse_core_ipc_send_msg(sock_fd, send_msg); + send_ret = muse_core_msg_send(sock_fd, send_msg); - muse_core_msg_json_factory_free(send_msg); + muse_core_msg_free(send_msg); send_msg = NULL; if (send_ret < 0) { @@ -2646,7 +2647,7 @@ ErrorExit: } if (sock_fd > -1) { - muse_core_connection_close(sock_fd); + muse_client_close(sock_fd); sock_fd = -1; } @@ -3251,7 +3252,7 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ length = sizeof(camera_wl_info_s) / sizeof(int) + \ (sizeof(camera_wl_info_s) % sizeof(int) ? 1 : 0); - msg = muse_core_msg_json_factory_new(api, + msg = muse_core_msg_new(api, MUSE_TYPE_INT, "type", type, MUSE_TYPE_ARRAY, "wl_info", length, (int *)&pc->wl_info, NULL); @@ -3264,7 +3265,7 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ __camera_update_api_waiting(pc->cb_info, api, 1); g_mutex_lock(&pc->cb_info->fd_lock); - send_ret = muse_core_ipc_send_msg(pc->cb_info->fd, msg); + send_ret = muse_core_msg_send(pc->cb_info->fd, msg); g_mutex_unlock(&pc->cb_info->fd_lock); } @@ -3277,7 +3278,7 @@ int camera_set_display(camera_h camera, camera_display_type_e type, camera_displ __camera_update_api_waiting(pc->cb_info, api, -1); - muse_core_msg_json_factory_free(msg); + muse_core_msg_free(msg); LOGD("wayland parent id : %d, window %d,%d,%dx%d", pc->wl_info.parent_id, pc->wl_info.window_x, pc->wl_info.window_y, @@ -5011,7 +5012,7 @@ int camera_attr_set_geotag(camera_h camera, double latitude, double longitude, d length = sizeof(set_geotag) / sizeof(int) + \ (sizeof(set_geotag) % sizeof(int) ? 1 : 0); - msg = muse_core_msg_json_factory_new(api, + msg = muse_core_msg_new(api, MUSE_TYPE_ARRAY, "set_geotag", length, (int *)set_geotag, NULL); if (!msg) { @@ -5023,7 +5024,7 @@ int camera_attr_set_geotag(camera_h camera, double latitude, double longitude, d __camera_update_api_waiting(pc->cb_info, api, 1); g_mutex_lock(&pc->cb_info->fd_lock); - send_ret = muse_core_ipc_send_msg(pc->cb_info->fd, msg); + send_ret = muse_core_msg_send(pc->cb_info->fd, msg); g_mutex_unlock(&pc->cb_info->fd_lock); } @@ -5036,7 +5037,7 @@ int camera_attr_set_geotag(camera_h camera, double latitude, double longitude, d __camera_update_api_waiting(pc->cb_info, api, -1); - muse_core_msg_json_factory_free(msg); + muse_core_msg_free(msg); LOGD("ret : 0x%x", ret); @@ -6597,7 +6598,7 @@ int camera_attr_set_display_roi_area(camera_h camera, int x, int y, int width, i length = sizeof(set_display_roi_area) / sizeof(int) + \ (sizeof(set_display_roi_area) % sizeof(int) ? 1 : 0); - msg = muse_core_msg_json_factory_new(api, + msg = muse_core_msg_new(api, MUSE_TYPE_ARRAY, "set_display_roi_area", length, (int *)set_display_roi_area, NULL); if (!msg) { @@ -6609,7 +6610,7 @@ int camera_attr_set_display_roi_area(camera_h camera, int x, int y, int width, i __camera_update_api_waiting(pc->cb_info, api, 1); g_mutex_lock(&pc->cb_info->fd_lock); - send_ret = muse_core_ipc_send_msg(pc->cb_info->fd, msg); + send_ret = muse_core_msg_send(pc->cb_info->fd, msg); g_mutex_unlock(&pc->cb_info->fd_lock); } @@ -6622,7 +6623,7 @@ int camera_attr_set_display_roi_area(camera_h camera, int x, int y, int width, i __camera_update_api_waiting(pc->cb_info, api, -1); - muse_core_msg_json_factory_free(msg); + muse_core_msg_free(msg); LOGD("ret : 0x%x", ret); |