Fix build error for toolchin upgrade (GCC6->GCC9) 72/220972/2 accepted/tizen/unified/20191227.142823 submit/tizen/20191226.093041
authorhj kim <backto.kim@samsung.com>
Thu, 26 Dec 2019 06:14:23 +0000 (15:14 +0900)
committerhj kim <backto.kim@samsung.com>
Thu, 26 Dec 2019 06:14:51 +0000 (15:14 +0900)
Change-Id: I81c8be36d227af48ae431435774e1b8255a54688

packaging/capi-content-media-content.spec
test/media-content_test.c

index 43e79ed..db56129 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-content-media-content
 Summary:    A Media content library in Tizen Native API
-Version:    0.4.3
+Version:    0.4.4
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 50c1444..9effbae 100755 (executable)
@@ -39,7 +39,7 @@ static int g_media_cnt = 0;
 #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;
@@ -127,10 +127,9 @@ bool get_audio_meta(audio_meta_h audio)
                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;
@@ -218,7 +217,38 @@ bool get_video_meta(video_meta_h video)
                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)
@@ -987,66 +1017,24 @@ int test_gallery_scenario(void)
 
                        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)
@@ -1116,66 +1104,25 @@ int test_gallery_scenario(void)
 
                                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)