From: jiyong.min Date: Wed, 7 Apr 2021 01:20:18 +0000 (+0900) Subject: [UTC][capi-media-image-util][Non-ACR][Replace sample.heic for reducing utc resource] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=528f2df5597f03670fa40a4fc2df5fe66d72c479;p=test%2Ftct%2Fnative%2Fapi.git [UTC][capi-media-image-util][Non-ACR][Replace sample.heic for reducing utc resource] 1. Reduced resources - a tpk size, a time and a memory usage of testing Some targets limit memory usage for a size of memory. Due to the size of huge sample image, a case has occurred that cannot be tested. Therefore, we change the sample image for UTC test compatibility. 2. Fix crash issue sometimes add missing 'IMAGE_UTIL_HEIF' in utc_encode and remove invalid log message Change-Id: I6b0831ea479b69f9b4e57c58f84c60aefbb9f1b0 --- diff --git a/src/utc/image-util/res/mobile/sample.heic b/src/utc/image-util/res/mobile/sample.heic index a605aacab..659078c4a 100644 Binary files a/src/utc/image-util/res/mobile/sample.heic and b/src/utc/image-util/res/mobile/sample.heic differ diff --git a/src/utc/image-util/res/tizeniot/sample.heic b/src/utc/image-util/res/tizeniot/sample.heic index a605aacab..659078c4a 100644 Binary files a/src/utc/image-util/res/tizeniot/sample.heic and b/src/utc/image-util/res/tizeniot/sample.heic differ diff --git a/src/utc/image-util/res/tv/sample.heic b/src/utc/image-util/res/tv/sample.heic index a605aacab..659078c4a 100644 Binary files a/src/utc/image-util/res/tv/sample.heic and b/src/utc/image-util/res/tv/sample.heic differ diff --git a/src/utc/image-util/res/wearable/sample.heic b/src/utc/image-util/res/wearable/sample.heic index a605aacab..659078c4a 100644 Binary files a/src/utc/image-util/res/wearable/sample.heic and b/src/utc/image-util/res/wearable/sample.heic differ diff --git a/src/utc/image-util/utc-image-util-decode-encode.c b/src/utc/image-util/utc-image-util-decode-encode.c index c5916f831..58e721044 100755 --- a/src/utc/image-util/utc-image-util-decode-encode.c +++ b/src/utc/image-util/utc-image-util-decode-encode.c @@ -27,7 +27,8 @@ #define DECODE_IMAGE_TYPE_N IMAGE_UTIL_HEIF #define ENCODE_IMAGE_TYPE_N IMAGE_UTIL_WEBP -#define INVALID_IMAGE_TYPE ((DECODE_IMAGE_TYPE_N > ENCODE_IMAGE_TYPE_N) ? DECODE_IMAGE_TYPE_N * 2 : ENCODE_IMAGE_TYPE_N * 2) +#define UTC_IMAGE_TYPE_N ((DECODE_IMAGE_TYPE_N > ENCODE_IMAGE_TYPE_N) ? DECODE_IMAGE_TYPE_N : ENCODE_IMAGE_TYPE_N) +#define INVALID_IMAGE_TYPE (UTC_IMAGE_TYPE_N * 2) typedef struct { bool support_decode; @@ -86,6 +87,7 @@ static utc_encode_t utc_encode[] = { [IMAGE_UTIL_GIF] = { NULL, NULL, { NULL, 0, 0 } }, [IMAGE_UTIL_BMP] = { NULL, NULL, { NULL, 0, 0 } }, [IMAGE_UTIL_WEBP] = { NULL, NULL, { NULL, 0, 0 } }, + [IMAGE_UTIL_HEIF] = { NULL, NULL, { NULL, 0, 0 } }, }; static int callback_error = IMAGE_UTIL_ERROR_NONE; @@ -209,14 +211,15 @@ static int __fill_test_buffer(image_util_type_e type) return ret; } - static void __utc_decode_free() { image_util_type_e type = 0; - for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) { + for (type = 0; type <= UTC_IMAGE_TYPE_N; type++) { IMAGEUTIL_SAFE_G_FREE(utc_decode[type].result.buffer); utc_decode[type].result.size = 0; + image_util_destroy_image(utc_decode[type].decoded); + utc_decode[type].decoded = NULL; IMAGEUTIL_SAFE_G_FREE(utc_decode[type].source); image_util_decode_destroy(utc_decode[type].handle); utc_decode[type].handle = NULL; @@ -227,7 +230,7 @@ static void __utc_encode_free() { image_util_type_e type = 0; - for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) { + for (type = 0; type <= UTC_IMAGE_TYPE_N; type++) { IMAGEUTIL_SAFE_G_FREE(utc_encode[type].result.buffer); utc_encode[type].result.size = 0; utc_encode[type].result.buffer_size = 0; @@ -1236,13 +1239,9 @@ int utc_image_util_decode_run_p2(void) int utc_image_util_decode_run2_n(void) { int ret = IMAGE_UTIL_ERROR_NONE; - image_util_image_h decoded_image = NULL; image_util_type_e type = 0; for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) { - ret = image_util_decode_run2(utc_decode[type].handle, &decoded_image); - assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER); - ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source); assert_eq(ret, IMAGE_UTIL_ERROR_NONE); @@ -1657,7 +1656,7 @@ void utc_image_util_encode_startup(void) } utc_encode[type].output = _utc_get_test_path(pszValue, UTC_CONFIG[type].output); - FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type, utc_encode[type].output); + FPRINTF("[%d:%s] PATH [Type: %d] [Encode: %s] \\n", __LINE__, __FUNCTION__, type, utc_encode[type].output); if (!utc_encode[type].output) FPRINTF("[%d:%s] Get UTC Path error! \\n", __LINE__, __FUNCTION__);