BuildRequires: pkgconfig(media-thumbnail)
BuildRequires: pkgconfig(drm-client)
BuildRequires: pkgconfig(libmedia-utils)
+BuildRequires: pkgconfig(libtzplatform-config)
%description
Media information service library for multimedia applications
#include <time.h>
#include <media-util.h>
+#include <tzplatform_config.h>
#ifdef __cplusplus
extern "C" {
#define MEDIA_SVC_UUID_SIZE 36 /**< Length of UUID*/
#define MEDIA_SVC_TAG_UNKNOWN "Unknown"
-#define MEDIA_SVC_MEDIA_PATH MEDIA_DATA_PATH /**< Media path*/
-#define MEDIA_SVC_THUMB_PATH_PREFIX MEDIA_SVC_MEDIA_PATH"/.thumb" /**< Thumbnail path prefix*/
-#define MEDIA_SVC_THUMB_INTERNAL_PATH MEDIA_SVC_THUMB_PATH_PREFIX"/phone" /**< Phone thumbnail path*/
-#define MEDIA_SVC_THUMB_EXTERNAL_PATH MEDIA_SVC_THUMB_PATH_PREFIX"/mmc" /**< MMC thumbnail path*/
-#define MEDIA_SVC_THUMB_DEFAULT_PATH MEDIA_SVC_THUMB_PATH_PREFIX"/thumb_default.png" /** default thumbnail */
+#define MEDIA_SVC_MEDIA_PATH tzplatform_mkpath(TZ_USER_DATA, "file-manager-service") /**< Media path*/
+#define MEDIA_SVC_THUMB_PATH_PREFIX tzplatform_mkpath(TZ_USER_DATA, "file-manager-service/.thumb") /**< Thumbnail path prefix*/
+#define MEDIA_SVC_THUMB_INTERNAL_PATH tzplatform_mkpath(TZ_USER_DATA, "file-manager-service/.thumb/phone") /**< Phone thumbnail path*/
+#define MEDIA_SVC_THUMB_EXTERNAL_PATH tzplatform_mkpath(TZ_USER_DATA, "file-manager-service/.thumb/mmc") /**< MMC thumbnail path*/
+#define MEDIA_SVC_THUMB_DEFAULT_PATH tzplatform_mkpath(TZ_USER_DATA, "file-manager-service/.thumb/thumb_default.png") /** default thumbnail */
#define MEDIA_SVC_DEFAULT_GPS_VALUE -200 /**< Default GPS Value*/
#define THUMB_EXT "jpg"
SET(fw_test "${fw_name}-test")
INCLUDE(FindPkgConfig)
-pkg_check_modules(${fw_test} REQUIRED glib-2.0 dlog libmedia-utils)
+pkg_check_modules(${fw_test} REQUIRED glib-2.0 dlog libmedia-utils libtzplatform-config)
FOREACH(flag ${${fw_test}_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
media_db_update_subscribe(_noti_cb, (void*)user_str);
/* 1. media_svc_insert_item_immediately */
- char *path = "/opt/usr/media/test/image1.jpg";
+ char *path = tzplatform_mkpath(TZ_USER_CONTENT, "test/image1.jpg");
media_svc_storage_type_e storage_type;
//ret = media_svc_insert_item_begin(g_db_handle, 100);
for (i = 0; i < 16; i++) {
char filepath[255] = {0,};
- snprintf(filepath, sizeof(filepath), "%s%d.jpg", "/opt/usr/media/test/image", i+1);
+ snprintf(filepath, sizeof(filepath), "%s%d.jpg", tzplatform_mkpath(TZ_USER_CONTENT,"test/image"), i+1);
media_svc_debug("File : %s\n", filepath);
file_list[i] = strdup(filepath);
ret = media_svc_insert_item_bulk(g_db_handle, storage_type, file_list[i], FALSE);
media_db_update_subscribe(_noti_cb, (void*)user_str);
/* 1. media_svc_insert_item_immediately */
- char *path = "/opt/usr/media/test/image1.jpg";
+ char *path = tzplatform_mkpath(TZ_USER_CONTENT,"test/image1.jpg");
media_svc_storage_type_e storage_type;
ret = media_svc_get_storage_type(path, &storage_type);
media_svc_debug("media_svc_refresh_item success");
/* 2. media_svc_move_item */
- const char *dst_path = "/opt/usr/media/test/image11.jpg";
+ const char *dst_path = tzplatform_mkpath(TZ_USER_CONTENT, "test/image11.jpg");
ret = media_svc_move_item(g_db_handle, storage_type, path, storage_type, dst_path);
if (ret < MEDIA_INFO_ERROR_NONE) {
media_svc_error("media_svc_move_item failed : %d", ret);
media_svc_debug("media_svc_delete_item_by_path success");
/* Rename folder */
- const char *src_folder_path = "/opt/usr/media/test";
- const char *dst_folder_path = "/opt/usr/media/test_test";
+ const char *src_folder_path = tzplatform_mkpath(TZ_USER_CONTENT, "test");
+ const char *dst_folder_path = tzplatform_mkpath(TZ_USER_CONTENT,"test_test");
ret = media_svc_rename_folder(g_db_handle, src_folder_path, dst_folder_path);
if (ret < MEDIA_INFO_ERROR_NONE) {
media_svc_error("media_svc_rename_folder failed : %d", ret);
#include <dlfcn.h>
#include <media-svc.h>
+#include <tzplatform_config.h>
+
#define PLUGIN_SO_FILE_NAME "/usr/lib/libmedia-content-plugin.so"
+#define MEDIA_ROOT_PATH_SDCARD tzplatform_mkpath(TZ_SYS_STORAGE,"sdcard")
void *funcHandle = NULL;
static void msg_print(int line, char *msg);
}
//check_item ================================================
- ret = svc_check_item("/opt/usr/media/Music/Over the horizon.mp3", "audio/mpeg", &err_msg);
+ ret = svc_check_item(tzplatform_mkpath(TZ_USER_CONTENT,"Music/Over the horizon.mp3"), "audio/mpeg", &err_msg);
if(ret < 0) {
msg_print(__LINE__, "svc_check_item error");
if(err_msg != NULL) {
#if 1
while (1) {
- printf("Enter path and mimetype ( ex. /opt/usr/media/a.jpg image ) : ");
+ printf("Enter path and mimetype ( ex. %s image ) : ", tzplatform_mkpath(TZ_USER_CONTENT, "a.jpg"));
scanf("%s %s", path, type);
//check_item_exist ============================================
#endif
//folder test ==================================================
- char *folder_path = "/opt/usr/media/Sounds";
+ char *folder_path = tzplatform_mkpath(TZ_USER_CONTENT,"Sounds"));
ret = svc_set_folder_item_validity(db_handle, folder_path, 0, 1, &err_msg);
if(ret < 0) {
msg_print(__LINE__, "svc_set_folder_item_validity error");