X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fplay_test.cc;h=f7aa52d6f539f18102a3f68080c59f70d6cc75e7;hb=937b96045830a2326daff83b70b892f2d25244ff;hp=54fe2699f7fd47b19ad9ac666a70857e309d4567;hpb=b299c1873bf23414061d551843275c77a9256a05;p=dcpomatic.git diff --git a/test/play_test.cc b/test/play_test.cc index 54fe2699f..f7aa52d6f 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 @@ -21,6 +21,7 @@ #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 */ @@ -34,7 +35,7 @@ struct Video { boost::shared_ptr content; boost::shared_ptr image; - DCPTime time; + Time time; }; class PlayerWrapper @@ -43,14 +44,14 @@ public: PlayerWrapper (shared_ptr p) : _player (p) { - _player->Video.connect (bind (&PlayerWrapper::process_video, this, _1, _2, _5)); + _player->Video.connect (bind (&PlayerWrapper::process_video, this, _1, _3)); } - void process_video (shared_ptr i, bool, DCPTime t) + void process_video (shared_ptr i, Time t) { Video v; v.content = _player->_last_video; - v.image = i->image (PIX_FMT_RGB24, false); + v.image = i->image (PIX_FMT_RGB24); v.time = t; _queue.push_front (v); } @@ -67,7 +68,7 @@ public: return v; } - void seek (DCPTime t, bool ac) + void seek (Time t, bool ac) { _player->seek (t, ac); _queue.clear (); @@ -81,21 +82,21 @@ 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"); shared_ptr A (new FFmpegContent (film, "test/data/red_24.mp4")); - film->examine_and_add_content (A); + film->examine_and_add_content (A, true); 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); + film->examine_and_add_content (B, true); 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->video_frame_rate(), 25); @@ -106,6 +107,8 @@ BOOST_AUTO_TEST_CASE (play_test) shared_ptr player = film->make_player (); PlayerWrapper wrap (player); + /* Seek and audio don't get on at the moment */ + player->disable_audio (); for (int i = 0; i < 32; ++i) { optional