}
static int
-_mm_imgp_gstcs_processing(gstreamer_s* pGstreamer_s, unsigned char *src, unsigned char *dst, image_format_s* input_format, image_format_s* output_format, imgp_info_s* pImgp_info)
+_mm_imgp_gstcs_processing(gstreamer_s* pGstreamer_s, unsigned char *src, unsigned char **dst, image_format_s* input_format, image_format_s* output_format, imgp_info_s* pImgp_info)
{
GstBus *bus = NULL;
GstStateChangeReturn ret_state;
return GSTCS_ERROR_INVALID_OPERATION;
}
gstcs_debug("pGstreamer_s->output_buffer: %p\n", pGstreamer_s->output_buffer);
- memcpy(dst, mapinfo.data, buffer_size);
+ *dst = calloc(1, buffer_size);
+ if (*dst == NULL) {
+ gstcs_error("ERROR - calloc ");
+ gst_buffer_unref(pGstreamer_s->output_buffer);
+ gst_object_unref(pGstreamer_s->pipeline);
+ pGstreamer_s->output_buffer = NULL;
+ return GSTCS_ERROR_INVALID_OPERATION;
+ }
+
+ memcpy(*dst, mapinfo.data, buffer_size);
pImgp_info->buffer_size = buffer_size;
gst_buffer_unmap(pGstreamer_s->output_buffer, &mapinfo);
} else {
pGstreamer_s->output_buffer = NULL;
gstcs_debug("End gstreamer processing");
- gstcs_debug("dst: %p", dst);
+ gstcs_debug("dst: %p", *dst);
return ret;
}
return ret;
}
-static int _mm_imgp_gstcs(imgp_info_s* pImgp_info, unsigned char *src, unsigned char *dst)
+static int _mm_imgp_gstcs(imgp_info_s* pImgp_info, unsigned char *src, unsigned char **dst)
{
image_format_s* input_format = NULL, *output_format = NULL;
gstreamer_s* pGstreamer_s;
ret = _mm_imgp_gstcs_processing(pGstreamer_s, src, dst, input_format, output_format, pImgp_info); /* input: buffer pointer for input image , input image format, input image width, input image height, output: buffer porinter for output image */
if (ret == GSTCS_ERROR_NONE)
- gstcs_debug("End _mm_imgp_gstcs_processing [dst: %p]", dst);
+ gstcs_debug("End _mm_imgp_gstcs_processing [dst: %p]", *dst);
else if (ret != GSTCS_ERROR_NONE)
gstcs_error("ERROR - _mm_imgp_gstcs_processing");
return ret;
}
-int mm_imgp(imgp_info_s* pImgp_info, unsigned char *src, unsigned char *dst, imgp_type_e _imgp_type)
+int mm_imgp(imgp_info_s* pImgp_info, unsigned char *src, unsigned char **dst, imgp_type_e _imgp_type)
{
if (pImgp_info == NULL) {
gstcs_error("Error: input vaule is NULL");