#include <dlog.h>
#include <pthread.h>
#include <glib.h>
+#include <tzplatform_config.h>
filter_h g_filter = NULL;
filter_h g_filter_g = NULL; //filter for group like folder, tag, playlist, album, year ...
#define test_audio_id "0f999626-6218-450c-a4ad-181a3bab6ebf"
#define test_video_id "c1a92494-cc5b-4d74-aa7d-253199234548"
#define test_image_id "db1c184c-6f31-43b4-b924-8c00ac5b6197"
+media_folder_h g_folder = NULL;
bool get_audio_meta(audio_meta_h audio)
{
media_content_debug("audio_id : [%s]", c_value);
SAFE_FREE(c_value);
- ret = audio_meta_get_title(audio, &c_value);
- if(ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
- media_content_debug("title : [%s]", c_value);
- SAFE_FREE(c_value);
-
ret = audio_meta_get_album(audio, &c_value);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error when get meta : [%d]", ret);
media_content_debug("artist : [%s]", c_value);
SAFE_FREE(c_value);
+ ret = audio_meta_get_album_artist(audio, &c_value);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("error when get meta : [%d]", ret);
+ media_content_debug("album_artist : [%s]", c_value);
+ SAFE_FREE(c_value);
+
ret = audio_meta_get_genre(audio, &c_value);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error when get meta : [%d]", ret);
media_content_debug("video_id : [%s]", c_value);
SAFE_FREE(c_value);
- ret = video_meta_get_title(video, &c_value);
- if(ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
- media_content_debug("title : [%s]", c_value);
- SAFE_FREE(c_value);
-
ret = video_meta_get_album(video, &c_value);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error when get meta : [%d]", ret);
media_content_debug("artist : [%s]", c_value);
SAFE_FREE(c_value);
+ ret = video_meta_get_album_artist(video, &c_value);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("error when get meta : [%d]", ret);
+ media_content_debug("album_artist : [%s]", c_value);
+ SAFE_FREE(c_value);
+
ret = video_meta_get_genre(video, &c_value);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error when get meta : [%d]", ret);
{
char *c_value = NULL;
char *media_id = NULL;
- int i_value = 0;
- time_t t_value = 0;
- bool b_value = false;
media_content_type_e media_type = 0;
- unsigned long long size = 0;
int ret = MEDIA_CONTENT_ERROR_NONE;
if(media == NULL)
media_content_error("error when get info : [%d]", ret);
media_content_debug("media_id : [%s]", media_id);
-#if 1
+ ret = media_info_get_file_path(media, &c_value);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("error when get info : [%d]", ret);
+ media_content_debug("file_path : [%s]", c_value);
+ SAFE_FREE(c_value);
+
+#if 0
+ int i_value = 0;
+ time_t t_value = 0;
+ bool b_value = false;
+ unsigned long long size = 0;
+
if(media_type == MEDIA_CONTENT_TYPE_MUSIC)
{
audio_meta_h audio;
{
image_meta_h image;
media_content_orientation_e orientation = 0;
+ bool is_burst_shot = false;
+ char *burst_id = NULL;
+ char *weather = NULL;
if(media_info_get_image(media, &image) == MEDIA_CONTENT_ERROR_NONE)
{
else
media_content_debug("[image] orientation : %d", orientation);
+ ret = image_meta_is_burst_shot(image, &is_burst_shot);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("error image_meta_is_burst_shot : [%d]", ret);
+ if(is_burst_shot)
+ {
+ ret = image_meta_get_burst_id(image, &burst_id);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("error image_meta_get_burst_id : [%d]", ret);
+ else
+ media_content_debug("[image] burst_id : [%s]", burst_id);
+
+ SAFE_FREE(burst_id);
+ }
+
ret = image_meta_destroy(image);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error image_meta_destroy : [%d]", ret);
media_content_error("error when get info : [%d]", ret);
media_content_debug("modified_time : [%d]", t_value);
+ ret = media_info_get_timeline(media, &t_value);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("error when get info : [%d]", ret);
+ media_content_debug("timeline : [%d]", t_value);
+
ret = media_info_get_rating(media, &i_value);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error when get info : [%d]", ret);
media_content_error("error when get info : [%d]", ret);
media_content_debug("is_drm : [%d]", b_value);
+ ret = media_info_set_weather(media, "Sunny");
+ if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ media_content_error("Fail to set weather");
+ return ret;
+
+ ret = media_info_get_weather(media, &c_value);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("error when get info : [%d]", ret);
+ media_content_debug("weather : [%s]", c_value);
+ SAFE_FREE(c_value);
+
/* Media server can't update when another db handle holds DB connection by sqlite3_prepare */
//ret = media_info_set_location_tag(media, "Test location tag");
//media_info_update_to_db(media);
SAFE_FREE(media_id);
#endif
+ SAFE_FREE(media_id);
return true;
}
{
int item_count;
char *folder_id = NULL;
- char *folder_path = NULL;
- char *folder_name = NULL;
+ char *str_val = NULL;
+ int int_val = -1;
media_content_storage_e storage_type;
bool ret;
media_folder_h *_folder = (media_folder_h*)user_data;
if(folder != NULL)
{
- media_folder_clone(_folder, folder);
+ if(_folder != NULL)
+ media_folder_clone(_folder, folder);
if(media_folder_get_folder_id(folder, &folder_id) != MEDIA_CONTENT_ERROR_NONE)
{
}
media_content_debug("folder_id = [%s]", folder_id);
- if(media_folder_get_path(folder, &folder_path) != MEDIA_CONTENT_ERROR_NONE)
+ if(media_folder_get_path(folder, &str_val) != MEDIA_CONTENT_ERROR_NONE)
{
SAFE_FREE(folder_id);
media_content_error("[ERROR] media_folder_get_path is failed");
return false;
}
- media_content_debug("folder_path = [%s]", folder_path);
- SAFE_FREE(folder_path);
+ media_content_debug("folder_path = [%s]", str_val);
+ SAFE_FREE(str_val);
- if(media_folder_get_name(folder, &folder_name) != MEDIA_CONTENT_ERROR_NONE)
+ if(media_folder_get_name(folder, &str_val) != MEDIA_CONTENT_ERROR_NONE)
{
SAFE_FREE(folder_id);
- SAFE_FREE(folder_path);
media_content_error("[ERROR] media_folder_get_name is failed");
return false;
}
- media_content_debug("folder_name = [%s]", folder_name);
- SAFE_FREE(folder_name);
+ media_content_debug("folder_name = [%s]", str_val);
+ SAFE_FREE(str_val);
if(media_folder_get_storage_type(folder, &storage_type) != MEDIA_CONTENT_ERROR_NONE)
{
SAFE_FREE(folder_id);
- SAFE_FREE(folder_path);
- SAFE_FREE(folder_name);
media_content_error("[ERROR] media_folder_get_storage_type is failed");
return false;
}
media_content_debug("storage_type = [%d]", storage_type);
+ if(media_folder_get_storage_id(folder, &str_val) != MEDIA_CONTENT_ERROR_NONE)
+ {
+ SAFE_FREE(folder_id);
+ media_content_error("[ERROR] media_folder_get_name is failed");
+ return false;
+ }
+ media_content_debug("storage_id = [%s]", str_val);
+
+ if(media_folder_get_order(folder, &int_val) != MEDIA_CONTENT_ERROR_NONE)
+ {
+ media_content_error("[ERROR] media_folder_get_order is failed");
+ return false;
+ }
+ media_content_debug("folder_order = [%d]", int_val);
+
if(media_folder_get_media_count_from_db(folder_id, g_filter, &item_count) != MEDIA_CONTENT_ERROR_NONE)
{
SAFE_FREE(folder_id);
- SAFE_FREE(folder_path);
- SAFE_FREE(folder_name);
media_content_error("[ERROR] media_folder_get_media_count_from_db is failed");
return false;
}
if(media_folder_foreach_media_from_db(folder_id, g_filter, media_item_cb, NULL) != MEDIA_CONTENT_ERROR_NONE)
{
SAFE_FREE(folder_id);
- SAFE_FREE(folder_path);
- SAFE_FREE(folder_name);
media_content_error("[ERROR] media_folder_foreach_media_from_db is failed");
return false;
}
SAFE_FREE(folder_id);
- SAFE_FREE(folder_path);
- SAFE_FREE(folder_name);
-
ret = true;
}
else
if(media_album_get_artist(album_h, &artist) != MEDIA_CONTENT_ERROR_NONE)
{
media_album_destroy(album_h);
+ /* fix prevent: Resource Leak */
+ SAFE_FREE(album_name);
return false;
}
int playlist_id = 0;
char *playlist_name = NULL;
media_playlist_h playlist_h;
+ char *playlist_thumbnail_path = NULL;
media_content_debug("playlist_list_cb ======");
media_content_debug("playlist_name : %s", playlist_name);
SAFE_FREE(playlist_name);
- media_playlist_get_playlist_from_db(playlist_id, NULL, &playlist_h);
+ media_playlist_get_thumbnail_path(playlist, &playlist_thumbnail_path);
+ media_content_debug("playlist_thumbnail_path : %s", playlist_thumbnail_path);
+ SAFE_FREE(playlist_thumbnail_path);
+
+ media_playlist_get_playlist_from_db(playlist_id, &playlist_h);
media_playlist_destroy(playlist_h);
}
media_content_debug("album_name : [%s]", album_name);
+ SAFE_FREE(album_name);
if(media_album_get_artist(album, &artist) != MEDIA_CONTENT_ERROR_NONE)
{
}
media_content_debug("artist : [%s]", artist);
+ SAFE_FREE(artist);
if(media_album_get_album_art(album, &album_art) != MEDIA_CONTENT_ERROR_NONE)
{
}
media_content_debug("album_art : [%s]", album_art);
-
- SAFE_FREE(album_name);
- SAFE_FREE(artist);
SAFE_FREE(album_art);
if(media_album_get_media_count_from_db(album_id, filter, &media_count) != MEDIA_CONTENT_ERROR_NONE)
int ret = MEDIA_CONTENT_ERROR_NONE;
/* Filter for media */
- char *condition = "MEDIA_TYPE=0"; /*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music, 4-other*/
+ char *condition = "MEDIA_TYPE=3"; /*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music, 4-other*/
//char *condition = "MEDIA_TYPE IS NOT 0 AND MEDIA_DESCRIPTION IS NOT NULL"; /*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music, 4-other*/
ret = media_filter_create(&g_filter);
* Or,
* call media_filter_set_order(g_filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_ARTIST, MEDIA_CONTENT_COLLATE_DEFAULT);
*/
- ret = media_filter_set_order(g_filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_ARTIST, MEDIA_CONTENT_COLLATE_DEFAULT);
+ /* Able to set multi column to set order */
+ //ret = media_filter_set_order(g_filter, MEDIA_CONTENT_ORDER_ASC, "MEDIA_MODIFIED_TIME, MEDIA_DISPLAY_NAME", MEDIA_CONTENT_COLLATE_DEFAULT);
+ //ret = media_filter_set_order(g_filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_ARTIST, MEDIA_CONTENT_COLLATE_DEFAULT);
+ //ret = media_filter_set_order(g_filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_TRACK_NUM_INT, MEDIA_CONTENT_COLLATE_DEFAULT);
+ //ret = media_filter_set_storage(g_filter, "cfbf3d2c-71c5-4611-bccc-7cbac890146e");
/* Filter for group */
- char *g_condition = "TAG_NAME like \"\%my\%\"";
+ //char *g_condition = "TAG_NAME like \"\%my\%\"";
//char *g_condition = "BOOKMARK_MARKED_TIME > 300";
ret = media_filter_create(&g_filter_g);
- ret = media_filter_set_condition(g_filter_g, g_condition, MEDIA_CONTENT_COLLATE_DEFAULT);
+ //ret = media_filter_set_condition(g_filter_g, g_condition, MEDIA_CONTENT_COLLATE_DEFAULT);
ret = media_filter_set_order(g_filter_g, MEDIA_CONTENT_ORDER_DESC, TAG_NAME, MEDIA_CONTENT_COLLATE_DEFAULT);
return ret;
media_content_debug("folder_name [%d] : %s", i, folder_name);
media_content_debug("folder_path [%d] : %s", i, folder_path);
-
ret = media_folder_get_media_count_from_db(folder_id, filter, &count);
/* User should free these string */
SAFE_FREE(folder_id);
int width = 0, height = 0;
media_content_orientation_e orientation = 0;
char *datetaken = NULL;
+ char *burst_id = NULL;
ret = media_info_get_image(media_handle, &image_handle);
if(ret != MEDIA_CONTENT_ERROR_NONE) {
ret = image_meta_get_date_taken(image_handle, &datetaken);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error image_meta_get_date_taken : [%d]", ret);
+ ret = image_meta_get_burst_id(image_handle, &burst_id);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("error image_meta_get_burst_id : [%d]", ret);
media_content_debug("This is Image");
media_content_debug("Width : %d, Height : %d, Orientation : %d, Date taken : %s", width, height, orientation, datetaken);
}
SAFE_FREE(datetaken);
+ SAFE_FREE(burst_id);
ret = image_meta_destroy(image_handle);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error image_meta_destroy : [%d]", ret);
} else if(media_type == MEDIA_CONTENT_TYPE_VIDEO) {
video_meta_h video_handle;
- char *title = NULL, *artist = NULL, *album = NULL;
+ char *title = NULL, *artist = NULL, *album = NULL, *album_artist = NULL;
int duration = 0;
time_t time_played = 0;
if(ret != MEDIA_CONTENT_ERROR_NONE) {
media_content_error("media_info_get_video failed: %d", ret);
} else {
- ret = video_meta_get_title(video_handle, &title);
- if(ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_get_title : [%d]", ret);
ret = video_meta_get_artist(video_handle, &artist);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error video_meta_get_artist : [%d]", ret);
ret = video_meta_get_album(video_handle, &album);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error video_meta_get_album : [%d]", ret);
+ ret = video_meta_get_album_artist(video_handle, &album_artist);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("error video_meta_get_album_artist : [%d]", ret);
ret = video_meta_get_duration(video_handle, &duration);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error video_meta_get_duration : [%d]", ret);
media_content_error("error video_meta_get_played_time : [%d]", ret);
media_content_debug("This is Video");
- media_content_debug("Title: %s, Album: %s, Artist: %s\nDuration: %d, Played time: %d", title, artist, album, duration, time_played);
+ media_content_debug("Title: %s, Album: %s, Artist: %s, Album_artist: %s \n Duration: %d, Played time: %d", title, album, artist, album_artist, duration, time_played);
}
SAFE_FREE(title);
SAFE_FREE(artist);
SAFE_FREE(album);
+ SAFE_FREE(album_artist);
ret = video_meta_destroy(video_handle);
if(ret != MEDIA_CONTENT_ERROR_NONE)
/* To check performance */
gettimeofday(&end, NULL);
long time = (end.tv_sec * 1000000 + end.tv_usec) - (start.tv_sec * 1000000 + start.tv_usec);
- printf("Time : %ld\n", time);
+ media_content_debug("Time : %ld\n", time);
/* Third, Get item list of a folder */
GList *item_list = NULL;
} else if(media_type == MEDIA_CONTENT_TYPE_VIDEO) {
video_meta_h video_handle;
- char *title = NULL, *artist = NULL, *album = NULL;
+ char *title = NULL, *artist = NULL, *album = NULL, *album_artist = NULL;;
int duration = 0;
time_t time_played;
if(ret != MEDIA_CONTENT_ERROR_NONE) {
media_content_error("media_info_get_video failed: %d", ret);
} else {
- ret = video_meta_get_title(video_handle, &title);
- if(ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_get_title : [%d]", ret);
ret = video_meta_get_artist(video_handle, &artist);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error video_meta_get_artist : [%d]", ret);
ret = video_meta_get_album(video_handle, &album);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error video_meta_get_album : [%d]", ret);
+ ret = video_meta_get_album_artist(video_handle, &album_artist);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("error video_meta_get_album_artist : [%d]", ret);
ret = video_meta_get_duration(video_handle, &duration);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error video_meta_get_duration : [%d]", ret);
media_content_error("error video_meta_get_played_time : [%d]", ret);
media_content_debug("This is Video");
- media_content_debug("Title: %s, Album: %s, Artist: %s\nDuration: %d, Played time: %d\n", title, artist, album, duration, time_played);
+ media_content_debug("Title: %s, Album: %s, Artist: %s, Album_artist: %s \n Duration: %d, Played time: %d\n", title, album, artist, album_artist, duration, time_played);
}
SAFE_FREE(title);
SAFE_FREE(artist);
SAFE_FREE(album);
+ SAFE_FREE(album_artist);
ret = video_meta_destroy(video_handle);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_tag_get_tag_id(tag_handle, &tag_id);
media_tag_get_name(tag_handle, &tag_name);
- printf("[%d] %s", tag_id, tag_name);
+ media_content_debug("[%d] %s", tag_id, tag_name);
ret = media_tag_foreach_media_from_db(tag_id, filter, gallery_media_item_cb, &media_list_in_tag);
if(ret != MEDIA_CONTENT_ERROR_NONE) {
media_content_error("Fail to create filter");
return ret;
}
- ret = media_filter_set_condition(filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT);
+ ret = media_filter_set_condition(filter, condition, MEDIA_CONTENT_COLLATE_LOCALIZED);
if(ret != MEDIA_CONTENT_ERROR_NONE) {
media_filter_destroy(filter);
media_content_error("Fail to set condition");
return ret;
}
- ret = media_filter_set_order(filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_TITLE, MEDIA_CONTENT_COLLATE_NOCASE);
+ ret = media_filter_set_order(filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_TITLE, MEDIA_CONTENT_COLLATE_LOCALIZED);
if(ret != MEDIA_CONTENT_ERROR_NONE) {
media_filter_destroy(filter);
media_content_error("Fail to set order");
#if 0
/* Bookmark */
- char *thumbnail_path1 = "/opt/media/Images and videos/My video clips/teat11.jpg";
+ char *thumbnail_path1 = tzplatform_mkpath(TZ_USER_CONTENT, "Images and videos/My video clips/teat11.jpg"));
media_bookmark_insert_to_db(test_video_id, 100, thumbnail_path1);
media_bookmark_insert_to_db(test_video_id, 200, thumbnail_path1);
int test_folder_operation(void)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- filter_h filter;
+ filter_h filter = NULL;
media_folder_h folder = NULL;
char *folder_id = NULL;
- int folder_count = 0;
+ int count = 0;
media_content_debug("\n============Folder Test============\n\n");
media_filter_set_condition(filter, "(MEDIA_TYPE = 0 or MEDIA_TYPE = 1) and MEDIA_STORAGE_TYPE=0", MEDIA_CONTENT_COLLATE_DEFAULT); /*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music, 4-other*/
media_filter_set_offset(filter, 0,5);
media_filter_set_order(filter,MEDIA_CONTENT_ORDER_DESC, MEDIA_PATH, MEDIA_CONTENT_COLLATE_NOCASE);
+ media_filter_set_storage(filter, "cfbf3d2c-71c5-4611-bccc-7cbac890146e");
- ret = media_folder_get_folder_count_from_db(filter, &folder_count);
- media_content_debug("Folder count : %d", folder_count);
+ ret = media_folder_get_folder_count_from_db(filter, &count);
+ media_content_debug("Folder count : [%d]", count);
ret = media_folder_foreach_folder_from_db(filter, folder_list_cb, &folder);
//test.3 get the media list in first folder
filter_h m_filter = NULL;
+
ret = media_filter_create(&m_filter);
if(ret != MEDIA_CONTENT_ERROR_NONE)
{
media_filter_set_offset(m_filter, 0,5);
media_filter_set_order(m_filter,MEDIA_CONTENT_ORDER_DESC, MEDIA_PATH, MEDIA_CONTENT_COLLATE_NOCASE);
- media_folder_get_folder_id(folder, &folder_id);
- media_content_debug("folder_id : %s", folder_id);
-
ret = media_folder_foreach_media_from_db(folder_id, m_filter, media_item_cb, NULL);
-
if(ret != MEDIA_CONTENT_ERROR_NONE)
- {
media_content_error("[ERROR] media_folder_foreach_media_from_db is failed, error code : %d", ret);
- }
media_filter_destroy(filter);
media_filter_destroy(m_filter);
test_filter_destroy();
+ /* fix prevent: Resource Leak */
+ SAFE_FREE(folder_id);
+
+ return ret;
+}
+
+bool folder_update_cb(media_folder_h folder, void *user_data)
+{
+ char *folder_id = NULL;
+ char *folder_path = NULL;
+ char *folder_name = NULL;
+ int folder_order = -1;
+ bool ret = true;
+
+ if(folder != NULL)
+ {
+ ret = media_folder_get_folder_id(folder, &folder_id);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+ media_content_debug("folder_id = [%s]", folder_id);
+ SAFE_FREE(folder_id);
+
+ ret = media_folder_get_path(folder, &folder_path);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+ media_content_debug("folder_path = [%s]", folder_path);
+ SAFE_FREE(folder_path);
+
+ ret = media_folder_get_name(folder, &folder_name);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+ media_content_debug("folder_name = [%s]", folder_name);
+ SAFE_FREE(folder_name);
+
+ ret = media_folder_get_order(folder, &folder_order);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+ media_content_debug("folder_order = [%d]", folder_order);
+
+ ret = media_folder_clone(&g_folder, folder);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+ ret = true;
+ }
+ else
+ {
+ ret = false;
+ }
+
+ return ret;
+}
+
+
+int test_folder_update(void)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ filter_h filter;
+ int folder_count = 0;
+
+ media_content_debug("\n============Folder Update Test============\n\n");
+
+ ret = media_filter_create(&filter);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+ ret = media_filter_set_condition(filter, "MEDIA_TYPE=0 and MEDIA_STORAGE_TYPE=0", MEDIA_CONTENT_COLLATE_DEFAULT); /*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music, 4-other*/
+ ret = media_filter_set_order(filter, MEDIA_CONTENT_ORDER_DESC, FOLDER_ORDER, MEDIA_CONTENT_COLLATE_NOCASE);
+
+ ret = media_folder_get_folder_count_from_db(filter, &folder_count);
+
+ media_content_debug("Folder count : %d", folder_count);
+
+ ret = media_folder_foreach_folder_from_db(filter, folder_update_cb, NULL);
+
+ media_filter_destroy(filter);
+
+ ret = media_folder_set_name(g_folder, "test_folder");
+
+ ret = media_folder_set_order(g_folder, 200);
+
+ ret = media_folder_update_to_db(g_folder);
+
+ ret = media_folder_destroy(g_folder);
+
return ret;
}
media_playlist_h playlist_1 = NULL;
media_playlist_h playlist_2 = NULL;
media_playlist_h playlist_3 = NULL;
+ media_playlist_h playlist_4 = NULL;
int playlist_id_1 = 0;
int playlist_id_2 = 0;
int playlist_id_3 = 0;
media_playlist_add_media(playlist_1, test_audio_id);
media_playlist_add_media(playlist_1, test_audio_id);
media_playlist_add_media(playlist_1, test_video_id);
+
+ #if 0
+ char *playlist_thumb_path = tzplatform_mkpath(TZ_USER_CONTENT, "Images/Default.jpg"));
+ media_playlist_set_thumbnail_path(playlist_1, playlist_thumb_path);
+ #endif
+
media_playlist_update_to_db(playlist_1);
}
}
/* Get Playlist Count*/
- media_playlist_get_playlist_count_from_db(filter, &playlist_count);
- media_content_debug("playlist_count [%d]", playlist_count);
+ ret = media_playlist_get_playlist_count_from_db(filter, &playlist_count);
+ if (ret == 0)
+ media_content_debug("playlist_count [%d]", playlist_count);
/* Get Playlist*/
GList *playlist_id_list = NULL;
media_content_debug("playlist_id_2 [%d]", playlist_id_2);
media_content_debug("playlist_id_3 [%d]", playlist_id_3);
+ /* Export and import playlist */
+ media_playlist_export_to_file(playlist_3, "/opt/usr/media/Music/playlist.m3u");
+ media_playlist_import_from_file( "/opt/usr/media/Music/playlist.m3u", "playlist_4", &playlist_4);
+
/* Filter for media*/
ret = media_filter_create(&m_filter);
media_playlist_destroy(playlist_2);
if(playlist_3 != NULL)
media_playlist_destroy(playlist_3);
+ if(playlist_4 != NULL)
+ media_playlist_destroy(playlist_4);
g_list_free(playlist_id_list);
g_list_free(playlist_member_id_list);
media_content_error("error media_filter_set_order : [%d]", ret);
//insert bookmark to video
- char *thumbnail_path1 = "/opt/usr/media/Images and videos/My video clips/teat11.jpg";
+ char *thumbnail_path1 = tzplatform_mkpath(TZ_USER_CONTENT, "Images and videos/My video clips/teat11.jpg");
ret = media_bookmark_insert_to_db(test_video_id, 400, thumbnail_path1);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error media_bookmark_insert_to_db : [%d]", ret);
ret = test_filter_create();
if(ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("[%d]error(0x%08x)", __LINE__, ret);
+ media_content_error("[error(0x%08x)", ret);
return ret;
}
- for(idx = 0; idx <= MEDIA_CONTENT_GROUP_KEYWORD; idx++)
+ for(idx = 0; idx < MEDIA_CONTENT_GROUP_MAX; idx++)
{
ret = media_group_get_group_count_from_db(g_filter, idx, &group_count);
if(ret != MEDIA_CONTENT_ERROR_NONE) {
}
#endif
}
+
+ /* fix prevent: Resource Leak */
+ SAFE_FREE(media_id);
+ SAFE_FREE(media_path);
}
return MEDIA_CONTENT_ERROR_NONE;
int test_insert(void)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- //char *path = "/opt/media/Images/Default.jpg";
- char *path = "/opt/usr/media/Others/other.txt";
+ char *path = "/opt/usr/media/Images/Default.jpg";
+ //char *path = "/opt/usr/media/Others/other.txt";
//char *path = NULL;
media_info_h media_item = NULL;
media_content_debug("\n============DB Insert Test============\n\n");
{
int ret = MEDIA_CONTENT_ERROR_NONE;
const char *move_media_id = "60aea677-4742-408e-b5f7-f2628062d06d";
- char *dst_path = "/opt/usr/media/Images/XX/Default1.jpg";
+ char *dst_path = tzplatform_mkpath(TZ_USER_CONTENT, "Images/XX/Default1.jpg");
media_info_h move_media = NULL;
ret = media_info_get_media_from_db(move_media_id, &move_media);
media_content_error("media_info_create_thumbnail failed: %d", ret);
}
+ /* fix prevent: Resource leak */
+ SAFE_FREE(media_id);
+
return true;
}
if(g_cnt == g_media_cnt)
g_main_loop_quit(g_loop);
+ /* fix prevent: Resource leak */
+ SAFE_FREE(media_id);
+
return true;
}
{
int ret = MEDIA_CONTENT_ERROR_NONE;
media_info_h media = NULL;
+ char *content_name = NULL;
+ bool favorite = FALSE;
//get the content of Over the horizon
- ret = media_info_get_media_from_db("0f999626-6218-450c-a4ad-181a3bab6ebf", &media);
+ ret = media_info_get_media_from_db("71b19196-5b38-4ab1-ab34-bfe05c369614", &media);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("media_info_get_media_from_db failed: %d", ret);
- test_disconnect_database();
-
ret = media_info_set_content_name(media, "TEST_content_name");
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("media_info_set_content_name failed: %d", ret);
+ ret = media_info_set_favorite(media, TRUE);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("media_info_set_favorite failed: %d", ret);
+
ret = media_info_update_to_db(media);
if(ret == MEDIA_CONTENT_ERROR_NONE)
media_content_debug("media_info_update_to_db is success");
if(media != NULL)
media_info_destroy(media);
+ /*get the updated value*/
+ ret = media_info_get_media_from_db("71b19196-5b38-4ab1-ab34-bfe05c369614", &media);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("media_info_get_media_from_db failed: %d", ret);
+
+ ret = media_info_get_content_name(media, &content_name);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("media_info_get_content_name failed: %d", ret);
+ else
+ media_content_debug("content name [%s]", content_name);
+
+ SAFE_FREE(content_name);
+
+ ret = media_info_get_favorite(media, &favorite);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("media_info_get_favorite failed: %d", ret);
+ else
+ media_content_debug("favorite [%d]", favorite);
+
+ ret = media_info_destroy(media);
+
return ret;
}
}
else
{
- printf("invalid media_type");
+ media_content_debug("invalid media_type");
}
if(mime_type != NULL)
int DFT_test(void)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- printf("\n============DFT_test============\n\n");
+ media_content_debug("\n============DFT_test============\n\n");
filter_h filter = NULL;
int media_cnt = 0;
ret = media_filter_create(&filter);
/*Internal Memory*/
- printf("[Internal Memory]\n");
+ media_content_debug("[Internal Memory]\n");
/*1. Photo ============================================================*/
ret = media_filter_set_condition(filter, "MEDIA_STORAGE_TYPE=0 AND MEDIA_TYPE=0", MEDIA_CONTENT_COLLATE_DEFAULT);
/*Get Photo Count*/
ret = media_info_get_media_count_from_db(filter, &media_cnt);
- printf("Photo count = [%d]\n", media_cnt);
+ media_content_debug("Photo count = [%d]\n", media_cnt);
/*Get Photo Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- printf("Photo size = [%d]\n", g_total_photo_size);
+ media_content_debug("Photo size = [%d]\n", g_total_photo_size);
/*2. Video ============================================================*/
ret = media_filter_set_condition(filter, "MEDIA_STORAGE_TYPE=0 AND MEDIA_TYPE=1", MEDIA_CONTENT_COLLATE_DEFAULT);
/*Get Video Count*/
ret = media_info_get_media_count_from_db(filter, &media_cnt);
- printf("Video count = [%d]\n", media_cnt);
+ media_content_debug("Video count = [%d]\n", media_cnt);
/*Get Video Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- printf("Video size = [%d]\n", g_total_video_size);
+ media_content_debug("Video size = [%d]\n", g_total_video_size);
/*3. MP3 ============================================================*/
ret = media_filter_set_condition(filter, "MEDIA_STORAGE_TYPE=0 AND MEDIA_TYPE=3 AND MEDIA_MIME_TYPE=\"audio/mpeg\"", MEDIA_CONTENT_COLLATE_DEFAULT);
/*Get MP3 Count*/
ret = media_info_get_media_count_from_db(filter, &media_cnt);
- printf("MP3 count = [%d]\n", media_cnt);
+ media_content_debug("MP3 count = [%d]\n", media_cnt);
/*Get MP3 Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- printf("MP3 size = [%d]\n", g_total_mp3_size);
+ media_content_debug("MP3 size = [%d]\n", g_total_mp3_size);
/*4. Voice Memo ============================================================*/
ret = media_filter_set_condition(filter, "MEDIA_STORAGE_TYPE=0 AND (MEDIA_MIME_TYPE=\"audio/AMR\" OR MEDIA_MIME_TYPE=\"audio/mp4\")", MEDIA_CONTENT_COLLATE_DEFAULT);
/*Get Voice Memo Count*/
ret = media_info_get_media_count_from_db(filter, &media_cnt);
- printf("Voice Memo count = [%d]\n", media_cnt);
+ media_content_debug("Voice Memo count = [%d]\n", media_cnt);
/*Get Voice Memo Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- printf("Voice Memo size = [%d]\n", g_total_voice_memo_size);
+ media_content_debug("Voice Memo size = [%d]\n", g_total_voice_memo_size);
g_total_photo_size = 0;
g_total_video_size = 0;
g_total_voice_memo_size = 0;
/*External Memory*/
- printf("\n[External Memory]\n");
+ media_content_debug("\n[External Memory]\n");
/*1. Photo ============================================================*/
ret = media_filter_set_condition(filter, "MEDIA_STORAGE_TYPE=1 AND MEDIA_TYPE=0", MEDIA_CONTENT_COLLATE_DEFAULT);
/*Get Photo Count*/
ret = media_info_get_media_count_from_db(filter, &media_cnt);
- printf("Photo count = [%d]\n", media_cnt);
+ media_content_debug("Photo count = [%d]\n", media_cnt);
/*Get Photo Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- printf("Photo size = [%d]\n", g_total_photo_size);
+ media_content_debug("Photo size = [%d]\n", g_total_photo_size);
/*2. Video ============================================================*/
ret = media_filter_set_condition(filter, "MEDIA_STORAGE_TYPE=1 AND MEDIA_TYPE=1", MEDIA_CONTENT_COLLATE_DEFAULT);
/*Get Video Count*/
ret = media_info_get_media_count_from_db(filter, &media_cnt);
- printf("Video count = [%d]\n", media_cnt);
+ media_content_debug("Video count = [%d]\n", media_cnt);
/*Get Video Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- printf("Video size = [%d]\n", g_total_video_size);
+ media_content_debug("Video size = [%d]\n", g_total_video_size);
/*3. MP3 ============================================================*/
ret = media_filter_set_condition(filter, "MEDIA_STORAGE_TYPE=1 AND MEDIA_TYPE=3 AND MEDIA_MIME_TYPE=\"audio/mpeg\"", MEDIA_CONTENT_COLLATE_DEFAULT);
/*Get MP3 Count*/
ret = media_info_get_media_count_from_db(filter, &media_cnt);
- printf("MP3 count = [%d]\n", media_cnt);
+ media_content_debug("MP3 count = [%d]\n", media_cnt);
/*Get MP3 Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- printf("MP3 size = [%d]\n", g_total_mp3_size);
+ media_content_debug("MP3 size = [%d]\n", g_total_mp3_size);
/*4. Voice Memo ============================================================*/
ret = media_filter_set_condition(filter, "MEDIA_STORAGE_TYPE=1 AND (MEDIA_MIME_TYPE=\"audio/AMR\" OR MEDIA_MIME_TYPE=\"audio/mp4\")", MEDIA_CONTENT_COLLATE_DEFAULT);
/*Get Voice Memo Count*/
ret = media_info_get_media_count_from_db(filter, &media_cnt);
- printf("Voice Memo count = [%d]\n", media_cnt);
+ media_content_debug("Voice Memo count = [%d]\n", media_cnt);
/*Get Voice Memo Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- printf("Voice Memo size = [%d]\n", g_total_voice_memo_size);
+ media_content_debug("Voice Memo size = [%d]\n", g_total_voice_memo_size);
ret = media_filter_destroy(filter);
- return 0;
+ return ret;
}
void insert_batch_cb(media_content_error_e error, void * user_data)
{
- printf("media_info_insert_batch_to_db completed!\n");
+ media_content_debug("media_info_insert_batch_to_db completed!\n");
}
int test_batch_operations()
for (i = 0; i < 10; 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_content_debug("File : %s\n", filepath);
file_list[i] = strdup(filepath);
}
}
filter_h filter;
- char *condition = "MEDIA_PATH LIKE \'/opt/usr/media/test/image%%jpg\'";
-
+ char *condition = "MEDIA_PATH LIKE \'";
+ strncat (condition, tzplatform_mkpath(TZ_USER_CONTENT, "test/image%%jpg\'"), 17);
ret = media_filter_create(&filter);
if(ret != MEDIA_CONTENT_ERROR_NONE) {
media_content_error("Fail to create filter");
return ret;
}
+void insert_burst_shot_cb(media_content_error_e error, void * user_data)
+{
+ media_content_debug("media_info_insert_burst_shot_to_db completed![%d]\n", error);
+ g_main_loop_quit(g_loop);
+}
+
+gboolean test_insert_burst_shot_to_db_start(gpointer data)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ int i = 0;
+ char *file_list[10];
+
+ for (i = 0; i < 10; i++) {
+ char filepath[255] = {0,};
+ snprintf(filepath, sizeof(filepath), "%s%d.jpg", tzplatform_mkpath(TZ_USER_CONTENT, "test/image"), i+1);
+ media_content_debug("File : %s\n", filepath);
+ file_list[i] = strdup(filepath);
+ }
+
+ ret = media_info_insert_burst_shot_to_db((const char **)file_list, 10, insert_burst_shot_cb, NULL);
+ if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ media_content_error("media_info_insert_burst_shot_to_db failed : %d\n", ret);
+ }
+
+ return ret;
+}
+
+int test_insert_burst_shot_to_db(void)
+{
+ GSource *source = NULL;
+ GMainContext *context = NULL;
+
+ g_loop = g_main_loop_new(NULL, FALSE);
+ context = g_main_loop_get_context(g_loop);
+ source = g_idle_source_new();
+ g_source_set_callback (source, test_insert_burst_shot_to_db_start, NULL, NULL);
+ g_source_attach (source, context);
+
+ g_main_loop_run(g_loop);
+ g_main_loop_unref(g_loop);
+
+ return 0;
+}
+
void _scan_cb(media_content_error_e err, void *user_data)
{
- printf("scan callback is called : %d\n", err);
+ media_content_debug("scan callback is called : %d\n", err);
g_main_loop_quit(g_loop);
return;
{
int ret = -1;
- const char *file_path = "/opt/usr/media/test/image1.jpg";
-
+ const char *file_path = tzplatform_mkpath(TZ_USER_CONTENT, "test/image1.jpg");
ret = media_content_scan_file(file_path);
if(ret != MEDIA_CONTENT_ERROR_NONE) {
media_content_error("Fail to media_content_scan_file : %d", ret);
{
int ret = -1;
- const char *dir_path = "/opt/usr/media";
+ const char *dir_path = tzplatform_getenv(TZ_USER_CONTENT);
- ret = media_content_scan_folder(dir_path, _scan_cb, NULL);
+ ret = media_content_scan_folder(dir_path, TRUE, _scan_cb, NULL);
if(ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("Fail to media_content_scan_file : %d", ret);
+ media_content_error("Fail to test_scan_dir_start : %d", ret);
return ret;
}
return 0;
}
-int test_scan_dir()
+gboolean cancel_scan_dir_start(gpointer data)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+
+ const char *dir_path = "/opt/usr/media/Images";
+
+ ret = media_content_cancel_scan_folder(dir_path);
+
+ if(ret == MEDIA_CONTENT_ERROR_NONE)
+ media_content_debug("media_content_cancel_scan_folder is success");
+ else
+ media_content_error("media_content_cancel_scan_folder is failed");
+
+ return false;
+}
+
+int test_scan_dir(int cancel)
{
GSource *source = NULL;
GMainContext *context = NULL;
g_source_set_callback (source, test_scan_dir_start, NULL, NULL);
g_source_attach (source, context);
+ if (cancel) {
+ GSource *cancel_src = NULL;
+ cancel_src = g_idle_source_new();
+ g_source_set_callback (cancel_src, cancel_scan_dir_start, NULL, NULL);
+ g_source_attach (cancel_src, context);
+ }
+
g_main_loop_run(g_loop);
g_main_loop_unref(g_loop);
return 0;
}
+void _noti_cb(media_content_error_e error,
+ int pid,
+ media_content_db_update_item_type_e update_item,
+ media_content_db_update_type_e update_type,
+ media_content_type_e media_type,
+ char *uuid,
+ char *path,
+ char *mime_type,
+ void *user_data)
+{
+ if (error == 0) {
+ media_content_debug("noti success! : %d\n", error);
+ } else {
+ media_content_debug("error occured! : %d\n", error);
+ }
+
+ media_content_debug("Noti from PID(%d)\n", pid);
+
+ if (update_item == MEDIA_ITEM_FILE) {
+ media_content_debug("Noti item : MEDIA_ITEM_FILE\n");
+ } else if (update_item == MEDIA_ITEM_DIRECTORY) {
+ media_content_debug("Noti item : MEDIA_ITEM_DIRECTORY\n");
+ }
+
+ if (update_type == MEDIA_CONTENT_INSERT) {
+ media_content_debug("Noti type : MEDIA_CONTENT_INSERT\n");
+ } else if (update_type == MEDIA_CONTENT_DELETE) {
+ media_content_debug("Noti type : MEDIA_CONTENT_DELETE\n");
+ } else if (update_type == MEDIA_CONTENT_UPDATE) {
+ media_content_debug("Noti type : MEDIA_CONTENT_UPDATE\n");
+ }
+
+ media_content_debug("content type : %d\n", media_type);
+
+ if (path)
+ media_content_debug("path : %s\n", path);
+ else
+ media_content_debug("path not\n");
+
+ if (uuid)
+ media_content_debug("uuid : %s\n", uuid);
+ else
+ media_content_debug("uuid not\n");
+
+ if (mime_type)
+ media_content_debug("mime_type : %s\n", mime_type);
+ else
+ media_content_debug("mime not\n");
+
+ if (user_data) media_content_debug("String : %s\n", (char *)user_data);
+
+ //g_main_loop_quit(g_loop);
+ return;
+}
+
+gboolean _send_noti_operations(gpointer data)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+
+ /* First of all, noti subscription */
+ char *user_str = strdup("hi");
+ media_content_set_db_updated_cb(_noti_cb, (void*)user_str);
+
+ /* media_info_insert_to_db */
+ media_info_h media_item = NULL;
+ char *path = tzplatform_mkpath(TZ_USER_CONTENT, "test/image1.jpg");
+
+ ret = media_info_insert_to_db(path, &media_item);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ media_content_error("media_info_insert_to_db failed : %d", ret);
+ media_info_destroy(media_item);
+ return FALSE;
+ }
+
+ media_content_debug("media_info_insert_to_db success");
+
+ /* media_info_delete_batch_from_db */
+ filter_h filter;
+ char *condition = "MEDIA_PATH LIKE \'";
+ strncat (condition, tzplatform_mkpath(TZ_USER_CONTENT, "test/image%%jpg\'"), 17);
+
+ ret = media_filter_create(&filter);
+ if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ media_content_error("Fail to create filter");
+ media_info_destroy(media_item);
+ return ret;
+ }
+
+ ret = media_filter_set_condition(filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT);
+ if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ media_filter_destroy(filter);
+ media_info_destroy(media_item);
+ media_content_error("Fail to set condition");
+ return ret;
+ }
+ ret = media_info_delete_batch_from_db(filter);
+ if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ media_filter_destroy(filter);
+ media_info_destroy(media_item);
+ media_content_error("media_info_delete_batch_from_db failed : %d\n", ret);
+ return ret;
+ }
+
+ media_filter_destroy(filter);
+
+ /* media_info_update_to_db */
+ ret = media_info_update_to_db(media_item);
+ if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ media_content_error("media_info_update_to_db failed : %d\n", ret);
+ media_info_destroy(media_item);
+ return ret;
+ }
+
+ media_info_destroy(media_item);
+
+ return FALSE;
+}
+
+int test_noti()
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ GSource *source = NULL;
+ GMainContext *context = NULL;
+
+ g_loop = g_main_loop_new(NULL, FALSE);
+ context = g_main_loop_get_context(g_loop);
+ source = g_idle_source_new();
+ g_source_set_callback (source, _send_noti_operations, NULL, NULL);
+ g_source_attach (source, context);
+
+ g_main_loop_run(g_loop);
+ g_main_loop_unref(g_loop);
+
+ test_filter_destroy();
+ media_content_unset_db_updated_cb();
+
+ return ret;
+}
+
int main(int argc, char *argv[])
{
int ret = MEDIA_CONTENT_ERROR_NONE;
if(ret != MEDIA_CONTENT_ERROR_NONE)
return ret;
+ ret = test_folder_update();
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ return ret;
+
ret = test_playlist_operation();
if(ret != MEDIA_CONTENT_ERROR_NONE)
return ret;
if(ret != MEDIA_CONTENT_ERROR_NONE)
return MEDIA_CONTENT_ERROR_NONE;
+ ret = test_insert_burst_shot_to_db();
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ return MEDIA_CONTENT_ERROR_NONE;
+
ret = test_scan_file();
if(ret != MEDIA_CONTENT_ERROR_NONE)
return MEDIA_CONTENT_ERROR_NONE;
- ret = test_scan_dir();
+ ret = test_scan_dir(true);
+ if(ret != MEDIA_CONTENT_ERROR_NONE)
+ return MEDIA_CONTENT_ERROR_NONE;
+
+ ret = test_noti();
if(ret != MEDIA_CONTENT_ERROR_NONE)
return MEDIA_CONTENT_ERROR_NONE;
#endif