using std::make_shared;
using std::shared_ptr;
using std::string;
+using std::vector;
/** Create a Content object from an XML node.
* @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)) {
#include <libcxml/cxml.h>
+#include <vector>
class Film;
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);
#include <stdexcept>
#include <string>
+
using std::cerr;
using std::cout;
using std::dynamic_pointer_cast;
using std::make_shared;
using std::shared_ptr;
using std::string;
+using std::vector;
using boost::optional;
+
class SimpleSignalManager : public SignalManager
{
public:
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);
return;
}
- list<shared_ptr<Content> > content;
+ vector<shared_ptr<Content>> content;
try {
content = content_factory (path);
} else if (i.path().extension() == ".mp4") {
auto all_content = content_factory(i);
if (!all_content.empty()) {
- content = all_content.front();
+ content = all_content[0];
}
}
#include "lib/film.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
-#include <iostream>
using std::string;
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
);
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");
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 });
*/
-#include "test.h"
#include "lib/analyse_audio_job.h"
#include "lib/audio_analysis.h"
#include "lib/audio_content.h"
#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;
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());
{
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());
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();
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));
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();
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));
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();
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();
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();
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();
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();
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);
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);
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);
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 ());
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 (
*/
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);
/** 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);
{
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());
/** 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));
}
auto film = new_test_film2 (
"content_test6",
- { content_factory(TestPaths::private_data() / "fha.mkv").front() },
+ content_factory(TestPaths::private_data() / "fha.mkv"),
&cl
);
/** 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 });
}
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);
{
/* 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);
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);
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");
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")});
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 (
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 ());
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 ());
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 ());
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);
}
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());
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) {
/** 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);
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);
/** 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);
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);
*/
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);
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);
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 (
/** 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 (
/* 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 ();
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));
}
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);
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);
}
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);
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());
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);
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());
*/
-#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 */
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));
{
/* 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());
*/
-#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;
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"));
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"));
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"));
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);
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");
{
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);
{
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);
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());
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());
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);
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);
*/
+#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
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);
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);
{
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());
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);
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);
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);
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());
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());
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());
/** 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);
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);
}
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));
/** #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);
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());
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()));
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);
*/
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);
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);
/* 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);
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 */
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);
/* 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());
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);
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");
*/
-#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;
/** 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);
}
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);
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 (
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 (
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 (
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);
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());
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);
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());
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()));
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()));
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));
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);
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 (
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);
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);
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());
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);
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);
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());
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);
/* 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);
}
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);
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;
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());
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());
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());
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());
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());
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());
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);
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);
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());