From: Ankit Srivastava Date: Wed, 12 Apr 2023 09:18:03 +0000 (+0530) Subject: [ITC][media-vision-dl][NonACR] Indentation corrected X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b87ed5029f68bebbce97227ee00a67d9a515bcbb;p=test%2Ftct%2Fnative%2Fapi.git [ITC][media-vision-dl][NonACR] Indentation corrected Change-Id: I8f3e6b01f5c9552d0f1d2969166645e0749130f3 Signed-off-by: Ankit Srivastava --- diff --git a/src/itc/media-vision-dl/ITs-media-vision-common.c b/src/itc/media-vision-dl/ITs-media-vision-common.c index f5bce45bb..23fbc9181 100644 --- a/src/itc/media-vision-dl/ITs-media-vision-common.c +++ b/src/itc/media-vision-dl/ITs-media-vision-common.c @@ -62,143 +62,143 @@ char* ImageUtilGetError(int nRet) char *szErrorVal = NULL; switch ( nRet ) { - case IMAGE_UTIL_ERROR_INVALID_PARAMETER: szErrorVal = "IMAGE_UTIL_ERROR_INVALID_PARAMETER"; break; - case IMAGE_UTIL_ERROR_OUT_OF_MEMORY: szErrorVal = "IMAGE_UTIL_ERROR_OUT_OF_MEMORY"; break; - case IMAGE_UTIL_ERROR_NO_SUCH_FILE: szErrorVal = "IMAGE_UTIL_ERROR_NO_SUCH_FILE"; break; - case IMAGE_UTIL_ERROR_INVALID_OPERATION: szErrorVal = "IMAGE_UTIL_ERROR_INVALID_OPERATION"; break; - case IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT: szErrorVal = "IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT"; break; - case IMAGE_UTIL_ERROR_NONE: szErrorVal = "IMAGE_UTIL_ERROR_NONE"; break; - default: szErrorVal = "Unknown Error"; break; + case IMAGE_UTIL_ERROR_INVALID_PARAMETER: szErrorVal = "IMAGE_UTIL_ERROR_INVALID_PARAMETER"; break; + case IMAGE_UTIL_ERROR_OUT_OF_MEMORY: szErrorVal = "IMAGE_UTIL_ERROR_OUT_OF_MEMORY"; break; + case IMAGE_UTIL_ERROR_NO_SUCH_FILE: szErrorVal = "IMAGE_UTIL_ERROR_NO_SUCH_FILE"; break; + case IMAGE_UTIL_ERROR_INVALID_OPERATION: szErrorVal = "IMAGE_UTIL_ERROR_INVALID_OPERATION"; break; + case IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT: szErrorVal = "IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT"; break; + case IMAGE_UTIL_ERROR_NONE: szErrorVal = "IMAGE_UTIL_ERROR_NONE"; break; + default: szErrorVal = "Unknown Error"; break; } return szErrorVal; } int image_load(const char *file_path, mv_source_h source) { - if (NULL == file_path || NULL == source) - { - FPRINTF("[Line : %d][%s] File path or source is NULL\\n", __LINE__, API_NAMESPACE); - return MEDIA_VISION_ERROR_INVALID_PARAMETER; - } + if (NULL == file_path || NULL == source) + { + FPRINTF("[Line : %d][%s] File path or source is NULL\\n", __LINE__, API_NAMESPACE); + return MEDIA_VISION_ERROR_INVALID_PARAMETER; + } - unsigned long width = 0; - unsigned long height = 0; - unsigned long long buffer_size = 0; - unsigned char *data_buffer = NULL; - image_util_decode_h hDecoder = NULL; + unsigned long width = 0; + unsigned long height = 0; + unsigned long long buffer_size = 0; + unsigned char *data_buffer = NULL; + image_util_decode_h hDecoder = NULL; - int ret = image_util_decode_create(&hDecoder); - if (IMAGE_UTIL_ERROR_NONE != ret) - { - FPRINTF("[Line : %d][%s] image_util_decode_create Failed\\n", __LINE__, API_NAMESPACE); - return ret; - } - ret = image_util_decode_set_input_path(hDecoder, file_path); - if (IMAGE_UTIL_ERROR_NONE != ret) - { - ret = image_util_decode_destroy(hDecoder); - if (IMAGE_UTIL_ERROR_NONE != ret) - { - FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); - return ret; - } - FPRINTF("[Line : %d][%s] image_util_decode_set_input_path Failed\\n", __LINE__, API_NAMESPACE); - return ret; - } - ret = image_util_decode_set_colorspace(hDecoder, IMAGE_UTIL_COLORSPACE_RGB888); - if (IMAGE_UTIL_ERROR_NONE != ret) - { - ret = image_util_decode_destroy(hDecoder); - if (IMAGE_UTIL_ERROR_NONE != ret) - { - FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); - return ret; - } - FPRINTF("[Line : %d][%s] image_util_decode_set_colorspace Failed\\n", __LINE__, API_NAMESPACE); - return ret; - } - ret = image_util_decode_set_output_buffer(hDecoder, &data_buffer); - if (IMAGE_UTIL_ERROR_NONE != ret) - { - ret = image_util_decode_destroy(hDecoder); - if (IMAGE_UTIL_ERROR_NONE != ret) - { - FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); - return ret; - } - FPRINTF("[Line : %d][%s] image_util_decode_set_output_buffer Failed\\n", __LINE__, API_NAMESPACE); - return ret; - } + int ret = image_util_decode_create(&hDecoder); + if (IMAGE_UTIL_ERROR_NONE != ret) + { + FPRINTF("[Line : %d][%s] image_util_decode_create Failed\\n", __LINE__, API_NAMESPACE); + return ret; + } + ret = image_util_decode_set_input_path(hDecoder, file_path); + if (IMAGE_UTIL_ERROR_NONE != ret) + { + ret = image_util_decode_destroy(hDecoder); + if (IMAGE_UTIL_ERROR_NONE != ret) + { + FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); + return ret; + } + FPRINTF("[Line : %d][%s] image_util_decode_set_input_path Failed\\n", __LINE__, API_NAMESPACE); + return ret; + } + ret = image_util_decode_set_colorspace(hDecoder, IMAGE_UTIL_COLORSPACE_RGB888); + if (IMAGE_UTIL_ERROR_NONE != ret) + { + ret = image_util_decode_destroy(hDecoder); + if (IMAGE_UTIL_ERROR_NONE != ret) + { + FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); + return ret; + } + FPRINTF("[Line : %d][%s] image_util_decode_set_colorspace Failed\\n", __LINE__, API_NAMESPACE); + return ret; + } + ret = image_util_decode_set_output_buffer(hDecoder, &data_buffer); + if (IMAGE_UTIL_ERROR_NONE != ret) + { + ret = image_util_decode_destroy(hDecoder); + if (IMAGE_UTIL_ERROR_NONE != ret) + { + FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); + return ret; + } + FPRINTF("[Line : %d][%s] image_util_decode_set_output_buffer Failed\\n", __LINE__, API_NAMESPACE); + return ret; + } - ret = image_util_decode_run(hDecoder, &width, &height, &buffer_size); - if (IMAGE_UTIL_ERROR_NONE != ret) - { - if (data_buffer) - { - free(data_buffer); - data_buffer = NULL; - } - ret = image_util_decode_destroy(hDecoder); - if (IMAGE_UTIL_ERROR_NONE != ret) - { - FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); - return ret; - } - FPRINTF("[Line : %d][%s] image_util_decode_run Failed\\n", __LINE__, API_NAMESPACE); - return ret; - } + ret = image_util_decode_run(hDecoder, &width, &height, &buffer_size); + if (IMAGE_UTIL_ERROR_NONE != ret) + { + if (data_buffer) + { + free(data_buffer); + data_buffer = NULL; + } + ret = image_util_decode_destroy(hDecoder); + if (IMAGE_UTIL_ERROR_NONE != ret) + { + FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); + return ret; + } + FPRINTF("[Line : %d][%s] image_util_decode_run Failed\\n", __LINE__, API_NAMESPACE); + return ret; + } - mv_colorspace_e source_colorspace = MEDIA_VISION_COLORSPACE_RGB888; + mv_colorspace_e source_colorspace = MEDIA_VISION_COLORSPACE_RGB888; - ret = mv_source_clear(source); - if (MEDIA_VISION_ERROR_NONE != ret) - { - if (data_buffer) - { - free(data_buffer); - data_buffer = NULL; - } - ret = image_util_decode_destroy(hDecoder); - if (IMAGE_UTIL_ERROR_NONE != ret) - { - FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); - return ret; - } - FPRINTF("[Line : %d][%s] Error occured when clearing the source\\n", __LINE__, API_NAMESPACE); - return ret; - } + ret = mv_source_clear(source); + if (MEDIA_VISION_ERROR_NONE != ret) + { + if (data_buffer) + { + free(data_buffer); + data_buffer = NULL; + } + ret = image_util_decode_destroy(hDecoder); + if (IMAGE_UTIL_ERROR_NONE != ret) + { + FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); + return ret; + } + FPRINTF("[Line : %d][%s] Error occured when clearing the source\\n", __LINE__, API_NAMESPACE); + return ret; + } - ret = mv_source_fill_by_buffer(source, data_buffer, buffer_size, width, height, source_colorspace); - if (MEDIA_VISION_ERROR_NONE != ret) - { - if (data_buffer) - { - free(data_buffer); - data_buffer = NULL; - } - ret = image_util_decode_destroy(hDecoder); - if (IMAGE_UTIL_ERROR_NONE != ret) - { - FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); - return ret; - } - FPRINTF("[Line : %d][%s] Error occured when filling the source by buffer\\n", __LINE__, API_NAMESPACE); - return ret; - } + ret = mv_source_fill_by_buffer(source, data_buffer, buffer_size, width, height, source_colorspace); + if (MEDIA_VISION_ERROR_NONE != ret) + { + if (data_buffer) + { + free(data_buffer); + data_buffer = NULL; + } + ret = image_util_decode_destroy(hDecoder); + if (IMAGE_UTIL_ERROR_NONE != ret) + { + FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); + return ret; + } + FPRINTF("[Line : %d][%s] Error occured when filling the source by buffer\\n", __LINE__, API_NAMESPACE); + return ret; + } - if (data_buffer) - { - free(data_buffer); - data_buffer = NULL; - } - ret = image_util_decode_destroy(hDecoder); - if (IMAGE_UTIL_ERROR_NONE != ret) - { - FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); - return ret; - } + if (data_buffer) + { + free(data_buffer); + data_buffer = NULL; + } + ret = image_util_decode_destroy(hDecoder); + if (IMAGE_UTIL_ERROR_NONE != ret) + { + FPRINTF("[Line : %d][%s] image_util_decode_destroy Failed\\n", __LINE__, API_NAMESPACE); + return ret; + } - return MEDIA_VISION_ERROR_NONE; + return MEDIA_VISION_ERROR_NONE; } /** @} */