gavinljj / libyuv

Automatically exported from code.google.com/p/libyuv
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

cannot build with libjpeg 9 #327

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. try to compile with libjpeg 9

What version of the product are you using? On what operating system?
979, included in chromium 34.0.1847.131, linux

Please provide any additional information below.

third_party/libyuv/source/mjpeg_decoder.cc: In constructor 
'libyuv::MJpegDecoder::MJpegDecoder()':
third_party/libyuv/source/mjpeg_decoder.cc:70:34: error: invalid conversion 
from 'int (*)(jpeg_decompress_struct*)' to 'boolean (*)(j_decompress_ptr) {aka 
boolean (*)(jpeg_decompress_struct*)}' [-fpermissive]
   source_mgr_->fill_input_buffer = &fill_input_buffer;
                                  ^
third_party/libyuv/source/mjpeg_decoder.cc: At global scope:
third_party/libyuv/source/mjpeg_decoder.cc:405:9: error: prototype for 'boolean 
libyuv::MJpegDecoder::fill_input_buffer(j_decompress_ptr)' does not match any 
in class 'libyuv::MJpegDecoder'
 boolean MJpegDecoder::fill_input_buffer(j_decompress_ptr cinfo) {
         ^
In file included from third_party/libyuv/source/mjpeg_decoder.cc:11:0:
third_party/libyuv/include/libyuv/mjpeg_decoder.h:157:14: error: candidate is: 
static int libyuv::MJpegDecoder::fill_input_buffer(jpeg_decompress_struct*)
   static int fill_input_buffer(jpeg_decompress_struct* cinfo);
              ^
third_party/libyuv/source/mjpeg_decoder.cc: In member function 'int 
libyuv::MJpegDecoder::StartDecode()':
third_party/libyuv/source/mjpeg_decoder.cc:494:43: error: invalid conversion 
from 'int' to 'boolean' [-fpermissive]
   decompress_struct_->do_fancy_upsampling = LIBYUV_FALSE;
                                           ^
third_party/libyuv/source/mjpeg_decoder.cc:496:42: error: invalid conversion 
from 'int' to 'boolean' [-fpermissive]
   decompress_struct_->enable_2pass_quant = LIBYUV_FALSE;
                                          ^
third_party/libyuv/source/mjpeg_decoder.cc:498:42: error: invalid conversion 
from 'int' to 'boolean' [-fpermissive]
   decompress_struct_->do_block_smoothing = LIBYUV_FALSE;
                                          ^
make: *** 
[out/Release/obj.target/libyuv/third_party/libyuv/source/mjpeg_decoder.o] Error 
1

Original issue reported on code.google.com by r...@c2.hu on 26 Apr 2014 at 1:25

GoogleCodeExporter commented 9 years ago
thanks... looks like the port to C introduced an implicit cast.
If you modify the GYP files you can disable JPEG.  Its not always necessary.
But I'll fix it soon

Original comment by fbarch...@google.com on 30 Apr 2014 at 12:53

GoogleCodeExporter commented 9 years ago
Yes, I know, and I built chromium with -Duse_system_libjpeg=0, so in case of 
chromium this issue is solved for me.
But how to disable using the external libjpeg 9 on separate build of libyuv? :)

Original comment by r...@c2.hu on 1 May 2014 at 5:28

GoogleCodeExporter commented 9 years ago
jpeg 9a is available here:
http://ijg.org/

It looks like boolean is no longer an int.  Its either a char for WIN32 or an 
enum.

Syncing up chrome, libjpeg is still on 6b.  May not be trivial to actually test 
this, but I can attempt a blind fix.

For the first 3 errors, it looks like the forward declares in libyuv's header 
no longer match.  Perhaps they don't need to be declared.
The other 3 should use boolean and/or libjpeg's 'FALSE'.  A cast to boolean is 
likely safe for assigning 0.

Original comment by fbarch...@chromium.org on 13 May 2014 at 12:22

GoogleCodeExporter commented 9 years ago
Here is the proposed fixes:
https://webrtc-codereview.appspot.com/15489005/

Original comment by fbarch...@chromium.org on 13 May 2014 at 2:05

GoogleCodeExporter commented 9 years ago
r1004 has fixes for jpeg 9.

Would you be able to test/confirm that libyuv builds against jpeg 9?

Original comment by fbarch...@chromium.org on 13 May 2014 at 7:02

GoogleCodeExporter commented 9 years ago
Yes, with r1004 the build was successful.
Thank you for the fix.

But the ui/gfx/codec/jpeg_codec.cc fails with same errors.

Original comment by r...@c2.hu on 13 May 2014 at 9:11

GoogleCodeExporter commented 9 years ago
Can you file a bug on crbug.com and feel free to cc me.
Show the exact build error(s), as it may not be easy to reproduce, but for 
libyuv the solution was clear, so hopefully chromium fix is too.

I'll follow up on this libyuv fix by rolling into chromium deps, but closing as 
fixed.
Thanks for reporting the issue clearly!

Original comment by fbarch...@chromium.org on 19 May 2014 at 7:21

GoogleCodeExporter commented 9 years ago
I filed a bug (and a patch, bacause not a hard thing to fix the issue):
https://code.google.com/p/chromium/issues/detail?id=374956

Original comment by r...@c2.hu on 19 May 2014 at 10:02