summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungHun Kim <yh8004.kim@samsung.com>2019-01-22 16:23:37 +0900
committerYoungHun Kim <yh8004.kim@samsung.com>2019-01-22 19:18:32 +0900
commit517a03d621473493e33a41281c107752964e9948 (patch)
tree193b5751a96a58a18576cc8d33c959cfb009cfd7
parentdb79f2902b6c0b30e6b4381796e55b4d6ba814c4 (diff)
downloadrecorder-517a03d621473493e33a41281c107752964e9948.tar.gz
recorder-517a03d621473493e33a41281c107752964e9948.tar.bz2
recorder-517a03d621473493e33a41281c107752964e9948.zip
[Version] 0.3.16 [Profile] Common [Issue Type] Update [Dependency module] N/A Change-Id: I06ea92ad2e5371a3ac4bb73d3d4f284fd0299f70
-rw-r--r--packaging/capi-media-recorder.spec2
-rw-r--r--src/recorder.c21
2 files changed, 19 insertions, 4 deletions
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) {