#define INVALID_IMAGE_TYPE sizeof(image_util_type_e) + 1 /* +1 margin due to new type */
#define LAST_IMAGE_TYPE IMAGE_UTIL_WEBP
+typedef struct {
+ char *source;
+ char *output;
+} utc_filename_t;
+
+static const utc_filename_t FILENAME[] = {
+ [IMAGE_UTIL_JPEG] = { "sample.jpg", "test_output.jpg" },
+ [IMAGE_UTIL_PNG] = { "sample.png", "test_output.png" },
+ [IMAGE_UTIL_GIF] = { "sample.gif", "test_output.gif" },
+ [IMAGE_UTIL_BMP] = { "sample.bmp", "test_output.bmp" },
+ [IMAGE_UTIL_WEBP] = { "sample.webp", "test_output.webp" },
+};
+
typedef struct {
unsigned char *buffer;
size_t size;
unsigned int height;
} decode_result_t;
+typedef struct {
+ char *source;
+ image_util_decode_h handle;
+ image_util_image_h decoded;
+ decode_result_t result;
+} utc_decode_t;
+
+static utc_decode_t utc_decode[] = {
+ [IMAGE_UTIL_JPEG] = { NULL, NULL, NULL, { NULL, 0, 0, 0 } },
+ [IMAGE_UTIL_PNG] = { NULL, NULL, NULL, { NULL, 0, 0, 0 } },
+ [IMAGE_UTIL_GIF] = { NULL, NULL, NULL, { NULL, 0, 0, 0 } },
+ [IMAGE_UTIL_BMP] = { NULL, NULL, NULL, { NULL, 0, 0, 0 } },
+ [IMAGE_UTIL_WEBP] = { NULL, NULL, NULL, { NULL, 0, 0, 0 } },
+};
+
typedef struct {
unsigned char *buffer;
unsigned long long size;
size_t buffer_size;
} encode_result_t;
-static const char *g_source_filename[] = {
- [IMAGE_UTIL_JPEG] = "sample.jpg",
- [IMAGE_UTIL_PNG] = "sample.png",
- [IMAGE_UTIL_GIF] = "sample.gif",
- [IMAGE_UTIL_BMP] = "sample.bmp",
- [IMAGE_UTIL_WEBP] = "sample.webp",
-};
-
-static const char *g_output_filename[] = {
- [IMAGE_UTIL_JPEG] = "test_output.jpg",
- [IMAGE_UTIL_PNG] = "test_output.png",
- [IMAGE_UTIL_GIF] = "test_output.gif",
- [IMAGE_UTIL_BMP] = "test_output.bmp",
- [IMAGE_UTIL_WEBP] = "test_output.webp",
-};
-
-static char *g_source_path[] = {
- [IMAGE_UTIL_JPEG] = NULL,
- [IMAGE_UTIL_PNG] = NULL,
- [IMAGE_UTIL_GIF] = NULL,
- [IMAGE_UTIL_BMP] = NULL,
- [IMAGE_UTIL_WEBP] = NULL,
-};
-
-static char *g_output_path[] = {
- [IMAGE_UTIL_JPEG] = NULL,
- [IMAGE_UTIL_PNG] = NULL,
- [IMAGE_UTIL_GIF] = NULL,
- [IMAGE_UTIL_BMP] = NULL,
- [IMAGE_UTIL_WEBP] = NULL,
-};
-
-static image_util_decode_h g_decoder[] = {
- [IMAGE_UTIL_JPEG] = NULL,
- [IMAGE_UTIL_PNG] = NULL,
- [IMAGE_UTIL_GIF] = NULL,
- [IMAGE_UTIL_BMP] = NULL,
- [IMAGE_UTIL_WEBP] = NULL,
-};
-
-static image_util_encode_h g_encoder[] = {
- [IMAGE_UTIL_JPEG] = NULL,
- [IMAGE_UTIL_PNG] = NULL,
- [IMAGE_UTIL_GIF] = NULL,
- [IMAGE_UTIL_BMP] = NULL,
- [IMAGE_UTIL_WEBP] = NULL,
-};
-
-static decode_result_t g_decode_result[] = {
- [IMAGE_UTIL_JPEG] = { NULL, 0, 0, 0 },
- [IMAGE_UTIL_PNG] = { NULL, 0, 0, 0 },
- [IMAGE_UTIL_GIF] = { NULL, 0, 0, 0 },
- [IMAGE_UTIL_BMP] = { NULL, 0, 0, 0 },
- [IMAGE_UTIL_WEBP] = { NULL, 0, 0, 0 },
-};
-
-static encode_result_t g_encode_result[] = {
- [IMAGE_UTIL_JPEG] = { NULL, 0, 0 },
- [IMAGE_UTIL_PNG] = { NULL, 0, 0 },
- [IMAGE_UTIL_GIF] = { NULL, 0, 0 },
- [IMAGE_UTIL_BMP] = { NULL, 0, 0 },
- [IMAGE_UTIL_WEBP] = { NULL, 0, 0 },
-};
-
-static image_util_image_h g_decoded_image[] = {
- [IMAGE_UTIL_JPEG] = NULL,
- [IMAGE_UTIL_PNG] = NULL,
- [IMAGE_UTIL_GIF] = NULL,
- [IMAGE_UTIL_BMP] = NULL,
- [IMAGE_UTIL_WEBP] = NULL,
+typedef struct {
+ char *output;
+ image_util_encode_h handle;
+ encode_result_t result;
+} utc_encode_t;
+
+static utc_encode_t utc_encode[] = {
+ [IMAGE_UTIL_JPEG] = { NULL, NULL, { NULL, 0, 0 } },
+ [IMAGE_UTIL_PNG] = { NULL, NULL, { NULL, 0, 0 } },
+ [IMAGE_UTIL_GIF] = { NULL, NULL, { NULL, 0, 0 } },
+ [IMAGE_UTIL_BMP] = { NULL, NULL, { NULL, 0, 0 } },
+ [IMAGE_UTIL_WEBP] = { NULL, NULL, { NULL, 0, 0 } },
};
static int callback_error = IMAGE_UTIL_ERROR_NONE;
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_image_h decoded_image = NULL;
- ret = _utc_decode_from_file(g_source_path[type], &decoded_image);
+ ret = _utc_decode_from_file(utc_decode[type].source, &decoded_image);
if (ret != IMAGE_UTIL_ERROR_NONE) {
FPRINTF("[%d:%s] _utc_decode_from_file failed! %d \\n", __LINE__, __FUNCTION__, ret);
return ret;
}
- ret = image_util_get_image(decoded_image, &g_decode_result[type].width, &g_decode_result[type].height, NULL,
- &g_decode_result[type].buffer, &g_decode_result[type].size);
+ ret = image_util_get_image(decoded_image, &utc_decode[type].result.width, &utc_decode[type].result.height, NULL,
+ &utc_decode[type].result.buffer, &utc_decode[type].result.size);
if (ret != IMAGE_UTIL_ERROR_NONE) {
FPRINTF("[%d:%s] image_util_get_image failed! %d \\n", __LINE__, __FUNCTION__, ret);
image_util_destroy_image(decoded_image);
return ret;
}
- ret = _utc_encode_to_buffer(type, decoded_image, &g_encode_result[type].buffer, &g_encode_result[type].size);
+ ret = _utc_encode_to_buffer(type, decoded_image, &utc_encode[type].result.buffer, &utc_encode[type].result.size);
if (ret != IMAGE_UTIL_ERROR_NONE)
FPRINTF("[%d:%s] _utc_encode_to_buffer failed! %d \\n", __LINE__, __FUNCTION__, ret);
return ret;
}
+
+static void __utc_decode_free()
+{
+ image_util_type_e type = 0;
+
+ for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ IMAGEUTIL_SAFE_G_FREE(utc_decode[type].result.buffer);
+ utc_decode[type].result.size = 0;
+ IMAGEUTIL_SAFE_G_FREE(utc_decode[type].source);
+ image_util_decode_destroy(utc_decode[type].handle);
+ utc_decode[type].handle = NULL;
+ }
+}
+
+static void __utc_encode_free()
+{
+ image_util_type_e type = 0;
+
+ for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+ IMAGEUTIL_SAFE_G_FREE(utc_encode[type].result.buffer);
+ utc_encode[type].result.size = 0;
+ utc_encode[type].result.buffer_size = 0;
+ IMAGEUTIL_SAFE_G_FREE(utc_encode[type].output);
+ image_util_encode_destroy(utc_encode[type].handle);
+ utc_encode[type].handle = NULL;
+ }
+}
+
/**
* @function utc_image_util_decode_startup
* @description Called before each test
PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue);
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- g_source_path[type] = _utc_get_test_path(pszValue, g_source_filename[type]);
- g_output_path[type] = _utc_get_test_path(pszValue, g_output_filename[type]);
+ utc_decode[type].source = _utc_get_test_path(pszValue, FILENAME[type].source);
+ utc_encode[type].output = _utc_get_test_path(pszValue, FILENAME[type].output);
FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type,
- g_source_path[type], g_output_path[type]);
+ utc_decode[type].source, utc_encode[type].output);
- if (!g_source_path[type] || !g_output_path[type])
+ if (!utc_decode[type].source || !utc_encode[type].output)
FPRINTF("[%d:%s] Get UTC Path error! \\n", __LINE__, __FUNCTION__);
}
}
}
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_create(&g_decoder[type]);
+ ret = image_util_decode_create(&utc_decode[type].handle);
if (IMAGE_UTIL_ERROR_NONE != ret)
PRINT_UTC_LOG("[Line : %d][%s] image_util_decode_create is failed(%d).\n", __LINE__, API_NAMESPACE, ret);
}
*/
void utc_image_util_decode_cleanup(void)
{
- image_util_type_e type = 0;
-
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- IMAGEUTIL_SAFE_G_FREE(g_decode_result[type].buffer);
- g_decode_result[type].size = 0;
- IMAGEUTIL_SAFE_G_FREE(g_encode_result[type].buffer);
- g_encode_result[type].size = 0;
- g_encode_result[type].buffer_size = 0;
- IMAGEUTIL_SAFE_G_FREE(g_source_path[type]);
- IMAGEUTIL_SAFE_G_FREE(g_output_path[type]);
- image_util_decode_destroy(g_decoder[type]);
- g_decoder[type] = NULL;
- }
+ __utc_decode_free();
+ __utc_encode_free();
}
static bool _image_util_supported_colorspace_cb(image_util_colorspace_e colorspace, void *user_data)
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_destroy(g_decoder[type]);
+ ret = image_util_decode_destroy(utc_decode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- g_decoder[type] = NULL;
+ utc_decode[type].handle = NULL;
- ret = image_util_decode_create(&g_decoder[type]);
+ ret = image_util_decode_create(&utc_decode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_input_path(NULL, g_source_path[type]);
+ ret = image_util_decode_set_input_path(NULL, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_input_path(g_encoder[type], g_source_path[type]);
+ ret = image_util_decode_set_input_path(utc_encode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_input_path(g_decoder[type], WRONG_PATH);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, WRONG_PATH);
assert_eq(ret, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_input_path(g_decoder[type], NULL);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_input_path(g_decoder[type], g_source_path[type]);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_input_buffer(NULL, g_encode_result[type].buffer, g_encode_result[type].size);
+ ret = image_util_decode_set_input_buffer(NULL, utc_encode[type].result.buffer, utc_encode[type].result.size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_input_buffer(g_encoder[type], g_encode_result[type].buffer, g_encode_result[type].size);
+ ret = image_util_decode_set_input_buffer(utc_encode[type].handle, utc_encode[type].result.buffer, utc_encode[type].result.size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_input_buffer(g_decoder[type], NULL, g_encode_result[type].size);
+ ret = image_util_decode_set_input_buffer(utc_decode[type].handle, NULL, utc_encode[type].result.size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_input_buffer(g_decoder[type], g_encode_result[type].buffer, 0);
+ ret = image_util_decode_set_input_buffer(utc_decode[type].handle, utc_encode[type].result.buffer, 0);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_input_buffer(g_decoder[type], g_encode_result[type].buffer, g_encode_result[type].size);
+ ret = image_util_decode_set_input_buffer(utc_decode[type].handle, utc_encode[type].result.buffer, utc_encode[type].result.size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_output_buffer(g_encoder[type], &data);
+ ret = image_util_decode_set_output_buffer(utc_encode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_output_buffer(g_decoder[type], NULL);
+ ret = image_util_decode_set_output_buffer(utc_decode[type].handle, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_output_buffer(g_decoder[type], &data);
+ ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_colorspace(g_decoder[type], IMAGE_UTIL_COLORSPACE_RGBA8888);
+ ret = image_util_decode_set_colorspace(utc_decode[type].handle, IMAGE_UTIL_COLORSPACE_RGBA8888);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_input_path(g_decoder[type], g_source_path[type]);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_colorspace(g_decoder[type], -1);
+ ret = image_util_decode_set_colorspace(utc_decode[type].handle, -1);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_decode_set_colorspace(g_decoder[type], IMAGE_UTIL_COLORSPACE_NV61 + 1);
+ ret = image_util_decode_set_colorspace(utc_decode[type].handle, IMAGE_UTIL_COLORSPACE_NV61 + 1);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
int ret = IMAGE_UTIL_ERROR_NONE;
int color_space = IMAGE_UTIL_COLORSPACE_YV12;
- ret = image_util_decode_set_input_path(g_decoder[IMAGE_UTIL_JPEG], g_source_path[IMAGE_UTIL_JPEG]);
+ ret = image_util_decode_set_input_path(utc_decode[IMAGE_UTIL_JPEG].handle, utc_decode[IMAGE_UTIL_JPEG].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
for (color_space = IMAGE_UTIL_COLORSPACE_YV12; color_space <= IMAGE_UTIL_COLORSPACE_NV61; color_space++) {
if (jpeg_colorspace_tbl[color_space] == IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT) {
- ret = image_util_decode_set_colorspace(g_decoder[IMAGE_UTIL_JPEG], color_space);
+ ret = image_util_decode_set_colorspace(utc_decode[IMAGE_UTIL_JPEG].handle, color_space);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
}
}
int ret = IMAGE_UTIL_ERROR_NONE;
int color_space = IMAGE_UTIL_COLORSPACE_YV12;
- ret = image_util_decode_set_input_path(g_decoder[IMAGE_UTIL_PNG], g_source_path[IMAGE_UTIL_PNG]);
+ ret = image_util_decode_set_input_path(utc_decode[IMAGE_UTIL_PNG].handle, utc_decode[IMAGE_UTIL_PNG].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
for (color_space = IMAGE_UTIL_COLORSPACE_YV12; color_space <= IMAGE_UTIL_COLORSPACE_NV61; color_space++) {
if (png_colorspace_tbl[color_space] == IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT) {
- ret = image_util_decode_set_colorspace(g_decoder[IMAGE_UTIL_PNG], color_space);
+ ret = image_util_decode_set_colorspace(utc_decode[IMAGE_UTIL_PNG].handle, color_space);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
}
}
int ret = IMAGE_UTIL_ERROR_NONE;
int color_space = IMAGE_UTIL_COLORSPACE_YV12;
- ret = image_util_decode_set_input_path(g_decoder[IMAGE_UTIL_GIF], g_source_path[IMAGE_UTIL_GIF]);
+ ret = image_util_decode_set_input_path(utc_decode[IMAGE_UTIL_GIF].handle, utc_decode[IMAGE_UTIL_GIF].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
for (color_space = IMAGE_UTIL_COLORSPACE_YV12; color_space <= IMAGE_UTIL_COLORSPACE_NV61; color_space++) {
if (gif_colorspace_tbl[color_space] == IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT) {
- ret = image_util_decode_set_colorspace(g_decoder[IMAGE_UTIL_GIF], color_space);
+ ret = image_util_decode_set_colorspace(utc_decode[IMAGE_UTIL_GIF].handle, color_space);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
}
}
int ret = IMAGE_UTIL_ERROR_NONE;
int color_space = IMAGE_UTIL_COLORSPACE_YV12;
- ret = image_util_decode_set_input_path(g_decoder[IMAGE_UTIL_BMP], g_source_path[IMAGE_UTIL_BMP]);
+ ret = image_util_decode_set_input_path(utc_decode[IMAGE_UTIL_BMP].handle, utc_decode[IMAGE_UTIL_BMP].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
for (color_space = IMAGE_UTIL_COLORSPACE_YV12; color_space <= IMAGE_UTIL_COLORSPACE_NV61; color_space++) {
if (bmp_colorspace_tbl[color_space] == IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT) {
- ret = image_util_decode_set_colorspace(g_decoder[IMAGE_UTIL_BMP], color_space);
+ ret = image_util_decode_set_colorspace(utc_decode[IMAGE_UTIL_BMP].handle, color_space);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
}
}
int ret = IMAGE_UTIL_ERROR_NONE;
int color_space = IMAGE_UTIL_COLORSPACE_YV12;
- ret = image_util_decode_set_input_path(g_decoder[IMAGE_UTIL_JPEG], g_source_path[IMAGE_UTIL_JPEG]);
+ ret = image_util_decode_set_input_path(utc_decode[IMAGE_UTIL_JPEG].handle, utc_decode[IMAGE_UTIL_JPEG].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
for (color_space = IMAGE_UTIL_COLORSPACE_YV12; color_space <= IMAGE_UTIL_COLORSPACE_NV61; color_space++) {
if (jpeg_colorspace_tbl[color_space] == IMAGE_UTIL_ERROR_NONE) {
- ret = image_util_decode_set_colorspace(g_decoder[IMAGE_UTIL_JPEG], color_space);
+ ret = image_util_decode_set_colorspace(utc_decode[IMAGE_UTIL_JPEG].handle, color_space);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
}
int ret = IMAGE_UTIL_ERROR_NONE;
int color_space = IMAGE_UTIL_COLORSPACE_YV12;
- ret = image_util_decode_set_input_path(g_decoder[IMAGE_UTIL_PNG], g_source_path[IMAGE_UTIL_PNG]);
+ ret = image_util_decode_set_input_path(utc_decode[IMAGE_UTIL_PNG].handle, utc_decode[IMAGE_UTIL_PNG].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
for (color_space = IMAGE_UTIL_COLORSPACE_YV12; color_space <= IMAGE_UTIL_COLORSPACE_NV61; color_space++) {
if (png_colorspace_tbl[color_space] == IMAGE_UTIL_ERROR_NONE) {
- ret = image_util_decode_set_colorspace(g_decoder[IMAGE_UTIL_PNG], color_space);
+ ret = image_util_decode_set_colorspace(utc_decode[IMAGE_UTIL_PNG].handle, color_space);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
}
int ret = IMAGE_UTIL_ERROR_NONE;
int color_space = IMAGE_UTIL_COLORSPACE_YV12;
- ret = image_util_decode_set_input_path(g_decoder[IMAGE_UTIL_GIF], g_source_path[IMAGE_UTIL_GIF]);
+ ret = image_util_decode_set_input_path(utc_decode[IMAGE_UTIL_GIF].handle, utc_decode[IMAGE_UTIL_GIF].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
for (color_space = IMAGE_UTIL_COLORSPACE_YV12; color_space <= IMAGE_UTIL_COLORSPACE_NV61; color_space++) {
if (gif_colorspace_tbl[color_space] == IMAGE_UTIL_ERROR_NONE) {
- ret = image_util_decode_set_colorspace(g_decoder[IMAGE_UTIL_GIF], color_space);
+ ret = image_util_decode_set_colorspace(utc_decode[IMAGE_UTIL_GIF].handle, color_space);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
}
int ret = IMAGE_UTIL_ERROR_NONE;
int color_space = IMAGE_UTIL_COLORSPACE_YV12;
- ret = image_util_decode_set_input_path(g_decoder[IMAGE_UTIL_BMP], g_source_path[IMAGE_UTIL_BMP]);
+ ret = image_util_decode_set_input_path(utc_decode[IMAGE_UTIL_BMP].handle, utc_decode[IMAGE_UTIL_BMP].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
for (color_space = IMAGE_UTIL_COLORSPACE_YV12; color_space <= IMAGE_UTIL_COLORSPACE_NV61; color_space++) {
if (bmp_colorspace_tbl[color_space] == IMAGE_UTIL_ERROR_NONE) {
- ret = image_util_decode_set_colorspace(g_decoder[IMAGE_UTIL_BMP], color_space);
+ ret = image_util_decode_set_colorspace(utc_decode[IMAGE_UTIL_BMP].handle, color_space);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
}
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_decode_set_jpeg_downscale(g_encoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_DOWNSCALE_1_1);
+ ret = image_util_decode_set_jpeg_downscale(utc_encode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_DOWNSCALE_1_1);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
return 0;
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_decode_set_input_path(g_decoder[IMAGE_UTIL_JPEG], g_source_path[IMAGE_UTIL_JPEG]);
+ ret = image_util_decode_set_input_path(utc_decode[IMAGE_UTIL_JPEG].handle, utc_decode[IMAGE_UTIL_JPEG].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_jpeg_downscale(g_decoder[IMAGE_UTIL_PNG], IMAGE_UTIL_DOWNSCALE_1_1);
+ ret = image_util_decode_set_jpeg_downscale(utc_decode[IMAGE_UTIL_PNG].handle, IMAGE_UTIL_DOWNSCALE_1_1);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
- ret = image_util_decode_set_jpeg_downscale(g_decoder[IMAGE_UTIL_GIF], IMAGE_UTIL_DOWNSCALE_1_1);
+ ret = image_util_decode_set_jpeg_downscale(utc_decode[IMAGE_UTIL_GIF].handle, IMAGE_UTIL_DOWNSCALE_1_1);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
- ret = image_util_decode_set_jpeg_downscale(g_decoder[IMAGE_UTIL_BMP], IMAGE_UTIL_DOWNSCALE_1_1);
+ ret = image_util_decode_set_jpeg_downscale(utc_decode[IMAGE_UTIL_BMP].handle, IMAGE_UTIL_DOWNSCALE_1_1);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
return 0;
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_decode_set_input_path(g_decoder[IMAGE_UTIL_JPEG], g_source_path[IMAGE_UTIL_JPEG]);
+ ret = image_util_decode_set_input_path(utc_decode[IMAGE_UTIL_JPEG].handle, utc_decode[IMAGE_UTIL_JPEG].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_jpeg_downscale(g_decoder[IMAGE_UTIL_JPEG], -1);
+ ret = image_util_decode_set_jpeg_downscale(utc_decode[IMAGE_UTIL_JPEG].handle, -1);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_decode_set_jpeg_downscale(g_decoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_DOWNSCALE_1_8 + 1);
+ ret = image_util_decode_set_jpeg_downscale(utc_decode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_DOWNSCALE_1_8 + 1);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
return 0;
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_decode_set_input_path(g_decoder[IMAGE_UTIL_JPEG], g_source_path[IMAGE_UTIL_JPEG]);
+ ret = image_util_decode_set_input_path(utc_decode[IMAGE_UTIL_JPEG].handle, utc_decode[IMAGE_UTIL_JPEG].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_jpeg_downscale(g_decoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_DOWNSCALE_1_1);
+ ret = image_util_decode_set_jpeg_downscale(utc_decode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_DOWNSCALE_1_1);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
return 0;
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_run(g_encoder[type], &image_width, &image_height, &image_size);
+ ret = image_util_decode_run(utc_encode[type].handle, &image_width, &image_height, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_output_buffer(g_decoder[type], &data);
+ ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run(g_decoder[type], &image_width, &image_height, &image_size);
+ ret = image_util_decode_run(utc_decode[type].handle, &image_width, &image_height, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_input_path(g_decoder[type], g_source_path[type]);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run(g_decoder[type], &image_width, &image_height, &image_size);
+ ret = image_util_decode_run(utc_decode[type].handle, &image_width, &image_height, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_input_buffer(g_decoder[type], g_encode_result[type].buffer, g_encode_result[type].size);
+ ret = image_util_decode_set_input_buffer(utc_decode[type].handle, utc_encode[type].result.buffer, utc_encode[type].result.size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run(g_decoder[type], &image_width, &image_height, &image_size);
+ ret = image_util_decode_run(utc_decode[type].handle, &image_width, &image_height, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_input_path(g_decoder[type], g_source_path[type]);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_output_buffer(g_decoder[type], &data);
+ ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run(g_decoder[type], &image_width, &image_height, &image_size);
+ ret = image_util_decode_run(utc_decode[type].handle, &image_width, &image_height, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
IMAGEUTIL_SAFE_FREE(data);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_input_buffer(g_decoder[type], g_encode_result[type].buffer, g_encode_result[type].size);
+ ret = image_util_decode_set_input_buffer(utc_decode[type].handle, utc_encode[type].result.buffer, utc_encode[type].result.size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_output_buffer(g_decoder[type], &data);
+ ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run(g_decoder[type], &image_width, &image_height, &image_size);
+ ret = image_util_decode_run(utc_decode[type].handle, &image_width, &image_height, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
IMAGEUTIL_SAFE_FREE(data);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_run2(g_decoder[type], &decoded_image);
+ 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(g_decoder[type], g_source_path[type]);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run2(g_decoder[type], NULL);
+ ret = image_util_decode_run2(utc_decode[type].handle, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_input_path(g_decoder[type], g_source_path[type]);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run2(g_decoder[type], &decoded_image);
+ ret = image_util_decode_run2(utc_decode[type].handle, &decoded_image);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
ret = image_util_destroy_image(decoded_image);
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_input_buffer(g_decoder[type], g_encode_result[type].buffer, g_encode_result[type].size);
+ ret = image_util_decode_set_input_buffer(utc_decode[type].handle, utc_encode[type].result.buffer, utc_encode[type].result.size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run2(g_decoder[type], &decoded_image);
+ ret = image_util_decode_run2(utc_decode[type].handle, &decoded_image);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
ret = image_util_destroy_image(decoded_image);
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_run_async(g_encoder[type], (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
+ ret = image_util_decode_run_async(utc_encode[type].handle, (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_output_buffer(g_decoder[type], &data);
+ ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run_async(g_decoder[type], (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
+ ret = image_util_decode_run_async(utc_decode[type].handle, (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_input_path(g_decoder[type], g_source_path[type]);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run_async(g_decoder[type], (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
+ ret = image_util_decode_run_async(utc_decode[type].handle, (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_input_buffer(g_decoder[type], g_encode_result[type].buffer, g_encode_result[type].size);
+ ret = image_util_decode_set_input_buffer(utc_decode[type].handle, utc_encode[type].result.buffer, utc_encode[type].result.size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run_async(g_decoder[type], (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
+ ret = image_util_decode_run_async(utc_decode[type].handle, (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_input_path(g_decoder[type], g_source_path[type]);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_output_buffer(g_decoder[type], &data);
+ ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run_async(g_decoder[type], NULL, NULL);
+ ret = image_util_decode_run_async(utc_decode[type].handle, NULL, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_set_input_path(g_decoder[type], g_source_path[type]);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_output_buffer(g_decoder[type], &data);
+ ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run_async(g_decoder[type], (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
+ ret = image_util_decode_run_async(utc_decode[type].handle, (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
wait_for_async();
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_input_buffer(g_decoder[type], g_encode_result[type].buffer, g_encode_result[type].size);
+ ret = image_util_decode_set_input_buffer(utc_decode[type].handle, utc_encode[type].result.buffer, utc_encode[type].result.size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_output_buffer(g_decoder[type], &data);
+ ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run_async(g_decoder[type], (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
+ ret = image_util_decode_run_async(utc_decode[type].handle, (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
wait_for_async();
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_run_async2(g_decoder[type], utc_decode_completed2_cb, NULL);
+ ret = image_util_decode_run_async2(utc_decode[type].handle, utc_decode_completed2_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_decode_set_input_path(g_decoder[type], g_source_path[type]);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run_async2(g_decoder[type], NULL, NULL);
+ ret = image_util_decode_run_async2(utc_decode[type].handle, NULL, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
callback_error = -1;
- ret = image_util_decode_set_input_path(g_decoder[type], g_source_path[type]);
+ ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run_async2(g_decoder[type], utc_decode_completed2_cb, NULL);
+ ret = image_util_decode_run_async2(utc_decode[type].handle, utc_decode_completed2_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
wait_for_async();
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_set_input_buffer(g_decoder[type], g_encode_result[type].buffer, g_encode_result[type].size);
+ ret = image_util_decode_set_input_buffer(utc_decode[type].handle, utc_encode[type].result.buffer, utc_encode[type].result.size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_decode_run_async2(g_decoder[type], utc_decode_completed2_cb, NULL);
+ ret = image_util_decode_run_async2(utc_decode[type].handle, utc_decode_completed2_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
wait_for_async();
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_destroy(g_encoder[type]);
+ ret = image_util_decode_destroy(utc_encode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_decode_destroy(g_decoder[type]);
+ ret = image_util_decode_destroy(utc_decode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- g_decoder[type] = NULL;
+ utc_decode[type].handle = NULL;
}
return 0;
PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE, pszValue);
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- g_source_path[type] = _utc_get_test_path(pszValue, g_source_filename[type]);
- g_output_path[type] = _utc_get_test_path(pszValue, g_output_filename[type]);
+ utc_decode[type].source = _utc_get_test_path(pszValue, FILENAME[type].source);
+ utc_encode[type].output = _utc_get_test_path(pszValue, FILENAME[type].output);
FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type,
- g_source_path[type], g_output_path[type]);
+ utc_decode[type].source, utc_encode[type].output);
- if (!g_source_path[type] || !g_output_path[type])
+ if (!utc_decode[type].source || !utc_encode[type].output)
FPRINTF("[%d:%s] Get UTC Path error! \\n", __LINE__, __FUNCTION__);
}
}
}
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_create(type, &g_encoder[type]);
+ ret = image_util_encode_create(type, &utc_encode[type].handle);
if (IMAGE_UTIL_ERROR_NONE != ret)
PRINT_UTC_LOG("[Line : %d][%s] image_util_encode_create is failed(%d).\n", __LINE__, API_NAMESPACE, ret);
}
void utc_image_util_encode_cleanup(void)
{
/* end of TC */
- image_util_type_e type = 0;
-
- for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- IMAGEUTIL_SAFE_FREE(g_decode_result[type].buffer);
- g_decode_result[type].size = 0;
- IMAGEUTIL_SAFE_FREE(g_encode_result[type].buffer);
- g_encode_result[type].size = 0;
- g_encode_result[type].buffer_size = 0;
- IMAGEUTIL_SAFE_G_FREE (g_source_path[type]);
- IMAGEUTIL_SAFE_G_FREE (g_output_path[type]);
- image_util_encode_destroy(g_encoder[type]);
- g_encoder[type] = NULL;
- image_util_destroy_image(g_decoded_image[type]);
- g_decoded_image[type] = NULL;
- }
+ __utc_decode_free();
+ __utc_encode_free();
}
/**
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_destroy(g_encoder[type]);
+ ret = image_util_encode_destroy(utc_encode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- g_encoder[type] = NULL;
+ utc_encode[type].handle = NULL;
- ret = image_util_encode_create(-1, &g_encoder[type]);
+ ret = image_util_encode_create(-1, &utc_encode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_create(INVALID_IMAGE_TYPE, &g_encoder[type]);
+ ret = image_util_encode_create(INVALID_IMAGE_TYPE, &utc_encode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_destroy(g_encoder[type]);
+ ret = image_util_encode_destroy(utc_encode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- g_encoder[type] = NULL;
+ utc_encode[type].handle = NULL;
- ret = image_util_encode_create(type, &g_encoder[type]);
+ ret = image_util_encode_create(type, &utc_encode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_resolution(g_decoder[type], 320, 240);
+ ret = image_util_encode_set_resolution(utc_decode[type].handle, 320, 240);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_resolution(g_encoder[type], 0, 240);
+ ret = image_util_encode_set_resolution(utc_encode[type].handle, 0, 240);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_set_resolution(g_encoder[type], 320, 0);
+ ret = image_util_encode_set_resolution(utc_encode[type].handle, 320, 0);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_resolution(g_encoder[IMAGE_UTIL_GIF], 320, 240);
+ ret = image_util_encode_set_resolution(utc_encode[IMAGE_UTIL_GIF].handle, 320, 240);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[IMAGE_UTIL_GIF], 320, 250);
+ ret = image_util_encode_set_resolution(utc_encode[IMAGE_UTIL_GIF].handle, 320, 250);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
return 0;
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_resolution(g_encoder[type], 320, 240);
+ ret = image_util_encode_set_resolution(utc_encode[type].handle, 320, 240);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_colorspace(g_decoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_COLORSPACE_RGBA8888);
+ ret = image_util_encode_set_colorspace(utc_decode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_COLORSPACE_RGBA8888);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
return 0;
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_colorspace(g_encoder[IMAGE_UTIL_JPEG], -1);
+ ret = image_util_encode_set_colorspace(utc_encode[IMAGE_UTIL_JPEG].handle, -1);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_set_colorspace(g_encoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_COLORSPACE_NV61 + 1);
+ ret = image_util_encode_set_colorspace(utc_encode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_COLORSPACE_NV61 + 1);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
return 0;
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_colorspace(g_encoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_COLORSPACE_YUV422);
+ ret = image_util_encode_set_colorspace(utc_encode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_COLORSPACE_YUV422);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
- ret = image_util_encode_set_colorspace(g_encoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_COLORSPACE_UYVY);
+ ret = image_util_encode_set_colorspace(utc_encode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_COLORSPACE_UYVY);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
- ret = image_util_encode_set_colorspace(g_encoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_COLORSPACE_YUYV);
+ ret = image_util_encode_set_colorspace(utc_encode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_COLORSPACE_YUYV);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
- ret = image_util_encode_set_colorspace(g_encoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_COLORSPACE_RGB565);
+ ret = image_util_encode_set_colorspace(utc_encode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_COLORSPACE_RGB565);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
- ret = image_util_encode_set_colorspace(g_encoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_COLORSPACE_BGRX8888);
+ ret = image_util_encode_set_colorspace(utc_encode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_COLORSPACE_BGRX8888);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
- ret = image_util_encode_set_colorspace(g_encoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_COLORSPACE_NV21);
+ ret = image_util_encode_set_colorspace(utc_encode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_COLORSPACE_NV21);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
- ret = image_util_encode_set_colorspace(g_encoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_COLORSPACE_NV16);
+ ret = image_util_encode_set_colorspace(utc_encode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_COLORSPACE_NV16);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
- ret = image_util_encode_set_colorspace(g_encoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_COLORSPACE_NV61);
+ ret = image_util_encode_set_colorspace(utc_encode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_COLORSPACE_NV61);
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
return 0;
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_colorspace(g_encoder[IMAGE_UTIL_JPEG], IMAGE_UTIL_COLORSPACE_RGBA8888);
+ ret = image_util_encode_set_colorspace(utc_encode[IMAGE_UTIL_JPEG].handle, IMAGE_UTIL_COLORSPACE_RGBA8888);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
return 0;
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_quality(g_decoder[IMAGE_UTIL_JPEG], 1);
+ ret = image_util_encode_set_quality(utc_decode[IMAGE_UTIL_JPEG].handle, 1);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
return 0;
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_quality(g_encoder[type], 1);
+ ret = image_util_encode_set_quality(utc_encode[type].handle, 1);
if (type != IMAGE_UTIL_JPEG)
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
}
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_quality(g_encoder[IMAGE_UTIL_JPEG], 0);
+ ret = image_util_encode_set_quality(utc_encode[IMAGE_UTIL_JPEG].handle, 0);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_set_quality(g_encoder[IMAGE_UTIL_JPEG], 101);
+ ret = image_util_encode_set_quality(utc_encode[IMAGE_UTIL_JPEG].handle, 101);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
return 0;
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_quality(g_encoder[IMAGE_UTIL_JPEG], 1);
+ ret = image_util_encode_set_quality(utc_encode[IMAGE_UTIL_JPEG].handle, 1);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
return 0;
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_png_compression(g_decoder[IMAGE_UTIL_PNG], IMAGE_UTIL_PNG_COMPRESSION_0);
+ ret = image_util_encode_set_png_compression(utc_decode[IMAGE_UTIL_PNG].handle, IMAGE_UTIL_PNG_COMPRESSION_0);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
return 0;
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_png_compression(g_encoder[type], IMAGE_UTIL_PNG_COMPRESSION_0);
+ ret = image_util_encode_set_png_compression(utc_encode[type].handle, IMAGE_UTIL_PNG_COMPRESSION_0);
if (type != IMAGE_UTIL_PNG)
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
}
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_png_compression(g_encoder[IMAGE_UTIL_PNG], -1);
+ ret = image_util_encode_set_png_compression(utc_encode[IMAGE_UTIL_PNG].handle, -1);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_set_png_compression(g_encoder[IMAGE_UTIL_PNG], IMAGE_UTIL_PNG_COMPRESSION_9 + 1);
+ ret = image_util_encode_set_png_compression(utc_encode[IMAGE_UTIL_PNG].handle, IMAGE_UTIL_PNG_COMPRESSION_9 + 1);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
return 0;
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_png_compression(g_encoder[IMAGE_UTIL_PNG], IMAGE_UTIL_PNG_COMPRESSION_0);
+ ret = image_util_encode_set_png_compression(utc_encode[IMAGE_UTIL_PNG].handle, IMAGE_UTIL_PNG_COMPRESSION_0);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
return 0;
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_gif_frame_delay_time(g_decoder[IMAGE_UTIL_GIF], 100);
+ ret = image_util_encode_set_gif_frame_delay_time(utc_decode[IMAGE_UTIL_GIF].handle, 100);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
return 0;
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_gif_frame_delay_time(g_encoder[type], 100);
+ ret = image_util_encode_set_gif_frame_delay_time(utc_encode[type].handle, 100);
if (type != IMAGE_UTIL_GIF)
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
}
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_gif_frame_delay_time(g_encoder[IMAGE_UTIL_GIF], 100);
+ ret = image_util_encode_set_gif_frame_delay_time(utc_encode[IMAGE_UTIL_GIF].handle, 100);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
return 0;
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_webp_lossless(g_encoder[type], true);
+ ret = image_util_encode_set_webp_lossless(utc_encode[type].handle, true);
if (type != IMAGE_UTIL_WEBP)
assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
}
{
int ret = IMAGE_UTIL_ERROR_NONE;
- ret = image_util_encode_set_webp_lossless(g_encoder[IMAGE_UTIL_WEBP], true);
+ ret = image_util_encode_set_webp_lossless(utc_encode[IMAGE_UTIL_WEBP].handle, true);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_webp_lossless(g_encoder[IMAGE_UTIL_WEBP], false);
+ ret = image_util_encode_set_webp_lossless(utc_encode[IMAGE_UTIL_WEBP].handle, false);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
return 0;
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(NULL, g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(NULL, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_decoder[type], g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(utc_decode[type].handle, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_input_buffer(g_encoder[type], NULL);
+ ret = image_util_encode_set_input_buffer(utc_encode[type].handle, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[type], g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[type].handle, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_output_path(NULL, g_output_path[type]);
+ ret = image_util_encode_set_output_path(NULL, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_output_path(g_decoder[type], g_output_path[type]);
+ ret = image_util_encode_set_output_path(utc_decode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_output_path(g_encoder[type], WRONG_PATH);
+ ret = image_util_encode_set_output_path(utc_encode[type].handle, WRONG_PATH);
assert_eq(ret, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_output_path(g_encoder[type], NULL);
+ ret = image_util_encode_set_output_path(utc_encode[type].handle, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_output_path(g_encoder[type], g_output_path[type]);
+ ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_output_buffer(g_decoder[type], &data);
+ ret = image_util_encode_set_output_buffer(utc_decode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_output_buffer(g_encoder[type], NULL);
+ ret = image_util_encode_set_output_buffer(utc_encode[type].handle, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_output_buffer(g_encoder[type], &data);
+ ret = image_util_encode_set_output_buffer(utc_encode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_run(g_decoder[type], &image_size);
+ ret = image_util_encode_run(utc_decode[type].handle, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_run(g_encoder[type], &image_size);
+ ret = image_util_encode_run(utc_encode[type].handle, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[type], g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[type].handle, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run(g_encoder[type], &image_size);
+ ret = image_util_encode_run(utc_encode[type].handle, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_output_path(g_encoder[type], g_output_path[type]);
+ ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run(g_encoder[type], &image_size);
+ ret = image_util_encode_run(utc_encode[type].handle, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_output_buffer(g_encoder[type], &data);
+ ret = image_util_encode_set_output_buffer(utc_encode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run(g_encoder[type], &image_size);
+ ret = image_util_encode_run(utc_encode[type].handle, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[type], g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[type].handle, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_output_path(g_encoder[type], g_output_path[type]);
+ ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run(g_encoder[type], &image_size);
+ ret = image_util_encode_run(utc_encode[type].handle, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(IMAGE_UTIL_GIF);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[IMAGE_UTIL_GIF], g_decode_result[IMAGE_UTIL_GIF].width, g_decode_result[IMAGE_UTIL_GIF].height);
+ ret = image_util_encode_set_resolution(utc_encode[IMAGE_UTIL_GIF].handle, utc_decode[IMAGE_UTIL_GIF].result.width, utc_decode[IMAGE_UTIL_GIF].result.height);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[IMAGE_UTIL_GIF], g_decode_result[IMAGE_UTIL_GIF].width, g_decode_result[IMAGE_UTIL_GIF].height);
+ ret = image_util_encode_set_resolution(utc_encode[IMAGE_UTIL_GIF].handle, utc_decode[IMAGE_UTIL_GIF].result.width, utc_decode[IMAGE_UTIL_GIF].result.height);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[IMAGE_UTIL_GIF], g_decode_result[IMAGE_UTIL_GIF].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[IMAGE_UTIL_GIF].handle, utc_decode[IMAGE_UTIL_GIF].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_output_path(g_encoder[IMAGE_UTIL_GIF], g_output_path[IMAGE_UTIL_GIF]);
+ ret = image_util_encode_set_output_path(utc_encode[IMAGE_UTIL_GIF].handle, utc_encode[IMAGE_UTIL_GIF].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run(g_encoder[IMAGE_UTIL_GIF], &image_size);
+ ret = image_util_encode_run(utc_encode[IMAGE_UTIL_GIF].handle, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_OPERATION);
return 0;
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[type], g_decode_result[type].width, g_decode_result[type].height);
+ ret = image_util_encode_set_resolution(utc_encode[type].handle, utc_decode[type].result.width, utc_decode[type].result.height);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[type], g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[type].handle, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_output_path(g_encoder[type], g_output_path[type]);
+ ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run(g_encoder[type], &image_size);
+ ret = image_util_encode_run(utc_encode[type].handle, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[type], g_decode_result[type].width, g_decode_result[type].height);
+ ret = image_util_encode_set_resolution(utc_encode[type].handle, utc_decode[type].result.width, utc_decode[type].result.height);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[type], g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[type].handle, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_output_buffer(g_encoder[type], &data);
+ ret = image_util_encode_set_output_buffer(utc_encode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run(g_encoder[type], &image_size);
+ ret = image_util_encode_run(utc_encode[type].handle, &image_size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
IMAGEUTIL_SAFE_FREE(data);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[type], g_decode_result[type].width, g_decode_result[type].height);
+ ret = image_util_encode_set_resolution(utc_encode[type].handle, utc_decode[type].result.width, utc_decode[type].result.height);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[type], g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[type].handle, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_output_path(g_encoder[type], g_output_path[type]);
+ ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run(g_encoder[type], &size);
+ ret = image_util_encode_run(utc_encode[type].handle, &size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
ret = __fill_test_buffer(IMAGE_UTIL_GIF);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[IMAGE_UTIL_GIF], g_decode_result[IMAGE_UTIL_GIF].width, g_decode_result[IMAGE_UTIL_GIF].height);
+ ret = image_util_encode_set_resolution(utc_encode[IMAGE_UTIL_GIF].handle, utc_decode[IMAGE_UTIL_GIF].result.width, utc_decode[IMAGE_UTIL_GIF].result.height);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[IMAGE_UTIL_GIF], g_decode_result[IMAGE_UTIL_GIF].width, g_decode_result[IMAGE_UTIL_GIF].height);
+ ret = image_util_encode_set_resolution(utc_encode[IMAGE_UTIL_GIF].handle, utc_decode[IMAGE_UTIL_GIF].result.width, utc_decode[IMAGE_UTIL_GIF].result.height);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[IMAGE_UTIL_GIF], g_decode_result[IMAGE_UTIL_GIF].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[IMAGE_UTIL_GIF].handle, utc_decode[IMAGE_UTIL_GIF].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[IMAGE_UTIL_GIF], g_decode_result[IMAGE_UTIL_GIF].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[IMAGE_UTIL_GIF].handle, utc_decode[IMAGE_UTIL_GIF].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_gif_frame_delay_time(g_encoder[IMAGE_UTIL_GIF], 100);
+ ret = image_util_encode_set_gif_frame_delay_time(utc_encode[IMAGE_UTIL_GIF].handle, 100);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_gif_frame_delay_time(g_encoder[IMAGE_UTIL_GIF], 100);
+ ret = image_util_encode_set_gif_frame_delay_time(utc_encode[IMAGE_UTIL_GIF].handle, 100);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_output_path(g_encoder[IMAGE_UTIL_GIF], g_output_path[IMAGE_UTIL_GIF]);
+ ret = image_util_encode_set_output_path(utc_encode[IMAGE_UTIL_GIF].handle, utc_encode[IMAGE_UTIL_GIF].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run(g_encoder[IMAGE_UTIL_GIF], &size);
+ ret = image_util_encode_run(utc_encode[IMAGE_UTIL_GIF].handle, &size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
return 0;
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_run_async(g_decoder[type], (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
+ ret = image_util_encode_run_async(utc_decode[type].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_run_async(g_encoder[type], (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
+ ret = image_util_encode_run_async(utc_encode[type].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[type], g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[type].handle, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_async(g_encoder[type], (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
+ ret = image_util_encode_run_async(utc_encode[type].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_output_path(g_encoder[type], g_output_path[type]);
+ ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_async(g_encoder[type], (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
+ ret = image_util_encode_run_async(utc_encode[type].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_set_output_buffer(g_encoder[type], &data);
+ ret = image_util_encode_set_output_buffer(utc_encode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_async(g_encoder[type], (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
+ ret = image_util_encode_run_async(utc_encode[type].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[type], g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[type].handle, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_output_path(g_encoder[type], g_output_path[type]);
+ ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_async(g_encoder[type], (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
+ ret = image_util_encode_run_async(utc_encode[type].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[type], g_decode_result[type].width, g_decode_result[type].height);
+ ret = image_util_encode_set_resolution(utc_encode[type].handle, utc_decode[type].result.width, utc_decode[type].result.height);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[type], g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[type].handle, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_output_path(g_encoder[type], g_output_path[type]);
+ ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_async(g_encoder[type], NULL, NULL);
+ ret = image_util_encode_run_async(utc_encode[type].handle, NULL, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
ret = __fill_test_buffer(IMAGE_UTIL_GIF);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[IMAGE_UTIL_GIF], g_decode_result[IMAGE_UTIL_GIF].width, g_decode_result[IMAGE_UTIL_GIF].height);
+ ret = image_util_encode_set_resolution(utc_encode[IMAGE_UTIL_GIF].handle, utc_decode[IMAGE_UTIL_GIF].result.width, utc_decode[IMAGE_UTIL_GIF].result.height);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[IMAGE_UTIL_GIF], g_decode_result[IMAGE_UTIL_GIF].width, g_decode_result[IMAGE_UTIL_GIF].height);
+ ret = image_util_encode_set_resolution(utc_encode[IMAGE_UTIL_GIF].handle, utc_decode[IMAGE_UTIL_GIF].result.width, utc_decode[IMAGE_UTIL_GIF].result.height);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[IMAGE_UTIL_GIF], g_decode_result[IMAGE_UTIL_GIF].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[IMAGE_UTIL_GIF].handle, utc_decode[IMAGE_UTIL_GIF].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_output_path(g_encoder[IMAGE_UTIL_GIF], g_output_path[IMAGE_UTIL_GIF]);
+ ret = image_util_encode_set_output_path(utc_encode[IMAGE_UTIL_GIF].handle, utc_encode[IMAGE_UTIL_GIF].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_async(g_encoder[IMAGE_UTIL_GIF], (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
+ ret = image_util_encode_run_async(utc_encode[IMAGE_UTIL_GIF].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
wait_for_async();
assert_eq(callback_error, IMAGE_UTIL_ERROR_INVALID_OPERATION);
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[type], g_decode_result[type].width, g_decode_result[type].height);
+ ret = image_util_encode_set_resolution(utc_encode[type].handle, utc_decode[type].result.width, utc_decode[type].result.height);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[type], g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[type].handle, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_output_path(g_encoder[type], g_output_path[type]);
+ ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_async(g_encoder[type], (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
+ ret = image_util_encode_run_async(utc_encode[type].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
wait_for_async();
assert_eq(callback_error, IMAGE_UTIL_ERROR_NONE);
ret = __fill_test_buffer(type);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_resolution(g_encoder[type], g_decode_result[type].width, g_decode_result[type].height);
+ ret = image_util_encode_set_resolution(utc_encode[type].handle, utc_decode[type].result.width, utc_decode[type].result.height);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_input_buffer(g_encoder[type], g_decode_result[type].buffer);
+ ret = image_util_encode_set_input_buffer(utc_encode[type].handle, utc_decode[type].result.buffer);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_set_output_buffer(g_encoder[type], &data);
+ ret = image_util_encode_set_output_buffer(utc_encode[type].handle, &data);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_async(g_encoder[type], (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
+ ret = image_util_encode_run_async(utc_encode[type].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
wait_for_async();
IMAGEUTIL_SAFE_FREE(data);
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = _utc_decode_from_file(g_source_path[type], &g_decoded_image[type]);
+ ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_to_file(g_encoder[type], g_decoded_image[type], g_output_path[type]);
+ ret = image_util_encode_run_to_file(utc_encode[type].handle, utc_decode[type].decoded, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = _utc_decode_from_file(g_source_path[type], &g_decoded_image[type]);
+ ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_to_file(NULL, g_decoded_image[type], g_output_path[type]);
+ ret = image_util_encode_run_to_file(NULL, utc_decode[type].decoded, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_run_to_file(g_encoder[type], NULL, g_output_path[type]);
+ ret = image_util_encode_run_to_file(utc_encode[type].handle, NULL, utc_encode[type].output);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_run_to_file(g_encoder[type], g_decoded_image[type], NULL);
+ ret = image_util_encode_run_to_file(utc_encode[type].handle, utc_decode[type].decoded, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = _utc_decode_from_file(g_source_path[type], &g_decoded_image[type]);
+ ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_to_buffer(g_encoder[type], g_decoded_image[type], &g_encode_result[type].buffer, &g_encode_result[type].buffer_size);
+ ret = image_util_encode_run_to_buffer(utc_encode[type].handle, utc_decode[type].decoded, &utc_encode[type].result.buffer, &utc_encode[type].result.buffer_size);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- assert_neq(g_encode_result[type].buffer, NULL);
- assert_gt(g_encode_result[type].buffer_size, 0);
+ assert_neq(utc_encode[type].result.buffer, NULL);
+ assert_gt(utc_encode[type].result.buffer_size, 0);
}
return 0;
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = _utc_decode_from_file(g_source_path[type], &g_decoded_image[type]);
+ ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_to_buffer(NULL, g_decoded_image[type], &g_encode_result[type].buffer, &g_encode_result[type].buffer_size);
+ ret = image_util_encode_run_to_buffer(NULL, utc_decode[type].decoded, &utc_encode[type].result.buffer, &utc_encode[type].result.buffer_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_run_to_buffer(g_encoder[type], NULL, &g_encode_result[type].buffer, &g_encode_result[type].buffer_size);
+ ret = image_util_encode_run_to_buffer(utc_encode[type].handle, NULL, &utc_encode[type].result.buffer, &utc_encode[type].result.buffer_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_run_to_buffer(g_encoder[type], g_decoded_image[type], NULL, &g_encode_result[type].buffer_size);
+ ret = image_util_encode_run_to_buffer(utc_encode[type].handle, utc_decode[type].decoded, NULL, &utc_encode[type].result.buffer_size);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_run_to_buffer(g_encoder[type], g_decoded_image[type], &g_encode_result[type].buffer, NULL);
+ ret = image_util_encode_run_to_buffer(utc_encode[type].handle, utc_decode[type].decoded, &utc_encode[type].result.buffer, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = _utc_decode_from_file(g_source_path[type], &g_decoded_image[type]);
+ ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_async_to_file(g_encoder[type], g_decoded_image[type], g_output_path[type],
+ ret = image_util_encode_run_async_to_file(utc_encode[type].handle, utc_decode[type].decoded, utc_encode[type].output,
utc_encode_to_file_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = _utc_decode_from_file(g_source_path[type], &g_decoded_image[type]);
+ ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_async_to_file(NULL, g_decoded_image[type], g_output_path[type], utc_encode_to_file_completed_cb, NULL);
+ ret = image_util_encode_run_async_to_file(NULL, utc_decode[type].decoded, utc_encode[type].output, utc_encode_to_file_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_run_async_to_file(g_encoder[type], NULL, g_output_path[type], utc_encode_to_file_completed_cb, NULL);
+ ret = image_util_encode_run_async_to_file(utc_encode[type].handle, NULL, utc_encode[type].output, utc_encode_to_file_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_run_async_to_file(g_encoder[type], g_decoded_image[type], NULL, utc_encode_to_file_completed_cb, NULL);
+ ret = image_util_encode_run_async_to_file(utc_encode[type].handle, utc_decode[type].decoded, NULL, utc_encode_to_file_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_run_async_to_file(g_encoder[type], g_decoded_image[type], g_output_path[type], NULL, NULL);
+ ret = image_util_encode_run_async_to_file(utc_encode[type].handle, utc_decode[type].decoded, utc_encode[type].output, NULL, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = _utc_decode_from_file(g_source_path[type], &g_decoded_image[type]);
+ ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_async_to_buffer(g_encoder[type], g_decoded_image[type], utc_encode_to_buffer_completed_cb,
- &g_encode_result[type]);
+ ret = image_util_encode_run_async_to_buffer(utc_encode[type].handle, utc_decode[type].decoded, utc_encode_to_buffer_completed_cb,
+ &utc_encode[type].result);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
wait_for_async();
assert_eq(callback_error, IMAGE_UTIL_ERROR_NONE);
- assert_neq(g_encode_result[type].buffer, NULL);
- assert_gt(g_encode_result[type].buffer_size, 0);
+ assert_neq(utc_encode[type].result.buffer, NULL);
+ assert_gt(utc_encode[type].result.buffer_size, 0);
}
return 0;
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = _utc_decode_from_file(g_source_path[type], &g_decoded_image[type]);
+ ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- ret = image_util_encode_run_async_to_buffer(NULL, g_decoded_image[type], utc_encode_to_buffer_completed_cb, NULL);
+ ret = image_util_encode_run_async_to_buffer(NULL, utc_decode[type].decoded, utc_encode_to_buffer_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_run_async_to_buffer(g_encoder[type], NULL, utc_encode_to_buffer_completed_cb, NULL);
+ ret = image_util_encode_run_async_to_buffer(utc_encode[type].handle, NULL, utc_encode_to_buffer_completed_cb, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
- ret = image_util_encode_run_async_to_buffer(g_encoder[type], g_decoded_image[type], NULL, NULL);
+ ret = image_util_encode_run_async_to_buffer(utc_encode[type].handle, utc_decode[type].decoded, NULL, NULL);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_destroy(g_decoder[type]);
+ ret = image_util_encode_destroy(utc_decode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
}
image_util_type_e type = 0;
for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
- ret = image_util_encode_destroy(g_encoder[type]);
+ ret = image_util_encode_destroy(utc_encode[type].handle);
assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
- g_encoder[type] = NULL;
+ utc_encode[type].handle = NULL;
}
return 0;