#include <dcp/mono_picture_asset.h>
#include <dcp/mono_picture_asset_reader.h>
#include <dcp/mono_picture_frame.h>
#include <dcp/mono_picture_asset.h>
#include <dcp/mono_picture_asset_reader.h>
#include <dcp/mono_picture_frame.h>
#include <dcp/reel_picture_asset.h>
#include <dcp/reel_mono_picture_asset.h>
#include <boost/test/unit_test.hpp>
#include <dcp/reel_picture_asset.h>
#include <dcp/reel_mono_picture_asset.h>
#include <boost/test/unit_test.hpp>
/** Build a small DCP with no picture and a single subtitle overlaid onto it from a SubRip file */
BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip)
{
/** Build a small DCP with no picture and a single subtitle overlaid onto it from a SubRip file */
BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip)
{
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
content->subtitle->set_use (true);
content->subtitle->set_burn (true);
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());
content->subtitle->set_use (true);
content->subtitle->set_burn (true);
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());
/** Build a small DCP with no picture and a single subtitle overlaid onto it from a DCP XML file */
BOOST_AUTO_TEST_CASE (burnt_subtitle_test_dcp)
{
/** Build a small DCP with no picture and a single subtitle overlaid onto it from a DCP XML file */
BOOST_AUTO_TEST_CASE (burnt_subtitle_test_dcp)
{
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
content->subtitle->set_use (true);
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());
content->subtitle->set_use (true);
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());
/** Burn some subtitles into an existing DCP to check the colour conversion */
BOOST_AUTO_TEST_CASE (burnt_subtitle_test_onto_dcp)
{
/** Burn some subtitles into an existing DCP to check the colour conversion */
BOOST_AUTO_TEST_CASE (burnt_subtitle_test_onto_dcp)
{
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
film->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());
- BOOST_REQUIRE (!wait_for_jobs());
- film->make_dcp ();
+ film->examine_and_add_content (content_factory(film, "test/data/flat_black.png")[0]);
film2->set_container (Ratio::from_id ("185"));
film2->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film2->set_name ("frobozz");
film2->set_container (Ratio::from_id ("185"));
film2->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film2->set_name ("frobozz");
- shared_ptr<StringText> sub = dynamic_pointer_cast<StringText> (
- content_factory(film2, "test/data/subrip2.srt").front()
+ auto sub = dynamic_pointer_cast<StringText> (
+ content_factory(film2, "test/data/subrip2.srt")[0]
);
sub->subtitle->set_burn (true);
sub->subtitle->set_outline (true);
film2->examine_and_add_content (sub);
BOOST_REQUIRE (!wait_for_jobs());
);
sub->subtitle->set_burn (true);
sub->subtitle->set_outline (true);
film2->examine_and_add_content (sub);
BOOST_REQUIRE (!wait_for_jobs());
BOOST_REQUIRE_EQUAL (dcp.cpls().front()->reels().size(), 1);
BOOST_REQUIRE (dcp.cpls().front()->reels().front()->main_picture());
BOOST_REQUIRE (dcp.cpls().front()->reels().front()->main_picture()->asset());
BOOST_REQUIRE_EQUAL (dcp.cpls().front()->reels().size(), 1);
BOOST_REQUIRE (dcp.cpls().front()->reels().front()->main_picture());
BOOST_REQUIRE (dcp.cpls().front()->reels().front()->main_picture()->asset());
- shared_ptr<const dcp::MonoPictureFrame> frame = pic->start_read()->get_frame (12);
- shared_ptr<dcp::OpenJPEGImage> xyz = frame->xyz_image ();
+ auto frame = pic->start_read()->get_frame(12);
+ auto xyz = frame->xyz_image ();
BOOST_CHECK_EQUAL (xyz->size().width, 1998);
BOOST_CHECK_EQUAL (xyz->size().height, 1080);
BOOST_CHECK_EQUAL (xyz->size().width, 1998);
BOOST_CHECK_EQUAL (xyz->size().height, 1080);