- Changed function
: mm_util_resize_image()
- This function resize mm_util_image_h image with width & height,
it will return allocated resized mm_util_image_h image.
before changing, it has too few parameter to check problem
like buffer overflow.
So, change parameter to mm_util_image_h with mandotory information.
[Version] 0.10.180
[Profile] Common
[Issue Type] Update image-utility
[Dependency module] N/A
[Test] Svace=(OK, http://10.113.170.22:8810/build/2920)
Change-Id: I461f96a1051d9918b81e5ec76ed434df5739b0bb
Name: libmm-camcorder
Summary: Camera and recorder library
Name: libmm-camcorder
Summary: Camera and recorder library
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
#include "mm_camcorder_internal.h"
#include "mm_camcorder_util.h"
#include "mm_camcorder_sound.h"
#include "mm_camcorder_internal.h"
#include "mm_camcorder_util.h"
#include "mm_camcorder_sound.h"
+#include <mm_util_image.h>
#include <mm_util_imgp.h>
#include <mm_util_jpeg.h>
#include <mm_util_imgp.h>
#include <mm_util_jpeg.h>
int ret = TRUE;
int mm_ret = MM_ERROR_NONE;
int input_format = MM_UTIL_COLOR_YUV420;
int ret = TRUE;
int mm_ret = MM_ERROR_NONE;
int input_format = MM_UTIL_COLOR_YUV420;
+ mm_util_image_h src_image = NULL;
+ mm_util_image_h dst_image = NULL;
if (!src_data || !dst_data || !dst_width || !dst_height || !dst_length) {
_mmcam_dbg_err("something is NULL %p,%p,%p,%p,%p",
if (!src_data || !dst_data || !dst_width || !dst_height || !dst_length) {
_mmcam_dbg_err("something is NULL %p,%p,%p,%p,%p",
_mmcam_dbg_log("src size %dx%d -> dst size %dx%d", src_width, src_height, *dst_width, *dst_height);
_mmcam_dbg_log("src size %dx%d -> dst size %dx%d", src_width, src_height, *dst_width, *dst_height);
- mm_ret = mm_util_resize_image(src_data, src_width, src_height, input_format,
- *dst_width, *dst_height, dst_data, dst_width, dst_height, dst_length);
+ mm_ret = mm_image_create_image(src_width, src_height, input_format, src_data, (size_t)src_length, &src_image);
+ if (mm_ret != MM_ERROR_NONE) {
+ GST_ERROR("mm_image_create_image failed 0x%x", ret);
+ return FALSE;
+ }
+ mm_ret = mm_util_resize_image(src_image, *dst_width, *dst_height, &dst_image);
+ mm_image_destroy_image(src_image);
if (mm_ret != MM_ERROR_NONE) {
GST_ERROR("mm_util_resize_image failed 0x%x", ret);
return FALSE;
}
if (mm_ret != MM_ERROR_NONE) {
GST_ERROR("mm_util_resize_image failed 0x%x", ret);
return FALSE;
}
+ mm_ret = mm_image_get_image(dst_image, dst_width, dst_height, NULL, dst_data, dst_length);
+ mm_image_destroy_image(dst_image);
+ if (mm_ret != MM_ERROR_NONE) {
+ GST_ERROR("mm_image_get_image failed 0x%x", ret);
+ return FALSE;
+ }
+
_mmcam_dbg_log("resize done %dx%d -> %dx%d, %p, length %zu",
src_width, src_height, *dst_width, *dst_height, *dst_data, *dst_length);
_mmcam_dbg_log("resize done %dx%d -> %dx%d, %p, length %zu",
src_width, src_height, *dst_width, *dst_height, *dst_data, *dst_length);