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((IS_MM_UTIL_COLOR_FORMAT(format) == FALSE), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid format [%d]", format);
+ mm_util_retvm_if((check_valid_picture_size(width, height) != MM_UTIL_ERROR_NONE), MM_UTIL_ERROR_INVALID_PARAMETER, "image width & height is too big");
*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:
case MM_UTIL_COLOR_NV12:
case MM_UTIL_COLOR_NV12_TILED:
+ case MM_UTIL_COLOR_NV21:
x_chroma_shift = 1;
y_chroma_shift = 1;
stride = MM_UTIL_ROUND_UP_4(width);
return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
}
- mm_util_debug("format: %d, *imgsize: %d", format, *imgsize);
+ mm_util_debug("format: %u, *imgsize: %u", format, *imgsize);
return ret;
}