#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>
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);
__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);
}
__camera_update_api_waiting(cb_info, api, -1);
- muse_core_msg_json_factory_free(msg);
+ muse_core_msg_free(msg);
return;
}
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;
__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);
}
__camera_update_api_waiting(cb_info, api, -1);
- muse_core_msg_json_factory_free(msg);
+ muse_core_msg_free(msg);
return;
}
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);
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");
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);
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");
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);
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) {
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;
}
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);
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,
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) {
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);
__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);
}
__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,
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) {
__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);
}
__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);
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) {
__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);
}
__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);