FS-8867: create conversion function stubs in the core so modules do not need to use libyuv directly

This commit is contained in:
Seven Du authored and Michael Jerris committed 2016-02-24 15:12:05 -06:00
1 parent cd2c86b427
commit ed78d38994
6 files changed
+165 -44

No files matched your search

+2 -12
View File
@@ -39,7 +39,6 @@ using namespace std;
using namespace cv;
#include <switch.h>
#include <libyuv.h>
#include <cv.h>
#include "cvaux.h"
@@ -724,12 +723,7 @@ static switch_status_t video_thread_callback(switch_core_session_t *session, swi
switch_assert(context->rawImage->width * 3 == context->rawImage->widthStep);
}
libyuv::I420ToRGB24(frame->img->planes[0], frame->img->stride[0],
frame->img->planes[1], frame->img->stride[1],
frame->img->planes[2], frame->img->stride[2],
(uint8_t *)context->rawImage->imageData, context->rawImage->widthStep,
context->rawImage->width, context->rawImage->height);
switch_img_to_raw(frame->img, context->rawImage->imageData, context->rawImage->widthStep * context->h, SWITCH_IMG_FMT_RGB24);
detectAndDraw(context);
if (context->detected.simo_count > 20) {
@@ -824,11 +818,7 @@ static switch_status_t video_thread_callback(switch_core_session_t *session, swi
}
if (context->rawImage && (context->debug || !context->overlay_count)) {
libyuv::RGB24ToI420((uint8_t *)context->rawImage->imageData, context->w * 3,
frame->img->planes[0], frame->img->stride[0],
frame->img->planes[1], frame->img->stride[1],
frame->img->planes[2], frame->img->stride[2],
context->rawImage->width, context->rawImage->height);
switch_img_from_raw(frame->img, (uint8_t *)context->rawImage->imageData, SWITCH_IMG_FMT_RGB24, context->rawImage->width, context->rawImage->height);
}
int abs = 0;
+1 -8
View File
@@ -34,8 +34,6 @@
#include <switch.h>
#include <libyuv.h>
#if defined(__clang__)
/* the imagemagick header files are very badly broken on clang. They really should be fixing this, in the mean time, this dirty hack works */
@@ -263,12 +261,7 @@ static switch_status_t read_page(pdf_file_context_t *context)
return SWITCH_STATUS_FALSE;
}
RAWToI420(storage, w * 3,
context->img->planes[0], context->img->stride[0],
context->img->planes[1], context->img->stride[1],
context->img->planes[2], context->img->stride[2],
context->img->d_w, context->img->d_h);
switch_img_from_raw(context->img, storage, SWITCH_IMG_FMT_BGR24, w, h);
free(storage);
} else {
switch_image_t *img = switch_img_alloc(NULL, SWITCH_IMG_FMT_ARGB, image->columns, image->rows, 0);
+1 -2
View File
@@ -1642,8 +1642,7 @@ int vlc_write_video_imem_get_callback(void *data, const char *cookie, int64_t *
}
*output = context->video_frame_buffer;
*size = 0;
switch_img_convert(img, SWITCH_CONVERT_FMT_YUYV, *output, size);
switch_img_to_raw(img, *output, *size, SWITCH_IMG_FMT_YUY2);
switch_img_free(&img);
return 0;
}