$(CYNARA_CLIENT_CFLAGS) \
$(CYNARA_SESSION_CFLAGS) \
$(CYNARA_CREDS_SOCKET_CFLAGS) \
+ $(STORAGE_CFLAGS) \
$(SYSTEM_INFO_CFLAGS)
libmedia_utils_la_LIBADD = $(GLIB_LIBS) \
$(CYNARA_CLIENT_LIBS) \
$(CYNARA_SESSION_LIBS) \
$(CYNARA_CREDS_SOCKET_LIBS) \
+ $(STORAGE_LIBS) \
$(SYSTEM_INFO_LIBS)
bin_PROGRAMS = media-server \
AC_SUBST(SYSTEM_INFO_CFLAGS)
AC_SUBST(SYSTEM_INFO_LIBS)
+#storage
+PKG_CHECK_MODULES(STORAGE, storage)
+AC_SUBST(STORAGE_CFLAGS)
+AC_SUBST(STORAGE_LIBS)
+
dnl use notification --------------------------------------------------------------------------
AC_ARG_ENABLE(notification, AC_HELP_STRING([--enable-notification], [using notification]),
[
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
+#include <storage.h>
#include "media-util-internal.h"
#include "media-util-dbg.h"
char repl_path[MAX_FILEPATH_LEN] = {0, };
#if !defined(_USE_SENIOR_MODE) && !defined(_USE_TV_PATH)
char *tmp_path = NULL;
- const char *old_path = "/opt/usr/media";
#endif
bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
if (!bus) {
memset(repl_path, 0, sizeof(repl_path));
#if !defined(_USE_SENIOR_MODE) && !defined(_USE_TV_PATH)
/* Need uid to change path */
- if (strncmp(path, "/opt/usr/home", strlen("/opt/usr/home")) == 0) {
- tmp_path = strstr(path, MEDIA_CONTENT_PATH);
- snprintf(repl_path, sizeof(repl_path), "%s%s", old_path, tmp_path + strlen(MEDIA_CONTENT_PATH));
- } else {
+ if (strncmp(path, MEDIA_ROOT_PATH_EXTERNAL, strlen(MEDIA_ROOT_PATH_EXTERNAL)) == 0) {
snprintf(repl_path, sizeof(repl_path), "%s", path);
+ } else {
+ if (storage_get_origin_internal_path(path, MAX_FILEPATH_LEN, repl_path) != STORAGE_ERROR_NONE) {
+ MSAPI_DBG("Failed to change internal path");
+ return MS_MEDIA_ERR_INTERNAL;
+ }
}
MSAPI_DBG("New path: [%s]", repl_path);
#include <glib.h>
#include <stdlib.h>
#include <gio/gio.h>
+#include <storage.h>
#include "media-util-internal.h"
#include "media-util-dbg.h"
char repl_path[MAX_FILEPATH_LEN] = {0, };
#if !defined(_USE_SENIOR_MODE) && !defined(_USE_TV_PATH)
char *tmp_path = NULL;
- const char *old_path = "/opt/usr/media";
#endif
bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
memset(repl_path, 0, sizeof(repl_path));
#if !defined(_USE_SENIOR_MODE) && !defined(_USE_TV_PATH)
/* Need uid to change path */
- if (strncmp(path, "/opt/usr/home", strlen("/opt/usr/home")) == 0) {
- tmp_path = strstr(path, MEDIA_CONTENT_PATH);
- snprintf(repl_path, sizeof(repl_path), "%s%s", old_path, tmp_path + strlen(MEDIA_CONTENT_PATH));
- } else {
+ if (strncmp(path, MEDIA_ROOT_PATH_EXTERNAL, strlen(MEDIA_ROOT_PATH_EXTERNAL)) == 0) {
snprintf(repl_path, sizeof(repl_path), "%s", path);
+ } else {
+ if (storage_get_origin_internal_path(path, MAX_FILEPATH_LEN, repl_path) != STORAGE_ERROR_NONE) {
+ MSAPI_DBG("Failed to change internal path");
+ return MS_MEDIA_ERR_INTERNAL;
+ }
}
MSAPI_DBG("New path: [%s]", repl_path);
Name: media-server
Summary: A server for media content management
-Version: 0.3.19
+Version: 0.3.20
Release: 0
Group: Multimedia/Service
License: Apache-2.0
BuildRequires: pkgconfig(cynara-client)
BuildRequires: pkgconfig(cynara-session)
BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(storage)
BuildRequires: gettext-tools
%if 0%{?TIZEN_PRODUCT_TV}