From 33c219544a069ec59df3c022f9dda61479fdfc98 Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Wed, 21 Oct 2015 16:41:16 +0900 Subject: [PATCH] Release version 0.2.5 1. add new API to set root directory Change-Id: I91a0c6b31e8f12d198830350a4fb6405f22abc03 Signed-off-by: Jeongmo Yang --- legacy/include/legacy_recorder.h | 16 ++++++++++++++++ legacy/src/legacy_recorder.c | 30 ++++++++++++++++++++++++++++++ muse/include/muse_recorder.h | 3 ++- muse/src/muse_recorder_dispatcher.c | 21 +++++++++++++++++++++ packaging/mmsvc-recorder.spec | 2 +- 5 files changed, 70 insertions(+), 2 deletions(-) diff --git a/legacy/include/legacy_recorder.h b/legacy/include/legacy_recorder.h index e603008..5b8876d 100644 --- a/legacy/include/legacy_recorder.h +++ b/legacy/include/legacy_recorder.h @@ -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); + +/** * @} */ diff --git a/legacy/src/legacy_recorder.c b/legacy/src/legacy_recorder.c index 2433e06..5df7f41 100644 --- a/legacy/src/legacy_recorder.c +++ b/legacy/src/legacy_recorder.c @@ -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); +} diff --git a/muse/include/muse_recorder.h b/muse/include/muse_recorder.h index 8b57b1e..7cb6e25 100644 --- a/muse/include/muse_recorder.h +++ b/muse/include/muse_recorder.h @@ -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; /** diff --git a/muse/src/muse_recorder_dispatcher.c b/muse/src/muse_recorder_dispatcher.c index 106f983..e6efbb5 100644 --- a/muse/src/muse_recorder_dispatcher.c +++ b/muse/src/muse_recorder_dispatcher.c @@ -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, */ }; diff --git a/packaging/mmsvc-recorder.spec b/packaging/mmsvc-recorder.spec index a871469..20b08ec 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.4 +Version: 0.2.5 Release: 0 Group: Multimedia/Libraries License: Apache-2.0 -- 2.7.4