mm_util_fenter();
- if (!imgsize) {
- mm_util_error("imgsize can't be null");
- return MM_UTIL_ERROR_NO_SUCH_FILE;
- }
+ mm_util_retvm_if(imgsize == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid imgsize");
+ mm_util_retvm_if(check_valid_picture_size(width, height) != MM_UTIL_ERROR_NONE, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid width and height");
*imgsize = 0;
- if (check_valid_picture_size(width, height) < 0) {
- mm_util_error("invalid width and height");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
-
switch (format) {
case MM_UTIL_COLOR_I420:
case MM_UTIL_COLOR_YUV420:
mm_util_fenter();
- if (!imgsize) {
- mm_util_error("imgsize can't be null");
- return MM_UTIL_ERROR_NO_SUCH_FILE;
- }
+ mm_util_retvm_if(imgsize == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid imgsize");
+ mm_util_retvm_if(check_valid_picture_size(width, height) != MM_UTIL_ERROR_NONE, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid width and height");
*imgsize = 0;
- if (check_valid_picture_size(width, height) < 0) {
- mm_util_error("invalid width and height");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
-
switch (format) {
case MM_UTIL_COLOR_I420:
case MM_UTIL_COLOR_YUV420:
{
int ret = MM_UTIL_ERROR_NONE;
- if (!dst_width || !dst_height) {
- mm_util_error("dst_width || dst_height is NULL");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
+ mm_util_retvm_if(dst_width == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid dst_width");
+ mm_util_retvm_if(dst_height == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid dst_height");
mm_util_fenter();
{
int ret = MM_UTIL_ERROR_NONE;
- if (_imgp_info_s == NULL) {
- mm_util_error("_imgp_info_s is NULL");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
+ mm_util_retvm_if(_imgp_info_s == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid _imgp_info_s");
_imgp_info_s->src_format = src_format;
_imgp_info_s->src_width = src_width;
else if (_imgp_plugin_type_e == IMGP_GSTCS)
module = g_module_open(PATH_GSTCS_LIB, G_MODULE_BIND_LAZY);
- if (module == NULL) {
- mm_util_error("[%d] %s | %s module open failed", _imgp_plugin_type_e, PATH_NEON_LIB, PATH_GSTCS_LIB);
- return NULL;
- }
+ mm_util_retvm_if(module == NULL, NULL, "[%d] %s | %s module open failed", _imgp_plugin_type_e, PATH_NEON_LIB, PATH_GSTCS_LIB);
mm_util_debug("module: %p, g_module_name: %s", module, g_module_name(module));
return module;
{
int ret = MM_UTIL_ERROR_NONE;
- if (!handle) {
- mm_util_error("[ERROR] - handle");
- return MM_UTIL_ERROR_INVALID_OPERATION;
- }
+ mm_util_retvm_if(handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle");
/* private values init */
handle->dst = NULL;
int ret = MM_UTIL_ERROR_NONE;
mm_util_color_image_h pop_data = NULL;
- if (!handle) {
- mm_util_error("[ERROR] - handle");
- return NULL;
- }
+ mm_util_retvm_if(handle == NULL, NULL, "invalid handle");
while (!handle->is_finish) {
mm_util_debug("waiting...");
{
int ret = MM_UTIL_ERROR_NONE;
- if (!handle) {
- mm_util_error("[ERROR] - handle");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
-
- if (handle->thread) {
- mm_util_error("Thread is already created");
- return MM_UTIL_ERROR_NONE;
- }
+ mm_util_retvm_if(handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle");
+ mm_util_retvm_if(handle->thread != NULL, MM_UTIL_ERROR_NONE, "[NO-ERROR] Thread is already created");
/*create threads*/
handle->thread = g_thread_new("transform_thread", (GThreadFunc)_mm_util_thread_repeate, (gpointer)handle);
- if (!handle->thread) {
- mm_util_error("ERROR - create thread");
- return MM_UTIL_ERROR_INVALID_OPERATION;
- }
+ mm_util_retvm_if(handle->thread == NULL, MM_UTIL_ERROR_INVALID_OPERATION, "ERROR - create thread");
mm_util_debug("New thread is created");
unsigned char *res_buffer = NULL;
size_t res_buffer_size = 0;
- if (handle == NULL) {
- mm_util_error("Invalid arguments [tag null]");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
+ mm_util_retvm_if(handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle");
mm_util_debug("src: %p, dst: %p", handle->src, handle->dst);
{
int ret = MM_UTIL_ERROR_NONE;
- if ((handle == NULL) || (source_image == NULL)) {
- mm_util_error("Invalid parameter");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
+ mm_util_retvm_if(handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle");
+ mm_util_retvm_if(source_image == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid source_image");
mm_util_debug("orig_image: %p [%zu] %lu X %lu (%u)", source_image->data, source_image->size,
source_image->width, source_image->height, source_image->color);
{
int ret = MM_UTIL_ERROR_NONE;
- if (!handle) {
- mm_util_error("[ERROR] - handle");
- return MM_UTIL_ERROR_INVALID_OPERATION;
- }
+ mm_util_retvm_if(handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle");
/* g_thread_exit(handle->thread); */
if (handle->thread) {
{
int ret = MM_UTIL_ERROR_NONE;
- if (imgp_handle == NULL) {
- mm_util_error("Invalid arguments [tag null]");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
+ mm_util_retvm_if(imgp_handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid imgp_handle");
mm_util_s *handle = calloc(1, sizeof(mm_util_s));
if (!handle) {
int ret = MM_UTIL_ERROR_NONE;
mm_util_s *handle = (mm_util_s *) imgp_handle;
- if (!handle) {
- mm_util_error("[ERROR] - handle");
- return MM_UTIL_ERROR_INVALID_OPERATION;
- }
+ mm_util_retvm_if(handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle");
handle->set_convert = TRUE;
handle->dst_format = colorspace;
int ret = MM_UTIL_ERROR_NONE;
mm_util_s *handle = (mm_util_s *) imgp_handle;
- if (!handle) {
- mm_util_error("[ERROR] - handle");
- return MM_UTIL_ERROR_INVALID_OPERATION;
- }
+ mm_util_retvm_if(handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle");
handle->set_resize = TRUE;
handle->dst_width = width;
int ret = MM_UTIL_ERROR_NONE;
mm_util_s *handle = (mm_util_s *) imgp_handle;
-
- if (!handle) {
- mm_util_error("[ERROR] - handle");
- return MM_UTIL_ERROR_INVALID_OPERATION;
- }
+ mm_util_retvm_if(handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle");
handle->set_rotate = TRUE;
handle->rotation = rotation;
unsigned int dest_width = end_x - start_x;
unsigned int dest_height = end_y - start_y;
- if (!handle) {
- mm_util_error("[ERROR] - handle");
- return MM_UTIL_ERROR_INVALID_OPERATION;
- }
+ mm_util_retvm_if(handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle");
handle->set_crop = TRUE;
handle->start_x = start_x;
mm_util_fenter();
- if (!handle) {
- mm_util_error("[ERROR] - handle");
- return MM_UTIL_ERROR_INVALID_OPERATION;
- }
+ mm_util_retvm_if(handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle");
+ mm_util_retvm_if(image == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid image");
+ mm_util_retvm_if(completed_callback == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid completed_callback");
- if (!image) {
- mm_util_error("[ERROR] - image");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- } else {
- mm_util_debug("image: %p", image);
- }
-
- if (!completed_callback) {
- mm_util_error("[ERROR] - completed_callback");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
+ mm_util_debug("image: %p", image);
MMUTIL_SAFE_FREE(handle->_util_cb);
handle->_util_cb = (mm_util_cb_s *)calloc(1, sizeof(mm_util_cb_s));
mm_util_s *handle = (mm_util_s *) imgp_handle;
- if (!handle) {
- mm_util_error("[ERROR] - handle");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
-
- if (!is_completed) {
- mm_util_error("[ERROR] - is_completed");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
+ mm_util_retvm_if(handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle");
+ mm_util_retvm_if(!is_completed, MM_UTIL_ERROR_INVALID_PARAMETER, "[ERROR] - is_completed");
*is_completed = handle->is_completed;
mm_util_debug("[Transform....] %d", *is_completed);
mm_util_fenter();
- if (!handle) {
- mm_util_error("[ERROR] - handle");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
-
- /* Close */
- if (_mm_util_handle_finalize(handle) != MM_UTIL_ERROR_NONE) {
- mm_util_error("_mm_util_handle_finalize)");
- return MM_UTIL_ERROR_INVALID_PARAMETER;
- }
+ mm_util_retvm_if(handle == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "invalid handle");
+ mm_util_retvm_if(_mm_util_handle_finalize(handle) != MM_UTIL_ERROR_NONE, MM_UTIL_ERROR_INVALID_PARAMETER, "fail _mm_util_handle_finalize");
MMUTIL_SAFE_FREE(handle->_util_cb);
MMUTIL_SAFE_FREE(handle);
mm_util_debug("src_width [%d] src_height [%d] src_format[%d]", src_width, src_height, src_format);
_mm_util_imgp_func = __mm_util_initialize(IMGP_RSZ, src_format, 0, &_module);
- if (_mm_util_imgp_func == NULL) {
- mm_util_error("ERROR - __mm_util_initialize");
- return MM_UTIL_ERROR_INVALID_OPERATION;
- }
+ mm_util_retvm_if(_mm_util_imgp_func == NULL, MM_UTIL_ERROR_INVALID_OPERATION, "fail __mm_util_initialize");
imgp_info_s *_imgp_info_s = (imgp_info_s *) calloc(1, sizeof(imgp_info_s));
if (_imgp_info_s == NULL) {