diff options
-rw-r--r-- | packaging/capi-media-recorder.spec | 2 | ||||
-rw-r--r-- | src/recorder.c | 21 |
2 files changed, 19 insertions, 4 deletions
diff --git a/packaging/capi-media-recorder.spec b/packaging/capi-media-recorder.spec index 44b17f5..4af4a24 100644 --- a/packaging/capi-media-recorder.spec +++ b/packaging/capi-media-recorder.spec @@ -1,6 +1,6 @@ Name: capi-media-recorder Summary: A Recorder API -Version: 0.3.12 +Version: 0.3.13 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/recorder.c b/src/recorder.c index 1b9df7b..2272ff6 100644 --- a/src/recorder.c +++ b/src/recorder.c @@ -36,6 +36,7 @@ #undef LOG_TAG #endif #define LOG_TAG "TIZEN_N_RECORDER" +#define MODULE_NAME "recorder" /* for device changed callback */ static GMutex g_rec_dev_state_changed_cb_lock; @@ -1494,6 +1495,7 @@ static int _recorder_create_common(recorder_h *recorder, muse_recorder_type_e ty int ret = RECORDER_ERROR_NONE; int destroy_ret = RECORDER_ERROR_NONE; int sock_fd = -1; + int module_index = -1; int send_ret = 0; char *send_msg = NULL; char *root_directory = NULL; @@ -1534,9 +1536,15 @@ static int _recorder_create_common(recorder_h *recorder, muse_recorder_type_e ty goto _ERR_RECORDER_EXIT; } + if (muse_client_get_module_index(MODULE_NAME, &module_index) != MM_ERROR_NONE) { + LOGE("muse client get module index failed"); + ret = RECORDER_ERROR_INVALID_OPERATION; + goto _ERR_RECORDER_EXIT; + } + if (type == MUSE_RECORDER_TYPE_AUDIO) { send_msg = muse_core_msg_new(MUSE_RECORDER_API_CREATE, - MUSE_TYPE_INT, "module", MUSE_RECORDER, + MUSE_TYPE_INT, "module", module_index, MUSE_TYPE_INT, PARAM_RECORDER_TYPE, MUSE_RECORDER_TYPE_AUDIO, MUSE_TYPE_INT, "pid", getpid(), NULL); @@ -1544,7 +1552,7 @@ static int _recorder_create_common(recorder_h *recorder, muse_recorder_type_e ty pc->camera = camera; camera_handle = (intptr_t)((camera_cli_s *)camera)->remote_handle; send_msg = muse_core_msg_new(MUSE_RECORDER_API_CREATE, - MUSE_TYPE_INT, "module", MUSE_RECORDER, + MUSE_TYPE_INT, "module", module_index, MUSE_TYPE_INT, PARAM_RECORDER_TYPE, MUSE_RECORDER_TYPE_VIDEO, MUSE_TYPE_INT, "pid", getpid(), MUSE_TYPE_POINTER, "camera_handle", camera_handle, @@ -3463,6 +3471,7 @@ int recorder_get_device_state(recorder_type_e type, recorder_device_state_e *sta { int ret = RECORDER_ERROR_NONE; int sock_fd = -1; + int module_index = -1; int get_device_state = 0; char *send_msg = NULL; char recv_msg[MUSE_RECORDER_MSG_MAX_LENGTH] = {'\0',}; @@ -3481,8 +3490,14 @@ int recorder_get_device_state(recorder_type_e type, recorder_device_state_e *sta goto _GET_DEVICE_STATE_EXIT; } + if (muse_client_get_module_index(MODULE_NAME, &module_index) != MM_ERROR_NONE) { + LOGE("muse client get module index failed"); + ret = RECORDER_ERROR_INVALID_OPERATION; + goto _GET_DEVICE_STATE_EXIT; + } + send_msg = muse_core_msg_new(MUSE_RECORDER_API_GET_DEVICE_STATE, - MUSE_TYPE_INT, "module", MUSE_RECORDER, + MUSE_TYPE_INT, "module", module_index, MUSE_TYPE_INT, PARAM_RECORDER_TYPE, type, NULL); if (!send_msg) { |