*
* \param[in] src The image descriptor
* \param[in] dest The target memory address
-* \param[in] size The size of target memory address used for bounds check
+* \param[in] stride Bytes in a row for the destination. Pass 0 if the buffer has contiguous rows. Can be negative. A multiple of 16 is optimal.
* \param[in] fmt The target format
*/
-SWITCH_DECLARE(switch_status_t) switch_img_to_raw(switch_image_t *src, void *dest, switch_size_t size, switch_img_fmt_t fmt);
+SWITCH_DECLARE(switch_status_t) switch_img_to_raw(switch_image_t *src, void *dest, int stride, switch_img_fmt_t fmt);
/*!\brief convert raw memory to switch_img_t
*
* if dest is NULL then a new img is created, user should destroy it later,
switch_assert(context->rawImage->width * 3 == context->rawImage->widthStep);
}
- switch_img_to_raw(frame->img, context->rawImage->imageData, context->rawImage->widthStep * context->h, SWITCH_IMG_FMT_RGB24);
+ switch_img_to_raw(frame->img, context->rawImage->imageData, context->rawImage->widthStep, SWITCH_IMG_FMT_RGB24);
detectAndDraw(context);
if (context->detected.simo_count > 20) {
}
*output = context->video_frame_buffer;
- switch_img_to_raw(img, *output, *size, SWITCH_IMG_FMT_YUY2);
+ switch_img_to_raw(img, *output, 0, SWITCH_IMG_FMT_YUY2);
switch_img_free(&img);
return 0;
}
}
#endif
-SWITCH_DECLARE(switch_status_t) switch_img_to_raw(switch_image_t *src, void *dest, switch_size_t size, switch_img_fmt_t fmt)
+SWITCH_DECLARE(switch_status_t) switch_img_to_raw(switch_image_t *src, void *dest, int stride, switch_img_fmt_t fmt)
{
#ifdef SWITCH_HAVE_YUV
uint32_t fourcc;
ret = ConvertFromI420(src->planes[0], src->stride[0],
src->planes[1], src->stride[1],
src->planes[2], src->stride[2],
- dest, size,
+ dest, stride,
src->d_w, src->d_h,
fourcc);