Port to modern FFmpeg, GCC 15, and updated liblo#10
Open
dnewcome wants to merge 1 commit into
Open
Conversation
Fixes build on current Linux distros. Major changes:
FFmpeg 7.x API migration (video_layer.cpp/h, ffdec.c, context.cpp):
- Replace AVPicture with AVFrame throughout
- avpicture_alloc/free/fill/get_size -> av_frame_get_buffer,
av_frame_unref, av_image_fill_arrays, av_image_get_buffer_size
- av_open_input_file/av_find_stream_info -> avformat_open_input/
avformat_find_stream_info
- Codec contexts now allocated with avcodec_alloc_context3 +
avcodec_parameters_to_context instead of borrowing from AVStream
- avcodec_open -> avcodec_open2; avcodec_close -> avcodec_free_context
- avcodec_decode_video2/audio3 -> avcodec_send_packet/avcodec_receive_frame
- av_free_packet -> av_packet_unref
- av_close_input_file -> avformat_close_input
- PIX_FMT_* -> AV_PIX_FMT_*
- channels -> ch_layout.nb_channels
- Remove av_register_all (removed in FFmpeg 4.x)
- avpicture_deinterlace stubbed out (removed in FFmpeg 4.x)
- Remove AVFormatParameters, url_set_interrupt_cb (removed APIs)
GCC 15 / SpiderMonkey configure fixes (lib/javascript/configure):
- K&R-style main(){} -> int main(){} (implicit int removed as error)
- bare return; -> return 0; in int main() test programs
- Fix missing execute permissions on build helper scripts
liblo API update (osc_ctrl.cpp):
- Handler data argument void* -> lo_message
- lo_send_message_from: use lo_server_thread_get_server() to convert
lo_server_thread to lo_server
Misc:
- Add compile and test-driver to .gitignore (automake-generated)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I'm not sure if FreeJ dependencies can be satisfied on a modern Linux distro, at least not without a lot of wrangling. This PR fixes all compilation errors against modern toolchains and library versions, tested on Ubuntu with GCC 15, FFmpeg 7.1, and liblo from current package repositories.
Mostly Claude wrangling but some inspection and manual cajoling. I did a smoke test just by running some javascript files but it does compile cleanly and runs on Ubuntu 25.10. I ran the test script that was there but I don't think it tested much but maybe I just didn't look hard enough.
BTW this is a cool project, I can't believe I didn't know of it until now. I was using veejay on RPi4 and wasn't aware that there was something that predated even that. I started work on fast-vj with the goal of doing something similar to this but with modern shader architectures that can work on limited hardware like the RPi. I ended up using LuaJIT instead of JS with the hopes that it could drive significant interactivity logic without becoming a bottleneck.
FFmpeg 7.x API migration
The largest body of work. FFmpeg has removed or deprecated many APIs over its 4.x–7.x releases that FreeJ relied on. Changes across
src/video_layer.cpp,src/include/video_layer.h,src/ffdec.c, andsrc/context.cpp:Struct changes
AVPicturewas removed in FFmpeg 5.0. All uses replaced withAVFrame, which carries the samedata[]andlinesize[]fields.rgba_pictureand the frame FIFO now holdAVFrame *allocated withav_frame_alloc().Allocation / buffer management
avpicture_alloc()→av_frame_get_buffer()avpicture_free()→av_frame_unref()+av_free()avpicture_fill()→av_image_fill_arrays()avpicture_get_size()→av_image_get_buffer_size()avpicture_deinterlace()was removed with no direct replacement; the deinterlace path is stubbed out (it was off by default anyway)Format / codec open sequence
av_open_input_file()→avformat_open_input()av_find_stream_info()→avformat_find_stream_info()AVFormatParametersandurl_set_interrupt_cb()removed; format options now passed viaAVDictionaryAVStream::codec(deprecated). Each stream now gets its own context viaavcodec_alloc_context3()+avcodec_parameters_to_context(), owned and freed by the layeravcodec_open()→avcodec_open2()avcodec_close()→avcodec_free_context()(closes and frees in one call)Decode API
avcodec_decode_video2()andavcodec_decode_audio3()replaced with the send/receive API:avcodec_send_packet()/avcodec_receive_frame()avcodec_get_frame_defaults()removed; replaced byav_frame_unref()semanticsMisc FFmpeg removals
av_register_all()/avcodec_register_all()/avcodec_init()removed (codecs auto-register since FFmpeg 4.0)av_free_packet()→av_packet_unref()av_close_input_file()→avformat_close_input()avcodec_alloc_frame()→av_frame_alloc()dump_format()→av_dump_format()PIX_FMT_*→AV_PIX_FMT_*AVCodecContext::channels→AVCodecContext::ch_layout.nb_channelsCODEC_TYPE_VIDEO→AVMEDIA_TYPE_VIDEOFF_B_TYPE/FF_I_TYPE→AV_PICTURE_TYPE_B/AV_PICTURE_TYPE_IGCC 15 / SpiderMonkey configure fixes
GCC 14+ promotes two previously-warning conditions to hard errors, breaking the bundled SpiderMonkey (
lib/javascript) configure script:-Wimplicit-intis now an error. The configure script contained K&R-stylemain(){return(0);}in compiler probe programs. Fixed toint main(){return(0);}.-Wreturn-mismatchis now an error. Eightint main()test functions used barereturn;with no value. Fixed toreturn 0;.build/hcc,build/hcpp, and a dozen other helper scripts caused the SpiderMonkey configure to fail mid-run with "Permission denied". Execute bit restored on all affected files.liblo API update
osc_ctrl.cppused the oldlo_method_handlersignature where the incoming-message argument wasvoid *. Current liblo types this aslo_message. Additionally,lo_send_message_from()requires alo_server(not alo_server_thread); fixed by callinglo_server_thread_get_server().Housekeeping
compileandtest-driverto.gitignore— these are automake-generated helper scripts that get dropped into the project root by./configureand don't belong in version control.Test environment
./configure && makecompletes cleanly and thefreejbinary runs.