using std::max;
using std::pair;
using std::string;
-using boost::dynamic_pointer_cast;
+using std::dynamic_pointer_cast;
+using std::make_shared;
using boost::optional;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
-using boost::shared_ptr;
+using std::shared_ptr;
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) {
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);
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);
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);
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);
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);
pair<int, int>
dcp_range (shared_ptr<Film> film)
{
- film->make_dcp ();
- BOOST_REQUIRE (!wait_for_jobs());
+ make_and_verify_dcp (film);
return pixel_range (film->dir(film->dcp_name()));
}
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());
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);
}
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);
}
{
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);
}