summaryrefslogtreecommitdiff
path: root/src/recorder.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/recorder.c')
-rw-r--r--src/recorder.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/recorder.c b/src/recorder.c
index ca37160..ee89521 100644
--- a/src/recorder.c
+++ b/src/recorder.c
@@ -29,6 +29,7 @@
#include <recorder_private.h>
#include <glib.h>
#include <dlog.h>
+#include <tzplatform_config.h>
#ifdef LOG_TAG
#undef LOG_TAG
@@ -1406,6 +1407,27 @@ _ERR_RECORDER_EXIT:
}
+int _recorder_replace_path(const char *path, char *replace_path)
+{
+ const char *old_path = "/opt/usr/media";
+
+ memset(replace_path, 0, RECORDER_FILENAME_MAX);
+ if (strncmp(path, old_path, strlen(old_path)) == 0) {
+ snprintf(replace_path, RECORDER_FILENAME_MAX, "%s%s", tzplatform_getenv(TZ_USER_CONTENT), path + strlen(old_path));
+ LOGD("replaced path : %s -> %s", path, replace_path);
+ } else {
+ snprintf(replace_path, RECORDER_FILENAME_MAX, "%s", path);
+ }
+
+ if (!(replace_path != NULL && strlen(replace_path) > 0)) {
+ LOGE("replace failed");
+ return RECORDER_ERROR_INVALID_OPERATION;
+ }
+
+ return RECORDER_ERROR_NONE;
+}
+
+
int recorder_create_videorecorder(camera_h camera, recorder_h *recorder)
{
return _recorder_create_common(recorder, MUSE_RECORDER_TYPE_VIDEO, camera);
@@ -1812,6 +1834,7 @@ int recorder_set_filename(recorder_h recorder, const char *filename)
muse_recorder_api_e api = MUSE_RECORDER_API_SET_FILENAME;
recorder_cli_s *pc = (recorder_cli_s *)recorder;
recorder_msg_param param;
+ char set_filename[RECORDER_FILENAME_MAX];
if (!pc || !pc->cb_info) {
LOGE("NULL handle");
@@ -1825,7 +1848,9 @@ int recorder_set_filename(recorder_h recorder, const char *filename)
LOGD("ENTER");
- RECORDER_MSG_PARAM_SET(param, STRING, filename);
+ _recorder_replace_path(filename, set_filename);
+
+ RECORDER_MSG_PARAM_SET(param, STRING, set_filename);
_recorder_msg_send_param1(api, pc->cb_info, &ret, &param);