summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfbarchard@google.com <fbarchard@google.com@16f28f9a-4ce2-e073-06de-1de4eb20be90>2014-05-13 19:00:01 +0000
committerfbarchard@google.com <fbarchard@google.com@16f28f9a-4ce2-e073-06de-1de4eb20be90>2014-05-13 19:00:01 +0000
commit8b857c0ac6f0e8cb0fc0b9410ea0d15b3afda4ab (patch)
tree735a41046c171b7956d748113a575da059f32f21
parentb846eb4f6e171e6285caa7c83186db4ec94d624d (diff)
downloadlibyuv-8b857c0ac6f0e8cb0fc0b9410ea0d15b3afda4ab.tar.gz
changes to accommodate libjpeg 9 interface.
BUG=327 TESTED=untested R=tpsiaki@google.com Review URL: https://webrtc-codereview.appspot.com/15489005 git-svn-id: http://libyuv.googlecode.com/svn/trunk@1004 16f28f9a-4ce2-e073-06de-1de4eb20be90
-rw-r--r--README.chromium2
-rw-r--r--include/libyuv/mjpeg_decoder.h30
-rw-r--r--include/libyuv/version.h2
-rw-r--r--source/mjpeg_decoder.cc26
4 files changed, 30 insertions, 30 deletions
diff --git a/README.chromium b/README.chromium
index d1eae11..2ef9a54 100644
--- a/README.chromium
+++ b/README.chromium
@@ -1,6 +1,6 @@
Name: libyuv
URL: http://code.google.com/p/libyuv/
-Version: 1003
+Version: 1004
License: BSD
License File: LICENSE
diff --git a/include/libyuv/mjpeg_decoder.h b/include/libyuv/mjpeg_decoder.h
index faffaea..82fd95d 100644
--- a/include/libyuv/mjpeg_decoder.h
+++ b/include/libyuv/mjpeg_decoder.h
@@ -43,6 +43,17 @@ enum JpegSubsamplingType {
kJpegUnknown
};
+struct Buffer {
+ const uint8* data;
+ int len;
+};
+
+struct BufferVector {
+ Buffer* buffers;
+ int len;
+ int pos;
+};
+
struct SetJmpErrorMgr;
// MJPEG ("Motion JPEG") is a pseudo-standard video codec where the frames are
@@ -142,25 +153,6 @@ class LIBYUV_API MJpegDecoder {
int* subsample_x, int* subsample_y, int number_of_components);
private:
- struct Buffer {
- const uint8* data;
- int len;
- };
-
- struct BufferVector {
- Buffer* buffers;
- int len;
- int pos;
- };
-
- // Methods that are passed to jpeglib.
- static int fill_input_buffer(jpeg_decompress_struct* cinfo);
- static void init_source(jpeg_decompress_struct* cinfo);
- static void skip_input_data(jpeg_decompress_struct* cinfo,
- long num_bytes); // NOLINT
- static void term_source(jpeg_decompress_struct* cinfo);
-
- static void ErrorHandler(jpeg_common_struct* cinfo);
void AllocOutputBuffers(int num_outbufs);
void DestroyOutputBuffers();
diff --git a/include/libyuv/version.h b/include/libyuv/version.h
index ce8fb14..cf2455c 100644
--- a/include/libyuv/version.h
+++ b/include/libyuv/version.h
@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
-#define LIBYUV_VERSION 1003
+#define LIBYUV_VERSION 1004
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
diff --git a/source/mjpeg_decoder.cc b/source/mjpeg_decoder.cc
index 193b829..15b0ed8 100644
--- a/source/mjpeg_decoder.cc
+++ b/source/mjpeg_decoder.cc
@@ -50,6 +50,14 @@ const int MJpegDecoder::kColorSpaceYCbCr = JCS_YCbCr;
const int MJpegDecoder::kColorSpaceCMYK = JCS_CMYK;
const int MJpegDecoder::kColorSpaceYCCK = JCS_YCCK;
+// Methods that are passed to jpeglib.
+boolean fill_input_buffer(jpeg_decompress_struct* cinfo);
+void init_source(jpeg_decompress_struct* cinfo);
+void skip_input_data(jpeg_decompress_struct* cinfo,
+ long num_bytes); // NOLINT
+void term_source(jpeg_decompress_struct* cinfo);
+void ErrorHandler(jpeg_common_struct* cinfo);
+
MJpegDecoder::MJpegDecoder()
: has_scanline_padding_(LIBYUV_FALSE),
num_outbufs_(0),
@@ -398,11 +406,11 @@ LIBYUV_BOOL MJpegDecoder::DecodeToCallback(CallbackFunction fn, void* opaque,
return FinishDecode();
}
-void MJpegDecoder::init_source(j_decompress_ptr cinfo) {
+void init_source(j_decompress_ptr cinfo) {
fill_input_buffer(cinfo);
}
-boolean MJpegDecoder::fill_input_buffer(j_decompress_ptr cinfo) {
+boolean fill_input_buffer(j_decompress_ptr cinfo) {
BufferVector* buf_vec = (BufferVector*)(cinfo->client_data);
if (buf_vec->pos >= buf_vec->len) {
assert(0 && "No more data");
@@ -415,17 +423,17 @@ boolean MJpegDecoder::fill_input_buffer(j_decompress_ptr cinfo) {
return TRUE;
}
-void MJpegDecoder::skip_input_data(j_decompress_ptr cinfo,
- long num_bytes) { // NOLINT
+void skip_input_data(j_decompress_ptr cinfo,
+ long num_bytes) { // NOLINT
cinfo->src->next_input_byte += num_bytes;
}
-void MJpegDecoder::term_source(j_decompress_ptr cinfo) {
+void term_source(j_decompress_ptr cinfo) {
// Nothing to do.
}
#ifdef HAVE_SETJMP
-void MJpegDecoder::ErrorHandler(j_common_ptr cinfo) {
+void ErrorHandler(j_common_ptr cinfo) {
// This is called when a jpeglib command experiences an error. Unfortunately
// jpeglib's error handling model is not very flexible, because it expects the
// error handler to not return--i.e., it wants the program to terminate. To
@@ -491,11 +499,11 @@ LIBYUV_BOOL MJpegDecoder::StartDecode() {
decompress_struct_->dct_method = JDCT_IFAST; // JDCT_ISLOW is default
decompress_struct_->dither_mode = JDITHER_NONE;
// Not applicable to 'raw':
- decompress_struct_->do_fancy_upsampling = LIBYUV_FALSE;
+ decompress_struct_->do_fancy_upsampling = (boolean)(LIBYUV_FALSE);
// Only for buffered mode:
- decompress_struct_->enable_2pass_quant = LIBYUV_FALSE;
+ decompress_struct_->enable_2pass_quant = (boolean)(LIBYUV_FALSE);
// Blocky but fast:
- decompress_struct_->do_block_smoothing = LIBYUV_FALSE;
+ decompress_struct_->do_block_smoothing = (boolean)(LIBYUV_FALSE);
if (!jpeg_start_decompress(decompress_struct_)) {
// ERROR: Couldn't start JPEG decompressor";