X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=test%2Fffmpeg_encoder_test.cc;h=9edf2bdbd5880748b64155e13e79e07eed1b6d2d;hp=c3e8c9a81a8ccafa2713eac29325be836c8dbf41;hb=94ab538738526948c5a52ed1222be1e484255541;hpb=c522d113d91f95fa78e017e6edce6a6d64e37778 diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc index c3e8c9a81..9edf2bdbd 100644 --- a/test/ffmpeg_encoder_test.cc +++ b/test/ffmpeg_encoder_test.cc @@ -24,6 +24,7 @@ #include "lib/config.h" #include "lib/content_factory.h" #include "lib/dcp_content.h" +#include "lib/dcpomatic_log.h" #include "lib/ffmpeg_content.h" #include "lib/ffmpeg_encoder.h" #include "lib/ffmpeg_examiner.h" @@ -68,12 +69,12 @@ ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat f name = String::compose("%1_test%2", name, number); auto c = make_shared(content); - shared_ptr film = new_test_film2 (name, {c}, &cl); + auto film = new_test_film2 (name, {c}, &cl); film->set_name (name); film->set_audio_channels (6); film->write_metadata (); - auto job = make_shared(film); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); auto file = boost::filesystem::path("build") / "test" / String::compose("%1.%2", name, extension); cl.add (file); FFmpegEncoder encoder (film, job, file, format, false, false, false, 23); @@ -126,7 +127,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test5) c->video->set_length (240); film->write_metadata (); - auto job = make_shared (film); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_test5.mov", ExportFormat::PRORES, false, false, false, 23); encoder.go (); } @@ -148,7 +149,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test6) s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255)); film->write_metadata(); - auto job = make_shared (film); + auto job = make_shared (film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_test6.mov", ExportFormat::PRORES, false, false, false, 23); encoder.go (); } @@ -173,7 +174,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test7) s->only_text()->set_effect (dcp::Effect::SHADOW); s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255)); - auto job = make_shared (film); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_test7.mov", ExportFormat::PRORES, false, false, false, 23); encoder.go (); } @@ -202,7 +203,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test2) s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255)); film->write_metadata(); - auto job = make_shared (film); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_h264_test2.mp4", ExportFormat::H264_AAC, false, false, false, 23); encoder.go (); } @@ -228,7 +229,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test3) s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255)); film->write_metadata(); - auto job = make_shared (film); + auto job = make_shared (film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_h264_test3.mp4", ExportFormat::H264_AAC, false, false, false, 23); encoder.go (); } @@ -242,7 +243,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test4) film->set_container(Ratio::from_id("185")); - auto job = make_shared(film); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder(film, job, "build/test/ffmpeg_encoder_h264_test4.mp4", ExportFormat::H264_AAC, false, false, false, 23); encoder.go(); } @@ -297,7 +298,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test5) map.set (0, 5, 1); Rs->audio->set_mapping (map); - auto job = make_shared (film); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_h264_test5.mp4", ExportFormat::H264_AAC, true, false, false, 23); encoder.go (); @@ -325,7 +326,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test6) i->set_use (true); } - auto job = make_shared (film2); + auto job = make_shared(film2, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film2, job, "build/test/ffmpeg_encoder_h264_test6_vf.mp4", ExportFormat::H264_AAC, true, false, false, 23); encoder.go (); } @@ -337,7 +338,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_3d_dcp_to_h264) auto dcp = make_shared(TestPaths::private_data() / "xm"); auto film2 = new_test_film2 ("ffmpeg_encoder_3d_dcp_to_h264_export", {dcp}); - auto job = make_shared (film2); + auto job = make_shared(film2, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film2, job, "build/test/ffmpeg_encoder_3d_dcp_to_h264.mp4", ExportFormat::H264_AAC, true, false, false, 23); encoder.go (); } @@ -359,7 +360,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test7) auto dcp = make_shared(film->dir(film->dcp_name())); auto film2 = new_test_film2 ("ffmpeg_encoder_h264_test7_export", {dcp}); - auto job = make_shared (film2); + auto job = make_shared (film2, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film2, job, "build/test/ffmpeg_encoder_h264_test7.mp4", ExportFormat::H264_AAC, true, false, false, 23); encoder.go (); } @@ -368,12 +369,12 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test7) /** Stereo project with mixdown-to-stereo set */ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test8) { - shared_ptr film = new_test_film2("ffmpeg_encoder_h264_test4"); - film->examine_and_add_content(shared_ptr(new DCPContent("test/data/scope_dcp"))); + auto film = new_test_film2("ffmpeg_encoder_h264_test4"); + film->examine_and_add_content(make_shared("test/data/scope_dcp")); BOOST_REQUIRE(!wait_for_jobs()); film->set_audio_channels (2); - shared_ptr job(new TranscodeJob(film)); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder(film, job, "build/test/ffmpeg_encoder_h264_test8.mp4", ExportFormat::H264_AAC, true, false, false, 23); encoder.go(); } @@ -384,7 +385,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test9) { shared_ptr film = new_test_film ("ffmpeg_encoder_prores_test9"); film->set_name ("ffmpeg_encoder_prores_test9"); - shared_ptr c (new ImageContent(TestPaths::private_data() / "bbc405.png")); + auto c = make_shared(TestPaths::private_data() / "bbc405.png"); film->set_container (Ratio::from_id ("185")); film->set_audio_channels (12); @@ -394,7 +395,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test9) c->video->set_length (240); film->write_metadata (); - shared_ptr job (new TranscodeJob (film)); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_test9.mov", ExportFormat::H264_AAC, false, false, false, 23); encoder.go (); } @@ -409,7 +410,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_from_dcp_with_crop) dcp->video->set_right_crop (32); film->write_metadata (); - auto job = make_shared(film); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_from_dcp_with_crop.mov", ExportFormat::PRORES, false, false, false, 23); encoder.go (); } @@ -424,7 +425,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_from_dcp_with_crop) dcp->video->set_right_crop (32); film->write_metadata (); - auto job = make_shared(film); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_from_dcp_with_crop.mov", ExportFormat::H264_AAC, false, false, false, 23); encoder.go (); } @@ -440,7 +441,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_with_reels) content1->video->set_length (240); content2->video->set_length (240); - auto job = make_shared(film); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_h264_with_reels.mov", ExportFormat::H264_AAC, false, true, false, 23); encoder.go (); @@ -462,7 +463,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_regression_1) auto content = content_factory(TestPaths::private_data() / "arrietty_JP-EN.mkv").front(); auto film = new_test_film2 ("ffmpeg_encoder_prores_regression_1", { content }); - auto job = make_shared(film); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_regression_1.mov", ExportFormat::PRORES, false, true, false, 23); encoder.go (); } @@ -471,16 +472,16 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_regression_1) /** Regression test for Butler video buffers reached 480 frames (audio is 0) (#2101) */ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_regression_2) { - auto logs = Config::instance()->log_types(); - Config::instance()->set_log_types(logs | LogEntry::TYPE_DEBUG_PLAYER); + auto logs = dcpomatic_log->types(); + dcpomatic_log->set_types(logs | LogEntry::TYPE_DEBUG_PLAYER); auto content = content_factory(TestPaths::private_data() / "tge_clip.mkv").front(); auto film = new_test_film2 ("ffmpeg_encoder_prores_regression_2", { content }); - auto job = make_shared(film); + auto job = make_shared(film, TranscodeJob::ChangedBehaviour::IGNORE); FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_regression_2.mov", ExportFormat::PRORES, false, true, false, 23); encoder.go (); - Config::instance()->set_log_types(logs); + dcpomatic_log->set_types(logs); }