Test reference tweaks.
[dcpomatic.git] / test / video_level_test.cc
index 95b69d2aa2a3cca6dcf8cff7699b16802d271fb3..9514e29a0f977b07aab3c42fc43e6cc6058698f0 100644 (file)
@@ -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) {
@@ -89,7 +90,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_image_full_range_not_changed)
 
        write_image (grey_image(size, grey_pixel), file);
 
-       FFmpegImageProxy proxy (file, VIDEO_RANGE_FULL);
+       FFmpegImageProxy proxy (file, VideoRange::FULL);
        ImageProxy::Result result = proxy.image ();
        BOOST_REQUIRE (!result.error);
 
@@ -111,7 +112,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_image_video_range_expanded)
 
        write_image (grey_image(size, grey_pixel), file);
 
-       FFmpegImageProxy proxy (file, VIDEO_RANGE_VIDEO);
+       FFmpegImageProxy proxy (file, VideoRange::VIDEO);
        ImageProxy::Result result = proxy.image ();
        BOOST_REQUIRE (!result.error);
 
@@ -289,7 +290,7 @@ movie_VoF (string name)
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
-       content->video->set_range (VIDEO_RANGE_FULL);
+       content->video->set_range (VideoRange::FULL);
 
        pair<int, int> range = pixel_range (film, content);
        BOOST_CHECK_EQUAL (range.first, 15);
@@ -326,7 +327,7 @@ movie_FoV (string name)
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
-       content->video->set_range (VIDEO_RANGE_VIDEO);
+       content->video->set_range (VideoRange::VIDEO);
 
        pair<int, int> range = pixel_range (film, content);
        BOOST_CHECK_EQUAL (range.first, 0);
@@ -363,7 +364,7 @@ image_FoV (string name)
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
-       content->video->set_range (VIDEO_RANGE_VIDEO);
+       content->video->set_range (VideoRange::VIDEO);
 
        pair<int, int> range = pixel_range (film, content);
        BOOST_CHECK_EQUAL (range.first, 11);
@@ -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());
 
@@ -437,7 +438,7 @@ BOOST_AUTO_TEST_CASE (movie_V_to_dcp)
        pair<int, int> range = dcp_range (movie_V("movie_V_to_dcp"));
        /* Video range has been correctly expanded to full for the DCP */
        BOOST_CHECK_EQUAL (range.first, 0);
-       BOOST_CHECK_EQUAL (range.second, 4082);
+       BOOST_CHECK_EQUAL (range.second, 4083);
 }
 
 
@@ -457,7 +458,7 @@ BOOST_AUTO_TEST_CASE (movie_F_to_dcp)
        pair<int, int> range = dcp_range (movie_F("movie_F_to_dcp"));
        /* The nearly-full-range of the input has been preserved */
        BOOST_CHECK_EQUAL (range.first, 0);
-       BOOST_CHECK_EQUAL (range.second, 4082);
+       BOOST_CHECK_EQUAL (range.second, 4083);
 }
 
 
@@ -474,14 +475,14 @@ BOOST_AUTO_TEST_CASE (image_F_to_dcp)
 {
        pair<int, int> range = dcp_range (image_F("image_F_to_dcp"));
        BOOST_CHECK_EQUAL (range.first, 0);
-       BOOST_CHECK_EQUAL (range.second, 4081);
+       BOOST_CHECK_EQUAL (range.second, 4083);
 }
 
 
 BOOST_AUTO_TEST_CASE (image_FoV_to_dcp)
 {
        pair<int, int> range = dcp_range (image_FoV("image_FoV_to_dcp"));
-       BOOST_CHECK_EQUAL (range.first, 431);
+       BOOST_CHECK_EQUAL (range.first, 430);
        BOOST_CHECK_EQUAL (range.second, 4012);
 }