summaryrefslogtreecommitdiff
path: root/test/ffmpeg_encoder_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-05-20 16:54:37 +0200
committerCarl Hetherington <cth@carlh.net>2024-05-21 23:52:46 +0200
commite3dba6242aed7415eddbbfb1e5d56ce6680603c1 (patch)
tree8628ae20b900cd03638648ef34711a56bf7ef3a6 /test/ffmpeg_encoder_test.cc
parent19b6cd41712d38cb5b1c97659c8a1cc86e784812 (diff)
Replace all new_test_film with new_test_film2.
Diffstat (limited to 'test/ffmpeg_encoder_test.cc')
-rw-r--r--test/ffmpeg_encoder_test.cc64
1 files changed, 14 insertions, 50 deletions
diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc
index 3690bc3fc..64ce8e96b 100644
--- a/test/ffmpeg_encoder_test.cc
+++ b/test/ffmpeg_encoder_test.cc
@@ -126,15 +126,10 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test5)
Cleanup cl;
cl.add(output);
- auto film = new_test_film ("ffmpeg_encoder_prores_test5");
- film->set_name ("ffmpeg_encoder_prores_test5");
auto c = make_shared<ImageContent>(TestPaths::private_data() / "bbc405.png");
- film->set_container (Ratio::from_id ("185"));
+ auto film = new_test_film2("ffmpeg_encoder_prores_test5", { c });
film->set_audio_channels (6);
- film->examine_and_add_content (c);
- BOOST_REQUIRE (!wait_for_jobs ());
-
c->video->set_length (240);
film->write_metadata ();
@@ -149,14 +144,10 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test5)
/** Subs -> Prores */
BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test6)
{
- auto film = new_test_film ("ffmpeg_encoder_prores_test6");
- film->set_name ("ffmpeg_encoder_prores_test6");
- film->set_container (Ratio::from_id ("185"));
+ auto s = make_shared<StringTextFileContent>("test/data/subrip2.srt");
+ auto film = new_test_film2("ffmpeg_encoder_prores_test6", { s });
film->set_audio_channels (6);
- auto s = make_shared<StringTextFileContent>("test/data/subrip2.srt");
- film->examine_and_add_content (s);
- BOOST_REQUIRE (!wait_for_jobs ());
s->only_text()->set_colour (dcp::Colour (255, 255, 0));
s->only_text()->set_effect (dcp::Effect::SHADOW);
s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255));
@@ -175,18 +166,11 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test7)
Cleanup cl;
cl.add(output);
- auto film = new_test_film ("ffmpeg_encoder_prores_test7");
- film->set_name ("ffmpeg_encoder_prores_test7");
- film->set_container (Ratio::from_id ("185"));
- film->set_audio_channels (6);
-
auto c = make_shared<FFmpegContent>("test/data/test.mp4");
- film->examine_and_add_content (c);
- BOOST_REQUIRE (!wait_for_jobs ());
-
auto s = make_shared<StringTextFileContent>("test/data/subrip.srt");
- film->examine_and_add_content (s);
- BOOST_REQUIRE (!wait_for_jobs ());
+ auto film = new_test_film2("ffmpeg_encoder_prores_test7", { c, s });
+ film->set_audio_channels (6);
+
s->only_text()->set_colour (dcp::Colour (255, 255, 0));
s->only_text()->set_effect (dcp::Effect::SHADOW);
s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255));
@@ -209,14 +193,10 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test1)
/** Just subtitles -> H264 */
BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test2)
{
- auto film = new_test_film ("ffmpeg_encoder_h264_test2");
- film->set_name ("ffmpeg_encoder_h264_test2");
- film->set_container (Ratio::from_id ("185"));
+ auto s = make_shared<StringTextFileContent>("test/data/subrip2.srt");
+ auto film = new_test_film2("ffmpeg_encoder_h264_test2", { s });
film->set_audio_channels (6);
- auto s = make_shared<StringTextFileContent>("test/data/subrip2.srt");
- film->examine_and_add_content (s);
- BOOST_REQUIRE (!wait_for_jobs ());
s->only_text()->set_colour (dcp::Colour (255, 255, 0));
s->only_text()->set_effect (dcp::Effect::SHADOW);
s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255));
@@ -231,18 +211,11 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test2)
/** Video + subs -> H264 */
BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test3)
{
- auto film = new_test_film ("ffmpeg_encoder_h264_test3");
- film->set_name ("ffmpeg_encoder_h264_test3");
- film->set_container (Ratio::from_id ("185"));
- film->set_audio_channels (6);
-
auto c = make_shared<FFmpegContent>("test/data/test.mp4");
- film->examine_and_add_content (c);
- BOOST_REQUIRE (!wait_for_jobs());
-
auto s = make_shared<StringTextFileContent>("test/data/subrip.srt");
- film->examine_and_add_content (s);
- BOOST_REQUIRE (!wait_for_jobs ());
+ auto film = new_test_film2("ffmpeg_encoder_h264_test3", { c, s });
+ film->set_audio_channels (6);
+
s->only_text()->set_colour (dcp::Colour (255, 255, 0));
s->only_text()->set_effect (dcp::Effect::SHADOW);
s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255));
@@ -271,24 +244,15 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test4)
/** Test mixdown from 5.1 to stereo */
BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test5)
{
- auto film = new_test_film("ffmpeg_encoder_h264_test5");
- film->set_name("ffmpeg_encoder_h264_test5");
- film->set_container (Ratio::from_id ("185"));
- film->set_audio_channels (6);
-
auto L = make_shared<FFmpegContent>("test/data/L.wav");
- film->examine_and_add_content (L);
auto R = make_shared<FFmpegContent>("test/data/R.wav");
- film->examine_and_add_content (R);
auto C = make_shared<FFmpegContent>("test/data/C.wav");
- film->examine_and_add_content (C);
auto Ls = make_shared<FFmpegContent>("test/data/Ls.wav");
- film->examine_and_add_content (Ls);
auto Rs = make_shared<FFmpegContent>("test/data/Rs.wav");
- film->examine_and_add_content (Rs);
auto Lfe = make_shared<FFmpegContent>("test/data/Lfe.wav");
- film->examine_and_add_content (Lfe);
- BOOST_REQUIRE (!wait_for_jobs ());
+
+ auto film = new_test_film2("ffmpeg_encoder_h264_test5", { L, R, C, Ls, Rs, Lfe });
+ film->set_audio_channels (6);
AudioMapping map (1, MAX_DCP_AUDIO_CHANNELS);