summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-07-09 20:41:10 +0200
committerCarl Hetherington <cth@carlh.net>2022-07-11 12:22:11 +0200
commitb1e22dff981fb86ae04b12bb5a064e61030793a8 (patch)
treeffb112f6e3f3311d8669f6a89628bf5f0bc40f2e
parent736d6bf3242a0ba3841cb765e97cf9fee3540460 (diff)
Use a vector rather than a list when returning from content_factory().
-rw-r--r--src/lib/content_factory.cc5
-rw-r--r--src/lib/content_factory.h3
-rw-r--r--src/tools/dcpomatic_create.cc5
-rw-r--r--src/wx/content_panel.cc2
-rw-r--r--src/wx/content_view.cc2
-rw-r--r--test/atmos_test.cc13
-rw-r--r--test/audio_analysis_test.cc7
-rw-r--r--test/audio_content_test.cc38
-rw-r--r--test/burnt_subtitle_test.cc4
-rw-r--r--test/butler_test.cc4
-rw-r--r--test/content_test.cc24
-rw-r--r--test/cpl_hash_test.cc2
-rw-r--r--test/dcp_decoder_test.cc6
-rw-r--r--test/dcp_digest_file_test.cc4
-rw-r--r--test/dcp_metadata_test.cc4
-rw-r--r--test/empty_caption_test.cc6
-rw-r--r--test/encryption_test.cc4
-rw-r--r--test/ffmpeg_audio_test.cc6
-rw-r--r--test/ffmpeg_decoder_error_test.cc10
-rw-r--r--test/ffmpeg_encoder_test.cc12
-rw-r--r--test/file_extension_test.cc12
-rw-r--r--test/file_naming_test.cc2
-rw-r--r--test/film_metadata_test.cc4
-rw-r--r--test/find_missing_test.cc6
-rw-r--r--test/guess_crop_test.cc18
-rw-r--r--test/hints_test.cc10
-rw-r--r--test/image_content_fade_test.cc2
-rw-r--r--test/import_dcp_test.cc36
-rw-r--r--test/isdcf_name_test.cc24
-rw-r--r--test/kdm_naming_test.cc4
-rw-r--r--test/markers_test.cc4
-rw-r--r--test/no_use_video_test.cc16
-rw-r--r--test/optimise_stills_test.cc24
-rw-r--r--test/overlap_video_test.cc4
-rw-r--r--test/player_test.cc34
-rw-r--r--test/pulldown_detect_test.cc2
-rw-r--r--test/reel_writer_test.cc4
-rw-r--r--test/reels_test.cc8
-rw-r--r--test/remake_id_test.cc10
-rw-r--r--test/remake_with_subtitle_test.cc2
-rw-r--r--test/required_disk_space_test.cc2
-rw-r--r--test/scaling_test.cc6
-rw-r--r--test/subtitle_charset_test.cc12
-rw-r--r--test/subtitle_font_id_test.cc4
-rw-r--r--test/subtitle_language_test.cc12
-rw-r--r--test/subtitle_reel_test.cc14
-rw-r--r--test/subtitle_timing_test.cc4
-rw-r--r--test/threed_test.cc2
-rw-r--r--test/torture_test.cc6
-rw-r--r--test/vf_test.cc30
-rw-r--r--test/video_level_test.cc18
-rw-r--r--test/video_mxf_content_test.cc2
-rw-r--r--test/writer_test.cc8
53 files changed, 254 insertions, 253 deletions
diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc
index 7bcc45503..135f3fe5f 100644
--- a/src/lib/content_factory.cc
+++ b/src/lib/content_factory.cc
@@ -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)) {
diff --git a/src/lib/content_factory.h b/src/lib/content_factory.h
index 7da5435d5..2cef84034 100644
--- a/src/lib/content_factory.h
+++ b/src/lib/content_factory.h
@@ -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);
diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc
index 4c40c24d3..a4f8dda6a 100644
--- a/src/tools/dcpomatic_create.cc
+++ b/src/tools/dcpomatic_create.cc
@@ -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);
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index a7c9a4454..5f3b3e476 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -483,7 +483,7 @@ ContentPanel::add_folder_clicked ()
return;
}
- list<shared_ptr<Content> > content;
+ vector<shared_ptr<Content>> content;
try {
content = content_factory (path);
diff --git a/src/wx/content_view.cc b/src/wx/content_view.cc
index 802569879..95b481e0b 100644
--- a/src/wx/content_view.cc
+++ b/src/wx/content_view.cc
@@ -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];
}
}
diff --git a/test/atmos_test.cc b/test/atmos_test.cc
index a364aa0eb..661eca5b9 100644
--- a/test/atmos_test.cc
+++ b/test/atmos_test.cc
@@ -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 });
diff --git a/test/audio_analysis_test.cc b/test/audio_analysis_test.cc
index e131ce57c..8162d540c 100644
--- a/test/audio_analysis_test.cc
+++ b/test/audio_analysis_test.cc
@@ -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());
diff --git a/test/audio_content_test.cc b/test/audio_content_test.cc
index db4c3a59f..6114c6b2c 100644
--- a/test/audio_content_test.cc
+++ b/test/audio_content_test.cc
@@ -29,29 +29,29 @@
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);
diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc
index 0fffe4913..38ce61326 100644
--- a/test/burnt_subtitle_test.cc
+++ b/test/burnt_subtitle_test.cc
@@ -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);
diff --git a/test/butler_test.cc b/test/butler_test.cc
index 7fd5ea571..1645d4100 100644
--- a/test/butler_test.cc
+++ b/test/butler_test.cc
@@ -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 ());
diff --git a/test/content_test.cc b/test/content_test.cc
index ef3b710e7..a22be29aa 100644
--- a/test/content_test.cc
+++ b/test/content_test.cc
@@ -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 });
}
diff --git a/test/cpl_hash_test.cc b/test/cpl_hash_test.cc
index 56dc1974c..de9b9b900 100644
--- a/test/cpl_hash_test.cc
+++ b/test/cpl_hash_test.cc
@@ -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);
diff --git a/test/dcp_decoder_test.cc b/test/dcp_decoder_test.cc
index 5d4d1e0ca..da4f6dcbb 100644
--- a/test/dcp_decoder_test.cc
+++ b/test/dcp_decoder_test.cc
@@ -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);
diff --git a/test/dcp_digest_file_test.cc b/test/dcp_digest_file_test.cc
index becfd4317..16fe4a5bb 100644
--- a/test/dcp_digest_file_test.cc
+++ b/test/dcp_digest_file_test.cc
@@ -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);
diff --git a/test/dcp_metadata_test.cc b/test/dcp_metadata_test.cc
index 67d170020..8d410e13d 100644
--- a/test/dcp_metadata_test.cc
+++ b/test/dcp_metadata_test.cc
@@ -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");
diff --git a/test/empty_caption_test.cc b/test/empty_caption_test.cc
index 83f5cce5e..f0449a3ce 100644
--- a/test/empty_caption_test.cc
+++ b/test/empty_caption_test.cc
@@ -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")});
diff --git a/test/encryption_test.cc b/test/encryption_test.cc
index 5a4a078da..b7703f4e9 100644
--- a/test/encryption_test.cc
+++ b/test/encryption_test.cc
@@ -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 (
diff --git a/test/ffmpeg_audio_test.cc b/test/ffmpeg_audio_test.cc
index 6bdadce97..ea7293f13 100644
--- a/test/ffmpeg_audio_test.cc
+++ b/test/ffmpeg_audio_test.cc
@@ -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 ());
diff --git a/test/ffmpeg_decoder_error_test.cc b/test/ffmpeg_decoder_error_test.cc
index 414c61384..b595543dc 100644
--- a/test/ffmpeg_decoder_error_test.cc
+++ b/test/ffmpeg_decoder_error_test.cc
@@ -37,11 +37,11 @@
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());
diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc
index c85eb6bd4..88321d794 100644
--- a/test/ffmpeg_encoder_test.cc
+++ b/test/ffmpeg_encoder_test.cc
@@ -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);
diff --git a/test/file_extension_test.cc b/test/file_extension_test.cc
index 2c9020b6c..676dc10ca 100644
--- a/test/file_extension_test.cc
+++ b/test/file_extension_test.cc
@@ -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);
diff --git a/test/file_naming_test.cc b/test/file_naming_test.cc
index 4f6d66fe6..069b1d825 100644
--- a/test/file_naming_test.cc
+++ b/test/file_naming_test.cc
@@ -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 (
diff --git a/test/film_metadata_test.cc b/test/film_metadata_test.cc
index 5c44c2a91..9b855de5b 100644
--- a/test/film_metadata_test.cc
+++ b/test/film_metadata_test.cc
@@ -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 (
diff --git a/test/find_missing_test.cc b/test/find_missing_test.cc
index b23581810..3e64bede4 100644
--- a/test/find_missing_test.cc
+++ b/test/find_missing_test.cc
@@ -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 ();
diff --git a/test/guess_crop_test.cc b/test/guess_crop_test.cc
index 891ba4036..ed273254c 100644
--- a/test/guess_crop_test.cc
+++ b/test/guess_crop_test.cc
@@ -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));
}
diff --git a/test/hints_test.cc b/test/hints_test.cc
index ff9896473..ce7e87b9c 100644
--- a/test/hints_test.cc
+++ b/test/hints_test.cc
@@ -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);
diff --git a/test/image_content_fade_test.cc b/test/image_content_fade_test.cc
index 1fcf98443..70755f22a 100644
--- a/test/image_content_fade_test.cc
+++ b/test/image_content_fade_test.cc
@@ -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());
diff --git a/test/import_dcp_test.cc b/test/import_dcp_test.cc
index cfac511b3..874e3d418 100644
--- a/test/import_dcp_test.cc
+++ b/test/import_dcp_test.cc
@@ -25,30 +25,30 @@
*/
-#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());
diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc
index d3227f636..4d17f704c 100644
--- a/test/isdcf_name_test.cc
+++ b/test/isdcf_name_test.cc
@@ -25,22 +25,20 @@
*/
-#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"));
diff --git a/test/kdm_naming_test.cc b/test/kdm_naming_test.cc
index f53f4aba2..dda30f688 100644
--- a/test/kdm_naming_test.cc
+++ b/test/kdm_naming_test.cc
@@ -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");
diff --git a/test/markers_test.cc b/test/markers_test.cc
index 844f25660..0bbb329a0 100644
--- a/test/markers_test.cc
+++ b/test/markers_test.cc
@@ -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);
diff --git a/test/no_use_video_test.cc b/test/no_use_video_test.cc
index 2cc914f84..d6a011ff2 100644
--- a/test/no_use_video_test.cc
+++ b/test/no_use_video_test.cc
@@ -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);
diff --git a/test/optimise_stills_test.cc b/test/optimise_stills_test.cc
index f2690f61e..6374d5474 100644
--- a/test/optimise_stills_test.cc
+++ b/test/optimise_stills_test.cc
@@ -19,30 +19,30 @@
*/
+#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);
diff --git a/test/overlap_video_test.cc b/test/overlap_video_test.cc
index c23444c4a..12a26fe60 100644
--- a/test/overlap_video_test.cc
+++ b/test/overlap_video_test.cc
@@ -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());
diff --git a/test/player_test.cc b/test/player_test.cc
index 80c7cf9eb..19336ac4f 100644
--- a/test/player_test.cc
+++ b/test/player_test.cc
@@ -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());
diff --git a/test/pulldown_detect_test.cc b/test/pulldown_detect_test.cc
index 3c2df826c..047f84b69 100644
--- a/test/pulldown_detect_test.cc
+++ b/test/pulldown_detect_test.cc
@@ -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()));
diff --git a/test/reel_writer_test.cc b/test/reel_writer_test.cc
index 18a327563..e4e7c6c42 100644
--- a/test/reel_writer_test.cc
+++ b/test/reel_writer_test.cc
@@ -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);
diff --git a/test/reels_test.cc b/test/reels_test.cc
index 5bee4a819..8dbfcd5ba 100644
--- a/test/reels_test.cc
+++ b/test/reels_test.cc
@@ -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);
diff --git a/test/remake_id_test.cc b/test/remake_id_test.cc
index c4953f980..d2cd54d88 100644
--- a/test/remake_id_test.cc
+++ b/test/remake_id_test.cc
@@ -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());
diff --git a/test/remake_with_subtitle_test.cc b/test/remake_with_subtitle_test.cc
index 3b6cf930c..68f5c4ebb 100644
--- a/test/remake_with_subtitle_test.cc
+++ b/test/remake_with_subtitle_test.cc
@@ -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);
diff --git a/test/required_disk_space_test.cc b/test/required_disk_space_test.cc
index cad2e2ee5..8a35ce902 100644
--- a/test/required_disk_space_test.cc
+++ b/test/required_disk_space_test.cc
@@ -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");
diff --git a/test/scaling_test.cc b/test/scaling_test.cc
index c361da80b..9a3424506 100644
--- a/test/scaling_test.cc
+++ b/test/scaling_test.cc
@@ -25,13 +25,13 @@
*/
-#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;
diff --git a/test/subtitle_charset_test.cc b/test/subtitle_charset_test.cc
index 8233bf023..333a895bf 100644
--- a/test/subtitle_charset_test.cc
+++ b/test/subtitle_charset_test.cc
@@ -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);
}
diff --git a/test/subtitle_font_id_test.cc b/test/subtitle_font_id_test.cc
index 41bc3a923..792e8eb55 100644
--- a/test/subtitle_font_id_test.cc
+++ b/test/subtitle_font_id_test.cc
@@ -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);
diff --git a/test/subtitle_language_test.cc b/test/subtitle_language_test.cc
index e198b78f9..7703a4275 100644
--- a/test/subtitle_language_test.cc
+++ b/test/subtitle_language_test.cc
@@ -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 (
diff --git a/test/subtitle_reel_test.cc b/test/subtitle_reel_test.cc
index 4a2021ba9..f22698d1f 100644
--- a/test/subtitle_reel_test.cc
+++ b/test/subtitle_reel_test.cc
@@ -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());
diff --git a/test/subtitle_timing_test.cc b/test/subtitle_timing_test.cc
index e8d4b07fe..68881aea8 100644
--- a/test/subtitle_timing_test.cc
+++ b/test/subtitle_timing_test.cc
@@ -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);
diff --git a/test/threed_test.cc b/test/threed_test.cc
index 4413ff01b..e322dbda5 100644
--- a/test/threed_test.cc
+++ b/test/threed_test.cc
@@ -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());
diff --git a/test/torture_test.cc b/test/torture_test.cc
index c9bffaac7..f8951932b 100644
--- a/test/torture_test.cc
+++ b/test/torture_test.cc
@@ -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));
diff --git a/test/vf_test.cc b/test/vf_test.cc
index 3389e83be..f3ba156a1 100644
--- a/test/vf_test.cc
+++ b/test/vf_test.cc
@@ -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);
diff --git a/test/video_level_test.cc b/test/video_level_test.cc
index fd2214684..5ff8bc4c9 100644
--- a/test/video_level_test.cc
+++ b/test/video_level_test.cc
@@ -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());
diff --git a/test/video_mxf_content_test.cc b/test/video_mxf_content_test.cc
index f4f2adab0..ca3040716 100644
--- a/test/video_mxf_content_test.cc
+++ b/test/video_mxf_content_test.cc
@@ -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);
diff --git a/test/writer_test.cc b/test/writer_test.cc
index e0df0610e..d5cafe1fb 100644
--- a/test/writer_test.cc
+++ b/test/writer_test.cc
@@ -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());