Replace mm-utility function to mm_image_xxx() 86/200986/3 accepted/tizen/unified/20190311.220542 submit/tizen/20190311.013617
authorjiyong.min <jiyong.min@samsung.com>
Thu, 7 Mar 2019 02:14:14 +0000 (11:14 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Thu, 7 Mar 2019 05:21:24 +0000 (14:21 +0900)
Change-Id: Ia1bc01dc36c21d0cbd83a3cb03e286a44c5624b5

CMakeLists.txt
packaging/capi-media-thumbnail-util.spec
src/thumbnail_util.c

index 5be24be..31c70e3 100755 (executable)
@@ -26,7 +26,7 @@ SET(submodule "thumbnail-util")
 SET(fw_name "${project_prefix}-${service}-${submodule}")
 
 # for package file
-SET(dependents "dlog glib-2.0 capi-base-common media-thumbnail libmedia-utils storage aul mm-fileinfo mmutil-magick")
+SET(dependents "dlog glib-2.0 capi-base-common media-thumbnail libmedia-utils storage aul mm-fileinfo mmutil-common mmutil-magick")
 SET(pc_dependents "capi-base-common")
 
 PROJECT(${fw_name})
index 9296444..52203f2 100755 (executable)
@@ -14,6 +14,7 @@ BuildRequires:  pkgconfig(media-thumbnail)
 BuildRequires:  pkgconfig(storage)
 BuildRequires:  pkgconfig(aul)
 BuildRequires:  pkgconfig(mm-fileinfo)
+BuildRequires:  pkgconfig(mmutil-common)
 BuildRequires:  pkgconfig(mmutil-magick)
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
index 08770d4..1f4c5e0 100644 (file)
@@ -354,9 +354,9 @@ int _thumbnail_util_extract_video(thumbnail_data_s *thumb)
                        goto ERROR;
                }
 
-               ret = mm_util_create_handle(&img, frame, width, height, size, MM_UTIL_COLOR_RGB24);
+               ret = mm_image_create_image(width, height, MM_UTIL_COLOR_RGB24, frame, size, &img);
                if (ret != MM_UTIL_ERROR_NONE) {
-                       thumbnail_util_error("Failed to mm_util_create_handle");
+                       thumbnail_util_error("Failed to mm_image_create_image");
                        goto ERROR;
                }
 
@@ -365,7 +365,7 @@ int _thumbnail_util_extract_video(thumbnail_data_s *thumb)
 
                if (thumb->extract_type == THUMBNAIL_UTIL_FILE) {
                        ret = mm_util_resize_B_P(img, thumb_width, thumb_height, thumb->thumbnail_path);
-                       mm_util_destroy_handle(img);
+                       mm_image_destroy_image(img);
                        if (ret != MM_UTIL_ERROR_NONE)
                                goto ERROR;
                } else {
@@ -377,11 +377,11 @@ int _thumbnail_util_extract_video(thumbnail_data_s *thumb)
                        mm_util_color_format_e res_format = MM_UTIL_COLOR_NUM;
 
                        ret = mm_util_resize_B_B(img, thumb_width, thumb_height, &res_img);
-                       mm_util_destroy_handle(img);
+                       mm_image_destroy_image(img);
                        if (ret != MM_UTIL_ERROR_NONE)
                                goto ERROR;
-                       ret = mm_util_get_image(res_img, &res_buf, &res_width, &res_height, &res_buf_size, &res_format);
-                       mm_util_destroy_handle(res_img);
+                       ret = mm_image_get_image(res_img, &res_width, &res_height, &res_format, &res_buf, &res_buf_size);
+                       mm_image_destroy_image(res_img);
                        if (ret != MM_UTIL_ERROR_NONE)
                                goto ERROR;
 
@@ -443,8 +443,8 @@ int _thumbnail_util_extract(thumbnail_data_s *thumb)
                        ret = mm_util_resize_P_B(thumb->path, thumb_width, thumb_height, MM_UTIL_COLOR_BGRA, &res_img);
                        thumbnail_util_retv_if(ret != MM_UTIL_ERROR_NONE, THUMBNAIL_UTIL_ERROR_INVALID_OPERATION);
 
-                       ret = mm_util_get_image(res_img, &buf, &width, &height, &buf_size, &format);
-                       mm_util_destroy_handle(res_img);
+                       ret = mm_image_get_image(res_img, &width, &height, &format, &buf, &buf_size);
+                       mm_image_destroy_image(res_img);
                        thumbnail_util_retv_if(ret != MM_UTIL_ERROR_NONE, THUMBNAIL_UTIL_ERROR_INVALID_OPERATION);
 
                        thumb->buffer = malloc(buf_size * sizeof(unsigned char));