summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjiyong.min <jiyong.min@samsung.com>2019-03-07 11:10:15 +0900
committerjiyong.min <jiyong.min@samsung.com>2019-03-07 11:11:30 +0900
commit4588212ac8b59c5c7b7af5cdda44b775bbcfe4cb (patch)
tree2012f1368cf67c0eb56a5fec8b51d9ac4116fa86
parent066b1b2972efae4f93058d0f1af6781b18a507cb (diff)
downloadlibmedia-thumbnail-4588212ac8b59c5c7b7af5cdda44b775bbcfe4cb.tar.gz
libmedia-thumbnail-4588212ac8b59c5c7b7af5cdda44b775bbcfe4cb.tar.bz2
libmedia-thumbnail-4588212ac8b59c5c7b7af5cdda44b775bbcfe4cb.zip
Replace mm-utility function to use mm_image_xxx()submit/tizen/20190311.013617accepted/tizen/unified/20190311.220550
Change-Id: Ia216c2678d1d7fc84759c6e3f216cc22f7545f8b
-rw-r--r--CMakeLists.txt2
-rw-r--r--packaging/libmedia-thumbnail.spec1
-rwxr-xr-xsrc/media-thumb-internal.c18
3 files changed, 11 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 51c1064..3313844 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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}")
diff --git a/packaging/libmedia-thumbnail.spec b/packaging/libmedia-thumbnail.spec
index 59a6af0..2e6a7c7 100644
--- a/packaging/libmedia-thumbnail.spec
+++ b/packaging/libmedia-thumbnail.spec
@@ -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)
diff --git a/src/media-thumb-internal.c b/src/media-thumb-internal.c
index 47051d4..871e913 100755
--- a/src/media-thumb-internal.c
+++ b/src/media-thumb-internal.c
@@ -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)