#include <media_content_internal.h>
-filter_h g_filter = NULL;
-filter_h g_filter_g = NULL; /*filter for group like folder, tag, playlist, album, year ... */
+static filter_h g_filter = NULL;
+static filter_h g_filter_g = NULL; /*filter for group like folder, tag, playlist, album, year ... */
-GMainLoop *g_loop = NULL;
+static GMainLoop *g_loop = NULL;
static int g_cnt = 0;
static int g_media_cnt = 0;
-#define test_audio_id "3304285f-1070-41af-8b4e-f0086cc768f3"
-#define test_video_id "53c43e7e-53d2-4194-80a6-55d5dcde0def"
+#define test_audio_id "3304285f-1070-41af-8b4e-f0086cc768f3"
+#define test_video_id "53c43e7e-53d2-4194-80a6-55d5dcde0def"
#define test_image_id "db1c184c-6f31-43b4-b924-8c00ac5b6197"
-media_folder_h g_folder = NULL;
-static void get_audio_meta(audio_meta_h audio)
+static void get_audio_meta(media_info_h media)
{
+ audio_meta_h audio = NULL;
char *c_value = NULL;
int i_value = 0;
- int ret = MEDIA_CONTENT_ERROR_NONE;
-
- media_content_debug("=== audio meta ===");
-
- ret = audio_meta_get_media_id(audio, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
-
- if (c_value)
- media_content_debug("audio_id : [%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);
-
- if (c_value)
- media_content_debug("album : [%s]", c_value);
- SAFE_FREE(c_value);
- ret = audio_meta_get_artist(audio, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
-
- if (c_value)
- 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);
-
- if (c_value)
- 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);
+ content_debug("=== audio meta ===");
+ if (media_info_get_audio(media, &audio) != MEDIA_CONTENT_ERROR_NONE)
+ return;
- if (c_value)
- media_content_debug("genre : [%s]", c_value);
- SAFE_FREE(c_value);
-
- ret = audio_meta_get_composer(audio, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
+ if (audio_meta_get_media_id(audio, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("audio_id : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("composer : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (audio_meta_get_album(audio, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("album : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = audio_meta_get_year(audio, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
+ if (audio_meta_get_artist(audio, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("artist : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("year : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (audio_meta_get_album_artist(audio, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("album artist : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = audio_meta_get_recorded_date(audio, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
+ if (audio_meta_get_genre(audio, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("genre : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("recorded_date : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (audio_meta_get_composer(audio, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("composer : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = audio_meta_get_copyright(audio, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
+ if (audio_meta_get_year(audio, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("year : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("copyright : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (audio_meta_get_recorded_date(audio, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("recorded date : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = audio_meta_get_track_num(audio, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
+ if (audio_meta_get_copyright(audio, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("copyright : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("track_num : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (audio_meta_get_track_num(audio, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("track number : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = audio_meta_get_bit_rate(audio, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
- else
- media_content_debug("bitrate : [%d]", i_value);
+ if (audio_meta_get_bit_rate(audio, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("bitrate : [%d]", i_value);
- ret = audio_meta_get_sample_rate(audio, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
- else
- media_content_debug("samplerate : [%d]", i_value);
+ if (audio_meta_get_sample_rate(audio, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("samplerate : [%d]", i_value);
- ret = audio_meta_get_channel(audio, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
- else
- media_content_debug("channel : [%d]", i_value);
+ if (audio_meta_get_channel(audio, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("channel : [%d]", i_value);
- ret = audio_meta_get_duration(audio, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
- else
- media_content_debug("duration : [%d]", i_value);
+ if (audio_meta_get_duration(audio, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("duration : [%d]", i_value);
+ audio_meta_destroy(audio);
}
-static void get_video_meta(video_meta_h video)
+static void get_video_meta(media_info_h media)
{
+ video_meta_h video = NULL;
char *c_value = NULL;
int i_value = 0;
- int ret = MEDIA_CONTENT_ERROR_NONE;
- media_content_debug("=== video meta ===");
-
- ret = video_meta_get_media_id(video, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
-
- if (c_value)
- media_content_debug("video_id : [%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);
+ content_debug("=== video meta ===");
+ if (media_info_get_video(media, &video) != MEDIA_CONTENT_ERROR_NONE)
+ return;
- if (c_value)
- media_content_debug("album : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (video_meta_get_media_id(video, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("video_id : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = video_meta_get_artist(video, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
+ if (video_meta_get_album(video, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("album : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("artist : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (video_meta_get_artist(video, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ 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);
+ if (video_meta_get_album_artist(video, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("album artist : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("album_artist : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (video_meta_get_genre(video, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("genre : [%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);
+ if (video_meta_get_composer(video, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("composer : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("genre : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (video_meta_get_year(video, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("year : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = video_meta_get_composer(video, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
+ if (video_meta_get_recorded_date(video, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("recorded date : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("omposer : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (video_meta_get_copyright(video, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("copyright : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = video_meta_get_year(video, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
+ if (video_meta_get_track_num(video, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("track num : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("year : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (video_meta_get_bit_rate(video, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("bitrate : [%d]", i_value);
- ret = video_meta_get_recorded_date(video, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
+ if (video_meta_get_duration(video, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("duration : [%d]", i_value);
- if (c_value)
- media_content_debug("recorded_date : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (video_meta_get_width(video, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("width : [%d]", i_value);
- ret = video_meta_get_copyright(video, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
+ if (video_meta_get_height(video, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("height : [%d]", i_value);
- if (c_value)
- media_content_debug("copyright : [%s]", c_value);
- SAFE_FREE(c_value);
+ video_meta_destroy(video);
+}
- ret = video_meta_get_track_num(video, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
+static void get_image_meta(media_info_h media)
+{
+ image_meta_h image = NULL;
+ char *c_value = NULL;
+ int i_value = 0;
+ media_content_orientation_e orientation;
- if (c_value)
- media_content_debug("track_num : [%s]", c_value);
- SAFE_FREE(c_value);
+ content_debug("=== image meta ===");
+ if (media_info_get_image(media, &image) != MEDIA_CONTENT_ERROR_NONE)
+ return;
- ret = video_meta_get_bit_rate(video, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
- else
- media_content_debug("bitrate : [%d]", i_value);
+ if (image_meta_get_width(image, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("width : [%d]", i_value);
- ret = video_meta_get_duration(video, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
- else
- media_content_debug("duration : [%d]", i_value);
+ if (image_meta_get_height(image, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("height : [%d]", i_value);
- ret = video_meta_get_width(video, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
- else
- media_content_debug("width : [%d]", i_value);
+ if (image_meta_get_orientation(image, &orientation) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("orientation : [%d]", orientation);
- ret = video_meta_get_height(video, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
- else
- media_content_debug("height : [%d]", i_value);
+ if (image_meta_get_date_taken(image, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("datetaken : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
+ image_meta_destroy(image);
}
-static void get_image_meta(image_meta_h image)
+static void get_book_meta(media_info_h media)
{
+ book_meta_h book = NULL;
char *c_value = NULL;
- int i_value = 0;
- media_content_orientation_e orientation;
- int ret = MEDIA_CONTENT_ERROR_NONE;
- media_content_debug("=== image meta ===");
+ content_debug("=== book meta ===");
+ if (media_info_get_book(media, &book) != MEDIA_CONTENT_ERROR_NONE)
+ return;
- ret = image_meta_get_width(image, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_width : [%d]", ret);
- else
- media_content_debug("width : [%d]", i_value);
+ if (book_meta_get_media_id(book, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("media_id : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = image_meta_get_height(image, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_height : [%d]", ret);
- else
- media_content_debug("height : [%d]", i_value);
+ if (book_meta_get_author(book, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("author : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = image_meta_get_orientation(image, &orientation);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_orientation : [%d]", ret);
- else
- media_content_debug("orientation : [%d]", orientation);
+ if (book_meta_get_date(book, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("date : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = image_meta_get_date_taken(image, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_date_taken : [%d]", ret);
+ if (book_meta_get_publisher(book, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("publisher : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("date_taken : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (book_meta_get_subject(book, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("subject : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
+ book_meta_destroy(book);
}
static void get_album_meta(media_album_h album)
{
char *c_value = NULL;
int i_value = 0;
- int ret = MEDIA_CONTENT_ERROR_NONE;
-
- media_content_debug("=== album meta ===");
-
- ret = media_album_get_album_id(album, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_album_get_album_id : [%d]", ret);
- else
- media_content_debug("album_id : [%d]", i_value);
-
- ret = media_album_get_name(album, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_album_get_name : [%d]", ret);
- if (c_value)
- media_content_debug("album_name : [%s]", c_value);
- SAFE_FREE(c_value);
-
- ret = media_album_get_artist(album, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_album_get_artist : [%d]", ret);
+ content_debug("=== album meta ===");
+ if (media_album_get_album_id(album, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("album id : [%d]", i_value);
- if (c_value)
- media_content_debug("album_artist : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (media_album_get_name(album, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("album name : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
+ if (media_album_get_artist(album, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("album artist : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
}
static void get_bookmark_meta(media_bookmark_h bookmark)
char *c_value = NULL;
int i_value = 0;
time_t time = 0;
- int ret = MEDIA_CONTENT_ERROR_NONE;
-
- media_content_debug("=== bookmark meta ===");
-
- ret = media_bookmark_get_bookmark_id(bookmark, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_get_bookmark_id : [%d]", ret);
- else
- media_content_debug("bookmark_id : %d", i_value);
- ret = media_bookmark_get_thumbnail_path(bookmark, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_get_thumbnail_path : [%d]", ret);
-
- if (c_value)
- media_content_debug("bookmark thumbnail_path : %s", c_value);
- SAFE_FREE(c_value);
+ content_debug("=== bookmark meta ===");
+ if (media_bookmark_get_bookmark_id(bookmark, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("bookmark_id : %d", i_value);
- ret = media_bookmark_get_marked_time(bookmark, &time);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_get_marked_time : [%d]", ret);
- else
- media_content_debug("bookmark marked_time : %ld", time);
-
- ret = media_bookmark_get_name(bookmark, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_get_name : [%d]", ret);
+ if (media_bookmark_get_thumbnail_path(bookmark, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("bookmark thumbnail_path : %s", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("bookmark name : %s", c_value);
- SAFE_FREE(c_value);
+ if (media_bookmark_get_marked_time(bookmark, &time) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("bookmark marked_time : %ld", time);
+ if (media_bookmark_get_name(bookmark, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("bookmark name : %s", c_value);
+ SAFE_FREE(c_value);
+ }
}
static void get_tag_meta(media_tag_h tag)
{
char *c_value = NULL;
int i_value = 0;
- int ret = MEDIA_CONTENT_ERROR_NONE;
-
- media_content_debug("=== tag meta ===");
-
- ret = media_tag_get_tag_id(tag, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_get_tag_id : [%d]", ret);
- else
- media_content_debug("tag_id : %d", i_value);
-
- ret = media_tag_get_name(tag, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_get_name : [%d]", ret);
- if (c_value)
- media_content_debug("tag_name : %s", c_value);
- SAFE_FREE(c_value);
+ content_debug("=== tag meta ===");
+ if (media_tag_get_tag_id(tag, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("tag_id : %d", i_value);
+ if (media_tag_get_name(tag, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("tag_name : %s", c_value);
+ SAFE_FREE(c_value);
+ }
}
static void get_face_meta(media_face_h face)
unsigned int rect_w = 0;
unsigned int rect_h = 0;
media_content_orientation_e orientation = 0;
- int ret = MEDIA_CONTENT_ERROR_NONE;
-
- media_content_debug("=== face meta ===");
- ret = media_face_get_face_id(face, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_face_get_face_id : [%d]", ret);
-
- if (c_value)
- media_content_debug("face_id : %s", c_value);
- SAFE_FREE(c_value);
-
- ret = media_face_get_media_id(face, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_face_get_media_id : [%d]", ret);
-
- if (c_value)
- media_content_debug("media_id : %s", c_value);
- SAFE_FREE(c_value);
+ content_debug("=== face meta ===");
+ if (media_face_get_face_id(face, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("face_id : %s", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = media_face_get_face_rect(face, &rect_x, &rect_y, &rect_w, &rect_h);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_face_get_face_rect : [%d]", ret);
- else
- media_content_debug("face_rect x[%d] y[%d] w[%d] h[%d]", rect_x, rect_y, rect_w, rect_h);
+ if (media_face_get_media_id(face, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("media_id : %s", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = media_face_get_orientation(face, &orientation);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_face_get_orientation : [%d]", ret);
- else
- media_content_debug("orientation : %d", orientation);
+ if (media_face_get_face_rect(face, &rect_x, &rect_y, &rect_w, &rect_h) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("face_rect x[%d] y[%d] w[%d] h[%d]", rect_x, rect_y, rect_w, rect_h);
- ret = media_face_get_tag(face, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_face_get_tag : [%d]", ret);
-
- if (c_value)
- media_content_debug("tag : %s", c_value);
- SAFE_FREE(c_value);
+ if (media_face_get_orientation(face, &orientation) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("orientation : %d", orientation);
+ if (media_face_get_tag(face, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("tag : %s", c_value);
+ SAFE_FREE(c_value);
+ }
}
static void get_folder_meta(media_folder_h folder, char **folder_id)
{
char *c_value = NULL;
media_content_storage_e storage_type;
- int ret = MEDIA_CONTENT_ERROR_NONE;
-
- media_content_debug("=== folder meta ===");
- ret = media_folder_get_folder_id(folder, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_folder_get_folder_id : [%d]", ret);
-
- if (c_value) {
- media_content_debug("folder_id : %s", c_value);
+ content_debug("=== folder meta ===");
+ if (media_folder_get_folder_id(folder, &c_value) != MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("folder_id : %s", c_value);
*folder_id = c_value;
}
- ret = media_folder_get_path(folder, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_folder_get_path : [%d]", ret);
-
- if (c_value)
- media_content_debug("folder_path : %s", c_value);
- SAFE_FREE(c_value);
-
- ret = media_folder_get_name(folder, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_folder_get_name : [%d]", ret);
-
- if (c_value)
- media_content_debug("folder_name : %s", c_value);
- SAFE_FREE(c_value);
-
- ret = media_folder_get_storage_type(folder, &storage_type);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_folder_get_storage_type : [%d]", ret);
- else
- media_content_debug("storage_type : [%d]", storage_type);
+ if (media_folder_get_path(folder, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("folder_path : %s", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = media_folder_get_storage_id(folder, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_folder_get_storage_id : [%d]", ret);
+ if (media_folder_get_name(folder, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("folder_name : %s", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("storage_id : %s", c_value);
- SAFE_FREE(c_value);
+ if (media_folder_get_storage_type(folder, &storage_type) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("storage_type : [%d]", storage_type);
+ if (media_folder_get_storage_id(folder, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("storage_id : %s", c_value);
+ SAFE_FREE(c_value);
+ }
}
static void get_media_meta(media_info_h media)
bool b_value = false;
unsigned long long size = 0;
media_content_type_e media_type = 0;
- int ret = MEDIA_CONTENT_ERROR_NONE;
- media_content_debug("=== media meta ===");
+ content_debug("=== media meta ===");
+ if (media_info_get_media_type(media, &media_type) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("media_type : [%d]", media_type);
- ret = media_info_get_media_type(media, &media_type);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_media_type : [%d]", ret);
- else
- media_content_debug("media_type : [%d]", media_type);
-
- ret = media_info_get_media_id(media, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_media_id : [%d]", ret);
-
- if (c_value)
- media_content_debug("media_id : [%s]", c_value);
- SAFE_FREE(c_value);
-
- ret = media_info_get_file_path(media, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_file_path : [%d]", ret);
+ if (media_info_get_media_id(media, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("media_id : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("file_path : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (media_info_get_file_path(media, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("file_path : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = media_info_get_display_name(media, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_display_name : [%d]", ret);
+ if (media_info_get_display_name(media, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("display_name : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("display_name : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (media_info_get_mime_type(media, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("mime_type : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = media_info_get_mime_type(media, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_mime_type : [%d]", ret);
+ if (media_info_get_thumbnail_path(media, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("thumbnail_path : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- if (c_value)
- media_content_debug("mime_type : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (media_info_get_description(media, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
+ content_debug("description : [%s]", c_value);
+ SAFE_FREE(c_value);
+ }
- ret = media_info_get_thumbnail_path(media, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_thumbnail_path : [%d]", ret);
+ if (media_info_get_size(media, &size) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("size : [%lld]", size);
- if (c_value)
- media_content_debug("thumbnail_path : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (media_info_get_added_time(media, &t_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("added_time : [%ld]", t_value);
- ret = media_info_get_description(media, &c_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_description : [%d]", ret);
+ if (media_info_get_modified_time(media, &t_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("modified_time : [%ld]", t_value);
- if (c_value)
- media_content_debug("description : [%s]", c_value);
- SAFE_FREE(c_value);
+ if (media_info_get_timeline(media, &t_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("timeline : [%ld]", t_value);
- ret = media_info_get_size(media, &size);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_size : [%d]", ret);
- else
- media_content_debug("size : [%lld]", size);
+ if (media_info_get_rating(media, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("rating : [%d]", i_value);
- ret = media_info_get_added_time(media, &t_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_added_time : [%d]", ret);
- else
- media_content_debug("added_time : [%ld]", t_value);
+ if (media_info_get_favorite(media, &b_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("favorite : [%d]", b_value);
- ret = media_info_get_modified_time(media, &t_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_modified_time : [%d]", ret);
- else
- media_content_debug("modified_time : [%ld]", t_value);
+ if (media_info_is_drm(media, &b_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("is_drm : [%d]", b_value);
- ret = media_info_get_timeline(media, &t_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_timeline : [%d]", ret);
- else
- media_content_debug("timeline : [%ld]", t_value);
-
- ret = media_info_get_rating(media, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_rating : [%d]", ret);
- else
- media_content_debug("rating : [%d]", i_value);
-
- ret = media_info_get_favorite(media, &b_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_favorite : [%d]", ret);
- else
- media_content_debug("favorite : [%d]", b_value);
-
- ret = media_info_is_drm(media, &b_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_is_drm : [%d]", ret);
- else
- media_content_debug("is_drm : [%d]", b_value);
-
- ret = media_info_is_360_content(media, &b_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_is_360_content : [%d]", ret);
- else
- media_content_debug("is_360 : [%d]", b_value);
+ if (media_info_is_360_content(media, &b_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("is_360 : [%d]", b_value);
#ifdef _USE_TVPD_MODE
- ret = media_info_get_stitched_state(media, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_stitched_state : [%d]", ret);
- else
- media_content_debug("360 stitched : [%d]", i_value);
+ if (media_info_get_stitched_state(media, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("360 stitched : [%d]", i_value);
- ret = media_info_get_stitched_engine(media, &i_value);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_stitched_engine : [%d]", ret);
- else
- media_content_debug("360 engine : [%d]", i_value);
+ if (media_info_get_stitched_engine(media, &i_value) == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("360 engine : [%d]", i_value);
#endif
- if (media_type == MEDIA_CONTENT_TYPE_MUSIC) {
- audio_meta_h audio;
-
- ret = media_info_get_audio(media, &audio);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_audio : [%d]", ret);
- else
- get_audio_meta(audio);
+ if (media_type == MEDIA_CONTENT_TYPE_MUSIC)
+ get_audio_meta(media);
- ret = audio_meta_destroy(audio);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error audio_meta_destroy : [%d]", ret);
-
- } else if (media_type == MEDIA_CONTENT_TYPE_IMAGE) {
- image_meta_h image;
-
- ret = media_info_get_image(media, &image);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_image : [%d]", ret);
- else
- get_image_meta(image);
-
- ret = image_meta_destroy(image);
- 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;
-
- ret = media_info_get_video(media, &video);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_get_video : [%d]", ret);
- else
- get_video_meta(video);
+ if (media_type == MEDIA_CONTENT_TYPE_IMAGE)
+ get_image_meta(media);
- ret = video_meta_destroy(video);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_destroy : [%d]", ret);
+ if (media_type == MEDIA_CONTENT_TYPE_VIDEO)
+ get_video_meta(media);
- } else {
- media_content_debug("Other Content");
- }
+ if (media_type == MEDIA_CONTENT_TYPE_BOOK)
+ get_book_meta(media);
+ if (media_type == MEDIA_CONTENT_TYPE_OTHERS)
+ content_debug("Other type");
}
bool media_item_cb(media_info_h media, void *user_data)
{
if (!media) {
- media_content_debug("NO Item");
+ content_debug("NO Item");
return true;
}
ret = media_bookmark_clone(&new_bm, bookmark);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_clone : [%d]", ret);
+ content_error("error media_bookmark_clone : [%d]", ret);
GList **list = (GList**)user_data;
*list = g_list_append(*list, new_bm);
char *folder_id = NULL;
media_folder_h *_folder = (media_folder_h*)user_data;
- media_content_debug("===========================");
+ content_debug("===========================");
if (folder != NULL) {
if (_folder != NULL)
media_folder_clone(_folder, folder);
if (media_folder_get_media_count_from_db(folder_id, g_filter, &item_count) != MEDIA_CONTENT_ERROR_NONE) {
SAFE_FREE(folder_id);
- media_content_error("[ERROR] media_folder_get_media_count_from_db is failed");
+ 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);
- media_content_error("[ERROR] media_folder_foreach_media_from_db is failed");
+ content_error("[ERROR] media_folder_foreach_media_from_db is failed");
return false;
}
media_playlist_h playlist_h;
char *playlist_thumbnail_path = NULL;
- media_content_debug("playlist_list_cb ======");
+ content_debug("playlist_list_cb ======");
#if 0
GList **list = (GList**)user_data;
#endif
if (playlist == NULL) {
- media_content_debug(" playlist handle is NULL");
+ content_debug(" playlist handle is NULL");
return false;
}
ret = media_playlist_get_playlist_id(playlist, &playlist_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_get_playlist_id : [%d]", ret);
+ content_error("error media_playlist_get_playlist_id : [%d]", ret);
- media_content_debug("playlist_id : %d", playlist_id);
+ content_debug("playlist_id : %d", playlist_id);
/* 64bit build issue */
#if 0
if (user_data != NULL)
#endif
ret = media_playlist_get_name(playlist, &playlist_name);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_get_name : [%d]", ret);
+ content_error("error media_playlist_get_name : [%d]", ret);
- media_content_debug("playlist_name : %s", playlist_name);
+ content_debug("playlist_name : %s", playlist_name);
SAFE_FREE(playlist_name);
ret = media_playlist_get_thumbnail_path(playlist, &playlist_thumbnail_path);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_get_thumbnail_path : [%d]", ret);
+ content_error("error media_playlist_get_thumbnail_path : [%d]", ret);
- media_content_debug("playlist_thumbnail_path : %s", playlist_thumbnail_path);
+ content_debug("playlist_thumbnail_path : %s", playlist_thumbnail_path);
SAFE_FREE(playlist_thumbnail_path);
ret = media_playlist_get_playlist_from_db(playlist_id, &playlist_h);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_get_playlist_from_db : [%d]", ret);
+ content_error("error media_playlist_get_playlist_from_db : [%d]", ret);
ret = media_playlist_destroy(playlist_h);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_destroy : [%d]", ret);
+ content_error("error media_playlist_destroy : [%d]", ret);
return true;
}
bool tag_list_cb(media_tag_h tag, void *user_data)
{
if (!tag) {
- media_content_debug(" tag handle is NULL");
+ content_debug(" tag handle is NULL");
return false;
}
ret = media_album_get_media_count_from_db(album_id, NULL, &media_count);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_album_get_media_count_from_db : [%d]", ret);
+ content_error("error media_album_get_media_count_from_db : [%d]", ret);
- media_content_debug("media_count : [%d]", media_count);
+ content_debug("media_count : [%d]", media_count);
ret = media_album_foreach_media_from_db(album_id, NULL, media_item_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("error media_album_foreach_media_from_db : [%d]", ret);
+ content_error("error media_album_foreach_media_from_db : [%d]", ret);
return false;
}
} else {
- media_content_error("album item not Found!!");
+ content_error("album item not Found!!");
}
return true;
int media_count = 0;
int *idx = user_data;
- media_content_debug("group item : [%s] [%d]", group_name, *idx);
+ content_debug("group item : [%s] [%d]", group_name, *idx);
if (media_group_get_media_count_from_db(group_name, *idx, g_filter, &media_count) != MEDIA_CONTENT_ERROR_NONE)
return false;
- media_content_debug("media_count : [%d]", media_count);
+ content_debug("media_count : [%d]", media_count);
if (media_group_foreach_media_from_db(group_name, *idx, g_filter, media_item_cb, NULL) != MEDIA_CONTENT_ERROR_NONE)
return false;
bool playlist_item_cb(int playlist_member_id, media_info_h media, void *user_data)
{
- media_content_debug("playlist_member_id : [%d]", playlist_member_id);
+ content_debug("playlist_member_id : [%d]", playlist_member_id);
/* 64bit build issue */
#if 0
GList **list = (GList**)user_data;
int test_filter_create(void)
{
- media_content_debug("\n============Filter Create============\n\n");
+ content_debug("\n============Filter Create============\n\n");
int ret = MEDIA_CONTENT_ERROR_NONE;
/* Filter for media */
const char *condition = "MEDIA_TYPE=3"; /*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music, 4-other*/
- /*const 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);
int test_filter_destroy(void)
{
- media_content_debug("\n============Filter Create============\n\n");
+ content_debug("\n============Filter Create============\n\n");
int ret = MEDIA_CONTENT_ERROR_NONE;
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- media_content_debug("\n============DB Connection Test============\n\n");
+ content_debug("\n============DB Connection Test============\n\n");
ret = media_content_connect();
if (ret == MEDIA_CONTENT_ERROR_NONE)
- media_content_debug("connection is success\n\n");
+ content_debug("connection is success\n\n");
else
- media_content_error("connection is failed\n\n");
+ content_error("connection is failed\n\n");
return ret;
}
/* First, Get folder list */
ret = media_folder_foreach_folder_from_db(filter, gallery_folder_list_cb, &folder_list);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("media_folder_foreach_folder_from_db failed: %d", ret);
+ content_error("media_folder_foreach_folder_from_db failed: %d", ret);
return -1;
} else {
- media_content_debug("media_folder_foreach_folder_from_db success!!");
+ content_debug("media_folder_foreach_folder_from_db success!!");
char *folder_id = NULL;
for (i = 0; i < g_list_length(folder_list); i++) {
ret = media_folder_get_media_count_from_db(folder_id, filter, &count);
SAFE_FREE(folder_id);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("media_folder_get_media_count_from_db failed: %d", ret);
+ content_error("media_folder_get_media_count_from_db failed: %d", ret);
return -1;
} else {
- media_content_debug("media count [%d] : %d", i, count);
+ content_debug("media count [%d] : %d", i, count);
}
}
}
media_content_order_e order_type = MEDIA_CONTENT_ORDER_DESC;
ret = media_filter_create(&filter);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("Fail to create filter");
+ content_error("Fail to create filter");
return ret;
}
ret = media_filter_set_condition(filter, "MEDIA_TYPE = 0", collate_type);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_filter_destroy(filter);
- media_content_error("Fail to set condition");
+ content_error("Fail to set condition");
return ret;
}
ret = media_filter_set_order(filter, order_type, MEDIA_DISPLAY_NAME, collate_type);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_filter_destroy(filter);
- media_content_error("Fail to set order");
+ content_error("Fail to set order");
return ret;
}
ret = media_info_foreach_media_from_db(filter, gallery_media_item_cb, &all_item_list);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("media_info_foreach_media_from_db failed: %d", ret);
+ content_error("media_info_foreach_media_from_db failed: %d", ret);
media_filter_destroy(filter);
return -1;
} else {
- media_content_debug("media_info_foreach_media_from_db success");
+ content_debug("media_info_foreach_media_from_db success");
for (i = 0; i < g_list_length(all_item_list); i++) {
media_handle = (media_info_h)g_list_nth_data(all_item_list, i);
/* To check performance */
gettimeofday(&end, NULL);
long time = (end.tv_sec * 1000000 + end.tv_usec) - (start.tv_sec * 1000000 + start.tv_usec);
- media_content_debug("Time : %ld\n", time);
+ content_debug("Time : %ld\n", time);
/* Third, Get item list of a folder */
GList *item_list = NULL;
SAFE_FREE(folder_id);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("media_folder_foreach_media_from_db failed: %d", ret);
+ content_error("media_folder_foreach_media_from_db failed: %d", ret);
return -1;
} else {
- media_content_error("media_folder_foreach_media_from_db success!");
+ content_error("media_folder_foreach_media_from_db success!");
for (j = 0; j < g_list_length(item_list); j++) {
media_handle = (media_info_h)g_list_nth_data(item_list, j);
ret = media_tag_foreach_tag_from_db(filter, gallery_tag_item_cb, &tag_list);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("media_tag_foreach_tag_from_db failed: %d", ret);
+ content_error("media_tag_foreach_tag_from_db failed: %d", ret);
return -1;
} else {
- media_content_error("media_tag_foreach_tag_from_db success");
+ content_error("media_tag_foreach_tag_from_db success");
for (i = 0; i < g_list_length(tag_list); i++) {
tag_handle = (media_tag_h)g_list_nth_data(tag_list, i);
get_tag_meta(tag_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
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("media_tag_foreach_media_from_db failed: %d", ret);
+ content_error("media_tag_foreach_media_from_db failed: %d", ret);
return -1;
} else {
- media_content_error("media_tag_foreach_media_from_db success");
+ content_error("media_tag_foreach_media_from_db success");
unsigned int j = 0;
media_info_h tag_media_handle;
media_handle = (media_info_h)g_list_nth_data(all_item_list, i);
ret = media_info_destroy(media_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_destroy failed: %d", ret);
+ content_error("media_info_destroy failed: %d", ret);
}
g_list_free(all_item_list);
media_handle = (media_info_h)g_list_nth_data(item_list, i);
ret = media_info_destroy(media_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_destroy failed: %d", ret);
+ content_error("media_info_destroy failed: %d", ret);
}
g_list_free(item_list);
tag_handle = (media_tag_h)g_list_nth_data(tag_list, i);
ret = media_tag_destroy(tag_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_destroy : [%d]", ret);
+ content_error("error media_tag_destroy : [%d]", ret);
}
g_list_free(tag_list);
media_handle = (media_info_h)g_list_nth_data(media_list_in_tag, i);
ret = media_info_destroy(media_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_destroy failed: %d", ret);
+ content_error("media_info_destroy failed: %d", ret);
}
g_list_free(media_list_in_tag);
ret = media_filter_create(&filter);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("Fail to create filter");
+ content_error("Fail to create filter");
return ret;
}
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");
+ content_error("Fail to set condition");
return ret;
}
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");
+ content_error("Fail to set order");
return ret;
}
ret = media_info_get_media_count_from_db(filter, &media_count);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_filter_destroy(filter);
- media_content_error("Fail to get media count");
+ content_error("Fail to get media count");
return ret;
}
- media_content_debug("media_count : [%d]", media_count);
+ content_debug("media_count : [%d]", media_count);
ret = media_info_foreach_media_from_db(filter, media_item_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_filter_destroy(filter);
- media_content_error("Fail to get media");
+ content_error("Fail to get media");
return ret;
}
int ret = MEDIA_CONTENT_ERROR_NONE;
int media_count = 0;
- media_content_debug("\n============Media info Test============\n\n");
+ content_debug("\n============Media info Test============\n\n");
test_filter_create();
ret = media_info_get_media_count_from_db(g_filter, &media_count);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_media_count_from_db failed: %d", ret);
+ content_error("media_info_get_media_count_from_db failed: %d", ret);
else
- media_content_debug("media_count : [%d]", media_count);
+ content_debug("media_count : [%d]", media_count);
ret = media_info_foreach_media_from_db(g_filter, media_item_cb, NULL);
if (ret == MEDIA_CONTENT_ERROR_NONE)
- media_content_debug("media_info_foreach_media_from_db is success");
+ content_debug("media_info_foreach_media_from_db is success");
else
- media_content_error("media_info_foreach_media_from_db is failed");
+ content_error("media_info_foreach_media_from_db is failed");
test_filter_destroy();
int ret = MEDIA_CONTENT_ERROR_NONE;
int bookmark_count = 0;
- media_content_debug("\n============Media info Test 2============\n\n");
+ content_debug("\n============Media info Test 2============\n\n");
test_filter_create();
media_info_get_bookmark_count_from_db(test_video_id, g_filter_g, &bookmark_count);
- media_content_debug("bookmark_count : [%d]", bookmark_count);
+ content_debug("bookmark_count : [%d]", bookmark_count);
ret = media_info_foreach_bookmark_from_db(test_video_id, g_filter_g, bookmarks_cb, NULL);
#endif
/* Tag */
ret = media_info_get_tag_count_from_db(test_audio_id, g_filter_g, &bookmark_count);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_tag_count_from_db failed: %d", ret);
+ content_error("media_info_get_tag_count_from_db failed: %d", ret);
else
- media_content_debug("tag_count : [%d]", bookmark_count);
+ content_debug("tag_count : [%d]", bookmark_count);
ret = media_info_foreach_tag_from_db(test_audio_id, g_filter_g, tag_list_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_foreach_tag_from_db failed: %d", ret);
+ content_error("media_info_foreach_tag_from_db failed: %d", ret);
test_filter_destroy();
char *folder_id = NULL;
int count = 0;
- media_content_debug("\n============Folder Test============\n\n");
+ content_debug("\n============Folder Test============\n\n");
test_filter_create();
ret = media_filter_create(&filter);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("[ERROR] media_folder_filter_create is failed");
+ content_error("[ERROR] media_folder_filter_create is failed");
return ret;
}
media_filter_set_storage(filter, "cfbf3d2c-71c5-4611-bccc-7cbac890146e");
ret = media_folder_get_folder_count_from_db(filter, &count);
- media_content_debug("Folder count : [%d]", count);
+ content_debug("Folder count : [%d]", count);
ret = media_folder_foreach_folder_from_db(filter, folder_list_cb, &folder);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
test_filter_destroy();
media_filter_destroy(filter);
- media_content_error("[ERROR] media_info_filter_create is failed");
+ content_error("[ERROR] media_info_filter_create is failed");
return ret;
}
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);
+ content_error("[ERROR] media_folder_foreach_media_from_db is failed, error code : %d", ret);
media_filter_destroy(filter);
media_filter_destroy(m_filter);
filter_h filter = NULL;
filter_h m_filter = NULL;
- media_content_debug("\n============Playlist Test============\n\n");
+ content_debug("\n============Playlist Test============\n\n");
/* Filter for playlist */
/* Get Playlist Count*/
ret = media_playlist_get_playlist_count_from_db(filter, &playlist_count);
if (ret == 0)
- media_content_debug("playlist_count [%d]", playlist_count);
+ content_debug("playlist_count [%d]", playlist_count);
/* Get Playlist*/
GList *playlist_id_list = NULL;
playlist_id_2 = (int)g_list_nth_data(playlist_id_list, 1);
playlist_id_3 = (int)g_list_nth_data(playlist_id_list, 2);
#endif
- media_content_debug("playlist_id_1 [%d]", playlist_id_1);
- media_content_debug("playlist_id_2 [%d]", playlist_id_2);
- media_content_debug("playlist_id_3 [%d]", playlist_id_3);
+ content_debug("playlist_id_1 [%d]", playlist_id_1);
+ content_debug("playlist_id_2 [%d]", playlist_id_2);
+ content_debug("playlist_id_3 [%d]", playlist_id_3);
/* Export and import playlist */
media_playlist_export_to_file(playlist_3, tzplatform_mkpath(TZ_USER_MUSIC, "playlist.m3u"));
/* Get media count */
media_playlist_get_media_count_from_db(playlist_id_1, m_filter, &media_count);
- media_content_debug("playlist_1_media_count [%d]", media_count);
+ content_debug("playlist_1_media_count [%d]", media_count);
media_playlist_get_media_count_from_db(playlist_id_2, m_filter, &media_count);
- media_content_debug("playlist_2_media_count [%d]", media_count);
+ content_debug("playlist_2_media_count [%d]", media_count);
media_playlist_get_media_count_from_db(playlist_id_3, m_filter, &media_count);
- media_content_debug("playlist_3_media_count [%d]", media_count);
+ content_debug("playlist_3_media_count [%d]", media_count);
/* Get media of playlist */
GList *playlist_member_id_list = NULL;
playlist_member_id_2_1 = (int)g_list_nth_data(playlist_member_id_list_1, 0);
playlist_member_id_2_2 = (int)g_list_nth_data(playlist_member_id_list_1, 1);
#endif
- media_content_debug("playlist_member_id_1_1 [%d]", playlist_member_id_1_1);
- media_content_debug("playlist_member_id_1_2 [%d]", playlist_member_id_1_2);
- media_content_debug("playlist_member_id_1_3 [%d]", playlist_member_id_1_3);
- media_content_debug("playlist_member_id_2_1 [%d]", playlist_member_id_2_1);
- media_content_debug("playlist_member_id_2_2 [%d]", playlist_member_id_2_2);
+ content_debug("playlist_member_id_1_1 [%d]", playlist_member_id_1_1);
+ content_debug("playlist_member_id_1_2 [%d]", playlist_member_id_1_2);
+ content_debug("playlist_member_id_1_3 [%d]", playlist_member_id_1_3);
+ content_debug("playlist_member_id_2_1 [%d]", playlist_member_id_2_1);
+ content_debug("playlist_member_id_2_2 [%d]", playlist_member_id_2_2);
media_playlist_get_play_order(playlist_1, playlist_member_id_1_1, &order_1);
media_playlist_get_play_order(playlist_1, playlist_member_id_1_2, &order_2);
media_playlist_get_play_order(playlist_1, playlist_member_id_1_3, &order_3);
media_playlist_get_play_order(playlist_2, playlist_member_id_2_1, &order_4);
media_playlist_get_play_order(playlist_2, playlist_member_id_2_2, &order_5);
- media_content_debug("order_1 [%d] order_2 [%d] order_3 [%d] order_4 [%d] order_5 [%d]", order_1, order_2, order_3, order_4, order_5);
+ content_debug("order_1 [%d] order_2 [%d] order_3 [%d] order_4 [%d] order_5 [%d]", order_1, order_2, order_3, order_4, order_5);
/* Update Playlist */
media_playlist_remove_media(playlist_2, playlist_member_id_2_1);
const char *playlist_thumb_path = tzplatform_mkpath(TZ_USER_IMAGES, "Default.jpg");
int playlist_id = 0;
- media_content_debug("\n============Playlist Test V2============\n\n");
+ content_debug("\n============Playlist Test V2============\n\n");
ret = media_playlist_create(&playlist_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_create : [%d]", ret);
+ content_error("error media_playlist_create : [%d]", ret);
ret = media_playlist_set_name(playlist_1, playlist_name_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_set_name : [%d]", ret);
+ content_error("error media_playlist_set_name : [%d]", ret);
ret = media_playlist_set_thumbnail_path(playlist_1, playlist_thumb_path);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_set_thumbnail_path : [%d]", ret);
+ content_error("error media_playlist_set_thumbnail_path : [%d]", ret);
ret = media_playlist_insert_to_db_v2(playlist_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_insert_to_db_v2 : [%d]", ret);
+ content_error("error media_playlist_insert_to_db_v2 : [%d]", ret);
ret = media_playlist_set_name(playlist_1, "myPlaylist_3");
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_set_name : [%d]", ret);
+ content_error("error media_playlist_set_name : [%d]", ret);
ret = media_playlist_get_playlist_id(playlist_1, &playlist_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_get_playlist_id : [%d]", ret);
+ content_error("error media_playlist_get_playlist_id : [%d]", ret);
ret = media_playlist_update_to_db_v2(playlist_id, playlist_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_update_to_db_v2 : [%d]", ret);
+ content_error("error media_playlist_update_to_db_v2 : [%d]", ret);
ret = media_playlist_destroy(playlist_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_playlist_destroy : [%d]", ret);
+ content_error("error media_playlist_destroy : [%d]", ret);
return ret;
}
int media_count = 0;
filter_h filter;
- media_content_debug("\n============Tag Test============\n\n");
+ content_debug("\n============Tag Test============\n\n");
const char *g_condition = "TAG_NAME like \"%%my%%\"";
/* Create Tag */
ret = media_tag_insert_to_db(tag_name_1, &tag_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_insert_to_db : [%d]", ret);
+ content_error("error media_tag_insert_to_db : [%d]", ret);
ret = media_tag_insert_to_db(tag_name_2, &tag_2);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_insert_to_db : [%d]", ret);
+ content_error("error media_tag_insert_to_db : [%d]", ret);
ret = media_tag_insert_to_db(tag_name_3, &tag_3);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_insert_to_db : [%d]", ret);
+ content_error("error media_tag_insert_to_db : [%d]", ret);
/* Add media to Tag */
ret = media_tag_add_media(tag_1, test_audio_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_add_media : [%d]", ret);
+ content_error("error media_tag_add_media : [%d]", ret);
ret = media_tag_add_media(tag_1, test_video_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_add_media : [%d]", ret);
+ content_error("error media_tag_add_media : [%d]", ret);
ret = media_tag_update_to_db(tag_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_update_to_db : [%d]", ret);
+ content_error("error media_tag_update_to_db : [%d]", ret);
ret = media_tag_add_media(tag_2, test_audio_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_add_media : [%d]", ret);
+ content_error("error media_tag_add_media : [%d]", ret);
ret = media_tag_update_to_db(tag_2);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_update_to_db : [%d]", ret);
+ content_error("error media_tag_update_to_db : [%d]", ret);
/* Get Tag Count*/
ret = media_tag_get_tag_count_from_db(filter, &tag_count);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_get_tag_count_from_db : [%d]", ret);
+ content_error("error media_tag_get_tag_count_from_db : [%d]", ret);
else
- media_content_debug("tag_count [%d]", tag_count);
+ content_debug("tag_count [%d]", tag_count);
/* Get Tag*/
ret = media_tag_foreach_tag_from_db(filter, tag_list_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_foreach_tag_from_db : [%d]", ret);
+ content_error("error media_tag_foreach_tag_from_db : [%d]", ret);
/* Get Tag id*/
ret = media_tag_get_tag_id(tag_1, &tag_id_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_get_tag_id : [%d]", ret);
+ content_error("error media_tag_get_tag_id : [%d]", ret);
else
- media_content_debug("tag_id_1 [%d]", tag_id_1);
+ content_debug("tag_id_1 [%d]", tag_id_1);
ret = media_tag_get_tag_id(tag_2, &tag_id_2);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_get_tag_id : [%d]", ret);
+ content_error("error media_tag_get_tag_id : [%d]", ret);
else
- media_content_debug("tag_id_2 [%d]", tag_id_2);
+ content_debug("tag_id_2 [%d]", tag_id_2);
ret = media_tag_get_tag_id(tag_3, &tag_id_3);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_get_tag_id : [%d]", ret);
+ content_error("error media_tag_get_tag_id : [%d]", ret);
else
- media_content_debug("tag_id_3 [%d]", tag_id_3);
+ content_debug("tag_id_3 [%d]", tag_id_3);
/* Get media count */
ret = media_tag_get_media_count_from_db(tag_id_1, NULL, &media_count);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_get_media_count_from_db : [%d]", ret);
+ content_error("error media_tag_get_media_count_from_db : [%d]", ret);
else
- media_content_debug("tag_1_media_count [%d]", media_count);
+ content_debug("tag_1_media_count [%d]", media_count);
ret = media_tag_get_media_count_from_db(tag_id_2, NULL, &media_count);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_get_media_count_from_db : [%d]", ret);
+ content_error("error media_tag_get_media_count_from_db : [%d]", ret);
else
- media_content_debug("tag_2_media_count [%d]", media_count);
+ content_debug("tag_2_media_count [%d]", media_count);
/* Get media of Tag */
ret = media_tag_foreach_media_from_db(tag_id_1, NULL, media_item_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_foreach_media_from_db : [%d]", ret);
+ content_error("error media_tag_foreach_media_from_db : [%d]", ret);
ret = media_tag_foreach_media_from_db(tag_id_2, NULL, media_item_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_foreach_media_from_db : [%d]", ret);
+ content_error("error media_tag_foreach_media_from_db : [%d]", ret);
/* Update Tag */
ret = media_tag_add_media(tag_2, test_video_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_add_media : [%d]", ret);
+ content_error("error media_tag_add_media : [%d]", ret);
ret = media_tag_set_name(tag_2, "test_tag");
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_set_name : [%d]", ret);
+ content_error("error media_tag_set_name : [%d]", ret);
ret = media_tag_update_to_db(tag_2);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_update_to_db : [%d]", ret);
+ content_error("error media_tag_update_to_db : [%d]", ret);
/* Get Updated Tag*/
ret = media_tag_foreach_tag_from_db(filter, tag_list_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_foreach_tag_from_db : [%d]", ret);
+ content_error("error media_tag_foreach_tag_from_db : [%d]", ret);
/* deletes the tag */
ret = media_tag_delete_from_db(tag_id_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_delete_from_db : [%d]", ret);
+ content_error("error media_tag_delete_from_db : [%d]", ret);
ret = media_tag_delete_from_db(tag_id_2);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_delete_from_db : [%d]", ret);
+ content_error("error media_tag_delete_from_db : [%d]", ret);
ret = media_tag_destroy(tag_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_destroy : [%d]", ret);
+ content_error("error media_tag_destroy : [%d]", ret);
ret = media_tag_destroy(tag_2);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_destroy : [%d]", ret);
+ content_error("error media_tag_destroy : [%d]", ret);
ret = media_tag_destroy(tag_3);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_destroy : [%d]", ret);
+ content_error("error media_tag_destroy : [%d]", ret);
ret = media_filter_destroy(filter);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_filter_destroy : [%d]", ret);
+ content_error("error media_filter_destroy : [%d]", ret);
return ret;
}
const char *tag_name_1 = "myTag_1";
int tag_id = -1;
- media_content_debug("\n============Tag Test V2============\n\n");
+ content_debug("\n============Tag Test V2============\n\n");
/* Create Tag */
ret = media_tag_create(&tag_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_create : [%d]", ret);
+ content_error("error media_tag_create : [%d]", ret);
ret = media_tag_set_name(tag_1, tag_name_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_set_name : [%d]", ret);
+ content_error("error media_tag_set_name : [%d]", ret);
/* Add media to Tag */
ret = media_tag_add_media(tag_1, test_audio_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_add_media : [%d]", ret);
+ content_error("error media_tag_add_media : [%d]", ret);
ret = media_tag_add_media(tag_1, test_video_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_add_media : [%d]", ret);
+ content_error("error media_tag_add_media : [%d]", ret);
ret = media_tag_insert_to_db_v2(tag_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_insert_to_db_v2 : [%d]", ret);
+ content_error("error media_tag_insert_to_db_v2 : [%d]", ret);
#if 1
ret = media_tag_get_tag_id(tag_1, &tag_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_get_tag_id : [%d]", ret);
+ content_error("error media_tag_get_tag_id : [%d]", ret);
ret = media_tag_remove_media(tag_1, test_video_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_add_media : [%d]", ret);
+ content_error("error media_tag_add_media : [%d]", ret);
ret = media_tag_update_to_db_v2(tag_id, tag_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_update_to_db_v2 : [%d]", ret);
+ content_error("error media_tag_update_to_db_v2 : [%d]", ret);
#endif
ret = media_tag_destroy(tag_1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_tag_destroy : [%d]", ret);
+ content_error("error media_tag_destroy : [%d]", ret);
return ret;
}
+static void __bookmark_handle_free(gpointer data)
+{
+ media_bookmark_h handle = (media_bookmark_h) data;
+ media_bookmark_destroy(handle);
+}
+
int test_bookmark_operation(void)
{
/* bookmark is only supported for video information. */
GList *all_item_list = NULL;
int idx = 0;
- media_content_debug("\n============Bookmark Test============\n\n");
+ content_debug("\n============Bookmark Test============\n\n");
const char *g_condition = "BOOKMARK_MARKED_TIME > 300";
ret = media_filter_create(&filter);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_filter_create : [%d]", ret);
+ content_error("error media_filter_create : [%d]", ret);
ret = media_filter_set_condition(filter, g_condition, MEDIA_CONTENT_COLLATE_DEFAULT);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_filter_set_condition : [%d]", ret);
+ content_error("error media_filter_set_condition : [%d]", ret);
ret = media_filter_set_order(filter, MEDIA_CONTENT_ORDER_DESC, BOOKMARK_MARKED_TIME, MEDIA_CONTENT_COLLATE_DEFAULT);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_filter_set_order : [%d]", ret);
+ content_error("error media_filter_set_order : [%d]", ret);
/* insert bookmark to video */
const char *thumbnail_path1 = tzplatform_mkpath(TZ_USER_VIDEOS, "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);
+ content_error("error media_bookmark_insert_to_db : [%d]", ret);
ret = media_bookmark_insert_to_db(test_video_id, 600, thumbnail_path1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_insert_to_db : [%d]", ret);
+ content_error("error media_bookmark_insert_to_db : [%d]", ret);
ret = media_bookmark_get_bookmark_count_from_db(filter, &bookmark_count);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_get_bookmark_count_from_db : [%d]", ret);
+ content_error("error media_bookmark_get_bookmark_count_from_db : [%d]", ret);
else
- media_content_debug("bookmark_count = [%d]", bookmark_count);
+ content_debug("bookmark_count = [%d]", bookmark_count);
ret = media_info_foreach_bookmark_from_db(test_video_id, NULL, bookmarks_cb, &all_item_list);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_foreach_bookmark_from_db : [%d]", ret);
+ content_error("error media_info_foreach_bookmark_from_db : [%d]", ret);
for (idx = 0; idx < g_list_length(all_item_list); idx++) {
media_bookmark_h bookmark_handle;
ret = media_bookmark_set_name(bookmark_handle, "test 1");
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_set_name : [%d]", ret);
+ content_error("error media_bookmark_set_name : [%d]", ret);
ret = media_bookmark_update_to_db(bookmark_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_update_to_db : [%d]", ret);
+ content_error("error media_bookmark_update_to_db : [%d]", ret);
}
+ if (all_item_list)
+ g_list_free_full(all_item_list, __bookmark_handle_free);
+
ret = media_info_foreach_bookmark_from_db(test_video_id, NULL, bookmarks_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_info_foreach_bookmark_from_db : [%d]", ret);
+ content_error("error media_info_foreach_bookmark_from_db : [%d]", ret);
ret = media_filter_destroy(filter);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_filter_destroy : [%d]", ret);
+ content_error("error media_filter_destroy : [%d]", ret);
return ret;
}
int test_bookmark_operation_v2(void)
{
- media_content_debug("\n============Bookmark Test V2============\n\n");
+ content_debug("\n============Bookmark Test V2============\n\n");
int ret = MEDIA_CONTENT_ERROR_NONE;
media_bookmark_h bookmark = NULL;
ret = media_bookmark_create(test_video_id, 400, &bookmark);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_create : [%d]", ret);
+ content_error("error media_bookmark_create : [%d]", ret);
ret = media_bookmark_set_name(bookmark, "test bookmark");
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_set_name : [%d]", ret);
+ content_error("error media_bookmark_set_name : [%d]", ret);
ret = media_bookmark_set_thumbnail_path(bookmark, thumbnail_path1);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_set_thumbnail_path : [%d]", ret);
+ content_error("error media_bookmark_set_thumbnail_path : [%d]", ret);
ret = media_bookmark_insert_to_db_v2(bookmark);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_insert_to_db_v2 : [%d]", ret);
+ content_error("error media_bookmark_insert_to_db_v2 : [%d]", ret);
ret = media_bookmark_set_name(bookmark, "test bookmark 2");
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_set_name : [%d]", ret);
+ content_error("error media_bookmark_set_name : [%d]", ret);
ret = media_bookmark_update_to_db(bookmark);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_update_to_db : [%d]", ret);
+ content_error("error media_bookmark_update_to_db : [%d]", ret);
ret = media_bookmark_destroy(bookmark);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_bookmark_destroy : [%d]", ret);
+ content_error("error media_bookmark_destroy : [%d]", ret);
return ret;
}
int test_album_list(void)
{
- media_content_debug("\n============Album Test============\n\n");
+ content_debug("\n============Album Test============\n\n");
int ret = MEDIA_CONTENT_ERROR_NONE;
int album_count = 0;
ret = media_filter_create(&filter);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("Fail to create filter");
+ content_error("Fail to create filter");
return ret;
}
ret = media_filter_set_condition(filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_filter_destroy(filter);
- media_content_error("Fail to set condition");
+ content_error("Fail to set condition");
return ret;
}
ret = media_filter_set_order(filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_ALBUM, MEDIA_CONTENT_COLLATE_NOCASE);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_filter_destroy(filter);
- media_content_error("Fail to set order");
+ content_error("Fail to set order");
return ret;
}
media_filter_destroy(filter);
return ret;
} else {
- media_content_debug("album_count [%d]", album_count);
+ content_debug("album_count [%d]", album_count);
}
ret = media_album_foreach_album_from_db(filter, album_list_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_album_foreach_album_from_db : [%d]", ret);
+ content_error("error media_album_foreach_album_from_db : [%d]", ret);
ret = media_filter_destroy(filter);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error media_filter_destroy : [%d]", ret);
+ content_error("error media_filter_destroy : [%d]", ret);
return ret;
}
int test_group_operation(void)
{
- media_content_debug("\n============Group Test============\n\n");
+ content_debug("\n============Group Test============\n\n");
int ret = MEDIA_CONTENT_ERROR_NONE;
int group_count = 0;
ret = test_filter_create();
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("[error(0x%08x)", ret);
+ content_error("[error(0x%08x)", ret);
return ret;
}
ret = media_group_get_group_count_from_db(g_filter, idx, &group_count);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
test_filter_destroy();
- media_content_error("media_group_get_group_count_from_db fail. ret=[%d] idx=[%d]", ret, idx);
+ content_error("media_group_get_group_count_from_db fail. ret=[%d] idx=[%d]", ret, idx);
return ret;
} else {
- media_content_debug("[%2d]group_count [%d]", idx, group_count);
+ content_debug("[%2d]group_count [%d]", idx, group_count);
}
ret = media_group_foreach_group_from_db(g_filter, idx, group_list_cb, &idx);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_group_foreach_group_from_db failed: %d", ret);
+ content_error("media_group_foreach_group_from_db failed: %d", ret);
}
ret = test_filter_destroy();
/* Get all item list */
ret = media_info_foreach_media_from_db(NULL, gallery_media_item_cb, &all_item_list);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("media_info_foreach_media_from_db failed: %d", ret);
+ content_error("media_info_foreach_media_from_db failed: %d", ret);
return -1;
} else {
- media_content_debug("media_info_foreach_media_from_db success");
+ content_debug("media_info_foreach_media_from_db success");
for (i = 0; i < g_list_length(all_item_list); i++) {
media_handle = (media_info_h)g_list_nth_data(all_item_list, i);
char *path = NULL;
#endif
media_info_h media_item = NULL;
- media_content_debug("\n============DB Insert Test============\n\n");
+ content_debug("\n============DB Insert Test============\n\n");
ret = media_info_insert_to_db(path, &media_item);
if ((ret == MEDIA_CONTENT_ERROR_NONE) && (media_item != NULL)) {
- media_content_debug("Insertion is success");
+ content_debug("Insertion is success");
} else {
- media_content_error("Insertion is failed");
+ content_error("Insertion is failed");
ret = media_info_destroy(media_item);
return ret;
}
ret = media_info_get_media_id(media_item, &media_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_media_id failed: %d", ret);
+ content_error("media_info_get_media_id failed: %d", ret);
else
- media_content_debug("Media ID: %s", media_id);
+ content_debug("Media ID: %s", media_id);
SAFE_FREE(media_id);
ret = media_info_update_to_db(media_item);
if (ret == MEDIA_CONTENT_ERROR_NONE)
- media_content_debug("media_info_update_to_db is success");
+ content_debug("media_info_update_to_db is success");
else
- media_content_error("media_info_update_to_db is failed");
+ content_error("media_info_update_to_db is failed");
ret = media_info_destroy(media_item);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_destroy failed: %d", ret);
+ content_error("media_info_destroy failed: %d", ret);
return ret;
}
ret = media_info_get_media_from_db(move_media_id, &move_media);
if (ret == MEDIA_CONTENT_ERROR_NONE)
- media_content_debug("media_info_get_media_from_db success");
+ content_debug("media_info_get_media_from_db success");
else
- media_content_error("media_info_get_media_from_db failed: %d", ret);
+ content_error("media_info_get_media_from_db failed: %d", ret);
- media_content_debug("\n============DB Move Test============\n\n");
+ content_debug("\n============DB Move Test============\n\n");
if (move_media) {
ret = media_info_move_to_db(move_media, dst_path);
if (ret == MEDIA_CONTENT_ERROR_NONE)
- media_content_debug("Move is success");
+ content_debug("Move is success");
else
- media_content_error("Move is failed");
+ content_error("Move is failed");
ret = media_info_destroy(move_media);
} else {
- media_content_debug("There is no item : %s", move_media_id);
+ content_debug("There is no item : %s", move_media_id);
}
return ret;
int ret = MEDIA_CONTENT_ERROR_NONE;
g_cnt++;
- media_content_debug("=================[%d][%d]", g_media_cnt, g_cnt);
- media_content_debug("error_code [%d]", error);
- media_content_debug("thumbnail_path [%s]", path);
+ content_debug("=================[%d][%d]", g_media_cnt, g_cnt);
+ content_debug("error_code [%d]", error);
+ content_debug("thumbnail_path [%s]", path);
if (user_data != NULL) {
media_info_h media = (media_info_h)user_data;
ret = media_info_get_thumbnail_path(media, &thumbnail_path);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_thumbnail_path failed: %d", ret);
+ content_error("media_info_get_thumbnail_path failed: %d", ret);
else
- media_content_debug("thumbnail_path get from media[%s]", thumbnail_path);
+ content_debug("thumbnail_path get from media[%s]", thumbnail_path);
SAFE_FREE(thumbnail_path);
ret = media_info_destroy(media);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_destroy failed: %d", ret);
+ content_error("media_info_destroy failed: %d", ret);
}
if (g_cnt == g_media_cnt)
int ret = MEDIA_CONTENT_ERROR_NONE;
if (media == NULL) {
- media_content_debug("NO Item");
+ content_debug("NO Item");
return true;
}
ret = media_info_get_media_id(media, &media_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_media_id failed: %d", ret);
+ content_error("media_info_get_media_id failed: %d", ret);
else
- media_content_debug("media_id : [%s]", media_id);
+ content_debug("media_id : [%s]", media_id);
ret = media_info_clone(&dst, media);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_clone failed: %d", ret);
+ content_error("media_info_clone failed: %d", ret);
else {
ret = media_info_create_thumbnail(dst, thumbnail_completed_cb, dst);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_create_thumbnail failed: %d", ret);
+ content_error("media_info_create_thumbnail failed: %d", ret);
}
/* fix prevent: Resource leak */
g_cnt++;
if (media == NULL) {
- media_content_debug("NO Item");
+ content_debug("NO Item");
return true;
}
ret = media_info_get_media_id(media, &media_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_media_id failed: %d", ret);
+ content_error("media_info_get_media_id failed: %d", ret);
else
- media_content_debug("media_id : [%s]", media_id);
+ content_debug("media_id : [%s]", media_id);
ret = media_info_clone(&dst, media);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_clone failed: %d", ret);
+ content_error("media_info_clone failed: %d", ret);
ret = media_info_cancel_thumbnail(dst);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_cancel_thumbnail failed: %d", ret);
+ content_error("media_info_cancel_thumbnail failed: %d", ret);
ret = media_info_destroy(dst);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_destroy failed: %d", ret);
+ content_error("media_info_destroy failed: %d", ret);
if (g_cnt == g_media_cnt)
g_main_loop_quit(g_loop);
ret = media_info_foreach_media_from_db(g_filter, thumbnail_create_cb, NULL);
if (ret == MEDIA_CONTENT_ERROR_NONE)
- media_content_debug("media_info_foreach_media_from_db is success");
+ content_debug("media_info_foreach_media_from_db is success");
else
- media_content_error("media_info_foreach_media_from_db is failed");
+ content_error("media_info_foreach_media_from_db is failed");
return false;
}
ret = media_info_foreach_media_from_db(g_filter, thumbnail_cancel_cb, NULL);
if (ret == MEDIA_CONTENT_ERROR_NONE)
- media_content_debug("media_info_foreach_media_from_db is success");
+ content_debug("media_info_foreach_media_from_db is success");
else
- media_content_error("media_info_foreach_media_from_db is failed");
+ content_error("media_info_foreach_media_from_db is failed");
return false;
}
ret = media_info_get_media_count_from_db(g_filter, &g_media_cnt);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_media_count_from_db failed: %d", ret);
+ content_error("media_info_get_media_count_from_db failed: %d", ret);
else
- media_content_debug("media_count : [%d]", g_media_cnt);
+ content_debug("media_count : [%d]", g_media_cnt);
g_loop = g_main_loop_new(NULL, FALSE);
context = g_main_loop_get_context(g_loop);
int ret = MEDIA_CONTENT_ERROR_NONE;
g_cnt++;
- media_content_debug("=================[%d][%d]", g_media_cnt, g_cnt);
- media_content_debug("error_code [%d]", error);
- media_content_debug("face_count [%d]", count);
+ content_debug("=================[%d][%d]", g_media_cnt, g_cnt);
+ content_debug("error_code [%d]", error);
+ content_debug("face_count [%d]", count);
if (count == 0) {
- media_content_debug("No faces are detected!");
+ content_debug("No faces are detected!");
} else if (user_data != NULL) {
media_info_h media = (media_info_h)user_data;
char *media_id = NULL;
ret = media_info_get_media_id(media, &media_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_media_id failed: %d", ret);
+ content_error("media_info_get_media_id failed: %d", ret);
if (media_id != NULL) {
ret = media_info_foreach_face_from_db(media_id, NULL, face_cb, NULL);
SAFE_FREE(media_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_foreach_face_from_db failed: %d", ret);
+ content_error("media_info_foreach_face_from_db failed: %d", ret);
}
ret = media_info_destroy(media);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_destroy failed: %d", ret);
+ content_error("media_info_destroy failed: %d", ret);
}
if (g_cnt == g_media_cnt)
int ret = MEDIA_CONTENT_ERROR_NONE;
if (media == NULL) {
- media_content_debug("NO Item");
+ content_debug("NO Item");
return true;
}
ret = media_info_get_media_id(media, &media_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_media_id failed: %d", ret);
+ content_error("media_info_get_media_id failed: %d", ret);
else
- media_content_debug("media_id : [%s]", media_id);
+ content_debug("media_id : [%s]", media_id);
ret = media_info_clone(&dst, media);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_clone failed: %d", ret);
+ content_error("media_info_clone failed: %d", ret);
GList **list = (GList**)user_data;
*list = g_list_append(*list, dst);
g_cnt++;
if (media == NULL) {
- media_content_debug("NO Item");
+ content_debug("NO Item");
return true;
}
ret = media_info_get_media_id(media, &media_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_media_id failed: %d", ret);
+ content_error("media_info_get_media_id failed: %d", ret);
else
- media_content_debug("media_id : [%s]", media_id);
+ content_debug("media_id : [%s]", media_id);
ret = media_info_clone(&dst, media);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_clone failed: %d", ret);
+ content_error("media_info_clone failed: %d", ret);
ret = media_info_cancel_face_detection(dst);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_cancel_face_detection failed: %d", ret);
+ content_error("media_info_cancel_face_detection failed: %d", ret);
ret = media_info_destroy(dst);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_destroy failed: %d", ret);
+ content_error("media_info_destroy failed: %d", ret);
if (g_cnt == g_media_cnt)
g_main_loop_quit(g_loop);
ret = media_info_foreach_media_from_db(g_filter, start_face_detection_cb, &all_item_list);
if (ret == MEDIA_CONTENT_ERROR_NONE)
- media_content_debug("media_info_foreach_media_from_db is success");
+ content_debug("media_info_foreach_media_from_db is success");
else
- media_content_error("media_info_foreach_media_from_db is failed");
+ content_error("media_info_foreach_media_from_db is failed");
for (idx = 0; idx < g_list_length(all_item_list); idx++) {
media_info_h media_handle = NULL;
ret = media_info_start_face_detection(media_handle, face_detection_complete_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_start_face_detection failed: %d", ret);
+ content_error("media_info_start_face_detection failed: %d", ret);
}
ret = media_info_foreach_media_from_db(g_filter, cancel_face_detection_cb, NULL);
if (ret == MEDIA_CONTENT_ERROR_NONE)
- media_content_debug("media_info_foreach_media_from_db is success");
+ content_debug("media_info_foreach_media_from_db is success");
else
- media_content_error("media_info_foreach_media_from_db is failed");
+ content_error("media_info_foreach_media_from_db is failed");
return false;
}
ret = media_info_get_media_count_from_db(g_filter, &g_media_cnt);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_media_count_from_db failed: %d", ret);
+ content_error("media_info_get_media_count_from_db failed: %d", ret);
else
- media_content_debug("media_count : [%d]", g_media_cnt);
+ content_debug("media_count : [%d]", g_media_cnt);
if (g_media_cnt == 0)
goto END;
return ret;
}
+int test_ebook_text_finder(const char *keyword)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ char **book_path_list = NULL;
+ unsigned int book_path_len = 0;
+ unsigned int i = 0;
+ media_info_h media = NULL;
+ book_meta_h book = NULL;
+ char *s_value = NULL;
+ long long ms_time = 0;
+ struct timeval start_time;
+ struct timeval end_time;
+
+ gettimeofday(&start_time, NULL);
+
+ ret = book_meta_get_path_with_keyword(keyword, &book_path_list, &book_path_len);
+ if (ret == MEDIA_CONTENT_ERROR_NONE)
+ content_debug("book_meta_get_path_with_keyword is success");
+ else
+ content_error("book_meta_get_path_with_keyword is failed");
+
+ gettimeofday(&end_time, NULL);
+
+ for (i = 0; i < book_path_len; i++) {
+ ret = media_info_get_media_from_db_by_path(book_path_list[i], &media);
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
+ continue;
+
+ content_debug("===============================");
+ content_debug("[%d] %s", i, book_path_list[i]);
+ content_debug("===============================");
+ media_info_get_title(media, &s_value);
+ content_debug("Title : %s", s_value);
+ g_free(s_value);
+ s_value = NULL;
+
+ ret = media_info_get_book(media, &book);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ media_info_destroy(media);
+ continue;
+ }
+
+ ret = book_meta_get_author(book, &s_value);
+ if (ret == MEDIA_CONTENT_ERROR_NONE && s_value) {
+ content_debug("Author : %s", s_value);
+ g_free(s_value);
+ s_value = NULL;
+ }
+
+ ret = book_meta_get_date(book, &s_value);
+ if (ret == MEDIA_CONTENT_ERROR_NONE && s_value) {
+ content_debug("Date : %s", s_value);
+ g_free(s_value);
+ s_value = NULL;
+ }
+
+ content_debug("===============================");
+ ret = book_meta_destroy(book);
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
+ content_error("book_meta_destroy failed");
+
+ ret = media_info_destroy(media);
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
+ content_error("media_info_destroy failed");
+
+ g_free(book_path_list[i]);
+ }
+
+ ms_time = (end_time.tv_sec * 1000LL + end_time.tv_usec / 1000) - (start_time.tv_sec * 1000LL + start_time.tv_usec/ 1000);
+ content_debug("Search Time [%lld]", ms_time);
+
+ g_free(book_path_list);
+
+ return ret;
+}
int test_disconnect_database(void)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- media_content_debug("\n============DB Disconnection Test============\n\n");
+ content_debug("\n============DB Disconnection Test============\n\n");
ret = media_content_disconnect();
if (ret == MEDIA_CONTENT_ERROR_NONE)
- media_content_debug("disconnection is success");
+ content_debug("disconnection is success");
else
- media_content_error("disconnection is failed");
+ content_error("disconnection is failed");
return ret;
}
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);
+ content_error("media_info_get_media_from_db 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);
+ 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");
+ content_debug("media_info_update_to_db is success");
else
- media_content_error("media_info_update_to_db is failed");
+ content_error("media_info_update_to_db is failed");
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);
+ content_error("media_info_get_media_from_db failed: %d", ret);
ret = media_info_get_favorite(media, &favorite);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_favorite failed: %d", ret);
+ content_error("media_info_get_favorite failed: %d", ret);
else
- media_content_debug("favorite [%d]", favorite);
+ content_debug("favorite [%d]", favorite);
ret = media_info_destroy(media);
return ret;
}
-int g_total_photo_size = 0;
-int g_total_video_size = 0;
-int g_total_mp3_size = 0;
-int g_total_voice_memo_size = 0;
+static int g_total_photo_size = 0;
+static int g_total_video_size = 0;
+static int g_total_mp3_size = 0;
+static int g_total_voice_memo_size = 0;
bool dft_cb(media_info_h media, void *user_data)
{
ret = media_info_get_media_type(media, &media_type);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_media_type failed: %d", ret);
+ content_error("media_info_get_media_type failed: %d", ret);
ret = media_info_get_size(media, &file_size);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_size failed: %d", ret);
+ content_error("media_info_get_size failed: %d", ret);
ret = media_info_get_mime_type(media, &mime_type);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_mime_type failed: %d", ret);
+ content_error("media_info_get_mime_type failed: %d", ret);
if (media_type == MEDIA_CONTENT_TYPE_IMAGE)
g_total_photo_size += file_size;
else
g_total_voice_memo_size += file_size;
} else
- media_content_debug("invalid media_type");
+ content_debug("invalid media_type");
SAFE_FREE(mime_type);
int DFT_test(void)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- media_content_debug("\n============DFT_test============\n\n");
+ content_debug("\n============DFT_test============\n\n");
filter_h filter = NULL;
int media_cnt = 0;
ret = media_filter_create(&filter);
/*Internal Memory*/
- media_content_debug("[Internal Memory]\n");
+ 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);
- media_content_debug("Photo count = [%d]\n", media_cnt);
+ content_debug("Photo count = [%d]\n", media_cnt);
/*Get Photo Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- media_content_debug("Photo size = [%d]\n", g_total_photo_size);
+ 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);
- media_content_debug("Video count = [%d]\n", media_cnt);
+ content_debug("Video count = [%d]\n", media_cnt);
/*Get Video Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- media_content_debug("Video size = [%d]\n", g_total_video_size);
+ 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);
- media_content_debug("MP3 count = [%d]\n", media_cnt);
+ content_debug("MP3 count = [%d]\n", media_cnt);
/*Get MP3 Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- media_content_debug("MP3 size = [%d]\n", g_total_mp3_size);
+ 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);
- media_content_debug("Voice Memo count = [%d]\n", media_cnt);
+ content_debug("Voice Memo count = [%d]\n", media_cnt);
/*Get Voice Memo Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- media_content_debug("Voice Memo size = [%d]\n", g_total_voice_memo_size);
+ 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*/
- media_content_debug("\n[External Memory]\n");
+ 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);
- media_content_debug("Photo count = [%d]\n", media_cnt);
+ content_debug("Photo count = [%d]\n", media_cnt);
/*Get Photo Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- media_content_debug("Photo size = [%d]\n", g_total_photo_size);
+ 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);
- media_content_debug("Video count = [%d]\n", media_cnt);
+ content_debug("Video count = [%d]\n", media_cnt);
/*Get Video Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- media_content_debug("Video size = [%d]\n", g_total_video_size);
+ 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);
- media_content_debug("MP3 count = [%d]\n", media_cnt);
+ content_debug("MP3 count = [%d]\n", media_cnt);
/*Get MP3 Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- media_content_debug("MP3 size = [%d]\n", g_total_mp3_size);
+ 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);
- media_content_debug("Voice Memo count = [%d]\n", media_cnt);
+ content_debug("Voice Memo count = [%d]\n", media_cnt);
/*Get Voice Memo Size*/
ret = media_info_foreach_media_from_db(filter, dft_cb, NULL);
- media_content_debug("Voice Memo size = [%d]\n", g_total_voice_memo_size);
+ content_debug("Voice Memo size = [%d]\n", g_total_voice_memo_size);
ret = media_filter_destroy(filter);
return ret;
void insert_batch_cb(media_content_error_e error, void * user_data)
{
- media_content_debug("media_info_insert_batch_to_db completed!\n");
+ content_debug("media_info_insert_batch_to_db completed!\n");
}
int test_batch_operations()
for (i = 0; i < 10; i++) {
file_list[i] = g_strdup_printf("%s%d.jpg", tzplatform_mkpath(TZ_USER_CONTENT, "test/image"), i+1);
- media_content_debug("File : %s\n", file_list[i]);
+ content_debug("File : %s\n", file_list[i]);
}
ret = media_info_insert_batch_to_db((const char **)file_list, 10, insert_batch_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_insert_batch_to_db failed : %d\n", ret);
+ content_error("media_info_insert_batch_to_db failed : %d\n", ret);
for (i = 0; i < 10; i++)
g_free(file_list[i]);
void _scan_cb(media_content_error_e err, void *user_data)
{
- media_content_debug("scan callback is called : %d\n", err);
+ content_debug("scan callback is called : %d\n", err);
g_main_loop_quit(g_loop);
return;
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);
+ content_error("Fail to media_content_scan_file : %d", ret);
return ret;
}
ret = media_content_scan_folder(dir_path, TRUE, _scan_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("Fail to test_scan_dir_start : %d", ret);
+ content_error("Fail to test_scan_dir_start : %d", ret);
return ret;
}
ret = media_content_cancel_scan_folder(dir_path);
if (ret == MEDIA_CONTENT_ERROR_NONE)
- media_content_debug("media_content_cancel_scan_folder is success");
+ content_debug("media_content_cancel_scan_folder is success");
else
- media_content_error("media_content_cancel_scan_folder is failed");
+ content_error("media_content_cancel_scan_folder is failed");
return false;
}
void *user_data)
{
if (error == 0)
- media_content_debug("noti success! : %d\n", error);
+ content_debug("noti success! : %d\n", error);
else
- media_content_debug("error occured! : %d\n", error);
+ content_debug("error occurred! : %d\n", error);
- media_content_debug("Noti from PID(%d)\n", pid);
+ content_debug("Noti from PID(%d)\n", pid);
if (update_item == MEDIA_ITEM_FILE)
- media_content_debug("Noti item : MEDIA_ITEM_FILE\n");
+ content_debug("Noti item : MEDIA_ITEM_FILE\n");
else if (update_item == MEDIA_ITEM_DIRECTORY)
- media_content_debug("Noti item : MEDIA_ITEM_DIRECTORY\n");
+ content_debug("Noti item : MEDIA_ITEM_DIRECTORY\n");
if (update_type == MEDIA_CONTENT_INSERT)
- media_content_debug("Noti type : MEDIA_CONTENT_INSERT\n");
+ content_debug("Noti type : MEDIA_CONTENT_INSERT\n");
else if (update_type == MEDIA_CONTENT_DELETE)
- media_content_debug("Noti type : MEDIA_CONTENT_DELETE\n");
+ content_debug("Noti type : MEDIA_CONTENT_DELETE\n");
else if (update_type == MEDIA_CONTENT_UPDATE)
- media_content_debug("Noti type : MEDIA_CONTENT_UPDATE\n");
+ content_debug("Noti type : MEDIA_CONTENT_UPDATE\n");
- media_content_debug("content type : %d\n", media_type);
+ content_debug("content type : %d\n", media_type);
if (path)
- media_content_debug("path : %s\n", path);
+ content_debug("path : %s\n", path);
else
- media_content_debug("path not\n");
+ content_debug("path not\n");
if (uuid)
- media_content_debug("uuid : %s\n", uuid);
+ content_debug("uuid : %s\n", uuid);
else
- media_content_debug("uuid not\n");
+ content_debug("uuid not\n");
if (mime_type)
- media_content_debug("mime_type : %s\n", mime_type);
+ content_debug("mime_type : %s\n", mime_type);
else
- media_content_debug("mime not\n");
+ content_debug("mime not\n");
- if (user_data) media_content_debug("String : %s\n", (char *)user_data);
+ if (user_data) content_debug("String : %s\n", (char *)user_data);
return;
}
void *user_data)
{
if (error == 0)
- media_content_debug("noti_2 success! : %d\n", error);
+ content_debug("noti_2 success! : %d\n", error);
else
- media_content_debug("error occured! : %d\n", error);
+ content_debug("error occurred! : %d\n", error);
- media_content_debug("Noti_2 from PID(%d)\n", pid);
+ content_debug("Noti_2 from PID(%d)\n", pid);
g_main_loop_quit(g_loop);
return;
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);
+ 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");
+ content_debug("media_info_insert_to_db success");
media_content_remove_db_updated_cb(noti_h);
/* 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);
+ content_error("media_info_update_to_db failed : %d\n", ret);
media_info_destroy(media_item);
return ret;
}
int i = 0;
ret = media_filter_create(&filter);
- media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "fail media_filter_create");
+ content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "fail media_filter_create");
ret = media_filter_set_condition(filter, "MEDIA_TYPE = 0", MEDIA_CONTENT_COLLATE_DEFAULT);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_filter_destroy(filter);
- media_content_error("Fail to set condition");
+ content_error("Fail to set condition");
return ret;
}
ret = media_info_foreach_media_from_db(filter, gallery_media_item_cb, &all_item_list);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
- media_content_error("media_info_foreach_media_from_db failed: %d", ret);
+ content_error("media_info_foreach_media_from_db failed: %d", ret);
media_filter_destroy(filter);
return ret;
}
ret = media_info_get_media_id(media_handle, &media_id);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_media_id failed: %d", ret);
+ content_error("media_info_get_media_id failed: %d", ret);
ret = media_info_get_face_count_from_db(media_id, filter, &face_count);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_get_face_count_from_db failed: %d", ret);
+ content_error("media_info_get_face_count_from_db failed: %d", ret);
- media_content_error("media_id [%s] face_count [%d]", media_id, face_count);
+ content_error("media_id [%s] face_count [%d]", media_id, face_count);
ret = media_info_foreach_face_from_db(media_id, filter, media_face_test_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_info_foreach_face_from_db failed: %d", ret);
+ content_error("media_info_foreach_face_from_db failed: %d", ret);
media_info_destroy(media_handle);
}
char *face_tag = "test_face_tag";
ret = media_face_create(media_id, &face);
- media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "fail media_face_create");
+ content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "fail media_face_create");
ret = media_face_set_face_rect(face, 10, 12, 50, 100);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_face_set_face_rect failed: %d", ret);
+ content_error("media_face_set_face_rect failed: %d", ret);
ret = media_face_set_orientation(face, 5);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_face_set_orientation failed: %d", ret);
+ content_error("media_face_set_orientation failed: %d", ret);
ret = media_face_set_tag(face, face_tag);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_face_set_tag failed: %d", ret);
+ content_error("media_face_set_tag failed: %d", ret);
ret = media_face_insert_to_db(face);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_face_insert_to_db failed: %d", ret);
+ content_error("media_face_insert_to_db failed: %d", ret);
ret = media_face_destroy(face);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_face_destroy failed: %d", ret);
+ content_error("media_face_destroy failed: %d", ret);
/* Update Test */
GList *all_item_list = NULL;
filter_h filter = NULL;
ret = media_filter_create(&filter);
- media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "fail media_filter_create");
+ content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "fail media_filter_create");
ret = media_filter_set_condition(filter, "MEDIA_FACE_TAG IS NOT NULL", MEDIA_CONTENT_COLLATE_DEFAULT);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
media_filter_destroy(filter);
- media_content_error("Fail to set condition");
+ content_error("Fail to set condition");
return ret;
}
ret = media_face_set_face_rect(face_handle, 20, 22, 70, 70);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_face_set_face_rect failed: %d", ret);
+ content_error("media_face_set_face_rect failed: %d", ret);
ret = media_face_set_orientation(face_handle, 3);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_face_set_orientation failed: %d", ret);
+ content_error("media_face_set_orientation failed: %d", ret);
ret = media_face_set_tag(face_handle, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_face_set_tag failed: %d", ret);
+ content_error("media_face_set_tag failed: %d", ret);
ret = media_face_update_to_db(face_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_face_update_to_db failed: %d", ret);
+ content_error("media_face_update_to_db failed: %d", ret);
media_face_destroy(face_handle);
}
int test_tv_filter_create(void)
{
- media_content_debug("\n============Filter Create============\n\n");
+ content_debug("\n============Filter Create============\n\n");
int ret = MEDIA_CONTENT_ERROR_NONE;
ret = media_filter_set_storage(g_tv_filter, "0a22a163-e634-4a2e-ba14-0469a969eea0");
- ret = media_filter_set_order(g_tv_filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_STORAGE_ID, MEDIA_CONTENT_COLLATE_DEFAULT);
+ ret = media_filter_set_order(g_tv_filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_TITLE, MEDIA_CONTENT_COLLATE_DEFAULT);
return ret;
}
int test_tv_filter_destroy(void)
{
- media_content_debug("\n============Filter Destroy============\n\n");
+ content_debug("\n============Filter Destroy============\n\n");
int ret = MEDIA_CONTENT_ERROR_NONE;
unsigned long long l_value = 0;
if (pvr == NULL) {
- media_content_debug("NO Item");
+ content_debug("NO Item");
return true;
}
ret = media_pvr_get_media_id(pvr, &c_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_media_id");
- media_content_debug("media_id [%s]", c_value);
+ content_error("Fail to media_pvr_get_media_id");
+ content_debug("media_id [%s]", c_value);
SAFE_FREE(c_value);
ret = media_pvr_get_channel_name(pvr, &c_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_channel_name");
- media_content_debug("channel_name [%s]", c_value);
+ content_error("Fail to media_pvr_get_channel_name");
+ content_debug("channel_name [%s]", c_value);
SAFE_FREE(c_value);
ret = media_pvr_get_program_title(pvr, &c_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_program_title");
- media_content_debug("program_title [%s]", c_value);
+ content_error("Fail to media_pvr_get_program_title");
+ content_debug("program_title [%s]", c_value);
SAFE_FREE(c_value);
ret = media_pvr_get_program_crid(pvr, &c_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_program_crid");
- media_content_debug("program_crid [%s]", c_value);
+ content_error("Fail to media_pvr_get_program_crid");
+ content_debug("program_crid [%s]", c_value);
SAFE_FREE(c_value);
ret = media_pvr_get_guidance(pvr, &c_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_guidance");
- media_content_debug("guidance [%s]", c_value);
+ content_error("Fail to media_pvr_get_guidance");
+ content_debug("guidance [%s]", c_value);
SAFE_FREE(c_value);
ret = media_pvr_get_synopsis(pvr, &c_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_synopsis");
- media_content_debug("synopsis [%s]", c_value);
+ content_error("Fail to media_pvr_get_synopsis");
+ content_debug("synopsis [%s]", c_value);
SAFE_FREE(c_value);
ret = media_pvr_get_genre(pvr, &c_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_synopsis");
- media_content_debug("genre [%s]", c_value);
+ content_error("Fail to media_pvr_get_synopsis");
+ content_debug("genre [%s]", c_value);
SAFE_FREE(c_value);
ret = media_pvr_get_language(pvr, &c_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_language");
- media_content_debug("language [%s]", c_value);
+ content_error("Fail to media_pvr_get_language");
+ content_debug("language [%s]", c_value);
SAFE_FREE(c_value);
ret = media_pvr_get_path(pvr, &c_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_path");
- media_content_debug("path [%s]", c_value);
+ content_error("Fail to media_pvr_get_path");
+ content_debug("path [%s]", c_value);
SAFE_FREE(c_value);
ret = media_pvr_get_storage_id(pvr, &c_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_storage_id");
- media_content_debug("storage_id [%s]", c_value);
+ content_error("Fail to media_pvr_get_storage_id");
+ content_debug("storage_id [%s]", c_value);
SAFE_FREE(c_value);
ret = media_pvr_get_size(pvr, &l_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_size");
- media_content_debug("size [%lld]", l_value);
+ content_error("Fail to media_pvr_get_size");
+ content_debug("size [%lld]", l_value);
ret = media_pvr_get_timezone(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_timezone");
- media_content_debug("timezone [%d]", i_value);
+ content_error("Fail to media_pvr_get_timezone");
+ content_debug("timezone [%d]", i_value);
ret = media_pvr_get_ptc(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_ptc");
- media_content_debug("ptc [%d]", i_value);
+ content_error("Fail to media_pvr_get_ptc");
+ content_debug("ptc [%d]", i_value);
ret = media_pvr_get_major(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_major");
- media_content_debug("[%d]", i_value);
+ content_error("Fail to media_pvr_get_major");
+ content_debug("[%d]", i_value);
ret = media_pvr_get_minor(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_minor");
- media_content_debug("minor [%d]", i_value);
+ content_error("Fail to media_pvr_get_minor");
+ content_debug("minor [%d]", i_value);
ret = media_pvr_get_channel_type(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_channel_type");
- media_content_debug("channel_type [%d]", i_value);
+ content_error("Fail to media_pvr_get_channel_type");
+ content_debug("channel_type [%d]", i_value);
ret = media_pvr_get_program_num(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_program_num");
- media_content_debug("program_num [%d]", i_value);
+ content_error("Fail to media_pvr_get_program_num");
+ content_debug("program_num [%d]", i_value);
unsigned int ui_value = 0;
ret = media_pvr_get_service_profile(pvr, &ui_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_service_profile");
- media_content_debug("service_profile [%u]", ui_value);
+ content_error("Fail to media_pvr_get_service_profile");
+ content_debug("service_profile [%u]", ui_value);
ret = media_pvr_get_duration(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_duration");
- media_content_debug("duration [%d]", i_value);
+ content_error("Fail to media_pvr_get_duration");
+ content_debug("duration [%d]", i_value);
ret = media_pvr_get_embargo_time(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_embargo_time");
- media_content_debug("embargo_time [%d]", i_value);
+ content_error("Fail to media_pvr_get_embargo_time");
+ content_debug("embargo_time [%d]", i_value);
ret = media_pvr_get_expiry_time(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_expiry_time");
- media_content_debug("expiry_time [%d]", i_value);
+ content_error("Fail to media_pvr_get_expiry_time");
+ content_debug("expiry_time [%d]", i_value);
ret = media_pvr_get_parental_rating(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_parental_rating");
- media_content_debug("parental_rating [%d]", i_value);
+ content_error("Fail to media_pvr_get_parental_rating");
+ content_debug("parental_rating [%d]", i_value);
ret = media_pvr_get_start_time(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_start_time");
- media_content_debug("start_time [%d]", i_value);
+ content_error("Fail to media_pvr_get_start_time");
+ content_debug("start_time [%d]", i_value);
ret = media_pvr_get_program_start_time(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_program_start_time");
- media_content_debug("program_start_time [%d]", i_value);
+ content_error("Fail to media_pvr_get_program_start_time");
+ content_debug("program_start_time [%d]", i_value);
ret = media_pvr_get_program_end_time(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_program_end_time");
- media_content_debug("program_end_time [%d]", i_value);
+ content_error("Fail to media_pvr_get_program_end_time");
+ content_debug("program_end_time [%d]", i_value);
ret = media_pvr_get_program_date(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_program_date");
- media_content_debug("program_date [%d]", i_value);
+ content_error("Fail to media_pvr_get_program_date");
+ content_debug("program_date [%d]", i_value);
ret = media_pvr_get_timer_record(pvr, &b_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_timer_record");
- media_content_debug("timer_record [%d]", b_value);
+ content_error("Fail to media_pvr_get_timer_record");
+ content_debug("timer_record [%d]", b_value);
ret = media_pvr_get_series_record(pvr, &b_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_series_record");
- media_content_debug("series_record [%d]", b_value);
+ content_error("Fail to media_pvr_get_series_record");
+ content_debug("series_record [%d]", b_value);
ret = media_pvr_get_hd(pvr, &i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_hd");
- media_content_debug("hd [%d]", i_value);
+ content_error("Fail to media_pvr_get_hd");
+ content_debug("hd [%d]", i_value);
ret = media_pvr_get_subtitle(pvr, &b_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_subtitle");
- media_content_debug("subtitle [%d]", b_value);
+ content_error("Fail to media_pvr_get_subtitle");
+ content_debug("subtitle [%d]", b_value);
ret = media_pvr_get_ttx(pvr, &b_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_ttx");
- media_content_debug("ttx [%d]", b_value);
+ content_error("Fail to media_pvr_get_ttx");
+ content_debug("ttx [%d]", b_value);
ret = media_pvr_get_ad(pvr, &b_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_ad");
- media_content_debug("ad [%d]", b_value);
+ content_error("Fail to media_pvr_get_ad");
+ content_debug("ad [%d]", b_value);
ret = media_pvr_get_hard_of_hearing_radio(pvr, &b_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_hard_of_hearing_radio");
- media_content_debug("hard_of_hearing_radio [%d]", b_value);
+ content_error("Fail to media_pvr_get_hard_of_hearing_radio");
+ content_debug("hard_of_hearing_radio [%d]", b_value);
ret = media_pvr_get_data_service(pvr, &b_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_data_service");
- media_content_debug("data_service [%d]", b_value);
+ content_error("Fail to media_pvr_get_data_service");
+ content_debug("data_service [%d]", b_value);
ret = media_pvr_get_content_lock(pvr, &b_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_content_lock");
- media_content_debug("content_lock [%d]", b_value);
+ content_error("Fail to media_pvr_get_content_lock");
+ content_debug("content_lock [%d]", b_value);
ret = media_pvr_get_content_watch(pvr, &b_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_content_watch");
- media_content_debug("content_watch [%d]", b_value);
+ content_error("Fail to media_pvr_get_content_watch");
+ content_debug("content_watch [%d]", b_value);
ret = media_pvr_get_has_audio_only(pvr, &b_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_has_audio_only");
- media_content_debug("has_audio_only [%d]", b_value);
+ content_error("Fail to media_pvr_get_has_audio_only");
+ content_debug("has_audio_only [%d]", b_value);
ret = media_pvr_get_is_local_record(pvr, &b_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_is_local_record");
- media_content_debug("is_local_record [%d]", b_value);
+ content_error("Fail to media_pvr_get_is_local_record");
+ content_debug("is_local_record [%d]", b_value);
ret = media_pvr_get_resolution(pvr, (media_pvr_resolution_e*)&i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_resolution");
- media_content_debug("resolution [%d]", i_value);
+ content_error("Fail to media_pvr_get_resolution");
+ content_debug("resolution [%d]", i_value);
ret = media_pvr_get_aspectratio(pvr, (media_pvr_aspectratio_e*)&i_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_aspectratio");
- media_content_debug("aspectratio [%d]", i_value);
+ content_error("Fail to media_pvr_get_aspectratio");
+ content_debug("aspectratio [%d]", i_value);
ret = media_pvr_get_highlight(pvr, &b_value);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_get_highlight");
- media_content_debug("highlight [%d]", b_value);
+ content_error("Fail to media_pvr_get_highlight");
+ content_debug("highlight [%d]", b_value);
return TRUE;
int ret = MEDIA_CONTENT_ERROR_NONE;
int media_count = 0;
- media_content_debug("\n============PVR Test============\n\n");
+ content_debug("\n============PVR Test============\n\n");
test_tv_filter_create();
ret = media_pvr_get_media_count_from_db(g_tv_filter, &media_count);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_pvr_get_media_count_from_db failed: %d", ret);
+ content_error("media_pvr_get_media_count_from_db failed: %d", ret);
else
- media_content_debug("media_count : [%d]", media_count);
+ content_debug("media_count : [%d]", media_count);
ret = media_pvr_foreach_media_from_db(g_tv_filter, pvr_item_cb, NULL);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_pvr_foreach_media_from_db is failed");
+ content_error("media_pvr_foreach_media_from_db is failed");
test_tv_filter_destroy();
ret = media_pvr_get_pvr_from_db("ff9b5a9a-a7b4-47f4-8255-84e007e25f13", &pvr);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("media_pvr_get_pvr_from_db failed: %d", ret);
+ content_error("media_pvr_get_pvr_from_db failed: %d", ret);
ret = media_pvr_set_content_lock(pvr, TRUE);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_set_content_lock");
+ content_error("Fail to media_pvr_set_content_lock");
ret = media_pvr_set_content_watch(pvr, TRUE);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_set_content_watch");
+ content_error("Fail to media_pvr_set_content_watch");
ret = media_pvr_set_program_title(pvr, "TEST TITLE");
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_set_program_title");
+ content_error("Fail to media_pvr_set_program_title");
ret = media_pvr_set_highlight(pvr, TRUE);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_set_highlight");
+ content_error("Fail to media_pvr_set_highlight");
ret = media_pvr_update_to_db(pvr);
if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("Fail to media_pvr_update_to_db");
+ content_error("Fail to media_pvr_update_to_db");
if (pvr != NULL)
media_pvr_destroy(pvr);
{
int ret = MEDIA_CONTENT_ERROR_NONE;
- media_content_debug("--- content manager test start ---\n\n");
+ content_debug("--- content manager test start ---\n\n");
ret = test_connect_database();
if (ret != MEDIA_CONTENT_ERROR_NONE)
#endif
#if 0
+ if (argc == 2) {
+ ret = test_ebook_text_finder(argv[1]);
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
+ return ret;
+ }
+
ret = test_start_face_detection(FALSE);
if (ret != MEDIA_CONTENT_ERROR_NONE)
return ret;
if (ret != MEDIA_CONTENT_ERROR_NONE)
return ret;
- media_content_debug("--- content manager test end ---\n");
+ content_debug("--- content manager test end ---\n");
return ret;
}