projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tentative support for 3D from alternate frames.
[dcpomatic.git]
/
test
/
play_test.cc
diff --git
a/test/play_test.cc
b/test/play_test.cc
index 12f80a282c0e29c0a7254e5f1e2f39ddaf5bf85d..51e2272568acbf26a1bc321d0ad1bdf63af3bc36 100644
(file)
--- a/
test/play_test.cc
+++ b/
test/play_test.cc
@@
-17,12
+17,18
@@
*/
*/
-#include "player.h"
+#include <boost/test/unit_test.hpp>
+#include "lib/player.h"
+#include "lib/ratio.h"
+#include "lib/dcp_content_type.h"
+#include "test.h"
/* This test needs stuff in Player that is only included in debug mode */
#ifdef DCPOMATIC_DEBUG
/* This test needs stuff in Player that is only included in debug mode */
#ifdef DCPOMATIC_DEBUG
+using std::cout;
using boost::optional;
using boost::optional;
+using boost::shared_ptr;
struct Video
{
struct Video
{
@@
-37,14
+43,14
@@
public:
PlayerWrapper (shared_ptr<Player> p)
: _player (p)
{
PlayerWrapper (shared_ptr<Player> p)
: _player (p)
{
- _player->Video.connect (bind (&PlayerWrapper::process_video, this, _1, _2, _
3
));
+ _player->Video.connect (bind (&PlayerWrapper::process_video, this, _1, _2, _
5
));
}
}
- void process_video (shared_ptr<
const
Image> i, bool, Time t)
+ void process_video (shared_ptr<
Player
Image> i, bool, Time t)
{
Video v;
v.content = _player->_last_video;
{
Video v;
v.content = _player->_last_video;
- v.image = i;
+ v.image = i
->image ()
;
v.time = t;
_queue.push_front (v);
}
v.time = t;
_queue.push_front (v);
}
@@
-83,22
+89,22
@@
BOOST_AUTO_TEST_CASE (play_test)
film->examine_and_add_content (A);
wait_for_jobs ();
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<FFmpegContent> B (new FFmpegContent (film, "test/data/red_30.mp4"));
film->examine_and_add_content (B);
wait_for_jobs ();
shared_ptr<FFmpegContent> 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 */
/* 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 */
/* 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> player = film->player ();
+ shared_ptr<Player> player = film->
make_
player ();
PlayerWrapper wrap (player);
/* Seek and audio don't get on at the moment */
player->disable_audio ();
PlayerWrapper wrap (player);
/* Seek and audio don't get on at the moment */
player->disable_audio ();
@@
-116,7
+122,6
@@
BOOST_AUTO_TEST_CASE (play_test)
player->seek (10 * TIME_HZ / 25, true);
optional<Video> v = wrap.get_video ();
BOOST_CHECK (v);
player->seek (10 * TIME_HZ / 25, true);
optional<Video> v = wrap.get_video ();
BOOST_CHECK (v);
- cout << (v.get().time * 25 / TIME_HZ) << "\n";
BOOST_CHECK_EQUAL (v.get().time, 10 * TIME_HZ / 25);
}
BOOST_CHECK_EQUAL (v.get().time, 10 * TIME_HZ / 25);
}