Use a vector rather than a list when returning from content_factory().
authorCarl Hetherington <cth@carlh.net>
Sat, 9 Jul 2022 18:41:10 +0000 (20:41 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 11 Jul 2022 10:22:11 +0000 (12:22 +0200)
53 files changed:
src/lib/content_factory.cc
src/lib/content_factory.h
src/tools/dcpomatic_create.cc
src/wx/content_panel.cc
src/wx/content_view.cc
test/atmos_test.cc
test/audio_analysis_test.cc
test/audio_content_test.cc
test/burnt_subtitle_test.cc
test/butler_test.cc
test/content_test.cc
test/cpl_hash_test.cc
test/dcp_decoder_test.cc
test/dcp_digest_file_test.cc
test/dcp_metadata_test.cc
test/empty_caption_test.cc
test/encryption_test.cc
test/ffmpeg_audio_test.cc
test/ffmpeg_decoder_error_test.cc
test/ffmpeg_encoder_test.cc
test/file_extension_test.cc
test/file_naming_test.cc
test/film_metadata_test.cc
test/find_missing_test.cc
test/guess_crop_test.cc
test/hints_test.cc
test/image_content_fade_test.cc
test/import_dcp_test.cc
test/isdcf_name_test.cc
test/kdm_naming_test.cc
test/markers_test.cc
test/no_use_video_test.cc
test/optimise_stills_test.cc
test/overlap_video_test.cc
test/player_test.cc
test/pulldown_detect_test.cc
test/reel_writer_test.cc
test/reels_test.cc
test/remake_id_test.cc
test/remake_with_subtitle_test.cc
test/required_disk_space_test.cc
test/scaling_test.cc
test/subtitle_charset_test.cc
test/subtitle_font_id_test.cc
test/subtitle_language_test.cc
test/subtitle_reel_test.cc
test/subtitle_timing_test.cc
test/threed_test.cc
test/torture_test.cc
test/vf_test.cc
test/video_level_test.cc
test/video_mxf_content_test.cc
test/writer_test.cc

index 7bcc45503bc0dbc1997e5926c77e0ed5dd82b25e..135f3fe5f5bb1da82dfbdfb16b908475b18b16f6 100644 (file)
@@ -50,6 +50,7 @@ using std::list;
 using std::make_shared;
 using std::shared_ptr;
 using std::string;
+using std::vector;
 
 
 /** Create a Content object from an XML node.
@@ -104,10 +105,10 @@ content_factory (cxml::ConstNodePtr node, int version, list<string>& notes)
  *  @param path File or directory.
  *  @return Content objects.
  */
-list<shared_ptr<Content>>
+vector<shared_ptr<Content>>
 content_factory (boost::filesystem::path path)
 {
-       list<shared_ptr<Content>> content;
+       vector<shared_ptr<Content>> content;
 
        if (boost::filesystem::is_directory (path)) {
 
index 7da5435d5f531c2ff4ebba39615c25c167a13ad2..2cef840340ffe10404e6b5c45d875da591c513bd 100644 (file)
@@ -25,6 +25,7 @@
 
 
 #include <libcxml/cxml.h>
+#include <vector>
 
 
 class Film;
@@ -32,4 +33,4 @@ class Content;
 
 
 extern std::shared_ptr<Content> content_factory (cxml::ConstNodePtr, int, std::list<std::string> &);
-extern std::list<std::shared_ptr<Content>> content_factory (boost::filesystem::path);
+extern std::vector<std::shared_ptr<Content>> content_factory (boost::filesystem::path);
index 4c40c24d3ce2384970e5b12ce39353a84888b655..a4f8dda6ac65e36435133a0d327ece208ee86e37 100644 (file)
@@ -45,6 +45,7 @@
 #include <stdexcept>
 #include <string>
 
+
 using std::cerr;
 using std::cout;
 using std::dynamic_pointer_cast;
@@ -53,8 +54,10 @@ using std::list;
 using std::make_shared;
 using std::shared_ptr;
 using std::string;
+using std::vector;
 using boost::optional;
 
+
 class SimpleSignalManager : public SignalManager
 {
 public:
@@ -117,7 +120,7 @@ main (int argc, char* argv[])
 
                for (auto cli_content: cc.content) {
                        auto const can = boost::filesystem::canonical (cli_content.path);
-                       list<shared_ptr<Content>> film_content_list;
+                       vector<shared_ptr<Content>> film_content_list;
 
                        if (boost::filesystem::exists (can / "ASSETMAP") || (boost::filesystem::exists (can / "ASSETMAP.xml"))) {
                                auto dcp = make_shared<DCPContent>(can);
index a7c9a445482ce486c30eea5b722464479c538631..5f3b3e4760e116065954789b276a07ac82a1ab73 100644 (file)
@@ -483,7 +483,7 @@ ContentPanel::add_folder_clicked ()
                return;
        }
 
-       list<shared_ptr<Content> > content;
+       vector<shared_ptr<Content>> content;
 
        try {
                content = content_factory (path);
index 80256987971e654e6e1bdeb49c193e5cc94de80d..95b481e0b75d5a74a56b1d5f4a0decadd44c7898 100644 (file)
@@ -99,7 +99,7 @@ ContentView::update ()
                        } else if (i.path().extension() == ".mp4") {
                                auto all_content = content_factory(i);
                                if (!all_content.empty()) {
-                                       content = all_content.front();
+                                       content = all_content[0];
                                }
                        }
 
index a364aa0eba3c7f5cadbdf9d357ab07f9053bb22c..661eca5b927b8058c762c899d8ddaf2a8d599938 100644 (file)
@@ -26,7 +26,6 @@
 #include "lib/film.h"
 #include "test.h"
 #include <boost/test/unit_test.hpp>
-#include <iostream>
 
 
 using std::string;
@@ -42,7 +41,7 @@ BOOST_AUTO_TEST_CASE (atmos_passthrough_test)
 
        auto film = new_test_film2 (
                "atmos_passthrough_test",
-               { content_factory(TestPaths::private_data() / "atmos_asset.mxf").front() },
+               content_factory(TestPaths::private_data() / "atmos_asset.mxf"),
                &cl
                );
 
@@ -60,8 +59,8 @@ BOOST_AUTO_TEST_CASE (atmos_encrypted_passthrough_test)
        Cleanup cl;
 
        auto ref = TestPaths::private_data() / "atmos_asset.mxf";
-       auto content = content_factory (TestPaths::private_data() / "atmos_asset.mxf").front();
-       auto film = new_test_film2 ("atmos_encrypted_passthrough_test", {content}, &cl);
+       auto content = content_factory(TestPaths::private_data() / "atmos_asset.mxf");
+       auto film = new_test_film2 ("atmos_encrypted_passthrough_test", content, &cl);
 
        film->set_encrypted (true);
        film->_key = dcp::Key ("4fac12927eb122af1c2781aa91f3a4cc");
@@ -96,10 +95,10 @@ BOOST_AUTO_TEST_CASE (atmos_trim_test)
        Cleanup cl;
 
        auto ref = TestPaths::private_data() / "atmos_asset.mxf";
-       auto content = content_factory (TestPaths::private_data() / "atmos_asset.mxf").front();
-       auto film = new_test_film2 ("atmos_trim_test", {content}, &cl);
+       auto content = content_factory(TestPaths::private_data() / "atmos_asset.mxf");
+       auto film = new_test_film2 ("atmos_trim_test", content, &cl);
 
-       content->set_trim_start (dcpomatic::ContentTime::from_seconds(1));
+       content[0]->set_trim_start (dcpomatic::ContentTime::from_seconds(1));
 
        /* Just check that the encode runs; I'm not sure how to test the MXF */
        make_and_verify_dcp (film, { dcp::VerificationNote::Code::MISSING_CPL_METADATA });
index e131ce57c9cf331650302488f95d0dcce0adc183..8162d540c1a87aff46af4eff0e780ee161f146c0 100644 (file)
@@ -27,7 +27,6 @@
  */
 
 
-#include "test.h"
 #include "lib/analyse_audio_job.h"
 #include "lib/audio_analysis.h"
 #include "lib/audio_content.h"
@@ -39,8 +38,8 @@
 #include "lib/job_manager.h"
 #include "lib/playlist.h"
 #include "lib/ratio.h"
+#include "test.h"
 #include <boost/test/unit_test.hpp>
-#include <iostream>
 
 
 using std::make_shared;
@@ -188,7 +187,7 @@ BOOST_AUTO_TEST_CASE (analyse_audio_test4)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name("TLR"));
        film->set_name ("frobozz");
-       auto content = content_factory(TestPaths::private_data() / "20 The Wedding Convoy Song.m4a").front();
+       auto content = content_factory(TestPaths::private_data() / "20 The Wedding Convoy Song.m4a")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
 
@@ -204,7 +203,7 @@ BOOST_AUTO_TEST_CASE (analyse_audio_leqm_test)
 {
        auto film = new_test_film2 ("analyse_audio_leqm_test");
        film->set_audio_channels (2);
-       auto content = content_factory(TestPaths::private_data() / "betty_stereo_48k.wav").front();
+       auto content = content_factory(TestPaths::private_data() / "betty_stereo_48k.wav")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
 
index db4c3a59fe026ead1d0f04b2d6c3a1270f1bb7f8..6114c6b2ce9935b27f3410ad11cacc5887687243 100644 (file)
 
 BOOST_AUTO_TEST_CASE (audio_content_fade_empty_region)
 {
-       auto content = content_factory("test/data/impulse_train.wav").front();
-       auto film = new_test_film2("audio_content_fade_empty_region", { content });
+       auto content = content_factory("test/data/impulse_train.wav");
+       auto film = new_test_film2("audio_content_fade_empty_region", content);
 
-       BOOST_CHECK (content->audio->fade(content->audio->stream(), 0, 0, 48000).empty());
+       BOOST_CHECK(content[0]->audio->fade(content[0]->audio->stream(), 0, 0, 48000).empty());
 }
 
 
 BOOST_AUTO_TEST_CASE (audio_content_fade_no_fade)
 {
-       auto content = content_factory("test/data/impulse_train.wav").front();
-       auto film = new_test_film2("audio_content_fade_no_fade", { content });
+       auto content = content_factory("test/data/impulse_train.wav");
+       auto film = new_test_film2("audio_content_fade_no_fade", content);
 
-       auto const stream = content->audio->stream();
+       auto const stream = content[0]->audio->stream();
 
-       BOOST_CHECK (content->audio->fade(stream, 0, 2000, 48000).empty());
-       BOOST_CHECK (content->audio->fade(stream, 9999, 451, 48000).empty());
-       BOOST_CHECK (content->audio->fade(stream, stream->length() + 100, 8000, 48000).empty());
+       BOOST_CHECK(content[0]->audio->fade(stream, 0, 2000, 48000).empty());
+       BOOST_CHECK(content[0]->audio->fade(stream, 9999, 451, 48000).empty());
+       BOOST_CHECK(content[0]->audio->fade(stream, stream->length() + 100, 8000, 48000).empty());
 }
 
 
 BOOST_AUTO_TEST_CASE (audio_content_fade_unfaded_part)
 {
-       auto content = content_factory("test/data/impulse_train.wav").front();
+       auto content = content_factory("test/data/impulse_train.wav")[0];
        auto film = new_test_film2("audio_content_fade_unfaded_part", { content });
 
        auto const stream = content->audio->stream();
@@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE (audio_content_fade_unfaded_part)
 
 BOOST_AUTO_TEST_CASE (audio_content_within_the_fade_in)
 {
-       auto content = content_factory("test/data/impulse_train.wav").front();
+       auto content = content_factory("test/data/impulse_train.wav")[0];
        auto film = new_test_film2("audio_content_within_the_fade_in", { content });
 
        content->audio->set_fade_in(dcpomatic::ContentTime::from_frames(2000, 48000));
@@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE (audio_content_within_the_fade_in)
 
 BOOST_AUTO_TEST_CASE (audio_content_within_the_fade_out)
 {
-       auto content = content_factory("test/data/impulse_train.wav").front();
+       auto content = content_factory("test/data/impulse_train.wav")[0];
        auto film = new_test_film2("audio_content_within_the_fade_out", { content });
 
        auto const stream = content->audio->stream();
@@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE (audio_content_within_the_fade_out)
 
 BOOST_AUTO_TEST_CASE (audio_content_overlapping_the_fade_in)
 {
-       auto content = content_factory("test/data/impulse_train.wav").front();
+       auto content = content_factory("test/data/impulse_train.wav")[0];
        auto film = new_test_film2("audio_content_overlapping_the_fade_in", { content });
 
        content->audio->set_fade_in(dcpomatic::ContentTime::from_frames(2000, 48000));
@@ -119,7 +119,7 @@ BOOST_AUTO_TEST_CASE (audio_content_overlapping_the_fade_in)
 
 BOOST_AUTO_TEST_CASE (audio_content_overlapping_the_fade_out)
 {
-       auto content = content_factory("test/data/impulse_train.wav").front();
+       auto content = content_factory("test/data/impulse_train.wav")[0];
        auto film = new_test_film2("audio_content_overlapping_the_fade_out", { content });
 
        auto const stream = content->audio->stream();
@@ -140,7 +140,7 @@ BOOST_AUTO_TEST_CASE (audio_content_overlapping_the_fade_out)
 
 BOOST_AUTO_TEST_CASE (audio_content_fade_in_and_out)
 {
-       auto content = content_factory("test/data/impulse_train.wav").front();
+       auto content = content_factory("test/data/impulse_train.wav")[0];
        auto film = new_test_film2("audio_content_fade_in_and_out", { content });
 
        auto const stream = content->audio->stream();
@@ -159,7 +159,7 @@ BOOST_AUTO_TEST_CASE (audio_content_fade_in_and_out)
 
 BOOST_AUTO_TEST_CASE (audio_content_fade_in_with_trim)
 {
-       auto content = content_factory("test/data/impulse_train.wav").front();
+       auto content = content_factory("test/data/impulse_train.wav")[0];
        auto film = new_test_film2("audio_content_fade_in_with_trim", { content });
 
        auto const stream = content->audio->stream();
@@ -186,7 +186,7 @@ BOOST_AUTO_TEST_CASE (audio_content_fade_in_with_trim)
 
 BOOST_AUTO_TEST_CASE (audio_content_fade_out_with_trim)
 {
-       auto content = content_factory("test/data/impulse_train.wav").front();
+       auto content = content_factory("test/data/impulse_train.wav")[0];
        auto film = new_test_film2("audio_content_fade_out_with_trim", { content });
 
        auto const stream = content->audio->stream();
@@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE (audio_content_fade_out_with_trim)
 BOOST_AUTO_TEST_CASE (audio_content_fade_out_with_trim_at_44k1)
 {
        /* 5s at 44.1kHz */
-       auto content = content_factory("test/data/white.wav").front();
+       auto content = content_factory("test/data/white.wav")[0];
        auto film = new_test_film2("audio_content_fade_out_with_trim_at_44k1", { content });
 
        auto const stream = content->audio->stream();
@@ -248,7 +248,7 @@ BOOST_AUTO_TEST_CASE (audio_content_fade_out_with_trim_at_44k1)
 
 BOOST_AUTO_TEST_CASE (audio_content_fades_same_as_video)
 {
-       auto content = content_factory("test/data/staircase.mov").front();
+       auto content = content_factory("test/data/staircase.mov")[0];
        auto film = new_test_film2("audio_content_fades_same_as_video", { content });
 
        content->audio->set_use_same_fades_as_video(true);
index 0fffe4913e52bf76e96698e1e7724eda99502c2d..38ce61326be1cb5ed0b534a312a2a912e105ff32 100644 (file)
@@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_onto_dcp)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       film->examine_and_add_content (content_factory(film, "test/data/flat_black.png").front());
+       film->examine_and_add_content (content_factory(film, "test/data/flat_black.png")[0]);
        BOOST_REQUIRE (!wait_for_jobs());
        make_and_verify_dcp (film);
 
@@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_onto_dcp)
        auto background_dcp = make_shared<DCPContent>(film2, film->dir(film->dcp_name()));
        film2->examine_and_add_content (background_dcp);
        auto sub = dynamic_pointer_cast<StringText> (
-               content_factory(film2, "test/data/subrip2.srt").front()
+               content_factory(film2, "test/data/subrip2.srt")[0]
                );
        sub->subtitle->set_burn (true);
        sub->subtitle->set_outline (true);
index 7fd5ea57113bdb43135b281000a86204b3140284..1645d41003fe886a485506ab1a5a6a1d6bd1a989 100644 (file)
@@ -46,9 +46,9 @@ BOOST_AUTO_TEST_CASE (butler_test1)
        film->set_name ("butler_test1");
        film->set_container (Ratio::from_id ("185"));
 
-       auto video = content_factory("test/data/flat_red.png").front();
+       auto video = content_factory("test/data/flat_red.png")[0];
        film->examine_and_add_content (video);
-       auto audio = content_factory("test/data/staircase.wav").front();
+       auto audio = content_factory("test/data/staircase.wav")[0];
        film->examine_and_add_content (audio);
        BOOST_REQUIRE (!wait_for_jobs ());
 
index ef3b710e76618d57e0c34545e2045fbd38299435..a22be29aac16130183dec3024ade5c117d028637 100644 (file)
@@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE (content_test1)
        film->set_name ("content_test1");
        film->set_container (Ratio::from_id ("185"));
 
-       auto content = content_factory(TestPaths::private_data() / "demo_sound_bug.mkv").front ();
+       auto content = content_factory(TestPaths::private_data() / "demo_sound_bug.mkv")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        make_and_verify_dcp (
@@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE (content_test1)
  */
 BOOST_AUTO_TEST_CASE (content_test2)
 {
-       auto content = content_factory("test/data/red_23976.mp4").front();
+       auto content = content_factory("test/data/red_23976.mp4")[0];
        auto film = new_test_film2 ("content_test2", {content});
        content->set_trim_start(ContentTime::from_seconds(0.5));
        make_and_verify_dcp (film);
@@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE (content_test2)
 /** Check that position and start trim of video content is forced to a frame boundary */
 BOOST_AUTO_TEST_CASE (content_test3)
 {
-       auto content = content_factory("test/data/red_24.mp4").front();
+       auto content = content_factory("test/data/red_24.mp4")[0];
        auto film = new_test_film2 ("content_test3", {content});
        film->set_sequence (false);
 
@@ -127,7 +127,7 @@ BOOST_AUTO_TEST_CASE (content_test4)
 {
        auto film = new_test_film2 ("content_test4");
 
-       auto video = content_factory("test/data/count300bd24.m2ts").front();
+       auto video = content_factory("test/data/count300bd24.m2ts")[0];
        film->examine_and_add_content (video);
        BOOST_REQUIRE (!wait_for_jobs());
 
@@ -139,12 +139,12 @@ BOOST_AUTO_TEST_CASE (content_test4)
 /** Content containing no video will not have its length rounded to the nearest video frame */
 BOOST_AUTO_TEST_CASE (content_test5)
 {
-       auto audio = content_factory("test/data/sine_16_48_220_10.wav").front();
-       auto film = new_test_film2 ("content_test5", {audio});
+       auto audio = content_factory("test/data/sine_16_48_220_10.wav");
+       auto film = new_test_film2 ("content_test5", audio);
 
-       audio->set_trim_end (dcpomatic::ContentTime(3000));
+       audio[0]->set_trim_end(dcpomatic::ContentTime(3000));
 
-       BOOST_CHECK (audio->length_after_trim(film) == DCPTime(957000));
+       BOOST_CHECK(audio[0]->length_after_trim(film) == DCPTime(957000));
 }
 
 
@@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE (content_test6)
 
        auto film = new_test_film2 (
                "content_test6",
-               { content_factory(TestPaths::private_data() / "fha.mkv").front() },
+               content_factory(TestPaths::private_data() / "fha.mkv"),
                &cl
                );
 
@@ -169,8 +169,8 @@ BOOST_AUTO_TEST_CASE (content_test6)
 /** Reel length error when making the test for #1833 */
 BOOST_AUTO_TEST_CASE (content_test7)
 {
-       auto content = content_factory(TestPaths::private_data() / "clapperboard.mp4").front();
-       auto film = new_test_film2 ("content_test7", {content});
-       content->audio->set_delay (-1000);
+       auto content = content_factory(TestPaths::private_data() / "clapperboard.mp4");
+       auto film = new_test_film2 ("content_test7", content);
+       content[0]->audio->set_delay(-1000);
        make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_RATE_FOR_2K });
 }
index 56dc1974c5ba2f3f24f0e805119337118e0dcff3..de9b9b900c8b8a6d7ba3d9ae515450958ba5b63e 100644 (file)
@@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE (hash_added_to_imported_dcp_test)
        string const ov_name = "hash_added_to_imported_dcp_test_ov";
        shared_ptr<Film> ov = new_test_film2 (
                ov_name,
-               { content_factory("test/data/flat_red.png").front() }
+               content_factory("test/data/flat_red.png")
                );
        make_and_verify_dcp (ov);
 
index 5d4d1e0cacbb2a2648513c56fac28352e747fe2d..da4f6dcbb8bd0f4bb55dc7ee6ef8d9afa8b22ea2 100644 (file)
@@ -53,16 +53,16 @@ BOOST_AUTO_TEST_CASE (check_reuse_old_data_test)
 {
        /* Make some DCPs */
 
-       auto ov = new_test_film2 ("check_reuse_old_data_ov", {content_factory("test/data/flat_red.png").front()});
+       auto ov = new_test_film2 ("check_reuse_old_data_ov", content_factory("test/data/flat_red.png"));
        make_and_verify_dcp (ov);
 
        auto ov_content = make_shared<DCPContent>(ov->dir(ov->dcp_name(false)));
-       auto vf = new_test_film2 ("check_reuse_old_data_vf", {ov_content, content_factory("test/data/L.wav").front()});
+       auto vf = new_test_film2 ("check_reuse_old_data_vf", {ov_content, content_factory("test/data/L.wav")[0]});
        ov_content->set_reference_video (true);
        make_and_verify_dcp (vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET});
 
        auto encrypted = new_test_film2 ("check_reuse_old_data_decrypted");
-       encrypted->examine_and_add_content (content_factory("test/data/flat_red.png").front());
+       encrypted->examine_and_add_content (content_factory("test/data/flat_red.png")[0]);
        BOOST_REQUIRE (!wait_for_jobs());
        encrypted->set_encrypted (true);
        make_and_verify_dcp (encrypted);
index becfd4317a0e9abed8a87f85da0d0c68efe0ba66..16fe4a5bb97f15b8b96bd420a3a355ef720fd3a8 100644 (file)
@@ -65,8 +65,8 @@ BOOST_AUTO_TEST_CASE (dcp_digest_file_test2)
                return {};
        };
 
-       auto red = content_factory("test/data/flat_red.png").front();
-       auto ov = new_test_film2 ("dcp_digest_file_test2_ov", { red });
+       auto red = content_factory("test/data/flat_red.png");
+       auto ov = new_test_film2 ("dcp_digest_file_test2_ov", red);
        ov->set_encrypted (true);
        make_and_verify_dcp (ov);
 
index 67d170020c33b184b0284298997fe0c44999d7d2..8d410e13dcecd7bb70d5286e076d2b04c37fc051 100644 (file)
@@ -30,8 +30,8 @@
 
 BOOST_AUTO_TEST_CASE (dcp_metadata_test)
 {
-       auto content = content_factory("test/data/flat_red.png").front();
-       auto film = new_test_film2 ("dcp_metadata_test", { content });
+       auto content = content_factory("test/data/flat_red.png");
+       auto film = new_test_film2 ("dcp_metadata_test", content);
 
        Config::instance()->set_dcp_creator ("this is the creator");
        Config::instance()->set_dcp_issuer ("this is the issuer");
index 83f5cce5e34e9f0c18fae9dfcd708045e6bb5552..f0449a3ceebc96cff0553c74c61e5b0c1077b932 100644 (file)
@@ -29,9 +29,9 @@
 
 BOOST_AUTO_TEST_CASE (check_for_no_empty_text_nodes_in_failure_case)
 {
-       auto content = content_factory("test/data/empty.srt").front();
-       auto film = new_test_film2 ("check_for_no_empty_text_nodes_in_failure_case", {content});
-       auto text = content->text.front();
+       auto content = content_factory("test/data/empty.srt");
+       auto film = new_test_film2 ("check_for_no_empty_text_nodes_in_failure_case", content);
+       auto text = content[0]->text.front();
        text->set_type (TextType::CLOSED_CAPTION);
        text->set_dcp_track({"English", dcp::LanguageTag("en-GB")});
 
index 5a4a078da81f1224960df35869b19fd6cfdc6e34..b7703f4e99cf2880c5259f0f558e595592101b95 100644 (file)
@@ -35,8 +35,8 @@ using std::make_shared;
 
 BOOST_AUTO_TEST_CASE (smpte_dcp_with_subtitles_can_be_decrypted)
 {
-       auto content = content_factory("test/data/15s.srt").front();
-       auto film = new_test_film2 ("smpte_dcp_with_subtitles_can_be_decrypted", { content });
+       auto content = content_factory("test/data/15s.srt");
+       auto film = new_test_film2 ("smpte_dcp_with_subtitles_can_be_decrypted", content);
        film->set_interop (false);
        film->set_encrypted (true);
        make_and_verify_dcp (
index 6bdadce97e1027b6211c042fbd0a9571bd2ed7a3..ea7293f13d00936299c3a698e46fb11a26c7bdb0 100644 (file)
@@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_audio_test)
 BOOST_AUTO_TEST_CASE (ffmpeg_audio_test2)
 {
        auto film = new_test_film2 ("ffmpeg_audio_test2");
-       auto content = content_factory(TestPaths::private_data() / "wayne.mkv").front();
+       auto content = content_factory(TestPaths::private_data() / "wayne.mkv")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
@@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_audio_test2)
 BOOST_AUTO_TEST_CASE (ffmpeg_audio_test3)
 {
        auto film = new_test_film2 ("ffmpeg_audio_test3");
-       auto content = content_factory(TestPaths::private_data() / "wayne.mkv").front();
+       auto content = content_factory(TestPaths::private_data() / "wayne.mkv")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
@@ -158,7 +158,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_audio_test3)
 BOOST_AUTO_TEST_CASE (ffmpeg_audio_test4)
 {
        auto film = new_test_film2 ("ffmpeg_audio_test4");
-       auto content = content_factory(TestPaths::private_data() / "Actuellement aout 2020.wmv").front();
+       auto content = content_factory(TestPaths::private_data() / "Actuellement aout 2020.wmv")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
index 414c6138496c31f14bb1e8c8cedf58c548d3cdab..b595543dccfc41dc07307cc196a10a62f38e11c7 100644 (file)
 
 BOOST_AUTO_TEST_CASE (check_exception_during_flush)
 {
-       auto content = content_factory(TestPaths::private_data() / "3d_thx_broadway_2010_lossless.m2ts").front();
-       auto film = new_test_film2 ("check_exception_during_flush", { content });
+       auto content = content_factory(TestPaths::private_data() / "3d_thx_broadway_2010_lossless.m2ts");
+       auto film = new_test_film2 ("check_exception_during_flush", content);
 
-       content->set_trim_start (dcpomatic::ContentTime(2310308));
-       content->set_trim_end (dcpomatic::ContentTime(116020));
+       content[0]->set_trim_start(dcpomatic::ContentTime(2310308));
+       content[0]->set_trim_end(dcpomatic::ContentTime(116020));
 
        make_and_verify_dcp (film);
 }
@@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE (check_exception_during_flush)
 
 BOOST_AUTO_TEST_CASE (check_exception_with_multiple_video_frames_per_packet)
 {
-       auto content = content_factory(TestPaths::private_data() / "chk.mkv").front();
+       auto content = content_factory(TestPaths::private_data() / "chk.mkv")[0];
        auto film = new_test_film2 ("check_exception_with_multiple_video_frames_per_packet", { content });
        auto player = std::make_shared<Player>(film, film->playlist());
 
index c85eb6bd45ba863138294a447b16bb32f71ffc13..88321d794b234fcc78be8f14a58de5db5b48b5ed 100644 (file)
@@ -322,7 +322,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test6)
        film2->examine_and_add_content (ov);
        BOOST_REQUIRE (!wait_for_jobs());
        ov->set_reference_video (true);
-       auto subs = content_factory("test/data/subrip.srt").front();
+       auto subs = content_factory("test/data/subrip.srt")[0];
        film2->examine_and_add_content (subs);
        BOOST_REQUIRE (!wait_for_jobs());
        for (auto i: subs->text) {
@@ -437,8 +437,8 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_from_dcp_with_crop)
 /** Export to H264 with reels */
 BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_with_reels)
 {
-       auto content1 = content_factory("test/data/flat_red.png").front();
-       auto content2 = content_factory("test/data/flat_red.png").front();
+       auto content1 = content_factory("test/data/flat_red.png")[0];
+       auto content2 = content_factory("test/data/flat_red.png")[0];
        auto film = new_test_film2 ("ffmpeg_encoder_h264_with_reels", { content1, content2 });
        film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
        content1->video->set_length (240);
@@ -449,7 +449,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_with_reels)
        encoder.go ();
 
        auto check = [](boost::filesystem::path path) {
-               auto reel = std::dynamic_pointer_cast<FFmpegContent>(content_factory(path).front());
+               auto reel = std::dynamic_pointer_cast<FFmpegContent>(content_factory(path)[0]);
                BOOST_REQUIRE (reel);
                FFmpegExaminer examiner(reel);
                BOOST_CHECK_EQUAL (examiner.video_length(), 240U);
@@ -463,7 +463,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_with_reels)
 /** Regression test for "Error during decoding: Butler finished" (#2097) */
 BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_regression_1)
 {
-       auto content = content_factory(TestPaths::private_data() / "arrietty_JP-EN.mkv").front();
+       auto content = content_factory(TestPaths::private_data() / "arrietty_JP-EN.mkv")[0];
        auto film = new_test_film2 ("ffmpeg_encoder_prores_regression_1", { content });
 
        auto job = make_shared<TranscodeJob>(film, TranscodeJob::ChangedBehaviour::IGNORE);
@@ -478,7 +478,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_regression_2)
        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 content = content_factory(TestPaths::private_data() / "tge_clip.mkv")[0];
        auto film = new_test_film2 ("ffmpeg_encoder_prores_regression_2", { content });
 
        auto job = make_shared<TranscodeJob>(film, TranscodeJob::ChangedBehaviour::IGNORE);
index 2c9020b6cb61c1eed253a40a4639ca59700e631e..676dc10ca87178ad30ad5be104300034d2282bb4 100644 (file)
@@ -31,9 +31,9 @@
  */
 BOOST_AUTO_TEST_CASE (interop_file_extension_test)
 {
-       auto video = content_factory("test/data/flat_red.png").front();
-       auto audio = content_factory("test/data/sine_440.wav").front();
-       auto sub = content_factory("test/data/15s.srt").front();
+       auto video = content_factory("test/data/flat_red.png")[0];
+       auto audio = content_factory("test/data/sine_440.wav")[0];
+       auto sub = content_factory("test/data/15s.srt")[0];
        auto film = new_test_film2("interop_file_extension_test", { video, audio, sub });
        film->set_interop(true);
 
@@ -56,9 +56,9 @@ BOOST_AUTO_TEST_CASE (interop_file_extension_test)
 
 BOOST_AUTO_TEST_CASE (smpte_file_extension_test)
 {
-       auto video = content_factory("test/data/flat_red.png").front();
-       auto audio = content_factory("test/data/sine_440.wav").front();
-       auto sub = content_factory("test/data/15s.srt").front();
+       auto video = content_factory("test/data/flat_red.png")[0];
+       auto audio = content_factory("test/data/sine_440.wav")[0];
+       auto sub = content_factory("test/data/15s.srt")[0];
        auto film = new_test_film2("smpte_file_extension_test", { video, audio, sub });
        film->set_interop(false);
 
index 4f6d66fe6da7743f104e0d9f0731bae435c55ac2..069b1d825dea998af1a69ca5f6453688b0035a88 100644 (file)
@@ -180,7 +180,7 @@ BOOST_AUTO_TEST_CASE (subtitle_file_naming)
        Config::instance()->set_dcp_asset_filename_format(dcp::NameFormat("%t ostrabagalous %c"));
 
        auto content = content_factory("test/data/15s.srt");
-       auto film = new_test_film2("subtitle_file_naming", { content.front() });
+       auto film = new_test_film2("subtitle_file_naming", content);
        film->set_interop(false);
 
        make_and_verify_dcp (
index 5c44c2a91377204e5a19e2da91dc8ddc131507ad..9b855de5b5c355e56918a904424b39834d5798d6 100644 (file)
@@ -83,8 +83,8 @@ BOOST_AUTO_TEST_CASE (film_metadata_test)
 /** Check a bug where <Content> tags with multiple <Text>s would fail to load */
 BOOST_AUTO_TEST_CASE (multiple_text_nodes_are_allowed)
 {
-       auto subs = content_factory("test/data/15s.srt").front();
-       auto caps = content_factory("test/data/15s.srt").front();
+       auto subs = content_factory("test/data/15s.srt")[0];
+       auto caps = content_factory("test/data/15s.srt")[0];
        auto film = new_test_film2("multiple_text_nodes_are_allowed1", { subs, caps });
        caps->only_text()->set_type(TextType::CLOSED_CAPTION);
        make_and_verify_dcp (
index b235818101f2b38046a27a2fa969190c2a814a9b..3e64bede4c50aebe221da239a0a3860d7a4db027 100644 (file)
@@ -49,9 +49,9 @@ BOOST_AUTO_TEST_CASE (find_missing_test_with_single_files)
 
        /* Make a film with that content */
        auto film = new_test_film2 (name + "_film", {
-               content_factory(content_dir / "A.png").front(),
-               content_factory(content_dir / "B.png").front(),
-               content_factory(content_dir / "C.png").front()
+               content_factory(content_dir / "A.png")[0],
+               content_factory(content_dir / "B.png")[0],
+               content_factory(content_dir / "C.png")[0]
                });
        film->write_metadata ();
 
index 891ba4036f97493ebe8892deb51f3992e97a7ae9..ed273254c87c32c06e5b3718ffe9570554772640 100644 (file)
@@ -35,26 +35,26 @@ using namespace dcpomatic;
 
 BOOST_AUTO_TEST_CASE (guess_crop_image_test1)
 {
-       auto content = content_factory(TestPaths::private_data() / "arrietty_724.tiff").front();
-       auto film = new_test_film2 ("guess_crop_image_test1", { content });
+       auto content = content_factory(TestPaths::private_data() / "arrietty_724.tiff");
+       auto film = new_test_film2 ("guess_crop_image_test1", content);
 
-       BOOST_CHECK (guess_crop(film, content, 0.1, {}) == Crop(0, 0, 11, 11));
+       BOOST_CHECK (guess_crop(film, content[0], 0.1, {}) == Crop(0, 0, 11, 11));
 }
 
 
 BOOST_AUTO_TEST_CASE (guess_crop_image_test2)
 {
-       auto content = content_factory(TestPaths::private_data() / "prophet_frame.tiff").front();
-       auto film = new_test_film2 ("guess_crop_image_test2", { content });
+       auto content = content_factory(TestPaths::private_data() / "prophet_frame.tiff");
+       auto film = new_test_film2 ("guess_crop_image_test2", content);
 
-       BOOST_CHECK (guess_crop(film, content, 0.1, {}) == Crop(0, 0, 22, 22));
+       BOOST_CHECK(guess_crop(film, content[0], 0.1, {}) == Crop(0, 0, 22, 22));
 }
 
 
 BOOST_AUTO_TEST_CASE (guess_crop_image_test3)
 {
-       auto content = content_factory(TestPaths::private_data() / "pillarbox.png").front();
-       auto film = new_test_film2 ("guess_crop_image_test3", { content });
+       auto content = content_factory(TestPaths::private_data() / "pillarbox.png");
+       auto film = new_test_film2 ("guess_crop_image_test3", content);
 
-       BOOST_CHECK (guess_crop(film, content, 0.1, {}) == Crop(113, 262, 0, 0));
+       BOOST_CHECK(guess_crop(film, content[0], 0.1, {}) == Crop(113, 262, 0, 0));
 }
index ff989647359bfe8e6aaa9357e0b6757f42d90f31..ce7e87b9c90e323947010cbe58dbd92ce3e4ea6d 100644 (file)
@@ -73,7 +73,7 @@ void
 check (TextType type, string name, optional<string> expected_hint = optional<string>())
 {
        auto film = new_test_film2 (name);
-       auto content = content_factory("test/data/" + name + ".srt").front();
+       auto content = content_factory("test/data/" + name + ".srt")[0];
        content->text.front()->set_type (type);
        content->text.front()->set_language (dcp::LanguageTag("en-US"));
        film->examine_and_add_content (content);
@@ -181,7 +181,7 @@ BOOST_AUTO_TEST_CASE (hint_subtitle_mxf_too_big)
        fake_font.close();
 
        auto film = new_test_film2 (name);
-       auto content = content_factory("test/data/" + name + ".srt").front();
+       auto content = content_factory("test/data/" + name + ".srt")[0];
        content->text.front()->set_type (TextType::OPEN_SUBTITLE);
        content->text.front()->set_language (dcp::LanguageTag("en-US"));
        film->examine_and_add_content (content);
@@ -215,7 +215,7 @@ BOOST_AUTO_TEST_CASE (hint_closed_caption_xml_too_big)
        }
        ccap.close();
 
-       auto content = content_factory("build/test/" + name + ".srt").front();
+       auto content = content_factory("build/test/" + name + ".srt")[0];
        content->text.front()->set_type (TextType::CLOSED_CAPTION);
        content->text.front()->set_language (dcp::LanguageTag("en-US"));
        film->examine_and_add_content (content);
@@ -234,7 +234,7 @@ BOOST_AUTO_TEST_CASE (hint_closed_caption_xml_too_big)
 BOOST_AUTO_TEST_CASE (hints_destroyed_while_running)
 {
        auto film = new_test_film2 ("hints_destroyed_while_running");
-       auto content = content_factory(TestPaths::private_data() / "boon_telly.mkv").front();
+       auto content = content_factory(TestPaths::private_data() / "boon_telly.mkv")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
 
@@ -248,7 +248,7 @@ BOOST_AUTO_TEST_CASE (hints_destroyed_while_running)
 
 BOOST_AUTO_TEST_CASE (hints_audio_with_no_language)
 {
-       auto content = content_factory("test/data/sine_440.wav").front();
+       auto content = content_factory("test/data/sine_440.wav")[0];
        auto film = new_test_film2 ("hints_audio_with_no_language", { content });
        content->audio->set_gain (-6);
 
index 1fcf98443cefc31507d71d9d4ede655df1571980..70755f22abc8ec9e2edae3c61e81fa96e98adc0d 100644 (file)
@@ -35,7 +35,7 @@ using std::shared_ptr;
 BOOST_AUTO_TEST_CASE (image_content_fade_test)
 {
        auto film = new_test_film2 ("image_content_fade_test");
-       auto content = content_factory("test/data/flat_red.png").front();
+       auto content = content_factory("test/data/flat_red.png")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
 
index cfac511b32e9e78f285eab944e58f8436b781a5c..874e3d418333eb456d23c0d1617e780ba5865243 100644 (file)
  */
 
 
-#include "test.h"
-#include "lib/film.h"
-#include "lib/screen.h"
-#include "lib/dcp_subtitle_content.h"
-#include "lib/ratio.h"
-#include "lib/dcp_content_type.h"
+#include "lib/config.h"
+#include "lib/content_factory.h"
+#include "lib/cross.h"
 #include "lib/dcp_content.h"
-#include "lib/ffmpeg_content.h"
+#include "lib/dcp_content_type.h"
+#include "lib/dcp_subtitle_content.h"
 #include "lib/examine_content_job.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/film.h"
 #include "lib/job_manager.h"
-#include "lib/config.h"
-#include "lib/cross.h"
+#include "lib/ratio.h"
+#include "lib/screen.h"
 #include "lib/video_content.h"
-#include "lib/content_factory.h"
+#include "test.h"
 #include <dcp/cpl.h>
 #include <boost/test/unit_test.hpp>
 
 
-using std::vector;
-using std::string;
-using std::map;
-using std::shared_ptr;
 using std::dynamic_pointer_cast;
 using std::make_shared;
+using std::map;
+using std::shared_ptr;
+using std::string;
+using std::vector;
 
 
 /** Make an encrypted DCP, import it and make a new unencrypted DCP */
@@ -110,10 +110,10 @@ BOOST_AUTO_TEST_CASE (import_dcp_markers_test)
        Cleanup cl;
 
        /* Make a DCP with some markers */
-       auto content = content_factory("test/data/flat_red.png").front();
-       auto film = new_test_film2 ("import_dcp_markers_test", {content}, &cl);
+       auto content = content_factory("test/data/flat_red.png");
+       auto film = new_test_film2 ("import_dcp_markers_test", content, &cl);
 
-       content->video->set_length (24 * 60 * 10);
+       content[0]->video->set_length (24 * 60 * 10);
 
        film->set_marker(dcp::Marker::FFOC, dcpomatic::DCPTime::from_frames(1, 24));
        film->set_marker(dcp::Marker::FFMC, dcpomatic::DCPTime::from_seconds(9.4));
@@ -161,7 +161,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_metadata_test)
 {
        /* Make a DCP with some ratings and a content version */
        auto film = new_test_film2 ("import_dcp_metadata_test");
-       auto content = content_factory("test/data/flat_red.png").front();
+       auto content = content_factory("test/data/flat_red.png")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
 
index d3227f636ee5ba57d75e71ef40841d73dc1ae49e..4d17f704c4507bbe0cfeddeade2b339f4151aee4 100644 (file)
  */
 
 
-#include <boost/test/unit_test.hpp>
-#include "lib/film.h"
-#include "lib/ratio.h"
-#include "lib/dcp_content_type.h"
-#include "lib/image_content.h"
-#include "lib/video_content.h"
-#include "lib/audio_mapping.h"
-#include "lib/ffmpeg_content.h"
 #include "lib/audio_content.h"
+#include "lib/audio_mapping.h"
 #include "lib/content_factory.h"
+#include "lib/dcp_content_type.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/film.h"
+#include "lib/image_content.h"
+#include "lib/ratio.h"
 #include "lib/text_content.h"
+#include "lib/video_content.h"
 #include "test.h"
-#include <iostream>
+#include <boost/test/unit_test.hpp>
 
 
-using std::cout;
 using std::make_shared;
 using std::shared_ptr;
 using std::string;
@@ -56,7 +54,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
        film->set_container (Ratio::from_id ("185"));
        film->_isdcf_date = boost::gregorian::date (2014, boost::gregorian::Jul, 4);
-       auto audio = content_factory("test/data/sine_440.wav").front();
+       auto audio = content_factory("test/data/sine_440.wav")[0];
        film->examine_and_add_content (audio);
        BOOST_REQUIRE (!wait_for_jobs());
        film->set_audio_language(dcp::LanguageTag("en-US"));
@@ -80,7 +78,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
        film->_isdcf_date = boost::gregorian::date (2014, boost::gregorian::Jul, 4);
        film->set_audio_channels (1);
        film->set_resolution (Resolution::FOUR_K);
-       auto text = content_factory("test/data/subrip.srt").front();
+       auto text = content_factory("test/data/subrip.srt")[0];
        BOOST_REQUIRE_EQUAL (text->text.size(), 1U);
        text->text.front()->set_burn (true);
        text->text.front()->set_language (dcp::LanguageTag("fr-FR"));
@@ -91,7 +89,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
        film->set_studio (string("di"));
        film->set_facility (string("ppfacility"));
        BOOST_REQUIRE (!wait_for_jobs());
-       audio = content_factory("test/data/sine_440.wav").front();
+       audio = content_factory("test/data/sine_440.wav")[0];
        film->examine_and_add_content (audio);
        BOOST_REQUIRE (!wait_for_jobs());
        film->set_audio_language (dcp::LanguageTag("de-DE"));
index f53f4aba2102d1987a324400884c628883ac6aef..dda30f68880f932f48eebf4a4f0aef895902f0c6 100644 (file)
@@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test)
        boost::filesystem::remove_all ("build/test/single_kdm_naming_test");
        auto film = new_test_film2 ("single_kdm_naming_test");
        film->set_name ("my_great_film");
-       film->examine_and_add_content (content_factory("test/data/flat_black.png").front());
+       film->examine_and_add_content (content_factory("test/data/flat_black.png")[0]);
        BOOST_REQUIRE (!wait_for_jobs());
        film->set_encrypted (true);
        make_and_verify_dcp (film);
@@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on(
        boost::filesystem::remove_all ("build/test/directory_kdm_naming_test");
        auto film = new_test_film2 (
                "directory_kdm_naming_test",
-               { content_factory("test/data/flat_black.png").front() }
+               { content_factory("test/data/flat_black.png")[0] }
                );
 
        film->set_name ("my_great_film");
index 844f25660a34d82d4c7aea3330632f90fa197ec1..0bbb329a0a8256e3435cb6fb13b19b646ac42a72 100644 (file)
@@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE (automatic_ffoc_lfoc_markers_test1)
 {
        string const name = "automatic_ffoc_lfoc_markers_test1";
        auto film = new_test_film2 (name);
-       film->examine_and_add_content (content_factory("test/data/flat_red.png").front());
+       film->examine_and_add_content (content_factory("test/data/flat_red.png")[0]);
        BOOST_REQUIRE (!wait_for_jobs());
 
        film->set_interop (false);
@@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE (automatic_ffoc_lfoc_markers_test2)
 {
        string const name = "automatic_ffoc_lfoc_markers_test2";
        auto film = new_test_film2 (name);
-       film->examine_and_add_content (content_factory("test/data/flat_red.png").front());
+       film->examine_and_add_content (content_factory("test/data/flat_red.png")[0]);
        BOOST_REQUIRE (!wait_for_jobs());
 
        film->set_interop (false);
index 2cc914f84f1c4d619819c9480ecc7d9f3bf4d20a..d6a011ff233d494ec28e7a248158f75be7135738 100644 (file)
@@ -52,8 +52,8 @@ using std::shared_ptr;
 BOOST_AUTO_TEST_CASE (no_use_video_test1)
 {
        auto film = new_test_film2 ("no_use_video_test1");
-       auto A = content_factory("test/data/flat_red.png").front();
-       auto B = content_factory("test/data/flat_green.png").front();
+       auto A = content_factory("test/data/flat_red.png")[0];
+       auto B = content_factory("test/data/flat_green.png")[0];
        film->examine_and_add_content (A);
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -72,8 +72,8 @@ BOOST_AUTO_TEST_CASE (no_use_video_test1)
 BOOST_AUTO_TEST_CASE (no_use_video_test2)
 {
        auto film = new_test_film2 ("no_use_video_test2");
-       auto A = content_factory (TestPaths::private_data() / "dolby_aurora.vob").front();
-       auto B = content_factory (TestPaths::private_data() / "big_buck_bunny_trailer_480p.mov").front();
+       auto A = content_factory(TestPaths::private_data() / "dolby_aurora.vob")[0];
+       auto B = content_factory(TestPaths::private_data() / "big_buck_bunny_trailer_480p.mov")[0];
        film->examine_and_add_content (A);
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -92,9 +92,9 @@ BOOST_AUTO_TEST_CASE (no_use_video_test2)
 BOOST_AUTO_TEST_CASE (no_use_video_test3)
 {
        auto ov_a = new_test_film2 ("no_use_video_test3_ov_a");
-       auto ov_a_pic = content_factory("test/data/flat_red.png").front();
+       auto ov_a_pic = content_factory("test/data/flat_red.png")[0];
        BOOST_REQUIRE (ov_a_pic);
-       auto ov_a_snd = content_factory("test/data/sine_16_48_220_10.wav").front();
+       auto ov_a_snd = content_factory("test/data/sine_16_48_220_10.wav")[0];
        BOOST_REQUIRE (ov_a_snd);
        ov_a->examine_and_add_content (ov_a_pic);
        ov_a->examine_and_add_content (ov_a_snd);
@@ -102,9 +102,9 @@ BOOST_AUTO_TEST_CASE (no_use_video_test3)
        make_and_verify_dcp (ov_a);
 
        auto ov_b = new_test_film2("no_use_video_test3_ov_b");
-       auto ov_b_pic = content_factory("test/data/flat_green.png").front();
+       auto ov_b_pic = content_factory("test/data/flat_green.png")[0];
        BOOST_REQUIRE (ov_b_pic);
-       auto ov_b_snd = content_factory("test/data/sine_16_48_880_10.wav").front();
+       auto ov_b_snd = content_factory("test/data/sine_16_48_880_10.wav")[0];
        BOOST_REQUIRE (ov_b_snd);
        ov_b->examine_and_add_content (ov_b_pic);
        ov_b->examine_and_add_content (ov_b_snd);
index f2690f61eb45808ea65106208109f649f4ee43ac..6374d5474015e027e8a3bfc31a3c6695ebc97783 100644 (file)
 */
 
 
+#include "lib/content.h"
+#include "lib/content_factory.h"
+#include "lib/dcp_content_type.h"
 #include "lib/dcp_encoder.h"
-#include "lib/writer.h"
-#include "lib/transcode_job.h"
-#include "lib/job_manager.h"
+#include "lib/dcpomatic_log.h"
 #include "lib/film.h"
+#include "lib/job_manager.h"
 #include "lib/ratio.h"
-#include "lib/content_factory.h"
-#include "lib/dcp_content_type.h"
-#include "lib/content.h"
+#include "lib/transcode_job.h"
 #include "lib/video_content.h"
-#include "lib/dcpomatic_log.h"
+#include "lib/writer.h"
 #include "test.h"
-#include <boost/test/unit_test.hpp>
 #include <boost/algorithm/string.hpp>
+#include <boost/test/unit_test.hpp>
 
 
+using std::dynamic_pointer_cast;
 using std::getline;
 using std::ifstream;
+using std::shared_ptr;
 using std::string;
 using std::vector;
 using boost::starts_with;
 using boost::split;
-using std::dynamic_pointer_cast;
-using std::shared_ptr;
 
 
 static
@@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE (optimise_stills_test1)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
-       auto content = content_factory("test/data/flat_red.png").front ();
+       auto content = content_factory("test/data/flat_red.png")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        make_and_verify_dcp (film);
@@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE (optimise_stills_test2)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name("TLR"));
        film->set_name ("frobozz");
-       auto content = content_factory("test/data/flat_red.png").front();
+       auto content = content_factory("test/data/flat_red.png")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        content->video->set_frame_type (VideoFrameType::THREE_D_LEFT_RIGHT);
index c23444c4abe6756f92299b3cacb4eea6a37f2587..12a26fe609a792a214bc8aafd95c672091f790d2 100644 (file)
@@ -47,9 +47,9 @@ BOOST_AUTO_TEST_CASE (overlap_video_test1)
 {
        auto film = new_test_film2 ("overlap_video_test1");
        film->set_sequence (false);
-       auto A = content_factory("test/data/flat_red.png").front();
+       auto A = content_factory("test/data/flat_red.png")[0];
        film->examine_and_add_content (A);
-       auto B = content_factory("test/data/flat_green.png").front();
+       auto B = content_factory("test/data/flat_green.png")[0];
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs());
 
index 80c7cf9eb44fc5509c7dd33a9fc1eb3493c08449..19336ac4f4d27ad0483dbe19850d34cec923375b 100644 (file)
@@ -149,10 +149,10 @@ BOOST_AUTO_TEST_CASE (player_subframe_test)
        film->set_name ("reels_test7");
        film->set_container (Ratio::from_id("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name("TST"));
-       auto A = content_factory("test/data/flat_red.png").front();
+       auto A = content_factory("test/data/flat_red.png")[0];
        film->examine_and_add_content (A);
        BOOST_REQUIRE (!wait_for_jobs());
-       auto B = content_factory("test/data/awkward_length.wav").front();
+       auto B = content_factory("test/data/awkward_length.wav")[0];
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs());
        film->set_video_frame_rate (24);
@@ -289,11 +289,11 @@ BOOST_AUTO_TEST_CASE (player_seek_test2)
 BOOST_AUTO_TEST_CASE (player_trim_test)
 {
        auto film = new_test_film2 ("player_trim_test");
-       auto A = content_factory("test/data/flat_red.png").front();
+       auto A = content_factory("test/data/flat_red.png")[0];
        film->examine_and_add_content (A);
        BOOST_REQUIRE (!wait_for_jobs ());
        A->video->set_length (10 * 24);
-       auto B = content_factory("test/data/flat_red.png").front();
+       auto B = content_factory("test/data/flat_red.png")[0];
        film->examine_and_add_content (B);
        BOOST_REQUIRE (!wait_for_jobs ());
        B->video->set_length (10 * 24);
@@ -328,9 +328,9 @@ store (list<Sub>* out, PlayerText text, TextType type, optional<DCPTextTrack> tr
 BOOST_AUTO_TEST_CASE (player_ignore_video_and_audio_test)
 {
        auto film = new_test_film2 ("player_ignore_video_and_audio_test");
-       auto ff = content_factory(TestPaths::private_data() / "boon_telly.mkv").front();
+       auto ff = content_factory(TestPaths::private_data() / "boon_telly.mkv")[0];
        film->examine_and_add_content (ff);
-       auto text = content_factory("test/data/subrip.srt").front();
+       auto text = content_factory("test/data/subrip.srt")[0];
        film->examine_and_add_content (text);
        BOOST_REQUIRE (!wait_for_jobs());
        text->only_text()->set_type (TextType::CLOSED_CAPTION);
@@ -352,7 +352,7 @@ BOOST_AUTO_TEST_CASE (player_ignore_video_and_audio_test)
 BOOST_AUTO_TEST_CASE (player_trim_crash)
 {
        auto film = new_test_film2 ("player_trim_crash");
-       auto boon = content_factory(TestPaths::private_data() / "boon_telly.mkv").front();
+       auto boon = content_factory(TestPaths::private_data() / "boon_telly.mkv")[0];
        film->examine_and_add_content (boon);
        BOOST_REQUIRE (!wait_for_jobs());
 
@@ -380,7 +380,7 @@ BOOST_AUTO_TEST_CASE (player_trim_crash)
 BOOST_AUTO_TEST_CASE (player_silence_crash)
 {
        auto film = new_test_film2 ("player_silence_crash");
-       auto sine = content_factory("test/data/impulse_train.wav").front();
+       auto sine = content_factory("test/data/impulse_train.wav")[0];
        film->examine_and_add_content (sine);
        BOOST_REQUIRE (!wait_for_jobs());
 
@@ -394,9 +394,9 @@ BOOST_AUTO_TEST_CASE (player_silence_crash)
 BOOST_AUTO_TEST_CASE (player_3d_test_1)
 {
        auto film = new_test_film2 ("player_3d_test_1a");
-       auto left = content_factory("test/data/flat_red.png").front();
+       auto left = content_factory("test/data/flat_red.png")[0];
        film->examine_and_add_content (left);
-       auto right = content_factory("test/data/flat_blue.png").front();
+       auto right = content_factory("test/data/flat_blue.png")[0];
        film->examine_and_add_content (right);
        BOOST_REQUIRE (!wait_for_jobs());
 
@@ -419,8 +419,8 @@ BOOST_AUTO_TEST_CASE (player_3d_test_1)
 /** Test a crash when processing a 3D DCP as content in a 2D project */
 BOOST_AUTO_TEST_CASE (player_3d_test_2)
 {
-       auto left = content_factory("test/data/flat_red.png").front();
-       auto right = content_factory("test/data/flat_blue.png").front();
+       auto left = content_factory("test/data/flat_red.png")[0];
+       auto right = content_factory("test/data/flat_blue.png")[0];
        auto film = new_test_film2 ("player_3d_test_2a", {left, right});
 
        left->video->set_frame_type (VideoFrameType::THREE_D_LEFT);
@@ -444,7 +444,7 @@ BOOST_AUTO_TEST_CASE (player_3d_test_2)
 BOOST_AUTO_TEST_CASE (player_silence_at_end_crash)
 {
        /* 25fps DCP with some audio */
-       auto content1 = content_factory("test/data/flat_red.png").front();
+       auto content1 = content_factory("test/data/flat_red.png")[0];
        auto film1 = new_test_film2 ("player_silence_at_end_crash_1", {content1});
        content1->video->set_length (25);
        film1->set_video_frame_rate (25);
@@ -463,7 +463,7 @@ BOOST_AUTO_TEST_CASE (player_silence_at_end_crash)
        }
 
        BOOST_REQUIRE (video);
-       auto content3 = content_factory(*video).front();
+       auto content3 = content_factory(*video)[0];
        film2->examine_and_add_content (content3);
        BOOST_REQUIRE (!wait_for_jobs());
        content3->set_position (film2, DCPTime::from_seconds(1.5));
@@ -475,7 +475,7 @@ BOOST_AUTO_TEST_CASE (player_silence_at_end_crash)
 /** #2257 */
 BOOST_AUTO_TEST_CASE (encrypted_dcp_with_no_kdm_gives_no_butler_error)
 {
-       auto content = content_factory("test/data/flat_red.png").front();
+       auto content = content_factory("test/data/flat_red.png")[0];
        auto film = new_test_film2 ("encrypted_dcp_with_no_kdm_gives_no_butler_error", { content });
        int constexpr length = 24 * 25;
        content->video->set_length(length);
@@ -520,8 +520,8 @@ BOOST_AUTO_TEST_CASE (interleaved_subtitle_are_emitted_correctly)
        subs_file[0].close();
        subs_file[1].close();
 
-       auto subs1 = content_factory(paths[0]).front();
-       auto subs2 = content_factory(paths[1]).front();
+       auto subs1 = content_factory(paths[0])[0];
+       auto subs2 = content_factory(paths[1])[0];
        auto film = new_test_film2("interleaved_subtitle_are_emitted_correctly", { subs1, subs2 });
        film->set_sequence(false);
        subs1->set_position(film, DCPTime());
index 3c2df826c06c76a3f93533c5bd34f9b9b0f057e3..047f84b6932d8c8686df86a646fdecf0ea729937 100644 (file)
@@ -32,7 +32,7 @@ using std::shared_ptr;
 BOOST_AUTO_TEST_CASE (pulldown_detect_test1)
 {
        shared_ptr<Film> film = new_test_film2 ("pulldown_detect_test1");
-       shared_ptr<Content> content = content_factory(TestPaths::private_data() / "greatbrain.mkv").front();
+       shared_ptr<Content> content = content_factory(TestPaths::private_data() / "greatbrain.mkv")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
        BOOST_REQUIRE (static_cast<bool>(content->video_frame_rate()));
index 18a3275630342deb0479cb8575aaf87790f0cabf..e4e7c6c4288b405ed66979199e31e079b25c839a 100644 (file)
@@ -109,8 +109,8 @@ BOOST_AUTO_TEST_CASE (write_frame_info_test)
 BOOST_AUTO_TEST_CASE (reel_reuse_video_test)
 {
        /* Make a DCP */
-       auto video = content_factory("test/data/flat_red.png").front();
-       auto audio = content_factory("test/data/white.wav").front();
+       auto video = content_factory("test/data/flat_red.png")[0];
+       auto audio = content_factory("test/data/white.wav")[0];
        auto film = new_test_film2 ("reel_reuse_video_test", { video, audio });
        make_and_verify_dcp (film);
 
index 5bee4a81918462bb45b3c26d260bd4698b04669d..8dbfcd5ba93c8cc4bad89546b2b458d48888defb 100644 (file)
@@ -315,8 +315,8 @@ BOOST_AUTO_TEST_CASE (reels_test6)
  */
 BOOST_AUTO_TEST_CASE (reels_test7)
 {
-       auto A = content_factory("test/data/flat_red.png").front();
-       auto B = content_factory("test/data/awkward_length.wav").front();
+       auto A = content_factory("test/data/flat_red.png")[0];
+       auto B = content_factory("test/data/awkward_length.wav")[0];
        auto film = new_test_film2 ("reels_test7", { A, B });
        film->set_video_frame_rate (24);
        A->video->set_length (2 * 24);
@@ -351,7 +351,7 @@ BOOST_AUTO_TEST_CASE (reels_test9)
        make_and_verify_dcp (film);
 
        auto B = make_shared<DCPContent>(film->dir(film->dcp_name()));
-       auto film2 = new_test_film2("reels_test9b", {B, content_factory("test/data/dcp_sub4.xml").front()});
+       auto film2 = new_test_film2("reels_test9b", {B, content_factory("test/data/dcp_sub4.xml")[0]});
        B->set_reference_video(true);
        B->set_reference_audio(true);
        film2->set_reel_type(ReelType::BY_VIDEO_CONTENT);
@@ -386,7 +386,7 @@ BOOST_AUTO_TEST_CASE (reels_test10)
 
        /* Now try to make the VF; this used to fail */
        auto ov_dcp = make_shared<DCPContent>(ov->dir(ov->dcp_name()));
-       auto vf = new_test_film2("reels_test10_vf", {ov_dcp, content_factory("test/data/15s.srt").front()});
+       auto vf = new_test_film2("reels_test10_vf", {ov_dcp, content_factory("test/data/15s.srt")[0]});
        vf->set_reel_type (ReelType::BY_VIDEO_CONTENT);
        ov_dcp->set_reference_video (true);
        ov_dcp->set_reference_audio (true);
index c4953f98044ca1f1174994dbfa1e0a675e28e844..d2cd54d88a2c875b4016851fea618ac5b142dad8 100644 (file)
@@ -46,8 +46,8 @@ using boost::optional;
 BOOST_AUTO_TEST_CASE (remake_id_test1)
 {
        /* Make a DCP */
-       auto content = content_factory("test/data/flat_red.png").front();
-       auto film = new_test_film2 ("remake_id_test1_1", {content});
+       auto content = content_factory("test/data/flat_red.png");
+       auto film = new_test_film2 ("remake_id_test1_1", content);
        make_and_verify_dcp (film);
 
        /* Copy the video file */
@@ -67,8 +67,8 @@ BOOST_AUTO_TEST_CASE (remake_id_test1)
 BOOST_AUTO_TEST_CASE (remake_id_test2)
 {
        /* Make a DCP */
-       auto content = content_factory("test/data/flat_red.png").front();
-       auto film = new_test_film2 ("remake_id_test2_1", {content});
+       auto content = content_factory("test/data/flat_red.png");
+       auto film = new_test_film2 ("remake_id_test2_1", content);
        film->set_encrypted (true);
        make_and_verify_dcp (film);
 
@@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE (remake_id_test2)
 
        /* Import the DCP into a new film */
        auto dcp_content = make_shared<DCPContent>(film->dir(film->dcp_name()));
-       auto film2 = new_test_film2("remake_id_test2_2", {dcp_content});
+       auto film2 = new_test_film2("remake_id_test2_2", { dcp_content });
        dcp_content->add_kdm(kdm);
        JobManager::instance()->add(make_shared<ExamineContentJob>(film2, dcp_content));
        BOOST_REQUIRE(!wait_for_jobs());
index 3b6cf930c8a71bb87fbc8b6dcf84ff281aa80bd8..68f5c4ebba0998dcc8a99d0576c971577007602b 100644 (file)
@@ -37,7 +37,7 @@ using std::dynamic_pointer_cast;
 BOOST_AUTO_TEST_CASE (remake_with_subtitle_test)
 {
        auto film = new_test_film2 ("remake_with_subtitle_test");
-       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory(TestPaths::private_data() / "prophet_short_clip.mkv").front());
+       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory(TestPaths::private_data() / "prophet_short_clip.mkv")[0]);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
        content->only_text()->set_burn (true);
index cad2e2ee5bdffbaac3a4ab826ebfc5bdd21989cf..8a35ce9022bb3a99875020e38895329d084d21d8 100644 (file)
@@ -49,7 +49,7 @@ BOOST_AUTO_TEST_CASE (required_disk_space_test)
        film->set_j2k_bandwidth (100000000);
        film->set_audio_channels (6);
        film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
-       auto content_a = content_factory("test/data/flat_blue.png").front();
+       auto content_a = content_factory("test/data/flat_blue.png")[0];
        BOOST_REQUIRE (content_a);
        film->examine_and_add_content (content_a);
        auto content_b = make_shared<DCPContent>("test/data/burnt_subtitle_test_dcp");
index c361da80bb2f66053516ad79daf0a1390b8b186d..9a3424506c0c5dae589cc406e9c1733884c0ad8d 100644 (file)
  */
 
 
-#include <boost/test/unit_test.hpp>
+#include "lib/dcp_content_type.h"
+#include "lib/film.h"
 #include "lib/image_content.h"
 #include "lib/ratio.h"
-#include "lib/film.h"
-#include "lib/dcp_content_type.h"
 #include "lib/video_content.h"
 #include "test.h"
+#include <boost/test/unit_test.hpp>
 
 
 using std::string;
index 8233bf023c9b7b1df9d74c4aa232b8ce09860bc7..333a895bfdf10bc16653079121f0f0de5fbf6468 100644 (file)
@@ -35,18 +35,18 @@ using std::dynamic_pointer_cast;
 /** Test parsing of UTF16 CR/LF input */
 BOOST_AUTO_TEST_CASE (subtitle_charset_test1)
 {
-       auto content = content_factory (TestPaths::private_data() / "PADDINGTON soustitresVFdef.srt").front();
-       auto film = new_test_film2 ("subtitle_charset_test1", { content });
+       auto content = content_factory(TestPaths::private_data() / "PADDINGTON soustitresVFdef.srt");
+       auto film = new_test_film2 ("subtitle_charset_test1", content);
 }
 
 
 /** Test parsing of OSX input */
 BOOST_AUTO_TEST_CASE (subtitle_charset_test2)
 {
-       auto content = content_factory ("test/data/osx.srt").front();
-       auto film = new_test_film2 ("subtitle_charset_test2", { content });
-       auto ts = dynamic_pointer_cast<StringTextFileContent> (content);
+       auto content = content_factory("test/data/osx.srt");
+       auto film = new_test_film2 ("subtitle_charset_test2", content);
+       auto ts = dynamic_pointer_cast<StringTextFileContent>(content[0]);
        BOOST_REQUIRE (ts);
        /* Make sure we got the subtitle data from the file */
-       BOOST_REQUIRE_EQUAL (content->full_length(film).get(), 6052032);
+       BOOST_REQUIRE_EQUAL(content[0]->full_length(film).get(), 6052032);
 }
index 41bc3a9230b3d58d35c5bdf83c8e3c014ebee67a..792e8eb556a65f448a15a5751b1b7e0608d3f0ce 100644 (file)
@@ -51,8 +51,8 @@ BOOST_AUTO_TEST_CASE(full_dcp_subtitle_font_id_test)
 
 BOOST_AUTO_TEST_CASE(dcp_subtitle_font_id_test)
 {
-       auto subs = content_factory(TestPaths::private_data() / "JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV" / "8b48f6ae-c74b-4b80-b994-a8236bbbad74_sub.mxf").front();
-       auto film = new_test_film2("dcp_subtitle_font_id_test", { subs });
+       auto subs = content_factory(TestPaths::private_data() / "JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV" / "8b48f6ae-c74b-4b80-b994-a8236bbbad74_sub.mxf");
+       auto film = new_test_film2("dcp_subtitle_font_id_test", subs);
 
        auto content = film->content();
        BOOST_REQUIRE_EQUAL(content.size(), 1U);
index e198b78f93c9cd350cb8923dc4c8f9c8f1f8e888..7703a42756ca61686ed22373470f947dc431eafb 100644 (file)
@@ -42,10 +42,10 @@ using std::shared_ptr;
 BOOST_AUTO_TEST_CASE (subtitle_language_interop_test)
 {
        string const name = "subtitle_language_interop_test";
-       auto fr = content_factory("test/data/frames.srt").front();
-       auto film = new_test_film2 (name, { fr });
+       auto fr = content_factory("test/data/frames.srt");
+       auto film = new_test_film2 (name, fr);
 
-       fr->only_text()->set_language (dcp::LanguageTag("fr-FR"));
+       fr[0]->only_text()->set_language (dcp::LanguageTag("fr-FR"));
        film->set_interop (true);
 
        make_and_verify_dcp (
@@ -63,10 +63,10 @@ BOOST_AUTO_TEST_CASE (subtitle_language_interop_test)
 BOOST_AUTO_TEST_CASE (subtitle_language_smpte_test)
 {
        string const name = "subtitle_language_smpte_test";
-       auto fr = content_factory("test/data/frames.srt").front();
-       auto film = new_test_film2 (name, { fr });
+       auto fr = content_factory("test/data/frames.srt");
+       auto film = new_test_film2 (name, fr);
 
-       fr->only_text()->set_language (dcp::LanguageTag("fr-FR"));
+       fr[0]->only_text()->set_language (dcp::LanguageTag("fr-FR"));
        film->set_interop (false);
 
        make_and_verify_dcp (
index 4a2021ba96ed136ba45533b733507b6df62d8857..f22698d1f6c82b3bd9d0b424b3f5f97fbbdf5c2c 100644 (file)
@@ -106,13 +106,13 @@ BOOST_AUTO_TEST_CASE (subtitle_in_all_reels_test)
        film->set_sequence (false);
        film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
        for (int i = 0; i < 3; ++i) {
-               auto video = content_factory("test/data/flat_red.png").front();
+               auto video = content_factory("test/data/flat_red.png")[0];
                film->examine_and_add_content (video);
                BOOST_REQUIRE (!wait_for_jobs());
                video->video->set_length (15 * 24);
                video->set_position (film, dcpomatic::DCPTime::from_seconds(15 * i));
        }
-       auto subs = content_factory("test/data/15s.srt").front();
+       auto subs = content_factory("test/data/15s.srt")[0];
        film->examine_and_add_content (subs);
        BOOST_REQUIRE (!wait_for_jobs());
        make_and_verify_dcp (
@@ -146,20 +146,20 @@ BOOST_AUTO_TEST_CASE (closed_captions_in_all_reels_test)
        film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
 
        for (int i = 0; i < 3; ++i) {
-               auto video = content_factory("test/data/flat_red.png").front();
+               auto video = content_factory("test/data/flat_red.png")[0];
                film->examine_and_add_content (video);
                BOOST_REQUIRE (!wait_for_jobs());
                video->video->set_length (15 * 24);
                video->set_position (film, dcpomatic::DCPTime::from_seconds(15 * i));
        }
 
-       auto ccap1 = content_factory("test/data/15s.srt").front();
+       auto ccap1 = content_factory("test/data/15s.srt")[0];
        film->examine_and_add_content (ccap1);
        BOOST_REQUIRE (!wait_for_jobs());
        ccap1->text.front()->set_type (TextType::CLOSED_CAPTION);
        ccap1->text.front()->set_dcp_track (DCPTextTrack("Test", dcp::LanguageTag("de-DE")));
 
-       auto ccap2 = content_factory("test/data/15s.srt").front();
+       auto ccap2 = content_factory("test/data/15s.srt")[0];
        film->examine_and_add_content (ccap2);
        BOOST_REQUIRE (!wait_for_jobs());
        ccap2->text.front()->set_type (TextType::CLOSED_CAPTION);
@@ -201,14 +201,14 @@ BOOST_AUTO_TEST_CASE (subtitles_split_at_reel_boundaries)
        film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
 
        for (int i = 0; i < 3; ++i) {
-               auto video = content_factory("test/data/flat_red.png").front();
+               auto video = content_factory("test/data/flat_red.png")[0];
                film->examine_and_add_content (video);
                BOOST_REQUIRE (!wait_for_jobs());
                video->video->set_length (15 * 24);
                video->set_position (film, dcpomatic::DCPTime::from_seconds(15 * i));
        }
 
-       auto subtitle = content_factory("test/data/45s.srt").front();
+       auto subtitle = content_factory("test/data/45s.srt")[0];
        film->examine_and_add_content (subtitle);
        BOOST_REQUIRE (!wait_for_jobs());
 
index e8d4b07fe51e01c4b54f9e02df2f38957113ecf7..68881aea89b81df332e4e11b1c6e120245f4f1e1 100644 (file)
@@ -40,8 +40,8 @@ BOOST_AUTO_TEST_CASE (test_subtitle_timing_with_frame_rate_change)
        constexpr auto content_frame_rate = 29.976f;
        const std::string name = "test_subtitle_timing_with_frame_rate_change";
 
-       auto picture = content_factory("test/data/flat_red.png").front();
-       auto sub = content_factory("test/data/hour.srt").front();
+       auto picture = content_factory("test/data/flat_red.png")[0];
+       auto sub = content_factory("test/data/hour.srt")[0];
        sub->text.front()->set_language(dcp::LanguageTag("en-GB"));
        picture->set_video_frame_rate (content_frame_rate);
 
index 4413ff01bcc737c7962da57abebb89c79e78dff7..e322dbda520a62076b9e9fcefce8ed100eb565a2 100644 (file)
@@ -183,7 +183,7 @@ BOOST_AUTO_TEST_CASE (threed_test7)
 
        auto film = new_test_film2 ("threed_test7");
        path const content_path = "test/data/flat_red.png";
-       auto c = content_factory(content_path).front();
+       auto c = content_factory(content_path)[0];
        film->examine_and_add_content (c);
        BOOST_REQUIRE (!wait_for_jobs());
 
index c9bffaac7acf02aac11bc95f9ed37859253cc8b5..f8951932b7956f3b574539824b662c17642fcdd2 100644 (file)
@@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE (torture_test1)
        film->set_sequence (false);
 
        /* Staircase at an offset of 2000 samples, trimmed both start and end, with a gain of exactly 2 (linear) */
-       auto staircase = content_factory("test/data/staircase.wav").front();
+       auto staircase = content_factory("test/data/staircase.wav")[0];
        film->examine_and_add_content (staircase);
        BOOST_REQUIRE (!wait_for_jobs());
        staircase->set_position (film, DCPTime::from_frames(2000, film->audio_frame_rate()));
@@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE (torture_test1)
        staircase->audio->set_gain (20 * log10(2));
 
        /* And again at an offset of 50000 samples, trimmed both start and end, with a gain of exactly 2 (linear) */
-       staircase = content_factory("test/data/staircase.wav").front();
+       staircase = content_factory("test/data/staircase.wav")[0];
        film->examine_and_add_content (staircase);
        BOOST_REQUIRE (!wait_for_jobs());
        staircase->set_position (film, DCPTime::from_frames(50000, film->audio_frame_rate()));
@@ -76,7 +76,7 @@ BOOST_AUTO_TEST_CASE (torture_test1)
        staircase->audio->set_gain (20 * log10(2));
 
        /* 1s of red at 5s in */
-       auto red = content_factory("test/data/flat_red.png").front();
+       auto red = content_factory("test/data/flat_red.png")[0];
        film->examine_and_add_content (red);
        BOOST_REQUIRE (!wait_for_jobs());
        red->set_position (film, DCPTime::from_seconds(5));
index 3389e83be0063104f7d5833827da1b77e79887f4..f3ba156a10518454f66eb85dcb0a2704b08bbbff 100644 (file)
@@ -102,11 +102,11 @@ BOOST_AUTO_TEST_CASE (vf_test2)
        auto ov = new_test_film ("vf_test2_ov");
        ov->set_dcp_content_type (DCPContentType::from_isdcf_name("TST"));
        ov->set_name ("vf_test2_ov");
-       auto video = content_factory("test/data/flat_red.png").front();
+       auto video = content_factory("test/data/flat_red.png")[0];
        ov->examine_and_add_content (video);
        BOOST_REQUIRE (!wait_for_jobs());
        video->video->set_length (24 * 5);
-       auto audio = content_factory("test/data/white.wav").front();
+       auto audio = content_factory("test/data/white.wav")[0];
        ov->examine_and_add_content (audio);
        BOOST_REQUIRE (!wait_for_jobs());
        make_and_verify_dcp (ov);
@@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE (vf_test2)
        BOOST_REQUIRE (!wait_for_jobs());
        dcp->set_reference_video (true);
        dcp->set_reference_audio (true);
-       auto sub = content_factory("test/data/subrip4.srt").front();
+       auto sub = content_factory("test/data/subrip4.srt")[0];
        vf->examine_and_add_content (sub);
        BOOST_REQUIRE (!wait_for_jobs());
        make_and_verify_dcp (
@@ -164,11 +164,11 @@ BOOST_AUTO_TEST_CASE (vf_test3)
        auto ov = new_test_film ("vf_test3_ov");
        ov->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        ov->set_name ("vf_test3_ov");
-       auto video = content_factory("test/data/flat_red.png").front();
+       auto video = content_factory("test/data/flat_red.png")[0];
        ov->examine_and_add_content (video);
        BOOST_REQUIRE (!wait_for_jobs());
        video->video->set_length (24 * 5);
-       auto audio = content_factory("test/data/white.wav").front();
+       auto audio = content_factory("test/data/white.wav")[0];
        ov->examine_and_add_content (audio);
        BOOST_REQUIRE (!wait_for_jobs());
        make_and_verify_dcp (ov);
@@ -208,11 +208,11 @@ BOOST_AUTO_TEST_CASE (vf_test4)
        auto ov = new_test_film ("vf_test4_ov");
        ov->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        ov->set_name ("vf_test4_ov");
-       auto video = content_factory("test/data/flat_red.png").front();
+       auto video = content_factory("test/data/flat_red.png")[0];
        ov->examine_and_add_content (video);
        BOOST_REQUIRE (!wait_for_jobs());
        video->video->set_length (24 * 5);
-       auto audio = content_factory("test/data/white.wav").front();
+       auto audio = content_factory("test/data/white.wav")[0];
        ov->examine_and_add_content (audio);
        BOOST_REQUIRE (!wait_for_jobs());
        make_and_verify_dcp (ov);
@@ -230,7 +230,7 @@ BOOST_AUTO_TEST_CASE (vf_test4)
        dcp->set_position(vf, DCPTime::from_seconds(10));
        dcp->set_reference_video (true);
        dcp->set_reference_audio (true);
-       auto more_video = content_factory("test/data/flat_red.png").front();
+       auto more_video = content_factory("test/data/flat_red.png")[0];
        vf->examine_and_add_content (more_video);
        BOOST_REQUIRE (!wait_for_jobs());
        more_video->set_position (vf, DCPTime());
@@ -266,7 +266,7 @@ BOOST_AUTO_TEST_CASE (vf_test5)
        ov->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        ov->set_reel_type (ReelType::BY_VIDEO_CONTENT);
        for (int i = 0; i < 3; ++i) {
-               auto video = content_factory("test/data/flat_red.png").front();
+               auto video = content_factory("test/data/flat_red.png")[0];
                ov->examine_and_add_content (video);
                BOOST_REQUIRE (!wait_for_jobs());
                video->video->set_length (24 * 10);
@@ -313,7 +313,7 @@ BOOST_AUTO_TEST_CASE (vf_test6)
        auto ov = new_test_film ("vf_test6_ov");
        ov->set_dcp_content_type (DCPContentType::from_isdcf_name("TST"));
        ov->set_reel_type (ReelType::BY_VIDEO_CONTENT);
-       auto video = content_factory("test/data/flat_red.png").front();
+       auto video = content_factory("test/data/flat_red.png")[0];
        ov->examine_and_add_content (video);
        BOOST_REQUIRE (!wait_for_jobs());
        video->video->set_length (24 * 10);
@@ -331,7 +331,7 @@ BOOST_AUTO_TEST_CASE (vf_test6)
        dcp->set_reference_video (true);
        dcp->set_reference_audio (true);
 
-       auto sub = content_factory("test/data/15s.srt").front();
+       auto sub = content_factory("test/data/15s.srt")[0];
        vf->examine_and_add_content (sub);
        BOOST_REQUIRE (!wait_for_jobs());
 
@@ -349,12 +349,12 @@ BOOST_AUTO_TEST_CASE (vf_test6)
 BOOST_AUTO_TEST_CASE (vf_test7)
 {
        /* First OV */
-       auto ov1 = new_test_film2 ("vf_test7_ov1", {content_factory("test/data/flat_red.png").front()});
+       auto ov1 = new_test_film2 ("vf_test7_ov1", {content_factory("test/data/flat_red.png")[0]});
        ov1->set_video_frame_rate (24);
        make_and_verify_dcp (ov1);
 
        /* Second OV */
-       auto ov2 = new_test_film2 ("vf_test7_ov2", {content_factory("test/data/flat_red.png").front()});
+       auto ov2 = new_test_film2 ("vf_test7_ov2", {content_factory("test/data/flat_red.png")[0]});
        ov2->set_video_frame_rate (24);
        make_and_verify_dcp (ov2);
 
@@ -378,7 +378,7 @@ BOOST_AUTO_TEST_CASE (test_vf_with_trimmed_multi_reel_dcp)
        /* Make an OV with 3 reels */
        std::vector<std::shared_ptr<Content>> ov_content;
        for (int i = 0; i < 3; ++i) {
-               auto c = content_factory("test/data/flat_red.png").front();
+               auto c = content_factory("test/data/flat_red.png")[0];
                c->video->set_length(240);
                ov_content.push_back(c);
        }
@@ -387,7 +387,7 @@ BOOST_AUTO_TEST_CASE (test_vf_with_trimmed_multi_reel_dcp)
        make_and_verify_dcp (ov);
 
        /* Make a VF with a specific arrangement */
-       auto vf_image = content_factory("test/data/flat_red.png").front();
+       auto vf_image = content_factory("test/data/flat_red.png")[0];
        auto vf_dcp = make_shared<DCPContent>(ov->dir(ov->dcp_name()));
        auto vf = new_test_film2 ("test_vf_with_trimmed_multi_reel_dcp_vf", { vf_image, vf_dcp });
        vf->set_reel_type(ReelType::BY_VIDEO_CONTENT);
index fd221468499728646f6cafc6d4ebf8f2e0bc536e..5ff8bc4c9c1b95fe7026ba40bd4e176d6fb817b1 100644 (file)
@@ -114,9 +114,9 @@ BOOST_AUTO_TEST_CASE (ffmpeg_image_video_range_expanded)
 
        write_image(grey_image(size, grey_pixel), file);
 
-       auto content = content_factory(file).front();
-       auto film = new_test_film2 ("ffmpeg_image_video_range_expanded", { content });
-       content->video->set_range (VideoRange::VIDEO);
+       auto content = content_factory(file);
+       auto film = new_test_film2 ("ffmpeg_image_video_range_expanded", content);
+       content[0]->video->set_range (VideoRange::VIDEO);
        auto player = make_shared<Player>(film, film->playlist());
 
        shared_ptr<PlayerVideo> player_video;
@@ -260,7 +260,7 @@ shared_ptr<Film>
 movie_V (string name)
 {
        auto film = new_test_film2 (name);
-       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mp4").front());
+       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mp4")[0]);
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -278,7 +278,7 @@ shared_ptr<Film>
 movie_VoF (string name)
 {
        auto film = new_test_film2 (name);
-       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mp4").front());
+       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mp4")[0]);
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -297,7 +297,7 @@ shared_ptr<Film>
 movie_F (string name)
 {
        auto film = new_test_film2 (name);
-       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mov").front());
+       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mov")[0]);
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -315,7 +315,7 @@ shared_ptr<Film>
 movie_FoV (string name)
 {
        auto film = new_test_film2 (name);
-       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mov").front());
+       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mov")[0]);
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -334,7 +334,7 @@ shared_ptr<Film>
 image_F (string name)
 {
        auto film = new_test_film2 (name);
-       auto content = dynamic_pointer_cast<ImageContent>(content_factory("test/data/rgb_grey_testcard.png").front());
+       auto content = dynamic_pointer_cast<ImageContent>(content_factory("test/data/rgb_grey_testcard.png")[0]);
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -352,7 +352,7 @@ shared_ptr<Film>
 image_FoV (string name)
 {
        auto film = new_test_film2 (name);
-       auto content = dynamic_pointer_cast<ImageContent>(content_factory("test/data/rgb_grey_testcard.png").front());
+       auto content = dynamic_pointer_cast<ImageContent>(content_factory("test/data/rgb_grey_testcard.png")[0]);
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
index f4f2adab0ffbe74e2b5be0bf7eb46dd0f611f378..ca304071682541fdf77383087c1362cf98035dd2 100644 (file)
@@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE (video_mxf_content_test)
        film->set_container (Ratio::from_id ("185"));
        film->set_name ("video_mxf_content_test");
 
-       auto content = content_factory(ref_mxf).front();
+       auto content = content_factory(ref_mxf)[0];
        auto check = dynamic_pointer_cast<VideoMXFContent> (content);
        BOOST_REQUIRE (check);
        film->examine_and_add_content (content);
index e0df0610e51e0c27020a9e122b1adf48cd2a4296..d5cafe1fbfd33aa25f517910e02d50327a2d194f 100644 (file)
@@ -41,9 +41,9 @@ using std::vector;
 
 BOOST_AUTO_TEST_CASE (test_write_odd_amount_of_silence)
 {
-       auto content = content_factory("test/data/flat_red.png").front();
-       auto film = new_test_film2 ("test_write_odd_amount_of_silence", {content});
-       content->video->set_length(24);
+       auto content = content_factory("test/data/flat_red.png");
+       auto film = new_test_film2 ("test_write_odd_amount_of_silence", content);
+       content[0]->video->set_length(24);
        auto writer = make_shared<Writer>(film, shared_ptr<Job>());
 
        auto audio = make_shared<AudioBuffers>(6, 48000);
@@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE (interrupt_writer)
 
        auto film = new_test_film2 ("test_interrupt_writer", {}, &cl);
 
-       auto content = content_factory("test/data/check_image0.png").front();
+       auto content = content_factory("test/data/check_image0.png")[0];
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());