Release version 0.2.5 90/49890/1 accepted/tizen/mobile/20151022.230114 accepted/tizen/tv/20151022.230127 accepted/tizen/wearable/20151022.230139 submit/tizen/20151022.102935
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 21 Oct 2015 07:41:16 +0000 (16:41 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Wed, 21 Oct 2015 07:41:16 +0000 (16:41 +0900)
1. add new API to set root directory

Change-Id: I91a0c6b31e8f12d198830350a4fb6405f22abc03
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
legacy/include/legacy_recorder.h
legacy/src/legacy_recorder.c
muse/include/muse_recorder.h
muse/src/muse_recorder_dispatcher.c
packaging/mmsvc-recorder.spec

index e603008..5b8876d 100644 (file)
@@ -1438,6 +1438,22 @@ int legacy_recorder_attr_set_orientation_tag(recorder_h recorder,  recorder_rota
 int legacy_recorder_attr_get_orientation_tag(recorder_h recorder, recorder_rotation_e *orientation);
 
 /**
+ * @brief Sets the root directory to check available space.
+ * @details This function sets root directory to recorder, and it's used to check available space to write recording file.
+ * @since_tizen 3.0
+ * @param[in]  recorder        The handle to the media recorder
+ * @param[in]  root_directory The root directory of the client process
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #RECORDER_ERROR_NONE Successful
+ * @retval #RECORDER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #RECORDER_ERROR_INVALID_STATE Invalid state
+ * @retval #RECORDER_ERROR_PERMISSION_DENIED The access to the resources can not be granted
+ * @retval #RECORDER_ERROR_NOT_SUPPORTED The feature is not supported
+ * @pre The recorder state must be #RECORDER_STATE_CREATED or #RECORDER_STATE_READY.
+ */
+int legacy_recorder_attr_set_root_directory(recorder_h recorder, const char *root_directory);
+
+/**
  * @}
  */
 
index 2433e06..5df7f41 100644 (file)
@@ -1987,3 +1987,33 @@ int  legacy_recorder_attr_get_orientation_tag(recorder_h recorder, recorder_rota
 
        return __convert_recorder_error_code(__func__, ret);
 }
+
+
+int legacy_recorder_attr_set_root_directory(recorder_h recorder,  const char *root_directory)
+{
+       int ret = MM_ERROR_NONE;
+       recorder_s *handle = (recorder_s *)recorder;
+       MMCamcorderStateType mmstate = MM_CAMCORDER_STATE_NONE;
+
+       if (recorder == NULL) {
+               LOGE("handle is NULL");
+               return RECORDER_ERROR_INVALID_PARAMETER;
+       }
+
+       if (root_directory == NULL) {
+               LOGE("filename is NULL");
+               return RECORDER_ERROR_INVALID_PARAMETER;
+       }
+
+       mm_camcorder_get_state(handle->mm_handle, &mmstate);
+       if (mmstate >= MM_CAMCORDER_STATE_RECORDING) {
+               LOGE("invalid state %d", mmstate);
+               return RECORDER_ERROR_INVALID_STATE;
+       }
+
+       ret = mm_camcorder_set_attributes(handle->mm_handle, NULL,
+                                         MMCAM_ROOT_DIRECTORY, root_directory, strlen(root_directory),
+                                         NULL);
+
+       return __convert_recorder_error_code(__func__, ret);
+}
index 8b57b1e..7cb6e25 100644 (file)
@@ -90,7 +90,8 @@ typedef enum {
        MUSE_RECORDER_API_ATTR_GET_AUDIO_CHANNEL,
        MUSE_RECORDER_API_ATTR_SET_ORIENTATION_TAG,
        MUSE_RECORDER_API_ATTR_GET_ORIENTATION_TAG, //55
-       MUSE_RECORDER_API_MAX //56
+       MUSE_RECORDER_API_ATTR_SET_ROOT_DIRECTORY,
+       MUSE_RECORDER_API_MAX
 } muse_recorder_api_e;
 
 /**
index 106f983..e6efbb5 100644 (file)
@@ -1092,6 +1092,26 @@ int recorder_dispatcher_attr_get_orientation_tag(muse_module_h module)
        return MUSE_RECORDER_ERROR_NONE;
 }
 
+int recorder_dispatcher_attr_set_root_directory(muse_module_h module)
+{
+       int ret = RECORDER_ERROR_NONE;
+       intptr_t handle;
+       char root_directory[MUSE_RECORDER_MSG_MAX_LENGTH] = {0,};
+       muse_recorder_api_e api = MUSE_RECORDER_API_ATTR_SET_ROOT_DIRECTORY;
+
+       handle = muse_core_ipc_get_handle(module);
+
+       muse_recorder_msg_get_string(root_directory, muse_core_client_get_msg(module));
+
+       ret = legacy_recorder_attr_set_root_directory((recorder_h)handle, root_directory);
+
+       LOGD("handle : 0x%x, root_directory : %s", handle, root_directory);
+
+       muse_recorder_msg_return(api, ret, module);
+
+       return MUSE_RECORDER_ERROR_NONE;
+}
+
 int (*dispatcher[MUSE_RECORDER_API_MAX]) (muse_module_h module) = {
        recorder_dispatcher_create, /* MUSE_RECORDER_API_CREATE, */
        recorder_dispatcher_destroy, /* MUSE_RECORDER_API_DESTROY, */
@@ -1149,4 +1169,5 @@ int (*dispatcher[MUSE_RECORDER_API_MAX]) (muse_module_h module) = {
        recorder_dispatcher_attr_get_audio_channel, /* MUSE_RECORDER_API_ATTR_GET_AUDIO_CHANNEL, */
        recorder_dispatcher_attr_set_orientation_tag, /* MUSE_RECORDER_API_ATTR_SET_ORIENTATION_TAG, */
        recorder_dispatcher_attr_get_orientation_tag, /* MUSE_RECORDER_API_ATTR_GET_ORIENTATION_TAG, */
+       recorder_dispatcher_attr_set_root_directory, /* MUSE_RECORDER_API_ATTR_SET_ROOT_DIRECTORY, */
 };
index a871469..20b08ec 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-recorder
 Summary:    A Recorder module for muse server
-Version:    0.2.4
+Version:    0.2.5
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0