summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-10-28 08:58:35 +0100
committerCarl Hetherington <cth@carlh.net>2025-11-30 00:42:42 +0100
commit465bde70ceb405d05da9b15d19414f4846588e7e (patch)
treefb482007d156087cc64cba58d6cebd9a3f0aac71
parentf5a1704e7e969d7605f8917d1a6edca0864870e3 (diff)
Remove support for FFmpeg < 8.
-rw-r--r--src/lib/audio_filter_graph.cc14
-rw-r--r--src/lib/ffmpeg_content.cc8
-rw-r--r--src/lib/filter_graph.cc8
-rw-r--r--src/lib/video_filter_graph.cc5
-rw-r--r--test/image_test.cc8
-rw-r--r--test/no_use_video_test.cc4
-rw-r--r--wscript6
7 files changed, 1 insertions, 52 deletions
diff --git a/src/lib/audio_filter_graph.cc b/src/lib/audio_filter_graph.cc
index 25a0bc7f2..746ee68e3 100644
--- a/src/lib/audio_filter_graph.cc
+++ b/src/lib/audio_filter_graph.cc
@@ -79,29 +79,15 @@ AudioFilterGraph::src_parameters () const
void
AudioFilterGraph::set_parameters (AVFilterContext* context) const
{
-#ifdef DCPOMATIC_FFMPEG_8
int r = av_opt_set(context, "sample_formats", "fltp", AV_OPT_SEARCH_CHILDREN);
-#else
- AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE };
- int r = av_opt_set_int_list (context, "sample_fmts", sample_fmts, AV_SAMPLE_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
-#endif
DCPOMATIC_ASSERT (r >= 0);
char ch_layout[64];
av_channel_layout_describe(&_channel_layout, ch_layout, sizeof(ch_layout));
-#ifdef DCPOMATIC_FFMPEG_8
r = av_opt_set(context, "channel_layouts", ch_layout, AV_OPT_SEARCH_CHILDREN);
-#else
- r = av_opt_set(context, "ch_layouts", ch_layout, AV_OPT_SEARCH_CHILDREN);
-#endif
DCPOMATIC_ASSERT (r >= 0);
-#ifdef DCPOMATIC_FFMPEG_8
r = av_opt_set_array(context, "samplerates", AV_OPT_SEARCH_CHILDREN, 0, 1, AV_OPT_TYPE_INT, &_sample_rate);
-#else
- int sample_rates[] = { _sample_rate, -1 };
- r = av_opt_set_int_list (context, "sample_rates", sample_rates, -1, AV_OPT_SEARCH_CHILDREN);
-#endif
DCPOMATIC_ASSERT (r >= 0);
}
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index 322553586..1bc824877 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -655,21 +655,13 @@ FFmpegContent::add_properties(shared_ptr<const Film> film, list<UserProperty>& p
_("SMPTE 2085, Y'D'zD'x"),
_("Chroma-derived non-constant luminance"),
_("Chroma-derived constant luminance"),
-#ifdef DCPOMATIC_FFMPEG_8
_("BT2100"),
_("SMPTE ST 2128, IPT-C2"),
_("YCgCo-R, even addition"),
_("YCgCo-R, odd addition")
-#else
- _("BT2100")
-#endif
};
-#ifdef DCPOMATIC_FFMPEG_8
DCPOMATIC_ASSERT(AVCOL_SPC_NB == 18);
-#else
- DCPOMATIC_ASSERT(AVCOL_SPC_NB == 15);
-#endif
p.push_back(UserProperty(UserProperty::VIDEO, _("Colourspace"), spaces[_colorspace.get_value_or(AVCOL_SPC_UNSPECIFIED)]));
diff --git a/src/lib/filter_graph.cc b/src/lib/filter_graph.cc
index 60f046374..26f143360 100644
--- a/src/lib/filter_graph.cc
+++ b/src/lib/filter_graph.cc
@@ -80,24 +80,16 @@ FilterGraph::setup(vector<Filter> const& filters)
throw DecodeError (N_("could not create buffer source"));
}
-#ifdef DCPOMATIC_FFMPEG_8
_buffer_sink_context = avfilter_graph_alloc_filter(_graph, buffer_sink, N_("out"));
if (!_buffer_sink_context) {
throw DecodeError(N_("could not allocate buffer sink."));
}
-#else
- if (avfilter_graph_create_filter (&_buffer_sink_context, buffer_sink, N_("out"), nullptr, nullptr, _graph) < 0) {
- throw DecodeError (N_("could not create buffer sink."));
- }
-#endif
set_parameters (_buffer_sink_context);
-#ifdef DCPOMATIC_FFMPEG_8
if (avfilter_init_dict(_buffer_sink_context, nullptr) < 0) {
throw DecodeError(N_("could not initialise buffer sink."));
}
-#endif
auto outputs = avfilter_inout_alloc ();
outputs->name = av_strdup(N_("in"));
diff --git a/src/lib/video_filter_graph.cc b/src/lib/video_filter_graph.cc
index 17b983c4d..9ead3c138 100644
--- a/src/lib/video_filter_graph.cc
+++ b/src/lib/video_filter_graph.cc
@@ -153,12 +153,7 @@ VideoFilterGraph::src_parameters () const
void
VideoFilterGraph::set_parameters (AVFilterContext* context) const
{
-#ifdef DCPOMATIC_FFMPEG_8
auto const r = av_opt_set(context, "pixel_formats", av_get_pix_fmt_name(_pixel_format), AV_OPT_SEARCH_CHILDREN);
-#else
- AVPixelFormat pix_fmts[] = { _pixel_format, AV_PIX_FMT_NONE };
- int r = av_opt_set_int_list (context, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
-#endif
DCPOMATIC_ASSERT (r >= 0);
}
diff --git a/test/image_test.cc b/test/image_test.cc
index 8d19c631e..501b658f6 100644
--- a/test/image_test.cc
+++ b/test/image_test.cc
@@ -464,11 +464,7 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test4)
Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VideoRange::FULL, AV_PIX_FMT_XYZ12LE, VideoRange::FULL, Image::Alignment::COMPACT, false
);
write_image(cropped, "build/test/crop_scale_window_test4.png");
-#ifdef DCPOMATIC_FFMPEG_8
check_image("test/data/crop_scale_window_test4_ffmpeg8.png", "build/test/crop_scale_window_test4.png");
-#else
- check_image("test/data/crop_scale_window_test4.png", "build/test/crop_scale_window_test4.png");
-#endif
}
@@ -492,11 +488,7 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test6)
Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VideoRange::FULL, AV_PIX_FMT_XYZ12LE, VideoRange::FULL, Image::Alignment::COMPACT, false
);
write_image(cropped, "build/test/crop_scale_window_test6.png");
-#ifdef DCPOMATIC_FFMPEG_8
check_image("test/data/crop_scale_window_test6_ffmpeg8.png", "build/test/crop_scale_window_test6.png");
-#else
- check_image("test/data/crop_scale_window_test6.png", "build/test/crop_scale_window_test6.png");
-#endif
}
diff --git a/test/no_use_video_test.cc b/test/no_use_video_test.cc
index 234de4049..7958c9198 100644
--- a/test/no_use_video_test.cc
+++ b/test/no_use_video_test.cc
@@ -85,11 +85,7 @@ BOOST_AUTO_TEST_CASE (no_use_video_test2)
make_and_verify_dcp (film);
-#ifdef DCPOMATIC_FFMPEG_8
check_dcp(TestPaths::private_data() / "no_use_video_test2_ffmpeg8", film);
-#else
- check_dcp(TestPaths::private_data() / "no_use_video_test2", film);
-#endif
cl.run();
}
diff --git a/wscript b/wscript
index bcfe22b44..8c3853d9c 100644
--- a/wscript
+++ b/wscript
@@ -474,7 +474,7 @@ def configure(conf):
# FFmpeg
if conf.options.static_ffmpeg:
- names = ['avformat', 'avfilter', 'avcodec', 'avutil', 'swscale', 'postproc', 'swresample']
+ names = ['avformat', 'avfilter', 'avcodec', 'avutil', 'swscale', 'swresample']
for name in names:
static = subprocess.Popen(shlex.split('pkg-config --static --libs lib%s' % name), stdout=subprocess.PIPE).communicate()[0].decode('utf-8')
libs = []
@@ -502,10 +502,6 @@ def configure(conf):
conf.check_cfg(package='libavcodec', args='--cflags --libs', uselib_store='AVCODEC', mandatory=True)
conf.check_cfg(package='libavutil', args='--cflags --libs', uselib_store='AVUTIL', mandatory=True)
conf.check_cfg(package='libswscale', args='--cflags --libs', uselib_store='SWSCALE', mandatory=True)
- # Use a lack of libpostproc as a sign that we are on FFmpeg 8
- # We need this check while we're using ffmpeg 7 and arch already switched to 8
- if conf.check_cfg(package='libpostproc', args='--cflags --libs', uselib_store='POSTPROC', mandatory=False) is None:
- conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_FFMPEG_8')
conf.check_cfg(package='libswresample', args='--cflags --libs', uselib_store='SWRESAMPLE', mandatory=True)