twitter / vireo

Vireo is a lightweight and versatile video processing library written in C++11
MIT License
927 stars 111 forks source link

FF_INPUT_BUFFER_PADDING_SIZE renamed as AV_INPUT_BUFFER_PADDING_SIZE #11

Open giulianoc opened 6 years ago

giulianoc commented 6 years ago

Hi, ^ I realized the last FFmpeg renamed FF_INPUT_BUFFER_PADDING_SIZE with AV_INPUT_BUFFER_PADDING_SIZE.

It has to be fixed in the following source file:

canbal commented 6 years ago

Are you getting a warning or an error during compilation?

giulianoc commented 6 years ago

It is a blocking compilation error. Replacing it with AV_INPUT_BUFFER_PADDING_SIZE worked fine.

Inside the FFmpeg/doc/APIchanges file, it is written:

2015-07-27 - lavc 56.56.100 / 56.35.0 - avcodec.h 94d68a4 / 7c6eb0a1 - Rename CODEC_FLAG defines to AV_CODEC_FLAG. 444e987 / def97856 - Rename CODECCAP defines to AV_CODECCAP. 29d147c / 059a9348 - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE to AV_INPUT_BUFFER_PADDING_SIZE and AV_INPUT_BUFFER_MIN_SIZE.

canbal commented 6 years ago

Thanks for reporting, and the suggested solution. Can you also attach your full compilation log for more info?

When I previously tested with the latest FFmpeg, I remember seeing some warnings about API deprecations/changes but it didn't result in blocking errors. At some point I will to do a proper FFmpeg upgrade and fix all warnings and potentially your issue as well.

giulianoc commented 6 years ago

Hi, below find a copy of the command generating the error, it was compiled on a MAC. I just installed again vireo and his dependencies on ubuntu and I did not get any error (really I had some issues I was able to manage).

BTW, if you want, I could be able to replace automake with cmake that I think is much better. In case, let me know. Best regards Giuliano

edipo-clnt-292:vireo multi$ make V=1 /Library/Developer/CommandLineTools/usr/bin/make all-recursive Making all in ../imagecore make[2]: Nothing to be done for all'. /bin/sh ./libtool --tag=CXX --mode=compile g++ -std=gnu++14 -DHAVE_CONFIG_H -I. -I./ -I../ -I../thirdparty/l-smash_extra -I/Users/multi/GestioneProgetti/Development/vireo/vireoBinaries/include -I/Users/multi/GestioneProgetti/Development/vireo/libwebm -g -O2 -fvisibility=hidden -fvisibility-inlines-hidden -MT internal/decode/libvireo_la-h264.lo -MD -MP -MF internal/decode/.deps/libvireo_la-h264.Tpo -c -o internal/decode/libvireo_la-h264.lotest -f 'internal/decode/h264.cpp' || echo './'`internal/decode/h264.cpp libtool: compile: g++ -std=gnu++14 -DHAVE_CONFIG_H -I. -I./ -I../ -I../thirdparty/l-smash_extra -I/Users/multi/GestioneProgetti/Development/vireo/vireoBinaries/include -I/Users/multi/GestioneProgetti/Development/vireo/libwebm -g -O2 -fvisibility=hidden -fvisibility-inlines-hidden -MT internal/decode/libvireo_la-h264.lo -MD -MP -MF internal/decode/.deps/libvireo_la-h264.Tpo -c internal/decode/h264.cpp -fno-common -DPIC -o internal/decode/.libs/libvireo_la-h264.o internal/decode/h264.cpp:67:20: warning: 'refcounted_frames' is deprecated [-Wdeprecated-declarations] codec_context->refcounted_frames = 1; ^ /Users/multi/GestioneProgetti/Development/vireo/vireoBinaries/include/libavcodec/avcodec.h:2327:5: note: 'refcounted_frames' has been explicitly marked deprecated here attribute_deprecated ^ /Users/multi/GestioneProgetti/Development/vireo/vireoBinaries/include/libavutil/attributes.h:94:49: note: expanded from macro 'attribute_deprecated'

define attribute_deprecated attribute((deprecated))

                                            ^

internal/decode/h264.cpp:103:60: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE' const uint16_t padded_size = (size_t)extradata.count() + FF_INPUT_BUFFER_PADDING_SIZE; ^ internal/decode/h264.cpp:197:17: warning: 'avcodec_decode_video2' is deprecated [-Wdeprecated-declarations] CHECK(avcodec_decode_video2(_this->codec_context.get(), frame.get(), &got_picture, &packet) == packet.size); ^ /Users/multi/GestioneProgetti/Development/vireo/vireoBinaries/include/libavcodec/avcodec.h:4663:1: note: 'avcodec_decode_video2' has been explicitly marked deprecated here attribute_deprecated ^ /Users/multi/GestioneProgetti/Development/vireo/vireoBinaries/include/libavutil/attributes.h:94:49: note: expanded from macro 'attribute_deprecated'

define attribute_deprecated attribute((deprecated))

                                            ^

internal/decode/h264.cpp:203:17: warning: 'avcodec_decode_video2' is deprecated [-Wdeprecated-declarations] CHECK(avcodec_decode_video2(_this->codec_context.get(), frame.get(), &got_picture, &packet) == 0); ^ /Users/multi/GestioneProgetti/Development/vireo/vireoBinaries/include/libavcodec/avcodec.h:4663:1: note: 'avcodec_decode_video2' has been explicitly marked deprecated here attribute_deprecated ^ /Users/multi/GestioneProgetti/Development/vireo/vireoBinaries/include/libavutil/attributes.h:94:49: note: expanded from macro 'attribute_deprecated'

define attribute_deprecated attribute((deprecated))

                                            ^

3 warnings and 1 error generated. make[2]: [internal/decode/libvireo_la-h264.lo] Error 1 make[1]: [all-recursive] Error 1 make: *** [all] Error 2 edipo-clnt-292:vireo multi$

canbal commented 6 years ago

I see a compile error at the end of your log, along with all the warnings I was talking about. You said you managed the resolve the error, is that true?

giulianoc commented 6 years ago

Yes, replacing FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE with AV_INPUT_BUFFER_PADDING_SIZE and AV_INPUT_BUFFER_MIN_SIZE works fine.