Replace mm-utility function to use mm_image_xxx() 85/200985/1 accepted/tizen/unified/20190311.220550 submit/tizen/20190311.013617
authorjiyong.min <jiyong.min@samsung.com>
Thu, 7 Mar 2019 02:10:15 +0000 (11:10 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Thu, 7 Mar 2019 02:11:30 +0000 (11:11 +0900)
Change-Id: Ia216c2678d1d7fc84759c6e3f216cc22f7545f8b

CMakeLists.txt
packaging/libmedia-thumbnail.spec
src/media-thumb-internal.c

index 51c1064b909d183d637948e8fd5f400d89366f6b..3313844c6e6aacad88bac18d23ca9fddd657e6bc 100644 (file)
@@ -34,7 +34,7 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src/include ${CMAKE_SOURCE_DIR}/src/include/util ${CMAKE_SOURCE_DIR}/src/include/util ${CMAKE_SOURCE_DIR}/src/include/ipc ${CMAKE_SOURCE_DIR}/server/include ${CMAKE_SOURCE_DIR}/md5)
 
 INCLUDE(FindPkgConfig)
-       pkg_check_modules(pkgs REQUIRED glib-2.0 gthread-2.0 dlog sqlite3 mm-fileinfo aul libmedia-utils libtzplatform-config mmutil-magick)
+       pkg_check_modules(pkgs REQUIRED glib-2.0 gthread-2.0 dlog sqlite3 mm-fileinfo aul libmedia-utils libtzplatform-config mmutil-common mmutil-magick)
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 59a6af0aa3770f3ed752e62f16ed5d3400eb8db5..2e6a7c7ac46f4eb1823fff3cb058c4f438670cc9 100644 (file)
@@ -17,6 +17,7 @@ BuildRequires: pkgconfig(aul)
 BuildRequires: pkgconfig(libmedia-utils)
 BuildRequires: pkgconfig(libtzplatform-config)
 BuildRequires: pkgconfig(sqlite3)
+BuildRequires: pkgconfig(mmutil-common)
 BuildRequires: pkgconfig(mmutil-magick)
 %if 0%{?gtests:1}
 BuildRequires:  pkgconfig(gmock)
index 47051d4ac55ea70f960bbd66035c9e97227b2a3f..871e9134575650abfab39fd25d56751d4632a110 100755 (executable)
@@ -77,14 +77,14 @@ int _media_thumb_general(const char *origin_path, const char *thumb_path, int th
                        return MS_MEDIA_ERR_INTERNAL;
                }
 
-               mm_util_get_image(img, &buf, &width, &height, &size, &format);
+               mm_image_get_image(img, &width, &height, &format, &buf, &size);
                thumb_info->data = calloc(1, size);
                memcpy(thumb_info->data, buf, size);
                thumb_info->size = size;
                thumb_info->width = width;
                thumb_info->height = height;
                SAFE_FREE(buf);
-               mm_util_destroy_handle(img);
+               mm_image_destroy_image(img);
        }
 
        return err;
@@ -246,7 +246,7 @@ int _media_thumb_video(const char *origin_path, const char *thumb_path, int thum
 
                thumb_dbg("Origin:W[%d] H[%d] Proper:W[%d] H[%d]", width, height, thumb_width, thumb_height);
 
-               err = mm_util_create_handle(&img, (unsigned char *)frame, width, height, size, MM_UTIL_COLOR_RGB24);
+               err = mm_image_create_image(width, height, MM_UTIL_COLOR_RGB24, (unsigned char *)frame, size, &img);
                if (width > thumb_width || height > thumb_height) {
                        if (rot_type != MM_UTIL_ROTATE_0) {
                                if (STRING_VALID(thumb_path)) {
@@ -261,7 +261,7 @@ int _media_thumb_video(const char *origin_path, const char *thumb_path, int thum
                                        err = mm_util_rotate_B_B(resize_img, rot_type, &dst_img);
                                        if (err != MM_UTIL_ERROR_NONE)
                                                goto ERROR;
-                                       mm_util_get_image(dst_img, &res_buf, &res_width, &res_height, &res_size, &res_format);
+                                       mm_image_get_image(dst_img, &res_width, &res_height, &res_format, &res_buf, &res_size);
                                        thumb_info->data = calloc(1, res_size);
                                        memcpy(thumb_info->data, res_buf, res_size);
                                        thumb_info->size = res_size;
@@ -276,7 +276,7 @@ int _media_thumb_video(const char *origin_path, const char *thumb_path, int thum
                                        err = mm_util_resize_B_B(img, thumb_width, thumb_height, &resize_img);
                                        if (err != MM_UTIL_ERROR_NONE)
                                                goto ERROR;
-                                       mm_util_get_image(resize_img, &res_buf, &res_width, &res_height, &res_size, &res_format);
+                                       mm_image_get_image(resize_img, &res_width, &res_height, &res_format, &res_buf, &res_size);
                                        thumb_info->data = calloc(1, res_size);
                                        memcpy(thumb_info->data, res_buf, res_size);
                                        thumb_info->size = res_size;
@@ -293,7 +293,7 @@ int _media_thumb_video(const char *origin_path, const char *thumb_path, int thum
                                        err = mm_util_rotate_B_B(img, rot_type, &dst_img);
                                        if (err != MM_UTIL_ERROR_NONE)
                                                goto ERROR;
-                                       mm_util_get_image(dst_img, &res_buf, &res_width, &res_height, &res_size, &res_format);
+                                       mm_image_get_image(dst_img, &res_width, &res_height, &res_format, &res_buf, &res_size);
                                        thumb_info->data = calloc(1, res_size);
                                        memcpy(thumb_info->data, res_buf, res_size);
                                        thumb_info->size = res_size;
@@ -316,9 +316,9 @@ int _media_thumb_video(const char *origin_path, const char *thumb_path, int thum
        }
 
 ERROR:
-       mm_util_destroy_handle(img);
-       mm_util_destroy_handle(resize_img);
-       mm_util_destroy_handle(dst_img);
+       mm_image_destroy_image(img);
+       mm_image_destroy_image(resize_img);
+       mm_image_destroy_image(dst_img);
        mm_file_destroy_content_attrs(content);
 
        if (err != MS_MEDIA_ERR_NONE)