musikcube
musikcube copied to clipboard
ffmpeg 7.x incompatibility
It appears there have been a number of API changes with the release of ffmpeg 7.0, some of which are not backward compatible. As a result, musikcube fails to build:
[ 55%] Building CXX object src/plugins/ffmpegdecoder/CMakeFiles/ffmpegdecoder.dir/plugin.cpp.o
[ 56%] Building CXX object src/plugins/ffmpegdecoder/CMakeFiles/ffmpegdecoder.dir/FfmpegDecoder.cpp.o
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp: In member function ‘bool FfmpegDecoder::InitializeResampler()’:
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:270:29: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘channel_layout’; did you mean ‘ch_layout’?
270 | this->codecContext->channel_layout,
| ^~~~~~~~~~~~~~
| ch_layout
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:273:29: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘channel_layout’; did you mean ‘ch_layout’?
273 | this->codecContext->channel_layout,
| ^~~~~~~~~~~~~~
| ch_layout
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:268:23: error: ‘swr_alloc_set_opts’ was not declared in this scope; did you mean ‘swr_alloc_set_opts2’?
268 | this->resampler = swr_alloc_set_opts(
| ^~~~~~~~~~~~~~~~~~
| swr_alloc_set_opts2
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp: In member function ‘virtual bool FfmpegDecoder::Open(musik::core::sdk::IDataStream*)’:
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:303:13: error: invalid conversion from ‘int (*)(void*, uint8_t*, int)’ {aka ‘int (*)(void*, unsigned char*, int)’} to ‘int (*)(void*, const uint8_t*, int)’ {aka ‘int (*)(void*, const unsigned char*, int)’} [-fpermissive]
303 | writeCallback,
| ^~~~~~~~~~~~~
| |
| int (*)(void*, uint8_t*, int) {aka int (*)(void*, unsigned char*, int)}
In file included from /home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.h:43,
from /home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:35:
/usr/include/libavformat/avio.h:404:25: note: initializing argument 6 of ‘AVIOContext* avio_alloc_context(unsigned char*, int, int, void*, int (*)(void*, uint8_t*, int), int (*)(void*, const uint8_t*, int), int64_t (*)(void*, int64_t, int))’
404 | int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:367:53: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘channel_layout’; did you mean ‘ch_layout’?
367 | if (this->codecContext->channel_layout == 0) {
| ^~~~~~~~~~~~~~
| ch_layout
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:368:53: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘channel_layout’; did you mean ‘ch_layout’?
368 | this->codecContext->channel_layout =
| ^~~~~~~~~~~~~~
| ch_layout
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:369:87: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘channels’
369 | av_get_default_channel_layout(this->codecContext->channels);
| ^~~~~~~~
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:369:37: error: ‘av_get_default_channel_layout’ was not declared in this scope
369 | av_get_default_channel_layout(this->codecContext->channels);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:383:60: error: ‘AVCodecParameters’ {aka ‘struct AVCodecParameters’} has no member named ‘channels’
383 | this->channels = stream->codecpar->channels;
| ^~~~~~~~
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp: In member function ‘AVFrame* FfmpegDecoder::AllocFrame(AVFrame*, AVSampleFormat, int, int)’:
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:594:55: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘channel_layout’; did you mean ‘ch_layout’?
594 | const int channelLayout = this->codecContext->channel_layout == 0
| ^~~~~~~~~~~~~~
| ch_layout
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:595:65: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘channels’
595 | ? av_get_default_channel_layout(this->codecContext->channels)
| ^~~~~~~~
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:595:15: error: ‘av_get_default_channel_layout’ was not declared in this scope
595 | ? av_get_default_channel_layout(this->codecContext->channels)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:596:35: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘channel_layout’; did you mean ‘ch_layout’?
596 | : this->codecContext->channel_layout;
| ^~~~~~~~~~~~~~
| ch_layout
/home/a/musikcube/musikcube-3.0.2/src/plugins/ffmpegdecoder/FfmpegDecoder.cpp:598:19: error: ‘AVFrame’ {aka ‘struct AVFrame’} has no member named ‘channel_layout’; did you mean ‘ch_layout’?
598 | original->channel_layout = channelLayout;
| ^~~~~~~~~~~~~~
| ch_layout
make[2]: *** [src/plugins/ffmpegdecoder/CMakeFiles/ffmpegdecoder.dir/build.make:90: src/plugins/ffmpegdecoder/CMakeFiles/ffmpegdecoder.dir/FfmpegDecoder.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:867: src/plugins/ffmpegdecoder/CMakeFiles/ffmpegdecoder.dir/all] Error 2
make: *** [Makefile:136: all] Error 2