X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fburnt_subtitle_test.cc;h=fc5b885780d11dc71d9b6b36b0449b3efd8b06fa;hb=80400212e939dc2f3b987cb6df57709929aa5178;hp=c5d6c4c14adaa73438b0afecb18da545b684210e;hpb=d3af12157a34c7748bb8545567426bd612a18e04;p=dcpomatic.git diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc index c5d6c4c14..fc5b88578 100644 --- a/test/burnt_subtitle_test.cc +++ b/test/burnt_subtitle_test.cc @@ -22,28 +22,49 @@ */ #include -#include "lib/subrip_content.h" +#include "lib/text_subtitle_content.h" +#include "lib/dcp_subtitle_content.h" #include "lib/film.h" #include "lib/ratio.h" #include "lib/dcp_content_type.h" #include "test.h" +#include using std::cout; using boost::shared_ptr; -/** Build a small DCP with no picture and a single subtitle overlaid onto it */ -BOOST_AUTO_TEST_CASE (burnt_subtitle_test) +/** 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) { - shared_ptr film = new_test_film ("burnt_subtitle_test"); + shared_ptr film = new_test_film ("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_with_subtitles (true); - shared_ptr content (new SubRipContent (film, "test/data/subrip2.srt")); - film->examine_and_add_content (content); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); + content->set_use_subtitles (true); + content->set_burn_subtitles (true); + film->examine_and_add_content (content, true); wait_for_jobs (); film->make_dcp (); wait_for_jobs (); - check_dcp ("test/data/burnt_subtitle_test", film->dir (film->dcp_name ())); + check_dcp ("test/data/burnt_subtitle_test_subrip", film->dir (film->dcp_name ())); +} + +/** 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) +{ + shared_ptr film = new_test_film ("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_burn_subtitles (true); + shared_ptr content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml")); + content->set_use_subtitles (true); + film->examine_and_add_content (content, true); + wait_for_jobs (); + film->make_dcp (); + wait_for_jobs (); + + check_dcp ("test/data/burnt_subtitle_test_dcp", film->dir (film->dcp_name ())); }