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;
+ strcpy(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;
+ strcpy(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;
+ strcpy(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;
+ strcpy(src_folder_path, tzplatform_mkpath(TZ_USER_CONTENT, "test"));
+ const char *dst_folder_path;
+ strcpy(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/a.jpg image ) : ", tzplatform_mkpath(TZ_USER_CONTENT,""));
scanf("%s %s", path, type);
//check_item_exist ============================================
#endif
//folder test ==================================================
- char *folder_path = "/opt/usr/media/Sounds";
+ char *folder_path;
+ strcpy(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");