I am trying to rebuild open scene graph version 3.4.1 from source, following this, i get the following build error about ffmpeg version:
Building CXX object src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/FFmpegDecoderAudio.o
/home/wrkdir/osg/osg/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp: In member function 'void osgFFmpeg::FFmpegDecoderAudio::open(AVStream*, osgFFmpeg::FFmpegParameters*)':
/home/wrkdir/osg/osg/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:230:20: error: 'AVCodecContext' {aka 'struct AVCodecContext'} has no member named 'get_buffer'; did you mean 'get_buffer2'?
230 | m_context->get_buffer = avcodec_default_get_buffer;
| ^~~~~~~~~~
| get_buffer2
/home/wrkdir/osg/osg/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:230:33: error: 'avcodec_default_get_buffer' was not declared in this scope; did you mean 'avcodec_default_get_buffer2'?
230 | m_context->get_buffer = avcodec_default_get_buffer;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| avcodec_default_get_buffer2
/home/wrkdir/osg/osg/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:231:20: error: 'AVCodecContext' {aka 'struct AVCodecContext'} has no member named 'release_buffer'
231 | m_context->release_buffer = avcodec_default_release_buffer;
| ^~~~~~~~~~~~~~
/home/wrkdir/osg/osg/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:231:37: error: 'avcodec_default_release_buffer' was not declared in this scope; did you mean 'avcodec_default_get_buffer2'?
231 | m_context->release_buffer = avcodec_default_release_buffer;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| avcodec_default_get_buffer2
I have tried to look for older version of ffmpeg that would reference avcodec_default_release_buffer in its documentation but couldnt find one, and rebuilt and installed version 3.0 and 2.0, however i get the same building error, has someone had the same building problem before on osg?
The documentation for ffmpeg 2.2 has that function listed as deprecated in the autogenerated function references: https://ffmpeg.org/doxygen/2.2/group__lavc__decoding.html#ga666e4cc55f8a14c3b1ea66aaef2f6970
It may have been removed since then. You could go back to 2.2 to access it again.
The commit notes say: 80e9e63 / 759001c - add the refcounted_frames field to AVCodecContext to make audio and video decoders return reference-counted frames. Add get_buffer2() callback to AVCodecContext which allocates reference-counted frames. Add avcodec_default_get_buffer2() as the default get_buffer2() implementation. Deprecate AVCodecContext.get_buffer() / release_buffer() / reget_buffer(), avcodec_default_get_buffer(), avcodec_default_reget_buffer(), avcodec_default_release_buffer(). Remove avcodec_default_free_buffers(), which should not have ever been called from outside of lavc. Deprecate the following AVFrame fields: * base -- is now stored in AVBufferRef * reference, type, buffer_hints -- are unnecessary in the new API * hwaccel_picture_private, owner, thread_opaque -- should not have been accessed from outside of lavc * qscale_table, qstride, qscale_type, mbskip_table, motion_val, mb_type, dct_coeff, ref_index -- mpegvideo-specific tables, which are not exported anymore.
So it looks like you should look at adapting the code to use the get_buffer2 version. If that's outside your ability, get ahold of me and I can see if I can help you.