summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-01-31 03:14:24 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-31 03:14:24 +0100
commit8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8 (patch)
treef8b25b13ac3732838be259e469d045438d999e7b /test
parent4985d87750c87019dfe5dc7ef44e12c45326dd0e (diff)
More enum class additions.
Diffstat (limited to 'test')
-rw-r--r--test/4k_test.cc2
-rw-r--r--test/client_server_test.cc247
-rw-r--r--test/closed_caption_test.cc8
-rw-r--r--test/create_cli_test.cc10
-rw-r--r--test/digest_test.cc2
-rw-r--r--test/ffmpeg_encoder_test.cc44
-rw-r--r--test/file_naming_test.cc4
-rw-r--r--test/hints_test.cc18
-rw-r--r--test/isdcf_name_test.cc2
-rw-r--r--test/optimise_stills_test.cc2
-rw-r--r--test/player_test.cc10
-rw-r--r--test/recover_test.cc21
-rw-r--r--test/reel_writer_test.cc42
-rw-r--r--test/reels_test.cc109
-rw-r--r--test/required_disk_space_test.cc11
-rw-r--r--test/shuffler_test.cc130
-rw-r--r--test/subtitle_reel_number_test.cc6
-rw-r--r--test/subtitle_reel_test.cc45
-rw-r--r--test/test.cc9
-rw-r--r--test/test.h7
-rw-r--r--test/threed_test.cc28
-rw-r--r--test/vf_test.cc32
-rw-r--r--test/video_level_test.cc7
23 files changed, 398 insertions, 398 deletions
diff --git a/test/4k_test.cc b/test/4k_test.cc
index 6c6dea827..38b43e9cd 100644
--- a/test/4k_test.cc
+++ b/test/4k_test.cc
@@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE (fourk_test)
LogSwitcher ls (film->log());
film->set_name ("4k_test");
auto c = make_shared<FFmpegContent>("test/data/test.mp4");
- film->set_resolution (RESOLUTION_4K);
+ film->set_resolution (Resolution::FOUR_K);
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
film->set_container (Ratio::from_id ("185"));
film->examine_and_add_content (c);
diff --git a/test/client_server_test.cc b/test/client_server_test.cc
index eb066ce0f..3dceb31b0 100644
--- a/test/client_server_test.cc
+++ b/test/client_server_test.cc
@@ -43,9 +43,10 @@
using std::list;
using std::shared_ptr;
+using std::weak_ptr;
+using std::make_shared;
using boost::thread;
using boost::optional;
-using std::weak_ptr;
using dcp::ArrayData;
void
@@ -60,7 +61,7 @@ do_remote_encode (shared_ptr<DCPVideo> frame, EncodeServerDescription descriptio
BOOST_AUTO_TEST_CASE (client_server_test_rgb)
{
- shared_ptr<Image> image (new Image (AV_PIX_FMT_RGB24, dcp::Size (1998, 1080), true));
+ auto image = make_shared<Image>(AV_PIX_FMT_RGB24, dcp::Size (1998, 1080), true);
uint8_t* p = image->data()[0];
for (int y = 0; y < 1080; ++y) {
@@ -73,7 +74,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
p += image->stride()[0];
}
- shared_ptr<Image> sub_image (new Image (AV_PIX_FMT_BGRA, dcp::Size (100, 200), true));
+ auto sub_image = make_shared<Image>(AV_PIX_FMT_BGRA, dcp::Size (100, 200), true);
p = sub_image->data()[0];
for (int y = 0; y < 200; ++y) {
uint8_t* q = p;
@@ -86,42 +87,38 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
p += sub_image->stride()[0];
}
- LogSwitcher ls (shared_ptr<Log>(new FileLog("build/test/client_server_test_rgb.log")));
-
- shared_ptr<PlayerVideo> pvf (
- new PlayerVideo (
- shared_ptr<ImageProxy> (new RawImageProxy (image)),
- Crop (),
- optional<double> (),
- dcp::Size (1998, 1080),
- dcp::Size (1998, 1080),
- EYES_BOTH,
- PART_WHOLE,
- ColourConversion(),
- VideoRange::FULL,
- weak_ptr<Content>(),
- optional<Frame>(),
- false
- )
+ LogSwitcher ls (make_shared<FileLog>("build/test/client_server_test_rgb.log"));
+
+ auto pvf = std::make_shared<PlayerVideo>(
+ make_shared<RawImageProxy>(image),
+ Crop (),
+ optional<double> (),
+ dcp::Size (1998, 1080),
+ dcp::Size (1998, 1080),
+ Eyes::BOTH,
+ Part::WHOLE,
+ ColourConversion(),
+ VideoRange::FULL,
+ weak_ptr<Content>(),
+ optional<Frame>(),
+ false
);
- pvf->set_text (PositionImage (sub_image, Position<int> (50, 60)));
+ pvf->set_text (PositionImage(sub_image, Position<int>(50, 60)));
- shared_ptr<DCPVideo> frame (
- new DCPVideo (
- pvf,
- 0,
- 24,
- 200000000,
- RESOLUTION_2K
- )
+ auto frame = make_shared<DCPVideo> (
+ pvf,
+ 0,
+ 24,
+ 200000000,
+ Resolution::TWO_K
);
- ArrayData locally_encoded = frame->encode_locally ();
+ auto locally_encoded = frame->encode_locally ();
- EncodeServer* server = new EncodeServer (true, 2);
+ auto server = new EncodeServer (true, 2);
- thread* server_thread = new thread (boost::bind (&EncodeServer::run, server));
+ auto server_thread = new thread (boost::bind(&EncodeServer::run, server));
/* Let the server get itself ready */
dcpomatic_sleep_seconds (1);
@@ -134,12 +131,12 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
threads.push_back (new thread (boost::bind (do_remote_encode, frame, description, locally_encoded)));
}
- for (list<thread*>::iterator i = threads.begin(); i != threads.end(); ++i) {
- (*i)->join ();
+ for (auto i: threads) {
+ i->join ();
}
- for (list<thread*>::iterator i = threads.begin(); i != threads.end(); ++i) {
- delete *i;
+ for (auto i: threads) {
+ delete i;
}
server->stop ();
@@ -150,7 +147,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
BOOST_AUTO_TEST_CASE (client_server_test_yuv)
{
- shared_ptr<Image> image (new Image (AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true));
+ auto image = make_shared<Image>(AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true);
for (int i = 0; i < image->planes(); ++i) {
uint8_t* p = image->data()[i];
@@ -159,7 +156,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
}
}
- shared_ptr<Image> sub_image (new Image (AV_PIX_FMT_BGRA, dcp::Size (100, 200), true));
+ auto sub_image = make_shared<Image>(AV_PIX_FMT_BGRA, dcp::Size (100, 200), true);
uint8_t* p = sub_image->data()[0];
for (int y = 0; y < 200; ++y) {
uint8_t* q = p;
@@ -172,42 +169,38 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
p += sub_image->stride()[0];
}
- LogSwitcher ls (shared_ptr<Log>(new FileLog("build/test/client_server_test_yuv.log")));
-
- shared_ptr<PlayerVideo> pvf (
- new PlayerVideo (
- shared_ptr<ImageProxy> (new RawImageProxy (image)),
- Crop (),
- optional<double> (),
- dcp::Size (1998, 1080),
- dcp::Size (1998, 1080),
- EYES_BOTH,
- PART_WHOLE,
- ColourConversion(),
- VideoRange::FULL,
- weak_ptr<Content>(),
- optional<Frame>(),
- false
- )
+ LogSwitcher ls (make_shared<FileLog>("build/test/client_server_test_yuv.log"));
+
+ auto pvf = std::make_shared<PlayerVideo>(
+ std::make_shared<RawImageProxy>(image),
+ Crop(),
+ optional<double>(),
+ dcp::Size(1998, 1080),
+ dcp::Size(1998, 1080),
+ Eyes::BOTH,
+ Part::WHOLE,
+ ColourConversion(),
+ VideoRange::FULL,
+ weak_ptr<Content>(),
+ optional<Frame>(),
+ false
);
- pvf->set_text (PositionImage (sub_image, Position<int> (50, 60)));
+ pvf->set_text (PositionImage(sub_image, Position<int>(50, 60)));
- shared_ptr<DCPVideo> frame (
- new DCPVideo (
- pvf,
- 0,
- 24,
- 200000000,
- RESOLUTION_2K
- )
+ auto frame = make_shared<DCPVideo>(
+ pvf,
+ 0,
+ 24,
+ 200000000,
+ Resolution::TWO_K
);
- ArrayData locally_encoded = frame->encode_locally ();
+ auto locally_encoded = frame->encode_locally ();
- EncodeServer* server = new EncodeServer (true, 2);
+ auto server = new EncodeServer (true, 2);
- thread* server_thread = new thread (boost::bind (&EncodeServer::run, server));
+ auto server_thread = new thread(boost::bind(&EncodeServer::run, server));
/* Let the server get itself ready */
dcpomatic_sleep_seconds (1);
@@ -217,15 +210,15 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
list<thread*> threads;
for (int i = 0; i < 8; ++i) {
- threads.push_back (new thread (boost::bind (do_remote_encode, frame, description, locally_encoded)));
+ threads.push_back (new thread(boost::bind(do_remote_encode, frame, description, locally_encoded)));
}
- for (list<thread*>::iterator i = threads.begin(); i != threads.end(); ++i) {
- (*i)->join ();
+ for (auto i: threads) {
+ i->join ();
}
- for (list<thread*>::iterator i = threads.begin(); i != threads.end(); ++i) {
- delete *i;
+ for (auto i: threads) {
+ delete i;
}
server->stop ();
@@ -236,7 +229,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
BOOST_AUTO_TEST_CASE (client_server_test_j2k)
{
- shared_ptr<Image> image (new Image (AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true));
+ auto image = make_shared<Image>(AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true);
for (int i = 0; i < image->planes(); ++i) {
uint8_t* p = image->data()[i];
@@ -245,69 +238,61 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
}
}
- LogSwitcher ls (shared_ptr<Log>(new FileLog("build/test/client_server_test_j2k.log")));
-
- shared_ptr<PlayerVideo> raw_pvf (
- new PlayerVideo (
- shared_ptr<ImageProxy> (new RawImageProxy (image)),
- Crop (),
- optional<double> (),
- dcp::Size (1998, 1080),
- dcp::Size (1998, 1080),
- EYES_BOTH,
- PART_WHOLE,
- ColourConversion(),
- VideoRange::FULL,
- weak_ptr<Content>(),
- optional<Frame>(),
- false
- )
+ LogSwitcher ls (make_shared<FileLog>("build/test/client_server_test_j2k.log"));
+
+ auto raw_pvf = std::make_shared<PlayerVideo> (
+ std::make_shared<RawImageProxy>(image),
+ Crop(),
+ optional<double>(),
+ dcp::Size(1998, 1080),
+ dcp::Size(1998, 1080),
+ Eyes::BOTH,
+ Part::WHOLE,
+ ColourConversion(),
+ VideoRange::FULL,
+ weak_ptr<Content>(),
+ optional<Frame>(),
+ false
);
- shared_ptr<DCPVideo> raw_frame (
- new DCPVideo (
- raw_pvf,
- 0,
- 24,
- 200000000,
- RESOLUTION_2K
- )
+ auto raw_frame = make_shared<DCPVideo> (
+ raw_pvf,
+ 0,
+ 24,
+ 200000000,
+ Resolution::TWO_K
);
- ArrayData raw_locally_encoded = raw_frame->encode_locally ();
-
- shared_ptr<PlayerVideo> j2k_pvf (
- new PlayerVideo (
- shared_ptr<ImageProxy> (new J2KImageProxy (raw_locally_encoded, dcp::Size (1998, 1080), AV_PIX_FMT_XYZ12LE)),
- Crop (),
- optional<double> (),
- dcp::Size (1998, 1080),
- dcp::Size (1998, 1080),
- EYES_BOTH,
- PART_WHOLE,
- PresetColourConversion::all().front().conversion,
- VideoRange::FULL,
- weak_ptr<Content>(),
- optional<Frame>(),
- false
- )
+ auto raw_locally_encoded = raw_frame->encode_locally ();
+
+ auto j2k_pvf = std::make_shared<PlayerVideo> (
+ std::make_shared<J2KImageProxy>(raw_locally_encoded, dcp::Size(1998, 1080), AV_PIX_FMT_XYZ12LE),
+ Crop(),
+ optional<double>(),
+ dcp::Size(1998, 1080),
+ dcp::Size(1998, 1080),
+ Eyes::BOTH,
+ Part::WHOLE,
+ PresetColourConversion::all().front().conversion,
+ VideoRange::FULL,
+ weak_ptr<Content>(),
+ optional<Frame>(),
+ false
);
- shared_ptr<DCPVideo> j2k_frame (
- new DCPVideo (
- j2k_pvf,
- 0,
- 24,
- 200000000,
- RESOLUTION_2K
- )
+ auto j2k_frame = make_shared<DCPVideo> (
+ j2k_pvf,
+ 0,
+ 24,
+ 200000000,
+ Resolution::TWO_K
);
- ArrayData j2k_locally_encoded = j2k_frame->encode_locally ();
+ auto j2k_locally_encoded = j2k_frame->encode_locally ();
- EncodeServer* server = new EncodeServer (true, 2);
+ auto server = new EncodeServer (true, 2);
- thread* server_thread = new thread (boost::bind (&EncodeServer::run, server));
+ auto server_thread = new thread (boost::bind (&EncodeServer::run, server));
/* Let the server get itself ready */
dcpomatic_sleep_seconds (1);
@@ -317,15 +302,15 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
list<thread*> threads;
for (int i = 0; i < 8; ++i) {
- threads.push_back (new thread (boost::bind (do_remote_encode, j2k_frame, description, j2k_locally_encoded)));
+ threads.push_back (new thread(boost::bind(do_remote_encode, j2k_frame, description, j2k_locally_encoded)));
}
- for (list<thread*>::iterator i = threads.begin(); i != threads.end(); ++i) {
- (*i)->join ();
+ for (auto i: threads) {
+ i->join ();
}
- for (list<thread*>::iterator i = threads.begin(); i != threads.end(); ++i) {
- delete *i;
+ for (auto i: threads) {
+ delete i;
}
server->stop ();
diff --git a/test/closed_caption_test.cc b/test/closed_caption_test.cc
index 48fc8e05c..31824b443 100644
--- a/test/closed_caption_test.cc
+++ b/test/closed_caption_test.cc
@@ -39,7 +39,7 @@ BOOST_AUTO_TEST_CASE (closed_caption_test1)
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs ());
- content->only_text()->set_type (TEXT_CLOSED_CAPTION);
+ content->only_text()->set_type (TextType::CLOSED_CAPTION);
film->make_dcp ();
BOOST_REQUIRE (!wait_for_jobs ());
@@ -68,11 +68,11 @@ BOOST_AUTO_TEST_CASE (closed_caption_test2)
film->examine_and_add_content (content3);
BOOST_REQUIRE (!wait_for_jobs ());
- content1->only_text()->set_type (TEXT_CLOSED_CAPTION);
+ content1->only_text()->set_type (TextType::CLOSED_CAPTION);
content1->only_text()->set_dcp_track (DCPTextTrack("First track", "fr-FR"));
- content2->only_text()->set_type (TEXT_CLOSED_CAPTION);
+ content2->only_text()->set_type (TextType::CLOSED_CAPTION);
content2->only_text()->set_dcp_track (DCPTextTrack("Second track", "de-DE"));
- content3->only_text()->set_type (TEXT_CLOSED_CAPTION);
+ content3->only_text()->set_type (TextType::CLOSED_CAPTION);
content3->only_text()->set_dcp_track (DCPTextTrack("Third track", "it-IT"));
film->make_dcp ();
diff --git a/test/create_cli_test.cc b/test/create_cli_test.cc
index 31c8ae877..9010dae21 100644
--- a/test/create_cli_test.cc
+++ b/test/create_cli_test.cc
@@ -130,18 +130,18 @@ BOOST_AUTO_TEST_CASE (create_cli_test)
BOOST_CHECK_EQUAL (*cc.output_dir, "flaps");
BOOST_REQUIRE_EQUAL (cc.content.size(), 3U);
BOOST_CHECK_EQUAL (cc.content[0].path, "fred");
- BOOST_CHECK_EQUAL (cc.content[0].frame_type, VIDEO_FRAME_TYPE_2D);
+ BOOST_CHECK_EQUAL (cc.content[0].frame_type, VideoFrameType::TWO_D);
BOOST_CHECK_EQUAL (cc.content[1].path, "jim");
- BOOST_CHECK_EQUAL (cc.content[1].frame_type, VIDEO_FRAME_TYPE_2D);
+ BOOST_CHECK_EQUAL (cc.content[1].frame_type, VideoFrameType::TWO_D);
BOOST_CHECK_EQUAL (cc.content[2].path, "sheila");
- BOOST_CHECK_EQUAL (cc.content[2].frame_type, VIDEO_FRAME_TYPE_2D);
+ BOOST_CHECK_EQUAL (cc.content[2].frame_type, VideoFrameType::TWO_D);
cc = run ("dcpomatic2_create --left-eye left.mp4 --right-eye right.mp4");
BOOST_REQUIRE_EQUAL (cc.content.size(), 2U);
BOOST_CHECK_EQUAL (cc.content[0].path, "left.mp4");
- BOOST_CHECK_EQUAL (cc.content[0].frame_type, VIDEO_FRAME_TYPE_3D_LEFT);
+ BOOST_CHECK_EQUAL (cc.content[0].frame_type, VideoFrameType::THREE_D_LEFT);
BOOST_CHECK_EQUAL (cc.content[1].path, "right.mp4");
- BOOST_CHECK_EQUAL (cc.content[1].frame_type, VIDEO_FRAME_TYPE_3D_RIGHT);
+ BOOST_CHECK_EQUAL (cc.content[1].frame_type, VideoFrameType::THREE_D_RIGHT);
BOOST_CHECK_EQUAL (cc.fourk, false);
cc = run ("dcpomatic2_create --fourk foo.mp4");
diff --git a/test/digest_test.cc b/test/digest_test.cc
index ba73461bf..bfa8e62f6 100644
--- a/test/digest_test.cc
+++ b/test/digest_test.cc
@@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE (digest_test)
film->examine_and_add_content (r);
film->examine_and_add_content (g);
film->examine_and_add_content (b);
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
BOOST_REQUIRE (!wait_for_jobs());
BOOST_CHECK (Config::instance()->master_encoding_threads() > 1);
diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc
index 1147b4d07..7a967b200 100644
--- a/test/ffmpeg_encoder_test.cc
+++ b/test/ffmpeg_encoder_test.cc
@@ -45,16 +45,16 @@ ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat f
string name = "ffmpeg_encoder_";
string extension;
switch (format) {
- case EXPORT_FORMAT_H264_AAC:
+ case ExportFormat::H264_AAC:
name += "h264";
extension = "mp4";
break;
- case EXPORT_FORMAT_PRORES:
+ case ExportFormat::PRORES:
name += "prores";
extension = "mov";
break;
- case EXPORT_FORMAT_H264_PCM:
- case EXPORT_FORMAT_SUBTITLES_DCP:
+ case ExportFormat::H264_PCM:
+ case ExportFormat::SUBTITLES_DCP:
BOOST_REQUIRE (false);
}
@@ -78,25 +78,25 @@ ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat f
/** Red / green / blue MP4 -> Prores */
BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test1)
{
- ffmpeg_content_test (1, "test/data/test.mp4", EXPORT_FORMAT_PRORES);
+ ffmpeg_content_test (1, "test/data/test.mp4", ExportFormat::PRORES);
}
/** Dolby Aurora trailer VOB -> Prores */
BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test2)
{
- ffmpeg_content_test (2, TestPaths::private_data() / "dolby_aurora.vob", EXPORT_FORMAT_PRORES);
+ ffmpeg_content_test (2, TestPaths::private_data() / "dolby_aurora.vob", ExportFormat::PRORES);
}
/** Sintel trailer -> Prores */
BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test3)
{
- ffmpeg_content_test (3, TestPaths::private_data() / "Sintel_Trailer1.480p.DivX_Plus_HD.mkv", EXPORT_FORMAT_PRORES);
+ ffmpeg_content_test (3, TestPaths::private_data() / "Sintel_Trailer1.480p.DivX_Plus_HD.mkv", ExportFormat::PRORES);
}
/** Big Buck Bunny trailer -> Prores */
BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test4)
{
- ffmpeg_content_test (4, TestPaths::private_data() / "big_buck_bunny_trailer_480p.mov", EXPORT_FORMAT_PRORES);
+ ffmpeg_content_test (4, TestPaths::private_data() / "big_buck_bunny_trailer_480p.mov", ExportFormat::PRORES);
}
/** Still image -> Prores */
@@ -115,7 +115,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test5)
film->write_metadata ();
shared_ptr<Job> job (new TranscodeJob (film));
- FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_test5.mov", EXPORT_FORMAT_PRORES, false, false, false, 23);
+ FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_test5.mov", ExportFormat::PRORES, false, false, false, 23);
encoder.go ();
}
@@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test6)
film->write_metadata();
shared_ptr<Job> job (new TranscodeJob (film));
- FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_test6.mov", EXPORT_FORMAT_PRORES, false, false, false, 23);
+ FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_test6.mov", ExportFormat::PRORES, false, false, false, 23);
encoder.go ();
}
@@ -160,14 +160,14 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test7)
s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255));
shared_ptr<Job> job (new TranscodeJob (film));
- FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_test7.mov", EXPORT_FORMAT_PRORES, false, false, false, 23);
+ FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_test7.mov", ExportFormat::PRORES, false, false, false, 23);
encoder.go ();
}
/** Red / green / blue MP4 -> H264 */
BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test1)
{
- ffmpeg_content_test(1, "test/data/test.mp4", EXPORT_FORMAT_H264_AAC);
+ ffmpeg_content_test(1, "test/data/test.mp4", ExportFormat::H264_AAC);
}
/** Just subtitles -> H264 */
@@ -187,7 +187,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test2)
film->write_metadata();
shared_ptr<Job> job (new TranscodeJob (film));
- FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_h264_test2.mp4", EXPORT_FORMAT_H264_AAC, false, false, false, 23);
+ FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_h264_test2.mp4", ExportFormat::H264_AAC, false, false, false, 23);
encoder.go ();
}
@@ -212,7 +212,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test3)
film->write_metadata();
shared_ptr<Job> job (new TranscodeJob (film));
- FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_h264_test3.mp4", EXPORT_FORMAT_H264_AAC, false, false, false, 23);
+ FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_h264_test3.mp4", ExportFormat::H264_AAC, false, false, false, 23);
encoder.go ();
}
@@ -226,7 +226,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test4)
film->set_container(Ratio::from_id("185"));
shared_ptr<Job> job(new TranscodeJob(film));
- FFmpegEncoder encoder(film, job, "build/test/ffmpeg_encoder_h264_test4.mp4", EXPORT_FORMAT_H264_AAC, false, false, false, 23);
+ FFmpegEncoder encoder(film, job, "build/test/ffmpeg_encoder_h264_test4.mp4", ExportFormat::H264_AAC, false, false, false, 23);
encoder.go();
}
@@ -280,7 +280,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test5)
Rs->audio->set_mapping (map);
shared_ptr<Job> job (new TranscodeJob (film));
- FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_h264_test5.mp4", EXPORT_FORMAT_H264_AAC, true, false, false, 23);
+ FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_h264_test5.mp4", ExportFormat::H264_AAC, true, false, false, 23);
encoder.go ();
check_ffmpeg ("build/test/ffmpeg_encoder_h264_test5.mp4", "test/data/ffmpeg_encoder_h264_test5.mp4", 1);
@@ -308,7 +308,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test6)
}
shared_ptr<Job> job (new TranscodeJob (film2));
- FFmpegEncoder encoder (film2, job, "build/test/ffmpeg_encoder_h264_test6_vf.mp4", EXPORT_FORMAT_H264_AAC, true, false, false, 23);
+ FFmpegEncoder encoder (film2, job, "build/test/ffmpeg_encoder_h264_test6_vf.mp4", ExportFormat::H264_AAC, true, false, false, 23);
encoder.go ();
}
@@ -321,9 +321,9 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test7)
shared_ptr<Content> R (shared_ptr<ImageContent>(new ImageContent(TestPaths::private_data() / "bbc405.png")));
film->examine_and_add_content (R);
BOOST_REQUIRE (!wait_for_jobs());
- L->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT);
+ L->video->set_frame_type (VideoFrameType::THREE_D_LEFT);
L->set_position (film, DCPTime());
- R->video->set_frame_type (VIDEO_FRAME_TYPE_3D_RIGHT);
+ R->video->set_frame_type (VideoFrameType::THREE_D_RIGHT);
R->set_position (film, DCPTime());
film->set_three_d (true);
film->make_dcp ();
@@ -335,7 +335,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test7)
BOOST_REQUIRE (!wait_for_jobs());
shared_ptr<Job> job (new TranscodeJob (film2));
- FFmpegEncoder encoder (film2, job, "build/test/ffmpeg_encoder_h264_test7.mp4", EXPORT_FORMAT_H264_AAC, true, false, false, 23);
+ FFmpegEncoder encoder (film2, job, "build/test/ffmpeg_encoder_h264_test7.mp4", ExportFormat::H264_AAC, true, false, false, 23);
encoder.go ();
}
@@ -349,7 +349,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test8)
film->set_audio_channels (2);
shared_ptr<Job> job(new TranscodeJob(film));
- FFmpegEncoder encoder(film, job, "build/test/ffmpeg_encoder_h264_test8.mp4", EXPORT_FORMAT_H264_AAC, true, false, false, 23);
+ FFmpegEncoder encoder(film, job, "build/test/ffmpeg_encoder_h264_test8.mp4", ExportFormat::H264_AAC, true, false, false, 23);
encoder.go();
}
@@ -370,6 +370,6 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test9)
film->write_metadata ();
shared_ptr<Job> job (new TranscodeJob (film));
- FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_test9.mov", EXPORT_FORMAT_H264_AAC, false, false, false, 23);
+ FFmpegEncoder encoder (film, job, "build/test/ffmpeg_encoder_prores_test9.mov", ExportFormat::H264_AAC, false, false, false, 23);
encoder.go ();
}
diff --git a/test/file_naming_test.cc b/test/file_naming_test.cc
index 6fce51060..ef43316d2 100644
--- a/test/file_naming_test.cc
+++ b/test/file_naming_test.cc
@@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE (file_naming_test)
b->set_video_frame_rate (24);
b->video->set_length (24);
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
film->write_metadata ();
film->make_dcp ();
BOOST_REQUIRE (!wait_for_jobs());
@@ -139,7 +139,7 @@ BOOST_AUTO_TEST_CASE (file_naming_test2)
b->set_video_frame_rate (24);
b->video->set_length (24);
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
film->make_dcp ();
BOOST_REQUIRE (!wait_for_jobs());
diff --git a/test/hints_test.cc b/test/hints_test.cc
index 1be36193a..2aec81693 100644
--- a/test/hints_test.cc
+++ b/test/hints_test.cc
@@ -85,7 +85,7 @@ check (TextType type, string name, optional<string> expected_hint = optional<str
BOOST_AUTO_TEST_CASE (hint_closed_caption_too_long)
{
check (
- TEXT_CLOSED_CAPTION,
+ TextType::CLOSED_CAPTION,
"hint_closed_caption_too_long",
String::compose("At least one of your closed caption lines has more than %1 characters. It is advisable to make each line %1 characters at most in length.", MAX_CLOSED_CAPTION_LENGTH, MAX_CLOSED_CAPTION_LENGTH)
);
@@ -95,7 +95,7 @@ BOOST_AUTO_TEST_CASE (hint_closed_caption_too_long)
BOOST_AUTO_TEST_CASE (hint_many_closed_caption_lines)
{
check (
- TEXT_CLOSED_CAPTION,
+ TextType::CLOSED_CAPTION,
"hint_many_closed_caption_lines",
String::compose("Some of your closed captions span more than %1 lines, so they will be truncated.", MAX_CLOSED_CAPTION_LINES)
);
@@ -105,7 +105,7 @@ BOOST_AUTO_TEST_CASE (hint_many_closed_caption_lines)
BOOST_AUTO_TEST_CASE (hint_subtitle_too_early)
{
check (
- TEXT_OPEN_SUBTITLE,
+ TextType::OPEN_SUBTITLE,
"hint_subtitle_too_early",
string("It is advisable to put your first subtitle at least 4 seconds after the start of the DCP to make sure it is seen.")
);
@@ -115,7 +115,7 @@ BOOST_AUTO_TEST_CASE (hint_subtitle_too_early)
BOOST_AUTO_TEST_CASE (hint_short_subtitles)
{
check (
- TEXT_OPEN_SUBTITLE,
+ TextType::OPEN_SUBTITLE,
"hint_short_subtitles",
string("At least one of your subtitles lasts less than 15 frames. It is advisable to make each subtitle at least 15 frames long.")
);
@@ -125,7 +125,7 @@ BOOST_AUTO_TEST_CASE (hint_short_subtitles)
BOOST_AUTO_TEST_CASE (hint_subtitles_too_close)
{
check (
- TEXT_OPEN_SUBTITLE,
+ TextType::OPEN_SUBTITLE,
"hint_subtitles_too_close",
string("At least one of your subtitles starts less than 2 frames after the previous one. It is advisable to make the gap between subtitles at least 2 frames.")
);
@@ -135,7 +135,7 @@ BOOST_AUTO_TEST_CASE (hint_subtitles_too_close)
BOOST_AUTO_TEST_CASE (hint_many_subtitle_lines)
{
check (
- TEXT_OPEN_SUBTITLE,
+ TextType::OPEN_SUBTITLE,
"hint_many_subtitle_lines",
string("At least one of your subtitles has more than 3 lines. It is advisable to use no more than 3 lines.")
);
@@ -145,7 +145,7 @@ BOOST_AUTO_TEST_CASE (hint_many_subtitle_lines)
BOOST_AUTO_TEST_CASE (hint_subtitle_too_long)
{
check (
- TEXT_OPEN_SUBTITLE,
+ TextType::OPEN_SUBTITLE,
"hint_subtitle_too_long",
string("At least one of your subtitle lines has more than 52 characters. It is advisable to make each line 52 characters at most in length.")
);
@@ -158,7 +158,7 @@ BOOST_AUTO_TEST_CASE (hint_subtitle_mxf_too_big)
shared_ptr<Film> film = new_test_film2 (name);
shared_ptr<Content> content = content_factory("test/data/" + name + ".srt").front();
- content->text.front()->set_type (TEXT_OPEN_SUBTITLE);
+ content->text.front()->set_type (TextType::OPEN_SUBTITLE);
for (int i = 1; i < 512; ++i) {
shared_ptr<dcpomatic::Font> font(new dcpomatic::Font(String::compose("font_%1", i)));
font->set_file ("test/data/LiberationSans-Regular.ttf");
@@ -195,7 +195,7 @@ BOOST_AUTO_TEST_CASE (hint_closed_caption_xml_too_big)
fclose (ccap);
shared_ptr<Content> content = content_factory("build/test/" + name + ".srt").front();
- content->text.front()->set_type (TEXT_CLOSED_CAPTION);
+ content->text.front()->set_type (TextType::CLOSED_CAPTION);
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());
vector<string> hints = get_hints (film);
diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc
index 3465db750..dc2263206 100644
--- a/test/isdcf_name_test.cc
+++ b/test/isdcf_name_test.cc
@@ -68,7 +68,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
film->set_container (Ratio::from_id ("239"));
film->_isdcf_date = boost::gregorian::date (2014, boost::gregorian::Jul, 4);
film->set_audio_channels (1);
- film->set_resolution (RESOLUTION_4K);
+ film->set_resolution (Resolution::FOUR_K);
film->set_subtitle_language (dcp::LanguageTag("fr-FR"));
shared_ptr<Content> text = content_factory("test/data/subrip.srt").front();
BOOST_REQUIRE_EQUAL (text->text.size(), 1U);
diff --git a/test/optimise_stills_test.cc b/test/optimise_stills_test.cc
index d0f2aaa6b..cec864e0f 100644
--- a/test/optimise_stills_test.cc
+++ b/test/optimise_stills_test.cc
@@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE (optimise_stills_test2)
shared_ptr<Content> content = content_factory("test/data/flat_red.png").front ();
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs ());
- content->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
+ content->video->set_frame_type (VideoFrameType::THREE_D_LEFT_RIGHT);
film->set_three_d (true);
film->make_dcp ();
BOOST_REQUIRE (!wait_for_jobs ());
diff --git a/test/player_test.cc b/test/player_test.cc
index 96f75f098..9194b84bb 100644
--- a/test/player_test.cc
+++ b/test/player_test.cc
@@ -312,7 +312,7 @@ BOOST_AUTO_TEST_CASE (player_ignore_video_and_audio_test)
shared_ptr<Content> text = content_factory("test/data/subrip.srt").front();
film->examine_and_add_content (text);
BOOST_REQUIRE (!wait_for_jobs());
- text->only_text()->set_type (TEXT_CLOSED_CAPTION);
+ text->only_text()->set_type (TextType::CLOSED_CAPTION);
text->only_text()->set_use (true);
shared_ptr<Player> player (new Player(film));
@@ -375,9 +375,9 @@ BOOST_AUTO_TEST_CASE (player_3d_test_1)
film->examine_and_add_content (right);
BOOST_REQUIRE (!wait_for_jobs());
- left->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT);
+ left->video->set_frame_type (VideoFrameType::THREE_D_LEFT);
left->set_position (film, DCPTime());
- right->video->set_frame_type (VIDEO_FRAME_TYPE_3D_RIGHT);
+ right->video->set_frame_type (VideoFrameType::THREE_D_RIGHT);
right->set_position (film, DCPTime());
film->set_three_d (true);
@@ -404,9 +404,9 @@ BOOST_AUTO_TEST_CASE (player_3d_test_2)
film->examine_and_add_content (right);
BOOST_REQUIRE (!wait_for_jobs());
- left->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT);
+ left->video->set_frame_type (VideoFrameType::THREE_D_LEFT);
left->set_position (film, DCPTime());
- right->video->set_frame_type (VIDEO_FRAME_TYPE_3D_RIGHT);
+ right->video->set_frame_type (VideoFrameType::THREE_D_RIGHT);
right->set_position (film, DCPTime());
film->set_three_d (true);
diff --git a/test/recover_test.cc b/test/recover_test.cc
index 13cb37a07..bdbd6f273 100644
--- a/test/recover_test.cc
+++ b/test/recover_test.cc
@@ -36,8 +36,9 @@
#include <iostream>
using std::cout;
-using std::string;
+using std::make_shared;
using std::shared_ptr;
+using std::string;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
@@ -85,15 +86,15 @@ BOOST_AUTO_TEST_CASE (recover_test_2d)
BOOST_AUTO_TEST_CASE (recover_test_3d, * boost::unit_test::depends_on("recover_test_2d"))
{
- shared_ptr<Film> film = new_test_film ("recover_test_3d");
+ auto film = new_test_film ("recover_test_3d");
film->set_interop (false);
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
film->set_container (Ratio::from_id ("185"));
film->set_name ("recover_test");
film->set_three_d (true);
- shared_ptr<ImageContent> content (new ImageContent("test/data/3d_test"));
- content->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
+ auto content = make_shared<ImageContent>("test/data/3d_test");
+ content->video->set_frame_type (VideoFrameType::THREE_D_LEFT_RIGHT);
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());
@@ -112,8 +113,8 @@ BOOST_AUTO_TEST_CASE (recover_test_3d, * boost::unit_test::depends_on("recover_t
film->make_dcp ();
BOOST_REQUIRE (!wait_for_jobs());
- shared_ptr<dcp::StereoPictureAsset> A (new dcp::StereoPictureAsset ("build/test/recover_test_3d/original.mxf"));
- shared_ptr<dcp::StereoPictureAsset> B (new dcp::StereoPictureAsset (video));
+ auto A = make_shared<dcp::StereoPictureAsset>("build/test/recover_test_3d/original.mxf");
+ auto B = make_shared<dcp::StereoPictureAsset>(video);
dcp::EqualityOptions eq;
BOOST_CHECK (A->equals (B, eq, boost::bind (&note, _1, _2)));
@@ -122,7 +123,7 @@ BOOST_AUTO_TEST_CASE (recover_test_3d, * boost::unit_test::depends_on("recover_t
BOOST_AUTO_TEST_CASE (recover_test_2d_encrypted, * boost::unit_test::depends_on("recover_test_3d"))
{
- shared_ptr<Film> film = new_test_film ("recover_test_2d_encrypted");
+ auto film = new_test_film ("recover_test_2d_encrypted");
film->set_interop (false);
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
film->set_container (Ratio::from_id ("185"));
@@ -130,7 +131,7 @@ BOOST_AUTO_TEST_CASE (recover_test_2d_encrypted, * boost::unit_test::depends_on(
film->set_encrypted (true);
film->_key = dcp::Key("eafcb91c9f5472edf01f3a2404c57258");
- shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/count300bd24.m2ts"));
+ auto content = make_shared<FFmpegContent>("test/data/count300bd24.m2ts");
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());
@@ -150,9 +151,9 @@ BOOST_AUTO_TEST_CASE (recover_test_2d_encrypted, * boost::unit_test::depends_on(
film->make_dcp ();
BOOST_REQUIRE (!wait_for_jobs());
- shared_ptr<dcp::MonoPictureAsset> A (new dcp::MonoPictureAsset ("build/test/recover_test_2d_encrypted/original.mxf"));
+ auto A = make_shared<dcp::MonoPictureAsset>("build/test/recover_test_2d_encrypted/original.mxf");
A->set_key (film->key ());
- shared_ptr<dcp::MonoPictureAsset> B (new dcp::MonoPictureAsset (video));
+ auto B = make_shared<dcp::MonoPictureAsset>(video);
B->set_key (film->key ());
dcp::EqualityOptions eq;
diff --git a/test/reel_writer_test.cc b/test/reel_writer_test.cc
index 1223a217a..9e567fb2a 100644
--- a/test/reel_writer_test.cc
+++ b/test/reel_writer_test.cc
@@ -50,50 +50,50 @@ static bool equal (dcp::FrameInfo a, ReelWriter const & writer, shared_ptr<InfoF
BOOST_AUTO_TEST_CASE (write_frame_info_test)
{
- shared_ptr<Film> film = new_test_film2 ("write_frame_info_test");
+ auto film = new_test_film2 ("write_frame_info_test");
dcpomatic::DCPTimePeriod const period (dcpomatic::DCPTime(0), dcpomatic::DCPTime(96000));
ReelWriter writer (film, period, shared_ptr<Job>(), 0, 1, false);
/* Write the first one */
dcp::FrameInfo info1(0, 123, "12345678901234567890123456789012");
- writer.write_frame_info (0, EYES_LEFT, info1);
+ writer.write_frame_info (0, Eyes::LEFT, info1);
{
- shared_ptr<InfoFileHandle> file = film->info_file_handle(period, true);
- BOOST_CHECK (equal(info1, writer, file, 0, EYES_LEFT));
+ auto file = film->info_file_handle(period, true);
+ BOOST_CHECK (equal(info1, writer, file, 0, Eyes::LEFT));
}
/* Write some more */
dcp::FrameInfo info2(596, 14921, "123acb789f1234ae782012n456339522");
- writer.write_frame_info (5, EYES_RIGHT, info2);
+ writer.write_frame_info (5, Eyes::RIGHT, info2);
{
- shared_ptr<InfoFileHandle> file = film->info_file_handle(period, true);
- BOOST_CHECK (equal(info1, writer, file, 0, EYES_LEFT));
- BOOST_CHECK (equal(info2, writer, file, 5, EYES_RIGHT));
+ auto file = film->info_file_handle(period, true);
+ BOOST_CHECK (equal(info1, writer, file, 0, Eyes::LEFT));
+ BOOST_CHECK (equal(info2, writer, file, 5, Eyes::RIGHT));
}
dcp::FrameInfo info3(12494, 99157123, "xxxxyyyyabc12356ffsfdsf456339522");
- writer.write_frame_info (10, EYES_LEFT, info3);
+ writer.write_frame_info (10, Eyes::LEFT, info3);
{
- shared_ptr<InfoFileHandle> file = film->info_file_handle(period, true);
- BOOST_CHECK (equal(info1, writer, file, 0, EYES_LEFT));
- BOOST_CHECK (equal(info2, writer, file, 5, EYES_RIGHT));
- BOOST_CHECK (equal(info3, writer, file, 10, EYES_LEFT));
+ auto file = film->info_file_handle(period, true);
+ BOOST_CHECK (equal(info1, writer, file, 0, Eyes::LEFT));
+ BOOST_CHECK (equal(info2, writer, file, 5, Eyes::RIGHT));
+ BOOST_CHECK (equal(info3, writer, file, 10, Eyes::LEFT));
}
/* Overwrite one */
dcp::FrameInfo info4(55512494, 123599157123, "ABCDEFGyabc12356ffsfdsf4563395ZZ");
- writer.write_frame_info (5, EYES_RIGHT, info4);
+ writer.write_frame_info (5, Eyes::RIGHT, info4);
{
- shared_ptr<InfoFileHandle> file = film->info_file_handle(period, true);
- BOOST_CHECK (equal(info1, writer, file, 0, EYES_LEFT));
- BOOST_CHECK (equal(info4, writer, file, 5, EYES_RIGHT));
- BOOST_CHECK (equal(info3, writer, file, 10, EYES_LEFT));
+ auto file = film->info_file_handle(period, true);
+ BOOST_CHECK (equal(info1, writer, file, 0, Eyes::LEFT));
+ BOOST_CHECK (equal(info4, writer, file, 5, Eyes::RIGHT));
+ BOOST_CHECK (equal(info3, writer, file, 10, Eyes::LEFT));
}
}
@@ -103,11 +103,11 @@ BOOST_AUTO_TEST_CASE (write_frame_info_test)
BOOST_AUTO_TEST_CASE (reel_reuse_video_test)
{
/* Make a DCP */
- shared_ptr<Film> film = new_test_film2 ("reel_reuse_video_test");
- shared_ptr<Content> video = content_factory("test/data/flat_red.png").front();
+ auto film = new_test_film2 ("reel_reuse_video_test");
+ auto video = content_factory("test/data/flat_red.png").front();
film->examine_and_add_content (video);
BOOST_REQUIRE (!wait_for_jobs());
- shared_ptr<Content> audio = content_factory("test/data/white.wav").front();
+ auto audio = content_factory("test/data/white.wav").front();
film->examine_and_add_content (audio);
BOOST_REQUIRE (!wait_for_jobs());
film->make_dcp ();
diff --git a/test/reels_test.cc b/test/reels_test.cc
index cf8dc3e2e..402005339 100644
--- a/test/reels_test.cc
+++ b/test/reels_test.cc
@@ -41,28 +41,29 @@ using std::cout;
using std::vector;
using std::string;
using std::shared_ptr;
+using std::make_shared;
using boost::function;
using namespace dcpomatic;
/** Test Film::reels() */
BOOST_AUTO_TEST_CASE (reels_test1)
{
- shared_ptr<Film> film = new_test_film ("reels_test1");
+ auto film = new_test_film ("reels_test1");
film->set_container (Ratio::from_id ("185"));
- shared_ptr<FFmpegContent> A (new FFmpegContent("test/data/test.mp4"));
+ auto A = make_shared<FFmpegContent>("test/data/test.mp4");
film->examine_and_add_content (A);
- shared_ptr<FFmpegContent> B (new FFmpegContent("test/data/test.mp4"));
+ auto B = make_shared<FFmpegContent>("test/data/test.mp4");
film->examine_and_add_content (B);
BOOST_REQUIRE (!wait_for_jobs());
BOOST_CHECK_EQUAL (A->full_length(film).get(), 288000);
- film->set_reel_type (REELTYPE_SINGLE);
- list<DCPTimePeriod> r = film->reels ();
+ film->set_reel_type (ReelType::SINGLE);
+ auto r = film->reels ();
BOOST_CHECK_EQUAL (r.size(), 1U);
BOOST_CHECK_EQUAL (r.front().from.get(), 0);
BOOST_CHECK_EQUAL (r.front().to.get(), 288000 * 2);
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
r = film->reels ();
BOOST_CHECK_EQUAL (r.size(), 2U);
BOOST_CHECK_EQUAL (r.front().from.get(), 0);
@@ -71,12 +72,12 @@ BOOST_AUTO_TEST_CASE (reels_test1)
BOOST_CHECK_EQUAL (r.back().to.get(), 288000 * 2);
film->set_j2k_bandwidth (100000000);
- film->set_reel_type (REELTYPE_BY_LENGTH);
+ film->set_reel_type (ReelType::BY_LENGTH);
/* This is just over 2.5s at 100Mbit/s; should correspond to 60 frames */
film->set_reel_length (31253154);
r = film->reels ();
BOOST_CHECK_EQUAL (r.size(), 3U);
- list<DCPTimePeriod>::const_iterator i = r.begin ();
+ auto i = r.begin ();
BOOST_CHECK_EQUAL (i->from.get(), 0);
BOOST_CHECK_EQUAL (i->to.get(), DCPTime::from_frames(60, 24).get());
++i;
@@ -92,7 +93,7 @@ BOOST_AUTO_TEST_CASE (reels_test1)
*/
BOOST_AUTO_TEST_CASE (reels_test2)
{
- shared_ptr<Film> film = new_test_film ("reels_test2");
+ auto film = new_test_film ("reels_test2");
film->set_name ("reels_test2");
film->set_container (Ratio::from_id ("185"));
film->set_interop (false);
@@ -119,7 +120,7 @@ BOOST_AUTO_TEST_CASE (reels_test2)
c->video->set_length (24);
}
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
BOOST_CHECK_EQUAL (film->reels().size(), 3U);
BOOST_REQUIRE (!wait_for_jobs());
@@ -132,15 +133,15 @@ BOOST_AUTO_TEST_CASE (reels_test2)
film2->set_name ("reels_test2b");
film2->set_container (Ratio::from_id ("185"));
film2->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
- film2->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film2->set_reel_type (ReelType::BY_VIDEO_CONTENT);
- shared_ptr<DCPContent> c (new DCPContent(film->dir(film->dcp_name())));
+ auto c = make_shared<DCPContent>(film->dir(film->dcp_name()));
film2->examine_and_add_content (c);
BOOST_REQUIRE (!wait_for_jobs ());
- list<DCPTimePeriod> r = film2->reels ();
+ auto r = film2->reels ();
BOOST_CHECK_EQUAL (r.size(), 3U);
- list<DCPTimePeriod>::const_iterator i = r.begin ();
+ auto i = r.begin ();
BOOST_CHECK_EQUAL (i->from.get(), 0);
BOOST_CHECK_EQUAL (i->to.get(), 96000);
++i;
@@ -157,26 +158,26 @@ BOOST_AUTO_TEST_CASE (reels_test2)
BOOST_REQUIRE (!wait_for_jobs());
}
-/** Check that REELTYPE_BY_VIDEO_CONTENT adds an extra reel, if necessary, at the end
+/** Check that ReelType::BY_VIDEO_CONTENT adds an extra reel, if necessary, at the end
* of all the video content to mop up anything afterward.
*/
BOOST_AUTO_TEST_CASE (reels_test3)
{
- shared_ptr<Film> film = new_test_film ("reels_test3");
+ auto film = new_test_film ("reels_test3");
film->set_name ("reels_test3");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
- shared_ptr<Content> dcp (new DCPContent("test/data/reels_test2"));
+ auto dcp = make_shared<DCPContent>("test/data/reels_test2");
film->examine_and_add_content (dcp);
- shared_ptr<Content> sub (new StringTextFileContent("test/data/subrip.srt"));
+ auto sub = make_shared<StringTextFileContent>("test/data/subrip.srt");
film->examine_and_add_content (sub);
BOOST_REQUIRE (!wait_for_jobs());
- list<DCPTimePeriod> reels = film->reels();
+ auto reels = film->reels();
BOOST_REQUIRE_EQUAL (reels.size(), 4U);
- list<DCPTimePeriod>::const_iterator i = reels.begin ();
+ auto i = reels.begin ();
BOOST_CHECK_EQUAL (i->from.get(), 0);
BOOST_CHECK_EQUAL (i->to.get(), 96000);
++i;
@@ -195,11 +196,11 @@ BOOST_AUTO_TEST_CASE (reels_test3)
*/
BOOST_AUTO_TEST_CASE (reels_test4)
{
- shared_ptr<Film> film = new_test_film ("reels_test4");
+ auto film = new_test_film ("reels_test4");
film->set_name ("reels_test4");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
film->set_interop (false);
/* 4 piece of 1s-long content */
@@ -215,9 +216,9 @@ BOOST_AUTO_TEST_CASE (reels_test4)
film->examine_and_add_content (subs);
BOOST_REQUIRE (!wait_for_jobs());
- list<DCPTimePeriod> reels = film->reels();
+ auto reels = film->reels();
BOOST_REQUIRE_EQUAL (reels.size(), 4U);
- list<DCPTimePeriod>::const_iterator i = reels.begin ();
+ auto i = reels.begin ();
BOOST_CHECK_EQUAL (i->from.get(), 0);
BOOST_CHECK_EQUAL (i->to.get(), 96000);
++i;
@@ -238,7 +239,7 @@ BOOST_AUTO_TEST_CASE (reels_test4)
BOOST_AUTO_TEST_CASE (reels_test5)
{
- shared_ptr<Film> film = new_test_film ("reels_test5");
+ auto film = new_test_film ("reels_test5");
film->set_sequence (false);
shared_ptr<DCPContent> dcp (new DCPContent("test/data/reels_test4"));
film->examine_and_add_content (dcp);
@@ -248,9 +249,9 @@ BOOST_AUTO_TEST_CASE (reels_test5)
dcp->set_position(film, DCPTime(2123));
{
- list<DCPTimePeriod> p = dcp->reels (film);
+ auto p = dcp->reels (film);
BOOST_REQUIRE_EQUAL (p.size(), 4U);
- list<DCPTimePeriod>::const_iterator i = p.begin();
+ auto i = p.begin();
BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 96000)));
BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 96000), DCPTime(4000 + 192000)));
BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 192000), DCPTime(4000 + 288000)));
@@ -259,9 +260,9 @@ BOOST_AUTO_TEST_CASE (reels_test5)
{
dcp->set_trim_start (ContentTime::from_seconds (0.5));
- list<DCPTimePeriod> p = dcp->reels (film);
+ auto p = dcp->reels (film);
BOOST_REQUIRE_EQUAL (p.size(), 4U);
- list<DCPTimePeriod>::const_iterator i = p.begin();
+ auto i = p.begin();
BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 48000)));
BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 48000), DCPTime(4000 + 144000)));
BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 144000), DCPTime(4000 + 240000)));
@@ -270,9 +271,9 @@ BOOST_AUTO_TEST_CASE (reels_test5)
{
dcp->set_trim_end (ContentTime::from_seconds (0.5));
- list<DCPTimePeriod> p = dcp->reels (film);
+ auto p = dcp->reels (film);
BOOST_REQUIRE_EQUAL (p.size(), 4U);
- list<DCPTimePeriod>::const_iterator i = p.begin();
+ auto i = p.begin();
BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 48000)));
BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 48000), DCPTime(4000 + 144000)));
BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 144000), DCPTime(4000 + 240000)));
@@ -281,9 +282,9 @@ BOOST_AUTO_TEST_CASE (reels_test5)
{
dcp->set_trim_start (ContentTime::from_seconds (1.5));
- list<DCPTimePeriod> p = dcp->reels (film);
+ auto p = dcp->reels (film);
BOOST_REQUIRE_EQUAL (p.size(), 3U);
- list<DCPTimePeriod>::const_iterator i = p.begin();
+ auto i = p.begin();
BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 0), DCPTime(4000 + 48000)));
BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 48000), DCPTime(4000 + 144000)));
BOOST_CHECK (*i++ == DCPTimePeriod (DCPTime(4000 + 144000), DCPTime(4000 + 192000)));
@@ -293,7 +294,7 @@ BOOST_AUTO_TEST_CASE (reels_test5)
/** Check reel split with a muxed video/audio source */
BOOST_AUTO_TEST_CASE (reels_test6)
{
- shared_ptr<Film> film = new_test_film ("reels_test6");
+ auto film = new_test_film ("reels_test6");
film->set_name ("reels_test6");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
@@ -302,7 +303,7 @@ BOOST_AUTO_TEST_CASE (reels_test6)
BOOST_REQUIRE (!wait_for_jobs ());
film->set_j2k_bandwidth (100000000);
- film->set_reel_type (REELTYPE_BY_LENGTH);
+ film->set_reel_type (ReelType::BY_LENGTH);
/* This is just over 2.5s at 100Mbit/s; should correspond to 60 frames */
film->set_reel_length (31253154);
film->make_dcp ();
@@ -310,24 +311,24 @@ BOOST_AUTO_TEST_CASE (reels_test6)
}
/** Check the case where the last bit of audio hangs over the end of the video
- * and we are using REELTYPE_BY_VIDEO_CONTENT.
+ * and we are using ReelType::BY_VIDEO_CONTENT.
*/
BOOST_AUTO_TEST_CASE (reels_test7)
{
- shared_ptr<Film> film = new_test_film ("reels_test7");
+ auto film = new_test_film ("reels_test7");
film->set_name ("reels_test7");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
- shared_ptr<Content> A = content_factory("test/data/flat_red.png").front();
+ auto A = content_factory("test/data/flat_red.png").front();
film->examine_and_add_content (A);
BOOST_REQUIRE (!wait_for_jobs ());
- shared_ptr<Content> B = content_factory("test/data/awkward_length.wav").front();
+ auto B = content_factory("test/data/awkward_length.wav").front();
film->examine_and_add_content (B);
BOOST_REQUIRE (!wait_for_jobs ());
film->set_video_frame_rate (24);
A->video->set_length (2 * 24);
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
BOOST_REQUIRE_EQUAL (film->reels().size(), 2U);
BOOST_CHECK (film->reels().front() == DCPTimePeriod(DCPTime(0), DCPTime::from_frames(2 * 24, 24)));
BOOST_CHECK (film->reels().back() == DCPTimePeriod(DCPTime::from_frames(2 * 24, 24), DCPTime::from_frames(3 * 24 + 1, 24)));
@@ -343,7 +344,7 @@ BOOST_AUTO_TEST_CASE (reels_test8)
film->set_name ("reels_test8");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
- shared_ptr<FFmpegContent> A (new FFmpegContent("test/data/test2.mp4"));
+ auto A = make_shared<FFmpegContent>("test/data/test2.mp4");
film->examine_and_add_content (A);
BOOST_REQUIRE (!wait_for_jobs ());
@@ -371,7 +372,7 @@ BOOST_AUTO_TEST_CASE (reels_test9)
B->set_reference_video(true);
B->set_reference_audio(true);
BOOST_REQUIRE(!wait_for_jobs());
- film2->set_reel_type(REELTYPE_BY_VIDEO_CONTENT);
+ film2->set_reel_type(ReelType::BY_VIDEO_CONTENT);
film2->write_metadata();
film2->make_dcp();
BOOST_REQUIRE(!wait_for_jobs());
@@ -397,7 +398,7 @@ BOOST_AUTO_TEST_CASE (reels_test10)
BOOST_REQUIRE (!wait_for_jobs());
B->video->set_length (5 * 24);
- ov->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ ov->set_reel_type (ReelType::BY_VIDEO_CONTENT);
ov->make_dcp ();
BOOST_REQUIRE (!wait_for_jobs());
ov->write_metadata ();
@@ -407,7 +408,7 @@ BOOST_AUTO_TEST_CASE (reels_test10)
shared_ptr<DCPContent> ov_dcp(new DCPContent(ov->dir(ov->dcp_name())));
vf->examine_and_add_content (ov_dcp);
BOOST_REQUIRE (!wait_for_jobs());
- vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ vf->set_reel_type (ReelType::BY_VIDEO_CONTENT);
ov_dcp->set_reference_video (true);
ov_dcp->set_reference_audio (true);
vf->examine_and_add_content (content_factory("test/data/15s.srt").front());
@@ -418,7 +419,7 @@ BOOST_AUTO_TEST_CASE (reels_test10)
vf->write_metadata ();
}
-/** Another reels error; REELTYPE_BY_VIDEO_CONTENT when the first content is not
+/** Another reels error; ReelType::BY_VIDEO_CONTENT when the first content is not
* at time 0.
*/
BOOST_AUTO_TEST_CASE (reels_test11)
@@ -431,7 +432,7 @@ BOOST_AUTO_TEST_CASE (reels_test11)
A->video->set_length (240);
A->set_video_frame_rate (24);
A->set_position (film, DCPTime::from_seconds(1));
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
film->make_dcp ();
BOOST_REQUIRE (!wait_for_jobs());
BOOST_CHECK_EQUAL (A->position().get(), DCPTime::from_seconds(1).get());
@@ -452,7 +453,7 @@ BOOST_AUTO_TEST_CASE (reels_test12)
{
shared_ptr<Film> film = new_test_film2 ("reels_test12");
film->set_video_frame_rate (24);
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
film->set_sequence (false);
shared_ptr<FFmpegContent> A(new FFmpegContent("test/data/flat_red.png"));
@@ -531,13 +532,13 @@ BOOST_AUTO_TEST_CASE (reels_should_not_be_short1)
}
/** Leaving less than 1 second's gap between two pieces of content with
- * REELTYPE_BY_VIDEO_CONTENT should not make a <1s reel.
+ * ReelType::BY_VIDEO_CONTENT should not make a <1s reel.
*/
BOOST_AUTO_TEST_CASE (reels_should_not_be_short2)
{
shared_ptr<Film> film = new_test_film2 ("reels_should_not_be_short2");
film->set_video_frame_rate (24);
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
shared_ptr<FFmpegContent> A(new FFmpegContent("test/data/flat_red.png"));
film->examine_and_add_content (A);
@@ -560,14 +561,14 @@ BOOST_AUTO_TEST_CASE (reels_should_not_be_short2)
BOOST_REQUIRE (notes.empty());
}
-/** Setting REELTYPE_BY_LENGTH and using a small length value should not make
+/** Setting ReelType::BY_LENGTH and using a small length value should not make
* <1s reels.
*/
BOOST_AUTO_TEST_CASE (reels_should_not_be_short3)
{
shared_ptr<Film> film = new_test_film2 ("reels_should_not_be_short3");
film->set_video_frame_rate (24);
- film->set_reel_type (REELTYPE_BY_LENGTH);
+ film->set_reel_type (ReelType::BY_LENGTH);
film->set_reel_length (1024 * 1024 * 10);
shared_ptr<FFmpegContent> A(new FFmpegContent("test/data/flat_red.png"));
@@ -584,14 +585,14 @@ BOOST_AUTO_TEST_CASE (reels_should_not_be_short3)
BOOST_REQUIRE (notes.empty());
}
-/** Having one piece of content less than 1s long in REELTYPE_BY_VIDEO_CONTENT
+/** Having one piece of content less than 1s long in ReelType::BY_VIDEO_CONTENT
* should not make a reel less than 1s long.
*/
BOOST_AUTO_TEST_CASE (reels_should_not_be_short4)
{
shared_ptr<Film> film = new_test_film2 ("reels_should_not_be_short4");
film->set_video_frame_rate (24);
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
shared_ptr<FFmpegContent> A(new FFmpegContent("test/data/flat_red.png"));
film->examine_and_add_content (A);
diff --git a/test/required_disk_space_test.cc b/test/required_disk_space_test.cc
index a4be8b9b7..5510864d9 100644
--- a/test/required_disk_space_test.cc
+++ b/test/required_disk_space_test.cc
@@ -24,11 +24,12 @@
*/
#include "lib/content_factory.h"
-#include "lib/film.h"
#include "lib/dcp_content.h"
+#include "lib/film.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
+using std::make_shared;
using std::shared_ptr;
using std::dynamic_pointer_cast;
@@ -40,14 +41,14 @@ void check_within_n (int64_t a, int64_t b, int64_t n)
BOOST_AUTO_TEST_CASE (required_disk_space_test)
{
- shared_ptr<Film> film = new_test_film ("required_disk_space_test");
+ auto film = new_test_film ("required_disk_space_test");
film->set_j2k_bandwidth (100000000);
film->set_audio_channels (6);
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
- shared_ptr<Content> content_a = content_factory("test/data/flat_blue.png").front();
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
+ auto content_a = content_factory("test/data/flat_blue.png").front();
BOOST_REQUIRE (content_a);
film->examine_and_add_content (content_a);
- shared_ptr<DCPContent> content_b (new DCPContent("test/data/burnt_subtitle_test_dcp"));
+ auto content_b = make_shared<DCPContent>("test/data/burnt_subtitle_test_dcp");
film->examine_and_add_content (content_b);
BOOST_REQUIRE (!wait_for_jobs());
film->write_metadata ();
diff --git a/test/shuffler_test.cc b/test/shuffler_test.cc
index f6a2a358c..d1c5b8533 100644
--- a/test/shuffler_test.cc
+++ b/test/shuffler_test.cc
@@ -46,10 +46,10 @@ BOOST_AUTO_TEST_CASE (shuffler_test1)
s.Video.connect (boost::bind (&receive, _1, _2));
for (int i = 0; i < 10; ++i) {
- push (s, i, EYES_LEFT);
- push (s, i, EYES_RIGHT);
- check (i, EYES_LEFT, __LINE__);
- check (i, EYES_RIGHT, __LINE__);
+ push (s, i, Eyes::LEFT);
+ push (s, i, Eyes::RIGHT);
+ check (i, Eyes::LEFT, __LINE__);
+ check (i, Eyes::RIGHT, __LINE__);
}
}
@@ -60,14 +60,14 @@ BOOST_AUTO_TEST_CASE (shuffler_test2)
s.Video.connect (boost::bind (&receive, _1, _2));
for (int i = 0; i < 10; i += 2) {
- push (s, i, EYES_LEFT);
- push (s, i + 1, EYES_LEFT);
- push (s, i, EYES_RIGHT);
- push (s, i + 1, EYES_RIGHT);
- check (i, EYES_LEFT, __LINE__);
- check (i, EYES_RIGHT, __LINE__);
- check (i + 1, EYES_LEFT, __LINE__);
- check (i + 1, EYES_RIGHT, __LINE__);
+ push (s, i, Eyes::LEFT);
+ push (s, i + 1, Eyes::LEFT);
+ push (s, i, Eyes::RIGHT);
+ push (s, i + 1, Eyes::RIGHT);
+ check (i, Eyes::LEFT, __LINE__);
+ check (i, Eyes::RIGHT, __LINE__);
+ check (i + 1, Eyes::LEFT, __LINE__);
+ check (i + 1, Eyes::RIGHT, __LINE__);
}
}
@@ -77,25 +77,25 @@ BOOST_AUTO_TEST_CASE (shuffler_test3)
Shuffler s;
s.Video.connect (boost::bind (&receive, _1, _2));
- push (s, 0, EYES_LEFT);
- check (0, EYES_LEFT, __LINE__);
- push (s, 0, EYES_RIGHT);
- check (0, EYES_RIGHT, __LINE__);
- push (s, 1, EYES_LEFT);
- check (1, EYES_LEFT, __LINE__);
- push (s, 1, EYES_RIGHT);
- check (1, EYES_RIGHT, __LINE__);
- push (s, 2, EYES_RIGHT);
- push (s, 3, EYES_LEFT);
- push (s, 3, EYES_RIGHT);
- push (s, 4, EYES_LEFT);
- push (s, 4, EYES_RIGHT);
+ push (s, 0, Eyes::LEFT);
+ check (0, Eyes::LEFT, __LINE__);
+ push (s, 0, Eyes::RIGHT);
+ check (0, Eyes::RIGHT, __LINE__);
+ push (s, 1, Eyes::LEFT);
+ check (1, Eyes::LEFT, __LINE__);
+ push (s, 1, Eyes::RIGHT);
+ check (1, Eyes::RIGHT, __LINE__);
+ push (s, 2, Eyes::RIGHT);
+ push (s, 3, Eyes::LEFT);
+ push (s, 3, Eyes::RIGHT);
+ push (s, 4, Eyes::LEFT);
+ push (s, 4, Eyes::RIGHT);
s.flush ();
- check (2, EYES_RIGHT, __LINE__);
- check (3, EYES_LEFT, __LINE__);
- check (3, EYES_RIGHT, __LINE__);
- check (4, EYES_LEFT, __LINE__);
- check (4, EYES_RIGHT, __LINE__);
+ check (2, Eyes::RIGHT, __LINE__);
+ check (3, Eyes::LEFT, __LINE__);
+ check (3, Eyes::RIGHT, __LINE__);
+ check (4, Eyes::LEFT, __LINE__);
+ check (4, Eyes::RIGHT, __LINE__);
}
/** One missing right eye image */
@@ -104,25 +104,25 @@ BOOST_AUTO_TEST_CASE (shuffler_test4)
Shuffler s;
s.Video.connect (boost::bind (&receive, _1, _2));
- push (s, 0, EYES_LEFT);
- check (0, EYES_LEFT, __LINE__);
- push (s, 0, EYES_RIGHT);
- check (0, EYES_RIGHT, __LINE__);
- push (s, 1, EYES_LEFT);
- check (1, EYES_LEFT, __LINE__);
- push (s, 1, EYES_RIGHT);
- check (1, EYES_RIGHT, __LINE__);
- push (s, 2, EYES_LEFT);
- push (s, 3, EYES_LEFT);
- push (s, 3, EYES_RIGHT);
- push (s, 4, EYES_LEFT);
- push (s, 4, EYES_RIGHT);
+ push (s, 0, Eyes::LEFT);
+ check (0, Eyes::LEFT, __LINE__);
+ push (s, 0, Eyes::RIGHT);
+ check (0, Eyes::RIGHT, __LINE__);
+ push (s, 1, Eyes::LEFT);
+ check (1, Eyes::LEFT, __LINE__);
+ push (s, 1, Eyes::RIGHT);
+ check (1, Eyes::RIGHT, __LINE__);
+ push (s, 2, Eyes::LEFT);
+ push (s, 3, Eyes::LEFT);
+ push (s, 3, Eyes::RIGHT);
+ push (s, 4, Eyes::LEFT);
+ push (s, 4, Eyes::RIGHT);
s.flush ();
- check (2, EYES_LEFT, __LINE__);
- check (3, EYES_LEFT, __LINE__);
- check (3, EYES_RIGHT, __LINE__);
- check (4, EYES_LEFT, __LINE__);
- check (4, EYES_RIGHT, __LINE__);
+ check (2, Eyes::LEFT, __LINE__);
+ check (3, Eyes::LEFT, __LINE__);
+ check (3, Eyes::RIGHT, __LINE__);
+ check (4, Eyes::LEFT, __LINE__);
+ check (4, Eyes::RIGHT, __LINE__);
}
/** Only one eye */
@@ -132,20 +132,20 @@ BOOST_AUTO_TEST_CASE (shuffler_test5)
s.Video.connect (boost::bind (&receive, _1, _2));
/* One left should come out straight away */
- push (s, 0, EYES_LEFT);
- check (0, EYES_LEFT, __LINE__);
+ push (s, 0, Eyes::LEFT);
+ check (0, Eyes::LEFT, __LINE__);
/* More lefts should be kept in the shuffler in the hope that some rights arrive */
for (int i = 0; i < s._max_size; ++i) {
- push (s, i + 1, EYES_LEFT);
+ push (s, i + 1, Eyes::LEFT);
}
BOOST_CHECK (pending_cv.empty ());
/* If enough lefts come the shuffler should conclude that there's no rights and start
giving out the lefts.
*/
- push (s, s._max_size + 1, EYES_LEFT);
- check (1, EYES_LEFT, __LINE__);
+ push (s, s._max_size + 1, Eyes::LEFT);
+ check (1, Eyes::LEFT, __LINE__);
}
/** One complete frame (L+R) missing.
@@ -156,18 +156,18 @@ BOOST_AUTO_TEST_CASE (shuffler_test6)
Shuffler s;
s.Video.connect (boost::bind (&receive, _1, _2));
- push (s, 0, EYES_LEFT);
- check (0, EYES_LEFT, __LINE__);
- push (s, 0, EYES_RIGHT);
- check (0, EYES_RIGHT, __LINE__);
+ push (s, 0, Eyes::LEFT);
+ check (0, Eyes::LEFT, __LINE__);
+ push (s, 0, Eyes::RIGHT);
+ check (0, Eyes::RIGHT, __LINE__);
- push (s, 2, EYES_LEFT);
- push (s, 2, EYES_RIGHT);
- check (2, EYES_LEFT, __LINE__);
- check (2, EYES_RIGHT, __LINE__);
+ push (s, 2, Eyes::LEFT);
+ push (s, 2, Eyes::RIGHT);
+ check (2, Eyes::LEFT, __LINE__);
+ check (2, Eyes::RIGHT, __LINE__);
- push (s, 3, EYES_LEFT);
- check (3, EYES_LEFT, __LINE__);
- push (s, 3, EYES_RIGHT);
- check (3, EYES_RIGHT, __LINE__);
+ push (s, 3, Eyes::LEFT);
+ check (3, Eyes::LEFT, __LINE__);
+ push (s, 3, Eyes::RIGHT);
+ check (3, Eyes::RIGHT, __LINE__);
}
diff --git a/test/subtitle_reel_number_test.cc b/test/subtitle_reel_number_test.cc
index d8c596c94..b19fd1cd0 100644
--- a/test/subtitle_reel_number_test.cc
+++ b/test/subtitle_reel_number_test.cc
@@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_number_test)
BOOST_REQUIRE (!wait_for_jobs ());
content->only_text()->set_use (true);
content->only_text()->set_burn (false);
- film->set_reel_type (REELTYPE_BY_LENGTH);
+ film->set_reel_type (ReelType::BY_LENGTH);
film->set_interop (true);
film->set_reel_length (1024 * 1024 * 512);
film->make_dcp ();
@@ -57,13 +57,13 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_number_test)
dcp::DCP dcp ("build/test/subtitle_reel_number_test/" + film->dcp_name());
dcp.read ();
BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U);
- shared_ptr<dcp::CPL> cpl = dcp.cpls().front();
+ auto cpl = dcp.cpls()[0];
BOOST_REQUIRE_EQUAL (cpl->reels().size(), 6U);
int n = 1;
for (auto i: cpl->reels()) {
if (i->main_subtitle()) {
- shared_ptr<dcp::InteropSubtitleAsset> ass = dynamic_pointer_cast<dcp::InteropSubtitleAsset>(i->main_subtitle()->asset());
+ auto ass = dynamic_pointer_cast<dcp::InteropSubtitleAsset>(i->main_subtitle()->asset());
BOOST_REQUIRE (ass);
BOOST_CHECK_EQUAL (ass->reel_number(), dcp::raw_convert<string>(n));
++n;
diff --git a/test/subtitle_reel_test.cc b/test/subtitle_reel_test.cc
index 906477963..c910d4aec 100644
--- a/test/subtitle_reel_test.cc
+++ b/test/subtitle_reel_test.cc
@@ -36,19 +36,20 @@
using std::list;
using std::string;
-using boost::optional;
using std::shared_ptr;
+using std::make_shared;
+using boost::optional;
/* Check that timings are done correctly for multi-reel DCPs with PNG subs */
BOOST_AUTO_TEST_CASE (subtitle_reel_test)
{
- shared_ptr<Film> film = new_test_film2 ("subtitle_reel_test");
+ auto film = new_test_film2 ("subtitle_reel_test");
film->set_interop (true);
- shared_ptr<ImageContent> red_a (new ImageContent("test/data/flat_red.png"));
- shared_ptr<ImageContent> red_b (new ImageContent("test/data/flat_red.png"));
- shared_ptr<DCPSubtitleContent> sub_a (new DCPSubtitleContent("test/data/png_subs/subs.xml"));
- shared_ptr<DCPSubtitleContent> sub_b (new DCPSubtitleContent("test/data/png_subs/subs.xml"));
+ auto red_a = make_shared<ImageContent>("test/data/flat_red.png");
+ auto red_b = make_shared<ImageContent>("test/data/flat_red.png");
+ auto sub_a = make_shared<DCPSubtitleContent>("test/data/png_subs/subs.xml");
+ auto sub_b = make_shared<DCPSubtitleContent>("test/data/png_subs/subs.xml");
film->examine_and_add_content (red_a);
film->examine_and_add_content (red_b);
@@ -64,7 +65,7 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_test)
red_b->video->set_length (240);
sub_b->set_position (film, dcpomatic::DCPTime::from_seconds(10));
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
film->make_dcp ();
BOOST_REQUIRE (!wait_for_jobs());
@@ -101,18 +102,18 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_test)
*/
BOOST_AUTO_TEST_CASE (subtitle_in_all_reels_test)
{
- shared_ptr<Film> film = new_test_film2 ("subtitle_in_all_reels_test");
+ auto film = new_test_film2 ("subtitle_in_all_reels_test");
film->set_interop (false);
film->set_sequence (false);
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
for (int i = 0; i < 3; ++i) {
- shared_ptr<Content> video = content_factory("test/data/flat_red.png").front();
+ auto video = content_factory("test/data/flat_red.png").front();
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));
}
- shared_ptr<Content> subs = content_factory("test/data/15s.srt").front();
+ auto subs = content_factory("test/data/15s.srt").front();
film->examine_and_add_content (subs);
BOOST_REQUIRE (!wait_for_jobs());
film->make_dcp ();
@@ -121,7 +122,7 @@ BOOST_AUTO_TEST_CASE (subtitle_in_all_reels_test)
dcp::DCP dcp ("build/test/subtitle_in_all_reels_test/" + film->dcp_name());
dcp.read ();
BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U);
- shared_ptr<dcp::CPL> cpl = dcp.cpls().front();
+ auto cpl = dcp.cpls()[0];
BOOST_REQUIRE_EQUAL (cpl->reels().size(), 3U);
for (auto i: cpl->reels()) {
@@ -135,29 +136,29 @@ BOOST_AUTO_TEST_CASE (subtitle_in_all_reels_test)
*/
BOOST_AUTO_TEST_CASE (closed_captions_in_all_reels_test)
{
- shared_ptr<Film> film = new_test_film2 ("closed_captions_in_all_reels_test");
+ auto film = new_test_film2 ("closed_captions_in_all_reels_test");
film->set_interop (false);
film->set_sequence (false);
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
for (int i = 0; i < 3; ++i) {
- shared_ptr<Content> video = content_factory("test/data/flat_red.png").front();
+ auto video = content_factory("test/data/flat_red.png").front();
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));
}
- shared_ptr<Content> ccap1 = content_factory("test/data/15s.srt").front();
+ auto ccap1 = content_factory("test/data/15s.srt").front();
film->examine_and_add_content (ccap1);
BOOST_REQUIRE (!wait_for_jobs());
- ccap1->text.front()->set_type (TEXT_CLOSED_CAPTION);
+ ccap1->text.front()->set_type (TextType::CLOSED_CAPTION);
ccap1->text.front()->set_dcp_track (DCPTextTrack("Test", "de-DE"));
- shared_ptr<Content> ccap2 = content_factory("test/data/15s.srt").front();
+ auto ccap2 = content_factory("test/data/15s.srt").front();
film->examine_and_add_content (ccap2);
BOOST_REQUIRE (!wait_for_jobs());
- ccap2->text.front()->set_type (TEXT_CLOSED_CAPTION);
+ ccap2->text.front()->set_type (TextType::CLOSED_CAPTION);
ccap2->text.front()->set_dcp_track (DCPTextTrack("Other", "en-GB"));
film->make_dcp ();
@@ -166,13 +167,13 @@ BOOST_AUTO_TEST_CASE (closed_captions_in_all_reels_test)
dcp::DCP dcp ("build/test/closed_captions_in_all_reels_test/" + film->dcp_name());
dcp.read ();
BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U);
- shared_ptr<dcp::CPL> cpl = dcp.cpls().front();
+ auto cpl = dcp.cpls().front();
BOOST_REQUIRE_EQUAL (cpl->reels().size(), 3U);
for (auto i: cpl->reels()) {
BOOST_REQUIRE_EQUAL (i->closed_captions().size(), 2U);
- optional<string> first = i->closed_captions().front()->language();
- optional<string> second = i->closed_captions().back()->language();
+ auto first = i->closed_captions().front()->language();
+ auto second = i->closed_captions().back()->language();
BOOST_REQUIRE (first);
BOOST_REQUIRE (second);
BOOST_CHECK (
diff --git a/test/test.cc b/test/test.cc
index 3f646fd1f..b82af3e2f 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -798,7 +798,7 @@ dcp::operator<< (std::ostream& s, dcp::Size i)
}
std::ostream&
-dcp::operator<< (std::ostream& s, Standard t)
+dcp::operator<< (std::ostream& s, dcp::Standard t)
{
switch (t) {
case Standard::INTEROP:
@@ -811,3 +811,10 @@ dcp::operator<< (std::ostream& s, Standard t)
return s;
}
+std::ostream&
+operator<< (std::ostream&s, VideoFrameType f)
+{
+ s << video_frame_type_to_string(f);
+ return s;
+}
+
diff --git a/test/test.h b/test/test.h
index c188a614f..da00fe688 100644
--- a/test/test.h
+++ b/test/test.h
@@ -20,7 +20,7 @@
#include "lib/warnings.h"
-#include <dcp/types.h>
+#include "lib/types.h"
#include <boost/filesystem.hpp>
@@ -67,9 +67,12 @@ private:
std::shared_ptr<Log> _old;
};
+
namespace dcp {
std::ostream& operator<< (std::ostream& s, dcp::Size i);
-std::ostream& operator<< (std::ostream& s, Standard t);
+std::ostream& operator<< (std::ostream& s, dcp::Standard t);
}
+
+std::ostream& operator<< (std::ostream& s, VideoFrameType f);
diff --git a/test/threed_test.cc b/test/threed_test.cc
index b12eb328d..78e656830 100644
--- a/test/threed_test.cc
+++ b/test/threed_test.cc
@@ -39,7 +39,7 @@
using std::cout;
using std::shared_ptr;
-/** Basic sanity check of 3D_LEFT_RIGHT */
+/** Basic sanity check of THREE_D_LEFT_RIGHT */
BOOST_AUTO_TEST_CASE (threed_test1)
{
shared_ptr<Film> film = new_test_film ("threed_test1");
@@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE (threed_test1)
film->examine_and_add_content (c);
BOOST_REQUIRE (!wait_for_jobs());
- c->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
+ c->video->set_frame_type (VideoFrameType::THREE_D_LEFT_RIGHT);
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
@@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE (threed_test1)
BOOST_REQUIRE (!wait_for_jobs ());
}
-/** Basic sanity check of 3D_ALTERNATE; at the moment this is just to make sure
+/** Basic sanity check of THREE_D_ALTERNATE; at the moment this is just to make sure
* that such a transcode completes without error.
*/
BOOST_AUTO_TEST_CASE (threed_test2)
@@ -70,7 +70,7 @@ BOOST_AUTO_TEST_CASE (threed_test2)
film->examine_and_add_content (c);
BOOST_REQUIRE (!wait_for_jobs());
- c->video->set_frame_type (VIDEO_FRAME_TYPE_3D_ALTERNATE);
+ c->video->set_frame_type (VideoFrameType::THREE_D_ALTERNATE);
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
@@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE (threed_test2)
BOOST_REQUIRE (!wait_for_jobs ());
}
-/** Basic sanity check of 3D_LEFT and 3D_RIGHT; at the moment this is just to make sure
+/** Basic sanity check of THREE_D_LEFT and THREE_D_RIGHT; at the moment this is just to make sure
* that such a transcode completes without error.
*/
BOOST_AUTO_TEST_CASE (threed_test3)
@@ -93,8 +93,8 @@ BOOST_AUTO_TEST_CASE (threed_test3)
film->examine_and_add_content (R);
BOOST_REQUIRE (!wait_for_jobs());
- L->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT);
- R->video->set_frame_type (VIDEO_FRAME_TYPE_3D_RIGHT);
+ L->video->set_frame_type (VideoFrameType::THREE_D_LEFT);
+ R->video->set_frame_type (VideoFrameType::THREE_D_RIGHT);
film->set_three_d (true);
film->make_dcp ();
@@ -112,8 +112,8 @@ BOOST_AUTO_TEST_CASE (threed_test4)
film->examine_and_add_content (R);
BOOST_REQUIRE (!wait_for_jobs());
- L->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT);
- R->video->set_frame_type (VIDEO_FRAME_TYPE_3D_RIGHT);
+ L->video->set_frame_type (VideoFrameType::THREE_D_LEFT);
+ R->video->set_frame_type (VideoFrameType::THREE_D_RIGHT);
/* There doesn't seem much point in encoding the whole input, especially as we're only
* checking for errors during the encode and not the result. Also decoding these files
* (4K HQ Prores) is very slow.
@@ -137,8 +137,8 @@ BOOST_AUTO_TEST_CASE (threed_test5)
film->examine_and_add_content (R);
BOOST_REQUIRE (!wait_for_jobs());
- L->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT);
- R->video->set_frame_type (VIDEO_FRAME_TYPE_3D_RIGHT);
+ L->video->set_frame_type (VideoFrameType::THREE_D_LEFT);
+ R->video->set_frame_type (VideoFrameType::THREE_D_RIGHT);
/* There doesn't seem much point in encoding the whole input, especially as we're only
* checking for errors during the encode and not the result.
*/
@@ -161,8 +161,8 @@ BOOST_AUTO_TEST_CASE (threed_test6)
film->examine_and_add_content (R);
BOOST_REQUIRE (!wait_for_jobs());
- L->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT);
- R->video->set_frame_type (VIDEO_FRAME_TYPE_3D_RIGHT);
+ L->video->set_frame_type (VideoFrameType::THREE_D_LEFT);
+ R->video->set_frame_type (VideoFrameType::THREE_D_RIGHT);
film->set_three_d (true);
film->make_dcp ();
@@ -183,7 +183,7 @@ BOOST_AUTO_TEST_CASE (threed_test7)
film->examine_and_add_content (c);
BOOST_REQUIRE (!wait_for_jobs());
- c->video->set_frame_type (VIDEO_FRAME_TYPE_3D);
+ c->video->set_frame_type (VideoFrameType::THREE_D);
film->set_three_d (true);
film->make_dcp ();
diff --git a/test/vf_test.cc b/test/vf_test.cc
index aff9bdae9..b538f967c 100644
--- a/test/vf_test.cc
+++ b/test/vf_test.cc
@@ -56,20 +56,20 @@ BOOST_AUTO_TEST_CASE (vf_test1)
BOOST_REQUIRE (!wait_for_jobs());
/* Multi-reel DCP can't be referenced if we are using a single reel for the project */
- film->set_reel_type (REELTYPE_SINGLE);
+ film->set_reel_type (ReelType::SINGLE);
string why_not;
BOOST_CHECK (!dcp->can_reference_video(film, why_not));
BOOST_CHECK (!dcp->can_reference_audio(film, why_not));
- BOOST_CHECK (!dcp->can_reference_text(film, TEXT_OPEN_SUBTITLE, why_not));
- BOOST_CHECK (!dcp->can_reference_text(film, TEXT_CLOSED_CAPTION, why_not));
+ BOOST_CHECK (!dcp->can_reference_text(film, TextType::OPEN_SUBTITLE, why_not));
+ BOOST_CHECK (!dcp->can_reference_text(film, TextType::CLOSED_CAPTION, why_not));
/* Multi-reel DCP can be referenced if we are using by-video-content */
- film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ film->set_reel_type (ReelType::BY_VIDEO_CONTENT);
BOOST_CHECK (dcp->can_reference_video(film, why_not));
BOOST_CHECK (dcp->can_reference_audio(film, why_not));
/* (but reels_test2 has no texts to reference) */
- BOOST_CHECK (!dcp->can_reference_text(film, TEXT_OPEN_SUBTITLE, why_not));
- BOOST_CHECK (!dcp->can_reference_text(film, TEXT_CLOSED_CAPTION, why_not));
+ BOOST_CHECK (!dcp->can_reference_text(film, TextType::OPEN_SUBTITLE, why_not));
+ BOOST_CHECK (!dcp->can_reference_text(film, TextType::CLOSED_CAPTION, why_not));
shared_ptr<FFmpegContent> other (new FFmpegContent("test/data/test.mp4"));
film->examine_and_add_content (other);
@@ -85,8 +85,8 @@ BOOST_AUTO_TEST_CASE (vf_test1)
BOOST_CHECK (dcp->can_reference_video(film, why_not));
BOOST_CHECK (dcp->can_reference_audio(film, why_not));
/* (reels_test2 has no texts to reference) */
- BOOST_CHECK (!dcp->can_reference_text(film, TEXT_OPEN_SUBTITLE, why_not));
- BOOST_CHECK (!dcp->can_reference_text(film, TEXT_CLOSED_CAPTION, why_not));
+ BOOST_CHECK (!dcp->can_reference_text(film, TextType::OPEN_SUBTITLE, why_not));
+ BOOST_CHECK (!dcp->can_reference_text(film, TextType::CLOSED_CAPTION, why_not));
}
/** Make a OV with video and audio and a VF referencing the OV and adding subs */
@@ -110,7 +110,7 @@ BOOST_AUTO_TEST_CASE (vf_test2)
shared_ptr<Film> vf = new_test_film ("vf_test2_vf");
vf->set_name ("vf_test2_vf");
vf->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
- vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ vf->set_reel_type (ReelType::BY_VIDEO_CONTENT);
shared_ptr<DCPContent> dcp (new DCPContent(ov->dir (ov->dcp_name ())));
BOOST_REQUIRE (dcp);
vf->examine_and_add_content (dcp);
@@ -168,7 +168,7 @@ BOOST_AUTO_TEST_CASE (vf_test3)
shared_ptr<Film> vf = new_test_film ("vf_test3_vf");
vf->set_name ("vf_test3_vf");
vf->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
- vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ vf->set_reel_type (ReelType::BY_VIDEO_CONTENT);
shared_ptr<DCPContent> dcp (new DCPContent(ov->dir(ov->dcp_name())));
BOOST_REQUIRE (dcp);
dcp->set_trim_start (ContentTime::from_seconds (1));
@@ -214,7 +214,7 @@ BOOST_AUTO_TEST_CASE (vf_test4)
shared_ptr<Film> vf = new_test_film ("vf_test4_vf");
vf->set_name ("vf_test4_vf");
vf->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
- vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ vf->set_reel_type (ReelType::BY_VIDEO_CONTENT);
vf->set_sequence (false);
shared_ptr<DCPContent> dcp (new DCPContent(ov->dir(ov->dcp_name())));
BOOST_REQUIRE (dcp);
@@ -257,7 +257,7 @@ BOOST_AUTO_TEST_CASE (vf_test5)
/* Make the OV */
shared_ptr<Film> ov = new_test_film ("vf_test5_ov");
ov->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
- ov->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ ov->set_reel_type (ReelType::BY_VIDEO_CONTENT);
for (int i = 0; i < 3; ++i) {
shared_ptr<Content> video = content_factory("test/data/flat_red.png").front();
ov->examine_and_add_content (video);
@@ -273,7 +273,7 @@ BOOST_AUTO_TEST_CASE (vf_test5)
shared_ptr<Film> vf = new_test_film ("vf_test5_vf");
vf->set_name ("vf_test5_vf");
vf->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
- vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ vf->set_reel_type (ReelType::BY_VIDEO_CONTENT);
vf->set_sequence (false);
shared_ptr<DCPContent> dcp (new DCPContent(ov->dir(ov->dcp_name())));
BOOST_REQUIRE (dcp);
@@ -306,7 +306,7 @@ BOOST_AUTO_TEST_CASE (vf_test6)
/* Make the OV */
shared_ptr<Film> 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);
+ ov->set_reel_type (ReelType::BY_VIDEO_CONTENT);
shared_ptr<Content> video = content_factory("test/data/flat_red.png").front();
ov->examine_and_add_content (video);
BOOST_REQUIRE (!wait_for_jobs());
@@ -318,7 +318,7 @@ BOOST_AUTO_TEST_CASE (vf_test6)
shared_ptr<Film> vf = new_test_film ("vf_test6_vf");
vf->set_name ("vf_test6_vf");
vf->set_dcp_content_type (DCPContentType::from_isdcf_name("TST"));
- vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ vf->set_reel_type (ReelType::BY_VIDEO_CONTENT);
vf->set_sequence (false);
shared_ptr<DCPContent> dcp (new DCPContent(ov->dir(ov->dcp_name())));
BOOST_REQUIRE (dcp);
@@ -361,7 +361,7 @@ BOOST_AUTO_TEST_CASE (vf_test7)
shared_ptr<DCPContent> ov2_dcp (new DCPContent(ov1->dir(ov1->dcp_name())));
vf->examine_and_add_content (ov2_dcp);
BOOST_REQUIRE (!wait_for_jobs());
- vf->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+ vf->set_reel_type (ReelType::BY_VIDEO_CONTENT);
ov1_dcp->set_reference_video (true);
ov2_dcp->set_reference_video (true);
ov1_dcp->set_position (vf, DCPTime::from_seconds(1));
diff --git a/test/video_level_test.cc b/test/video_level_test.cc
index 632551fa4..2461bb9b3 100644
--- a/test/video_level_test.cc
+++ b/test/video_level_test.cc
@@ -56,6 +56,7 @@ using std::max;
using std::pair;
using std::string;
using std::dynamic_pointer_cast;
+using std::make_shared;
using boost::optional;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
@@ -67,7 +68,7 @@ static
shared_ptr<Image>
grey_image (dcp::Size size, uint8_t pixel)
{
- shared_ptr<Image> grey(new Image(AV_PIX_FMT_RGB24, size, true));
+ auto grey = make_shared<Image>(AV_PIX_FMT_RGB24, size, true);
for (int y = 0; y < size.height; ++y) {
uint8_t* p = grey->data()[0] + y * grey->stride()[0];
for (int x = 0; x < size.width; ++x) {
@@ -414,14 +415,14 @@ V_movie_range (shared_ptr<Film> film)
shared_ptr<TranscodeJob> job (new TranscodeJob(film));
job->set_encoder (
shared_ptr<FFmpegEncoder>(
- new FFmpegEncoder (film, job, film->file("export.mov"), EXPORT_FORMAT_PRORES, true, false, false, 23)
+ new FFmpegEncoder (film, job, film->file("export.mov"), ExportFormat::PRORES, true, false, false, 23)
)
);
JobManager::instance()->add (job);
BOOST_REQUIRE (!wait_for_jobs());
/* This is a bit of a hack; add the exported file into the project so we can decode it */
- shared_ptr<FFmpegContent> content(new FFmpegContent(film->file("export.mov")));
+ auto content = make_shared<FFmpegContent>(film->file("export.mov"));
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());