From 9640339f2e9dc126406f6b6f8a091b924898b4f5 Mon Sep 17 00:00:00 2001 From: deva Date: Sun, 25 Sep 2005 20:59:02 +0000 Subject: *** empty log message *** --- src/img_encoder.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/img_encoder.cc') diff --git a/src/img_encoder.cc b/src/img_encoder.cc index 1516fc0..9282dc0 100644 --- a/src/img_encoder.cc +++ b/src/img_encoder.cc @@ -37,6 +37,10 @@ #include "debug.h" +extern "C" { +#include +} + #include "jpeg_mem_dest.h" // Use libdv @@ -103,12 +107,14 @@ void ImgEncoder::encode(Frame *dvframe, int quality) unsigned char rgb[720*576*4]; getRGB(dvframe, rgb); - writeJPEGFile(quality, (JSAMPLE*)rgb, 720, 576); + writeJPEGFile(quality, rgb, 720, 576); } -void ImgEncoder::writeJPEGFile(int quality, JSAMPLE * image_buffer, int image_width, int image_height) +void ImgEncoder::writeJPEGFile(int quality, unsigned char *rgb, int image_width, int image_height) { + JSAMPLE *image_buffer = (JSAMPLE*)rgb; + size_t buffersize = (image_width * image_height * 3) + JPEG_HEADER_PAD; char *jpeg_output_buffer = new char [buffersize]; struct jpeg_compress_struct cinfo; -- cgit v1.2.3