projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix confusion over when DCPDecoder::_next means wrt reels.
[dcpomatic.git]
/
test
/
play_test.cc
diff --git
a/test/play_test.cc
b/test/play_test.cc
index 54fe2699f7fd47b19ad9ac666a70857e309d4567..b950044a81bd3ba8a599c4c76d14d7766d47fabd 100644
(file)
--- a/
test/play_test.cc
+++ b/
test/play_test.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013
-2014
Carl Hetherington <cth@carlh.net>
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
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,7
+21,9
@@
#include "lib/player.h"
#include "lib/ratio.h"
#include "lib/dcp_content_type.h"
#include "lib/player.h"
#include "lib/ratio.h"
#include "lib/dcp_content_type.h"
+#include "lib/player_video_frame.h"
#include "test.h"
#include "test.h"
+#include <iostream>
/* 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
@@
-34,7
+36,7
@@
struct Video
{
boost::shared_ptr<Content> content;
boost::shared_ptr<const Image> image;
{
boost::shared_ptr<Content> content;
boost::shared_ptr<const Image> image;
-
DCP
Time time;
+ Time time;
};
class PlayerWrapper
};
class PlayerWrapper
@@
-43,14
+45,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, _5
));
+ _player->Video.connect (bind (&PlayerWrapper::process_video, this, _1, _
3
));
}
}
- void process_video (shared_ptr<Player
Image> i, bool, DCP
Time t)
+ void process_video (shared_ptr<Player
VideoFrame> i,
Time t)
{
Video v;
v.content = _player->_last_video;
{
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);
}
v.time = t;
_queue.push_front (v);
}
@@
-61,13
+63,13
@@
public:
if (_queue.empty ()) {
return optional<Video> ();
}
if (_queue.empty ()) {
return optional<Video> ();
}
-
+
Video v = _queue.back ();
_queue.pop_back ();
return v;
}
Video v = _queue.back ();
_queue.pop_back ();
return v;
}
- void seek (
DCP
Time t, bool ac)
+ void seek (Time t, bool ac)
{
_player->seek (t, ac);
_queue.clear ();
{
_player->seek (t, ac);
_queue.clear ();
@@
-81,7
+83,7
@@
private:
BOOST_AUTO_TEST_CASE (play_test)
{
shared_ptr<Film> film = new_test_film ("play_test");
BOOST_AUTO_TEST_CASE (play_test)
{
shared_ptr<Film> 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");
film->set_container (Ratio::from_id ("185"));
film->set_name ("play_test");
@@
-89,14
+91,14
@@
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 */
BOOST_CHECK_EQUAL (film->video_frame_rate(), 25);
/* Film should have been set to 25fps */
BOOST_CHECK_EQUAL (film->video_frame_rate(), 25);
@@
-104,8
+106,10
@@
BOOST_AUTO_TEST_CASE (play_test)
/* A is 16 frames long at 25 fps */
BOOST_CHECK_EQUAL (B->position(), 16 * TIME_HZ / 25);
/* A is 16 frames long at 25 fps */
BOOST_CHECK_EQUAL (B->position(), 16 * TIME_HZ / 25);
- shared_ptr<Player> player
= film->make_player (
);
+ shared_ptr<Player> player
(new Player (film)
);
PlayerWrapper wrap (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<Video> v = wrap.get_video ();
for (int i = 0; i < 32; ++i) {
optional<Video> v = wrap.get_video ();
@@
-117,10
+121,10
@@
BOOST_AUTO_TEST_CASE (play_test)
}
}
}
}
-
player->seek (6
* TIME_HZ / 25, true);
+
wrap.seek (10
* TIME_HZ / 25, true);
optional<Video> v = wrap.get_video ();
BOOST_CHECK (v);
optional<Video> v = wrap.get_video ();
BOOST_CHECK (v);
- BOOST_CHECK_EQUAL (v.get().time,
6
* TIME_HZ / 25);
+ BOOST_CHECK_EQUAL (v.get().time,
10
* TIME_HZ / 25);
}
#endif
}
#endif