#1004634 openscenegraph: FTBFS with ffmpeg 5.0

#1004634#5
Date:
2022-01-30 22:14:48 UTC
From:
To:
Source: openscenegraph
Version: 3.6.5+dfsg1-7
Severity: important
X-Debbugs-Cc: sramacher@debian.org
Tags: sid bookworm ftbfs
Usertags: ffmpeg5.0

openscenegraph FTBFS with ffmpeg 5.0 (available in experimental):
| [ 40%] Building CXX object src/osgPlugins/freetype/CMakeFiles/osgdb_freetype.dir/ReaderWriterFreeType.cpp.o
| cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/osgPlugins/freetype && /usr/lib/ccache/c++ -Dosgdb_freetype_EXPORTS -I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/include -I/<<PKGBUILDDIR>>/include -I/usr/include/freetype2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -Wmaybe-uninitialized -Wextra -Wshadow -Wno-misleading-indentation -O2 -g -DNDEBUG -fPIC -MD -MT src/osgPlugins/freetype/CMakeFiles/osgdb_freetype.dir/ReaderWriterFreeType.cpp.o -MF CMakeFiles/osgdb_freetype.dir/ReaderWriterFreeType.cpp.o.d -o CMakeFiles/osgdb_freetype.dir/ReaderWriterFreeType.cpp.o -c /<<PKGBUILDDIR>>/src/osgPlugins/freetype/ReaderWriterFreeType.cpp
| In file included from /<<PKGBUILDDIR>>/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp:10,
|                  from /<<PKGBUILDDIR>>/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:1:
| /<<PKGBUILDDIR>>/src/osgPlugins/ffmpeg/FFmpegPacket.hpp: In member function ‘void osgFFmpeg::FFmpegPacket::clear()’:
| /<<PKGBUILDDIR>>/src/osgPlugins/ffmpeg/FFmpegPacket.hpp:45:17: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
|    45 |                 av_free_packet(&packet);
|       |                 ^~~~~~~~~~~~~~
|       |                 av_new_packet
| /<<PKGBUILDDIR>>/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp: In function ‘int osgFFmpeg::decode_audio(AVCodecContext*, int16_t*, int*, const uint8_t*, int, SwrContext*, int, int, AVSampleFormat)’:
| /<<PKGBUILDDIR>>/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:48:11: error: ‘avcodec_decode_audio4’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
|    48 |     ret = avcodec_decode_audio4(avctx, frame, &got_frame, &avpkt);
|       |           ^~~~~~~~~~~~~~~~~~~~~
|       |           avcodec_decode_subtitle2
| /<<PKGBUILDDIR>>/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:53:34: error: ‘av_frame_get_channels’ was not declared in this scope; did you mean ‘av_frame_get_buffer’?
|    53 |     if (ret >= 0 && got_frame && av_frame_get_channels(frame)>0) {
|       |                                  ^~~~~~~~~~~~~~~~~~~~~
|       |                                  av_frame_get_buffer
| /<<PKGBUILDDIR>>/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp: In member function ‘void osgFFmpeg::FFmpegDecoderAudio::open(AVStream*, osgFFmpeg::FFmpegParameters*)’:
| /<<PKGBUILDDIR>>/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:154:29: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
|   154 |         m_context = stream->codec;
|       |                             ^~~~~
| /<<PKGBUILDDIR>>/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:217:55: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
|   217 |         AVCodec * const p_codec = avcodec_find_decoder(m_context->codec_id);
|       |                                   ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
|       |                                                       |
|       |                                                       const AVCodec*
| make[3]: *** [src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/build.make:93: src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/FFmpegDecoderAudio.cpp.o] Error 1
| make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'

Cheers

#1004634#10
Date:
2022-01-31 08:31:52 UTC
From:
To:
Hi Sebastian,

This looks like an API breakage from ffmpeg versions 4 to 5.  I have
seen no transition for this, but in the meantime, do you have any
pointer about the old removed functions and their replacements?

Thanks,

Alberto

#1004634#15
Date:
2022-01-31 08:31:52 UTC
From:
To:
Hi Sebastian,

This looks like an API breakage from ffmpeg versions 4 to 5.  I have
seen no transition for this, but in the meantime, do you have any
pointer about the old removed functions and their replacements?

Thanks,

Alberto

#1004634#20
Date:
2022-02-01 20:21:57 UTC
From:
To:
Hi Alberto,

Yes, ffmpeg 5 removed some functions that were deprecated in ffmpeg 4
and constified some return values and arguments. I haven't seen a guide
to update though.

Cheers

#1004634#27
Date:
2022-02-02 09:33:51 UTC
From:
To:
Thanks! I have located https://ffmpeg.org/doxygen/4.1/deprecated.html
were some are covered, but others aren't.  I will look for some others
doing the transition as well.  So far, upstream is unchanged in that regard.

Cheers,

Alberto

#1004634#32
Date:
2022-02-02 09:47:29 UTC
From:
To:
There is also /usr/share/doc/ffmpeg/api/deprecated.html in ffmpeg-doc
(hopefully updated for ffmpeg 4.4).

Cheers

#1004634#41
Date:
2022-09-20 17:56:56 UTC
From:
To:
Hi all,

I've patched the audio part. But not completed. The video part needs
more changes. But I don't have enough time now.

Just attach the partial patch I made so that when someone has time or I
have time then we can continue it.

Yours,
Paul