summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2017-03-17 17:44:47 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2017-03-23 15:36:03 +0900
commitbeb63d2651043b57ef7fac69afd5f7c9f81fa4ee (patch)
treedd8c495d23b081e72a2cdde68e8f8e8d10700e48
parente0c703153631230fa92ac63da2caa527c7b6a7c1 (diff)
downloadmmsvc-recorder-beb63d2651043b57ef7fac69afd5f7c9f81fa4ee.tar.gz
mmsvc-recorder-beb63d2651043b57ef7fac69afd5f7c9f81fa4ee.tar.bz2
mmsvc-recorder-beb63d2651043b57ef7fac69afd5f7c9f81fa4ee.zip
Add command dispatcher for external storage state changed callback
[Version] 0.2.39 [Profile] Common [Issue Type] Update [Dependency module] N/A [Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-3.0-mobile_20170315.2] Change-Id: I4df3189794e17b2f21c7b8da5d25820aadcc9341 Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
-rw-r--r--legacy/include/legacy_recorder.h12
-rw-r--r--legacy/src/legacy_recorder.c17
-rw-r--r--muse/src/muse_recorder_dispatcher.c27
-rw-r--r--packaging/mmsvc-recorder.spec2
4 files changed, 56 insertions, 2 deletions
diff --git a/legacy/include/legacy_recorder.h b/legacy/include/legacy_recorder.h
index 93d9f8d..efa2b07 100644
--- a/legacy/include/legacy_recorder.h
+++ b/legacy/include/legacy_recorder.h
@@ -1543,6 +1543,18 @@ int legacy_recorder_attr_get_orientation_tag(recorder_h recorder, recorder_rotat
int legacy_recorder_attr_set_root_directory(recorder_h recorder, const char *root_directory);
/**
+ * @brief Manages current recording with storage state.
+ * @details This function manages current recording with storage state.
+ * @since_tizen 3.0
+ * @param[in] recorder The handle to the media recorder
+ * @param[in] storage_state The state of external storage
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RECORDER_ERROR_NONE Successful
+ * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int legacy_recorder_manage_external_storage_state(recorder_h recorder, int storage_state);
+
+/**
* @}
*/
diff --git a/legacy/src/legacy_recorder.c b/legacy/src/legacy_recorder.c
index 74d8f1b..e7c1721 100644
--- a/legacy/src/legacy_recorder.c
+++ b/legacy/src/legacy_recorder.c
@@ -2221,3 +2221,20 @@ int legacy_recorder_set_sound_stream_info(recorder_h recorder, char *stream_type
return __convert_recorder_error_code(__func__, ret);
}
+
+int legacy_recorder_manage_external_storage_state(recorder_h recorder, int storage_state)
+{
+ int ret = MM_ERROR_NONE;
+ recorder_s *handle = (recorder_s *)recorder;
+
+ if (recorder == NULL) {
+ LOGE("handle is NULL");
+ return RECORDER_ERROR_INVALID_PARAMETER;
+ }
+
+ LOGW("storage state %d", storage_state);
+
+ ret = mm_camcorder_manage_external_storage_state(handle->mm_handle, storage_state);
+
+ return __convert_recorder_error_code(__func__, ret);
+}
diff --git a/muse/src/muse_recorder_dispatcher.c b/muse/src/muse_recorder_dispatcher.c
index 2f0edb8..f4d4afb 100644
--- a/muse/src/muse_recorder_dispatcher.c
+++ b/muse/src/muse_recorder_dispatcher.c
@@ -2407,11 +2407,36 @@ static int recorder_cmd_dispatcher_shutdown(muse_module_h module)
return MUSE_RECORDER_ERROR_NONE;
}
+
+static int recorder_cmd_external_storage_state_changed(muse_module_h module)
+{
+ int ret = RECORDER_ERROR_NONE;
+ int storage_state = 0;
+ muse_recorder_handle_s *muse_recorder = NULL;
+
+ muse_recorder = (muse_recorder_handle_s *)muse_core_ipc_get_handle(module);
+ if (muse_recorder == NULL) {
+ LOGE("NULL handle");
+ return MUSE_RECORDER_ERROR_NONE;
+ }
+
+ storage_state = (int)muse_core_client_get_cust_data(module);
+
+ LOGW("storage state %d", storage_state);
+
+ ret = legacy_recorder_manage_external_storage_state(muse_recorder->recorder_handle, storage_state);
+
+ LOGW("done : 0x%x", ret);
+
+ return MUSE_RECORDER_ERROR_NONE;
+}
+
+
int (*cmd_dispatcher[MUSE_MODULE_COMMAND_MAX])(muse_module_h module) = {
recorder_cmd_dispatcher_initialize, /* MUSE_MODULE_COMMAND_INITIALIZE */
recorder_cmd_dispatcher_shutdown, /* MUSE_MODULE_COMMAND_SHUTDOWN */
NULL, /* MUSE_MODULE_COMMAND_DEBUG_INFO_DUMP */
NULL, /* MUSE_MODULE_COMMAND_CREATE_SERVER_ACK */
NULL, /* MUSE_MODULE_COMMAND_RESOURCE_NOT_AVAILABLE */
- NULL /* MUSE_MODULE_COMMAND_EXTERNAL_STORAGE_STATE_CHANGED */
+ recorder_cmd_external_storage_state_changed /* MUSE_MODULE_COMMAND_EXTERNAL_STORAGE_STATE_CHANGED */
};
diff --git a/packaging/mmsvc-recorder.spec b/packaging/mmsvc-recorder.spec
index cabb380..56986e3 100644
--- a/packaging/mmsvc-recorder.spec
+++ b/packaging/mmsvc-recorder.spec
@@ -1,6 +1,6 @@
Name: mmsvc-recorder
Summary: A Recorder module for muse server
-Version: 0.2.38
+Version: 0.2.39
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0