X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fplay_test.cc;h=bbf70781a87d4600526428055228fc54809c1c62;hb=2898a88b4554335439891d8198bed8c820c20396;hp=0a15bfed2c9cded8787bd056eab9a3d576fd5f54;hpb=05ef423e0fa4c1730c70770ff9528ee45f70e064;p=dcpomatic.git diff --git a/test/play_test.cc b/test/play_test.cc index 0a15bfed2..bbf70781a 100644 --- a/test/play_test.cc +++ b/test/play_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,12 +17,19 @@ */ -#include "player.h" +#include +#include "lib/player.h" +#include "lib/ratio.h" +#include "lib/dcp_content_type.h" +#include "lib/player_video_frame.h" +#include "test.h" /* This test needs stuff in Player that is only included in debug mode */ #ifdef DCPOMATIC_DEBUG +using std::cout; using boost::optional; +using boost::shared_ptr; struct Video { @@ -37,14 +44,14 @@ public: PlayerWrapper (shared_ptr p) : _player (p) { - _player->Video.connect (bind (&PlayerWrapper::process_video, this, _1, _2, _3)); + _player->Video.connect (bind (&PlayerWrapper::process_video, this, _1, _3)); } - void process_video (shared_ptr i, bool, Time t) + void process_video (shared_ptr i, Time t) { Video v; v.content = _player->_last_video; - v.image = i; + v.image = i->image (PIX_FMT_RGB24); v.time = t; _queue.push_front (v); } @@ -75,7 +82,7 @@ private: BOOST_AUTO_TEST_CASE (play_test) { shared_ptr film = new_test_film ("play_test"); - film->set_dcp_content_type (DCPContentType::from_dci_name ("FTR")); + film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR")); film->set_container (Ratio::from_id ("185")); film->set_name ("play_test"); @@ -83,20 +90,20 @@ BOOST_AUTO_TEST_CASE (play_test) film->examine_and_add_content (A); wait_for_jobs (); - BOOST_CHECK_EQUAL (A->video_length(), 16); + BOOST_CHECK_EQUAL (A->video_length_after_3d_combine(), 16); shared_ptr B (new FFmpegContent (film, "test/data/red_30.mp4")); film->examine_and_add_content (B); wait_for_jobs (); - BOOST_CHECK_EQUAL (B->video_length(), 16); + BOOST_CHECK_EQUAL (B->video_length_after_3d_combine(), 16); /* Film should have been set to 25fps */ - BOOST_CHECK_EQUAL (film->dcp_video_frame_rate(), 25); + BOOST_CHECK_EQUAL (film->video_frame_rate(), 25); - BOOST_CHECK_EQUAL (A->start(), 0); + BOOST_CHECK_EQUAL (A->position(), 0); /* A is 16 frames long at 25 fps */ - BOOST_CHECK_EQUAL (B->start(), 16 * TIME_HZ / 25); + BOOST_CHECK_EQUAL (B->position(), 16 * TIME_HZ / 25); shared_ptr player = film->make_player (); PlayerWrapper wrap (player); @@ -113,10 +120,9 @@ BOOST_AUTO_TEST_CASE (play_test) } } - player->seek (10 * TIME_HZ / 25, true); + wrap.seek (10 * TIME_HZ / 25, true); optional