From: YoungHun Kim Date: Tue, 22 Jan 2019 07:23:37 +0000 (+0900) Subject: Get the module index using muse configure X-Git-Tag: submit/tizen/20190130.080354 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Fsubmit%2Ftizen%2F20190130.080354;p=platform%2Fcore%2Fapi%2Frecorder.git Get the module index using muse configure [Version] 0.3.16 [Profile] Common [Issue Type] Update [Dependency module] N/A Change-Id: I06ea92ad2e5371a3ac4bb73d3d4f284fd0299f70 --- diff --git a/packaging/capi-media-recorder.spec b/packaging/capi-media-recorder.spec index d7fc9eb..e8ca824 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.15 +Version: 0.3.16 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/recorder.c b/src/recorder.c index fef62ed..691f291 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; @@ -1459,6 +1460,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; @@ -1499,9 +1501,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); @@ -1509,7 +1517,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, @@ -3428,6 +3436,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',}; @@ -3446,8 +3455,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) {