diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-05-19 21:35:46 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-05-19 21:35:46 +0200 |
| commit | 8d67ad2e74b6d2c88b52a397a2c2823254ec09fb (patch) | |
| tree | c5901380449dcd83ea8f5eaeafd775d8f40e6c29 /test | |
| parent | e08d1ce718493a869e429be3a6f811575f2c8dd1 (diff) | |
wip: black pieces; sad part is that Shuffler can't cope with content that doesn't start at the same time.2253-3d-empty
Diffstat (limited to 'test')
| -rw-r--r-- | test/overlap_video_test.cc | 2 | ||||
| -rw-r--r-- | test/player_test.cc | 18 | ||||
| -rw-r--r-- | test/threed_test.cc | 6 |
3 files changed, 22 insertions, 4 deletions
diff --git a/test/overlap_video_test.cc b/test/overlap_video_test.cc index c23444c4a..9b2f4249b 100644 --- a/test/overlap_video_test.cc +++ b/test/overlap_video_test.cc @@ -65,8 +65,6 @@ BOOST_AUTO_TEST_CASE (overlap_video_test1) BOOST_CHECK (pieces.front()->ignore_video); BOOST_CHECK (pieces.front()->ignore_video.get() == dcpomatic::DCPTimePeriod(dcpomatic::DCPTime::from_seconds(1), dcpomatic::DCPTime::from_seconds(1) + B->length_after_trim(film))); - BOOST_CHECK (player->_black.done()); - make_and_verify_dcp (film); dcp::DCP back (film->dir(film->dcp_name())); diff --git a/test/player_test.cc b/test/player_test.cc index 3954fbbae..d7a8035e8 100644 --- a/test/player_test.cc +++ b/test/player_test.cc @@ -26,6 +26,7 @@ #include "lib/audio_buffers.h" +#include "lib/black_content.h" #include "lib/butler.h" #include "lib/compose.hpp" #include "lib/content_factory.h" @@ -35,6 +36,7 @@ #include "lib/ffmpeg_content.h" #include "lib/film.h" #include "lib/image_content.h" +#include "lib/piece.h" #include "lib/player.h" #include "lib/ratio.h" #include "lib/string_text_file_content.h" @@ -47,6 +49,7 @@ using std::cout; +using std::dynamic_pointer_cast; using std::list; using std::shared_ptr; using std::make_shared; @@ -164,9 +167,20 @@ BOOST_AUTO_TEST_CASE (player_subframe_test) BOOST_CHECK (film->length() == DCPTime::from_frames(3 * 24 + 1, 24)); auto player = std::make_shared<Player>(film, Image::Alignment::COMPACT); + player->setup_pieces (); - BOOST_REQUIRE_EQUAL (player->_black._periods.size(), 1U); - BOOST_CHECK (player->_black._periods.front().first == DCPTimePeriod(DCPTime::from_frames(3 * 24, 24), DCPTime::from_frames(3 * 24 + 1, 24))); + list<std::shared_ptr<Piece>> black; + std::copy_if( + player->_pieces.begin(), + player->_pieces.end(), + std::back_inserter(black), + [](shared_ptr<Piece> piece) { + return static_cast<bool>(dynamic_pointer_cast<BlackContent>(piece->content)); + }); + BOOST_REQUIRE_EQUAL (black.size(), 1U); + BOOST_CHECK (black.front()->content->position() == DCPTime::from_frames(3 * 24, 24)); + BOOST_CHECK (black.front()->content->full_length(film) == DCPTime::from_frames(1, 24)); + BOOST_REQUIRE_EQUAL (player->_silent._periods.size(), 1U); BOOST_CHECK (player->_silent._periods.front() == DCPTimePeriod(DCPTime(289920), DCPTime::from_frames(3 * 24 + 1, 24))); } diff --git a/test/threed_test.cc b/test/threed_test.cc index 78316be08..e42c4ef4f 100644 --- a/test/threed_test.cc +++ b/test/threed_test.cc @@ -247,6 +247,12 @@ BOOST_AUTO_TEST_CASE (threed_test_separate_files_slightly_different_lengths) */ BOOST_AUTO_TEST_CASE (threed_test_separate_files_very_different_lengths) { + dcpomatic_log->set_types ( + LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | + LogEntry::TYPE_ERROR | LogEntry::TYPE_DISK | LogEntry::TYPE_DEBUG_PLAYER | + LogEntry::TYPE_DEBUG_THREE_D + ); + auto film = new_test_film2 ("threed_test3"); auto L = make_shared<FFmpegContent>("test/data/test.mp4"); film->examine_and_add_content (L); |
