From 70683b891672aba401c111e4afc599ca230d7314 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Tue, 29 Nov 2022 11:16:57 -0800 Subject: [PATCH] ffmpeg: increase minimum required version to 4.4 Now that 0.35 has been released, we can consider increasing our minimum required ffmpeg version. Currently, we think 4.4 is the most recent version we can move to (from the current requirement of 4.0). This allows us to remove a few conditionals. There are more that we won't be able to remove unless we move further up to 5.1. --- demux/demux_lavf.c | 4 ---- meson.build | 14 +++++++------- video/mp_image.c | 2 -- wscript | 14 +++++++------- 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 22e6531f8b..2b65471b02 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -36,9 +36,7 @@ #include #include -#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 43, 100) #include -#endif #include "audio/chmap_avchannel.h" @@ -745,14 +743,12 @@ static void handle_new_stream(demuxer_t *demuxer, int i) sh->codec->rotate = (((int)(-r) % 360) + 360) % 360; } -#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 43, 100) if ((sd = av_stream_get_side_data(st, AV_PKT_DATA_DOVI_CONF, NULL))) { const AVDOVIDecoderConfigurationRecord *cfg = (void *) sd; MP_VERBOSE(demuxer, "Found Dolby Vision config record: profile " "%d level %d\n", cfg->dv_profile, cfg->dv_level); av_format_inject_global_side_data(avfc); } -#endif // This also applies to vfw-muxed mkv, but we can't detect these easily. sh->codec->avi_dts = matches_avinputformat_name(priv, "avi"); diff --git a/meson.build b/meson.build index 0eb10d4fe1..ae744236b3 100644 --- a/meson.build +++ b/meson.build @@ -16,12 +16,12 @@ source_root = meson.project_source_root() python = find_program('python3') # ffmpeg -libavcodec = dependency('libavcodec', version: '>= 58.12.100') -libavfilter = dependency('libavfilter', version: '>= 7.14.100') -libavformat = dependency('libavformat', version: '>= 58.9.100') -libavutil = dependency('libavutil', version: '>= 56.12.100') -libswresample = dependency('libswresample', version: '>= 3.0.100') -libswscale = dependency('libswscale', version: '>= 5.0.101') +libavcodec = dependency('libavcodec', version: '>= 58.134.100') +libavfilter = dependency('libavfilter', version: '>= 7.110.100') +libavformat = dependency('libavformat', version: '>= 58.76.100') +libavutil = dependency('libavutil', version: '>= 56.70.100') +libswresample = dependency('libswresample', version: '>= 3.9.100') +libswscale = dependency('libswscale', version: '>= 5.9.100') libass = dependency('libass', version: '>= 0.12.2') pthreads = dependency('threads') @@ -631,7 +631,7 @@ if features['libarchive'] 'stream/stream_libarchive.c') endif -libavdevice = dependency('libavdevice', version: '>= 57.0.0', required: get_option('libavdevice')) +libavdevice = dependency('libavdevice', version: '>= 58.13.100', required: get_option('libavdevice')) features += {'libavdevice': libavdevice.found()} if features['libavdevice'] dependencies += libavdevice diff --git a/video/mp_image.c b/video/mp_image.c index 52c3f751f2..533061465d 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -1026,11 +1026,9 @@ struct mp_image *mp_image_from_av_frame(struct AVFrame *src) } #endif -#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 61, 100) sd = av_frame_get_side_data(src, AV_FRAME_DATA_FILM_GRAIN_PARAMS); if (sd) dst->film_grain = sd->buf; -#endif for (int n = 0; n < src->nb_side_data; n++) { sd = src->side_data[n]; diff --git a/wscript b/wscript index 9fc7583225..1acba8a756 100644 --- a/wscript +++ b/wscript @@ -412,12 +412,12 @@ libav_dependencies = [ { 'name': 'ffmpeg', 'desc': 'FFmpeg library', - 'func': check_pkg_config('libavutil', '>= 56.12.100', - 'libavcodec', '>= 58.16.100', - 'libavformat', '>= 58.9.100', - 'libswscale', '>= 5.0.101', - 'libavfilter', '>= 7.14.100', - 'libswresample', '>= 3.0.100'), + 'func': check_pkg_config('libavutil', '>= 56.70.100', + 'libavcodec', '>= 58.134.100', + 'libavformat', '>= 58.76.100', + 'libswscale', '>= 5.9.100', + 'libavfilter', '>= 7.110.100', + 'libswresample', '>= 3.9.100'), 'req': True, 'fmsg': "Unable to find development files for some of the required \ FFmpeg libraries. Git master is recommended." @@ -428,7 +428,7 @@ FFmpeg libraries. Git master is recommended." }, { 'name': '--libavdevice', 'desc': 'libavdevice', - 'func': check_pkg_config('libavdevice', '>= 57.0.0'), + 'func': check_pkg_config('libavdevice', '>= 58.13.100'), } ]