From fd1168711512818e4ed2a1bb63cfc80f27fa602d Mon Sep 17 00:00:00 2001 From: hjkim Date: Fri, 8 Mar 2024 16:49:11 +0900 Subject: [PATCH] Remove unused code Some image-util native APIs are removed. so remove related code here as well. Change-Id: I17e65256c26cad926f094ce699add9d9b23970f0 --- common/include/mm_util_image.h | 2 -- common/mm_util_image.c | 8 -------- imgp/include/mm_util_imgp.h | 1 - imgp/mm_util_imgp.c | 5 ----- jxl/mm_util_jxl.c | 2 +- packaging/libmm-utility.spec | 2 +- 6 files changed, 2 insertions(+), 18 deletions(-) diff --git a/common/include/mm_util_image.h b/common/include/mm_util_image.h index b015f51..8b32941 100755 --- a/common/include/mm_util_image.h +++ b/common/include/mm_util_image.h @@ -24,8 +24,6 @@ extern "C" { #endif -#define TEMP_DATA_SIZE SIZE_MAX //To be removed - bool mm_image_is_valid_image(mm_util_image_h image); void mm_image_debug_image(mm_util_image_h image, const char *message); diff --git a/common/mm_util_image.c b/common/mm_util_image.c index 8f5b38d..ca8e297 100755 --- a/common/mm_util_image.c +++ b/common/mm_util_image.c @@ -81,11 +81,6 @@ int mm_image_create_image(unsigned int width, unsigned int height, mm_util_color_format_e color, const unsigned char *data, size_t size, mm_util_image_h *image) { - /* Just TEMP_DATA_SIZE has been used internally. - * It will be removed after removing deprecated CAPIs. */ - if (size == TEMP_DATA_SIZE) - return __create_new_image(width, height, color, data, size, false, false, image); - return __create_new_image(width, height, color, data, size, true, true, image); } @@ -136,9 +131,6 @@ int mm_image_get_image(mm_util_image_h image, unsigned int *width, mm_image_info_s *_image = (mm_image_info_s *)image; mm_util_retvm_if(!IS_VALID_IMAGE(image), MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid image"); - /* Just TEMP_DATA_SIZE has been used internally. - * It will be removed after removing deprecated CAPIs. */ - mm_util_retvm_if(_image->size == TEMP_DATA_SIZE, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid size"); if (width) *width = _image->width; diff --git a/imgp/include/mm_util_imgp.h b/imgp/include/mm_util_imgp.h index ff65a1e..111cd4e 100644 --- a/imgp/include/mm_util_imgp.h +++ b/imgp/include/mm_util_imgp.h @@ -26,7 +26,6 @@ extern "C" { #include "mm_util_type.h" -int mm_util_get_image_size(mm_util_color_format_e format, unsigned int width, unsigned int height, size_t *imgsize); int mm_util_convert_colorspace(mm_util_image_h src, mm_util_color_format_e color, mm_util_image_h *dst); int mm_util_resize_image(mm_util_image_h src, unsigned int width, unsigned int height, mm_util_image_h *dst); int mm_util_rotate_image(mm_util_image_h src, mm_util_rotate_type_e angle, mm_util_image_h *dst); diff --git a/imgp/mm_util_imgp.c b/imgp/mm_util_imgp.c index 4456655..05d4cff 100644 --- a/imgp/mm_util_imgp.c +++ b/imgp/mm_util_imgp.c @@ -624,8 +624,3 @@ int mm_util_crop_image(mm_util_image_h src, unsigned int start_x, unsigned int s return ret; } - -int mm_util_get_image_size(mm_util_color_format_e format, unsigned int width, unsigned int height, size_t *imgsize) -{ - return __mm_util_get_image_size(format, width, height, false, imgsize); -} diff --git a/jxl/mm_util_jxl.c b/jxl/mm_util_jxl.c index 2cb0852..ee753a1 100644 --- a/jxl/mm_util_jxl.c +++ b/jxl/mm_util_jxl.c @@ -154,7 +154,7 @@ static int __set_basic_info_from_image(mm_util_image_h decoded, JxlBasicInfo *ba basic_info->ysize = (uint32_t)mm_image->height; *format = jxl_formats[mm_image->color]; *pixels = mm_image->data; - *pixels_size = (mm_image->size == TEMP_DATA_SIZE) ? (size_t)(mm_image->width * mm_image->height * format->num_channels) : mm_image->size; + *pixels_size = mm_image->size; return MM_UTIL_ERROR_NONE; } diff --git a/packaging/libmm-utility.spec b/packaging/libmm-utility.spec index 7d9b07b..ac24ccd 100644 --- a/packaging/libmm-utility.spec +++ b/packaging/libmm-utility.spec @@ -1,6 +1,6 @@ Name: libmm-utility Summary: Multimedia Framework Utility Library -Version: 0.4.18 +Version: 0.4.19 Release: 0 Group: System/Libraries License: Apache-2.0 -- 2.7.4