#define test_image_id "db1c184c-6f31-43b4-b924-8c00ac5b6197"
media_folder_h g_folder = NULL;
-bool get_audio_meta(audio_meta_h audio)
+void get_audio_meta(audio_meta_h audio)
{
char *c_value = NULL;
int i_value = 0;
media_content_error("error when get meta : [%d]", ret);
media_content_debug("duration : [%d]", i_value);
- return true;
}
-bool get_video_meta(video_meta_h video)
+void get_video_meta(video_meta_h video)
{
char *c_value = NULL;
int i_value = 0;
media_content_error("error when get meta : [%d]", ret);
media_content_debug("height : [%d]", i_value);
- return true;
+}
+
+void get_image_meta(image_meta_h image)
+{
+ char *c_value = NULL;
+ int i_value = 0;
+ media_content_orientation_e orientation;
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+
+ media_content_debug("=== image meta ===");
+
+ ret = image_meta_get_width(image, &i_value);
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("error image_meta_get_width : [%d]", ret);
+ media_content_debug("width : [%d]", i_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);
+ media_content_debug("height : [%d]", i_value);
+
+ ret = image_meta_get_orientation(image, &orientation);
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
+ media_content_error("error image_meta_get_orientation : [%d]", ret);
+ media_content_debug("orientation : [%d]", orientation);
+
+ 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);
+ media_content_debug("date_taken : [%s]", c_value);
+ SAFE_FREE(c_value);
+
}
bool gallery_folder_list_cb(media_folder_h folder, void *user_data)
if (media_type == MEDIA_CONTENT_TYPE_IMAGE) {
image_meta_h image_handle;
- int width = 0, height = 0;
- media_content_orientation_e orientation = 0;
- char *datetaken = NULL;
ret = media_info_get_image(media_handle, &image_handle);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("media_info_get_image failed: %d", ret);
- } else {
- ret = image_meta_get_width(image_handle, &width);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_width : [%d]", ret);
- ret = image_meta_get_height(image_handle, &height);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_height : [%d]", ret);
- ret = image_meta_get_orientation(image_handle, &orientation);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_orientation : [%d]", ret);
- ret = image_meta_get_date_taken(image_handle, &datetaken);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_date_taken : [%d]", ret);
-
- media_content_debug("This is Image");
- media_content_debug("Width : %d, Height : %d, Orientation : %d, Date taken : %s", width, height, orientation, datetaken);
- }
+ else
+ get_image_meta(image_handle);
- SAFE_FREE(datetaken);
ret = image_meta_destroy(image_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error image_meta_destroy : [%d]", ret);
} else if (media_type == MEDIA_CONTENT_TYPE_VIDEO) {
video_meta_h video_handle;
- char *title = NULL, *artist = NULL, *album = NULL, *album_artist = NULL;
- int duration = 0;
-
ret = media_info_get_video(media_handle, &video_handle);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("media_info_get_video failed: %d", ret);
- } else {
- ret = video_meta_get_artist(video_handle, &artist);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_get_artist : [%d]", ret);
- ret = video_meta_get_album(video_handle, &album);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_get_album : [%d]", ret);
- ret = video_meta_get_album_artist(video_handle, &album_artist);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_get_album_artist : [%d]", ret);
- ret = video_meta_get_duration(video_handle, &duration);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_get_duration : [%d]", ret);
-
- media_content_debug("This is Video");
- media_content_debug("Title: %s, Album: %s, Artist: %s, Album_artist: %s \n Duration: %d", title, album, artist, album_artist, duration);
- }
-
- SAFE_FREE(title);
- SAFE_FREE(artist);
- SAFE_FREE(album);
- SAFE_FREE(album_artist);
+ else
+ get_video_meta(video_handle);
ret = video_meta_destroy(video_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE)
if (media_type == MEDIA_CONTENT_TYPE_IMAGE) {
image_meta_h image_handle;
- int width = 0, height = 0;
- media_content_orientation_e orientation = 0;
- char *datetaken = NULL;
ret = media_info_get_image(media_handle, &image_handle);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("media_info_get_image failed: %d", ret);
- } else {
- ret = image_meta_get_width(image_handle, &width);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_width : [%d]", ret);
- ret = image_meta_get_height(image_handle, &height);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_height : [%d]", ret);
- ret = image_meta_get_orientation(image_handle, &orientation);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_orientation : [%d]", ret);
- ret = image_meta_get_date_taken(image_handle, &datetaken);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_date_taken : [%d]", ret);
-
- media_content_debug("This is Image");
- media_content_debug("Width : %d, Height : %d, Orientation : %d, Date taken : %s", width, height, orientation, datetaken);
- }
+ else
+ get_image_meta(image_handle);
- SAFE_FREE(datetaken);
ret = image_meta_destroy(image_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error image_meta_destroy : [%d]", ret);
} else if (media_type == MEDIA_CONTENT_TYPE_VIDEO) {
video_meta_h video_handle;
- char *title = NULL, *artist = NULL, *album = NULL, *album_artist = NULL;;
- int duration = 0;
ret = media_info_get_video(media_handle, &video_handle);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("media_info_get_video failed: %d", ret);
- } else {
- ret = video_meta_get_artist(video_handle, &artist);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_get_artist : [%d]", ret);
- ret = video_meta_get_album(video_handle, &album);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_get_album : [%d]", ret);
- ret = video_meta_get_album_artist(video_handle, &album_artist);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_get_album_artist : [%d]", ret);
- ret = video_meta_get_duration(video_handle, &duration);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_get_duration : [%d]", ret);
-
- media_content_debug("This is Video");
- media_content_debug("Title: %s, Album: %s, Artist: %s, Album_artist: %s \n Duration: %d\n", title, album, artist, album_artist, duration);
- }
-
- SAFE_FREE(title);
- SAFE_FREE(artist);
- SAFE_FREE(album);
- SAFE_FREE(album_artist);
+ else
+ get_video_meta(video_handle);
ret = video_meta_destroy(video_handle);
if (ret != MEDIA_CONTENT_ERROR_NONE)