summaryrefslogtreecommitdiff
path: root/src/img_encoder.cc
diff options
context:
space:
mode:
authordeva <deva>2005-09-25 20:59:02 +0000
committerdeva <deva>2005-09-25 20:59:02 +0000
commit9640339f2e9dc126406f6b6f8a091b924898b4f5 (patch)
treedad14d120f0fc4401552714b5efffe20b5c78a4d /src/img_encoder.cc
parent36326a9c1bab28c5eccea6cc2c56c9a8b83dac0d (diff)
*** empty log message ***
Diffstat (limited to 'src/img_encoder.cc')
-rw-r--r--src/img_encoder.cc10
1 files changed, 8 insertions, 2 deletions
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 <jpeglib.h>
+}
+
#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;