summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-04-14 01:01:28 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-18 11:50:29 +0100
commit65b331d32c383f3a9049f29bf03ab3fe3193b31a (patch)
tree3b27e0ca60742021094cee889a1c8d1ef4d75f8c /test
parent6dd3777a0074f6f97c7f7286621006a1c14376e8 (diff)
Split audio; builds.
Diffstat (limited to 'test')
-rw-r--r--test/audio_analysis_test.cc9
-rw-r--r--test/audio_decoder_test.cc47
-rw-r--r--test/audio_delay_test.cc3
-rw-r--r--test/dcp_subtitle_test.cc5
-rw-r--r--test/frame_rate_test.cc19
-rw-r--r--test/isdcf_name_test.cc20
-rw-r--r--test/recover_test.cc3
-rw-r--r--test/reels_test.cc11
-rw-r--r--test/repeat_frame_test.cc6
-rw-r--r--test/scaling_test.cc8
-rw-r--r--test/seek_zero_test.cc4
-rw-r--r--test/skip_frame_test.cc6
-rw-r--r--test/srt_subtitle_test.cc15
-rw-r--r--test/threed_test.cc7
-rw-r--r--test/time_calculation_test.cc95
-rw-r--r--test/video_content_scale_test.cc7
-rw-r--r--test/video_decoder_fill_test.cc7
-rw-r--r--test/xml_subtitle_test.cc9
18 files changed, 149 insertions, 132 deletions
diff --git a/test/audio_analysis_test.cc b/test/audio_analysis_test.cc
index 83ed458ca..75306d8b7 100644
--- a/test/audio_analysis_test.cc
+++ b/test/audio_analysis_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2016 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
@@ -30,6 +30,7 @@
#include "lib/ffmpeg_content.h"
#include "lib/ratio.h"
#include "lib/job_manager.h"
+#include "lib/audio_content.h"
#include "test.h"
using boost::shared_ptr;
@@ -110,8 +111,8 @@ BOOST_AUTO_TEST_CASE (audio_analysis_negative_delay_test)
{
shared_ptr<Film> film = new_test_film ("audio_analysis_negative_delay_test");
film->set_name ("audio_analysis_negative_delay_test");
- shared_ptr<AudioContent> c (new FFmpegContent (film, private_data / "boon_telly.mkv"));
- c->set_audio_delay (-250);
+ shared_ptr<FFmpegContent> c (new FFmpegContent (film, private_data / "boon_telly.mkv"));
+ c->audio->set_audio_delay (-250);
film->examine_and_add_content (c);
wait_for_jobs ();
@@ -126,7 +127,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test2)
{
shared_ptr<Film> film = new_test_film ("audio_analysis_test2");
film->set_name ("audio_analysis_test2");
- shared_ptr<AudioContent> c (new FFmpegContent (film, private_data / "3d_thx_broadway_2010_lossless.m2ts"));
+ shared_ptr<FFmpegContent> c (new FFmpegContent (film, private_data / "3d_thx_broadway_2010_lossless.m2ts"));
film->examine_and_add_content (c);
wait_for_jobs ();
diff --git a/test/audio_decoder_test.cc b/test/audio_decoder_test.cc
index 2c6794a76..f714e0682 100644
--- a/test/audio_decoder_test.cc
+++ b/test/audio_decoder_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2016 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
@@ -21,11 +21,13 @@
* @brief Tests of the AudioDecoder class.
*/
-#include <cassert>
-#include <boost/test/unit_test.hpp>
#include "test.h"
+#include "lib/content.h"
#include "lib/audio_decoder.h"
-#include "lib/single_stream_audio_content.h"
+#include "lib/audio_content.h"
+#include "lib/film.h"
+#include <boost/test/unit_test.hpp>
+#include <cassert>
#include <iostream>
using std::string;
@@ -33,14 +35,14 @@ using std::cout;
using std::min;
using boost::shared_ptr;
-class TestAudioContent : public SingleStreamAudioContent
+class TestAudioContent : public Content
{
public:
TestAudioContent (shared_ptr<const Film> film)
: Content (film)
- , SingleStreamAudioContent (film)
{
- _audio_stream.reset (new AudioStream (48000, 2));
+ audio.reset (new AudioContent (this, film));
+ audio->set_stream (AudioStreamPtr (new AudioStream (48000, 2)));
}
std::string summary () const {
@@ -48,19 +50,19 @@ public:
}
DCPTime full_length () const {
- return DCPTime::from_seconds (float (audio_length()) / audio_stream()->frame_rate ());
+ return DCPTime::from_seconds (float (audio_length()) / audio->stream()->frame_rate ());
}
Frame audio_length () const {
- return llrint (61.2942 * audio_stream()->frame_rate ());
+ return llrint (61.2942 * audio->stream()->frame_rate ());
}
};
class TestAudioDecoder : public AudioDecoder
{
public:
- TestAudioDecoder (shared_ptr<TestAudioContent> content)
- : AudioDecoder (content, false)
+ TestAudioDecoder (shared_ptr<TestAudioContent> content, shared_ptr<Log> log)
+ : AudioDecoder (content->audio, false, log)
, _test_audio_content (content)
, _position (0)
{}
@@ -72,14 +74,14 @@ public:
_test_audio_content->audio_length() - _position
);
- shared_ptr<AudioBuffers> buffers (new AudioBuffers (_test_audio_content->audio_stream()->channels(), N));
- for (int i = 0; i < _test_audio_content->audio_stream()->channels(); ++i) {
+ shared_ptr<AudioBuffers> buffers (new AudioBuffers (_test_audio_content->audio->stream()->channels(), N));
+ for (int i = 0; i < _test_audio_content->audio->stream()->channels(); ++i) {
for (int j = 0; j < N; ++j) {
buffers->data(i)[j] = j + _position;
}
}
- audio (_test_audio_content->audio_stream(), buffers, ContentTime::from_frames (_position, 48000));
+ audio (_test_audio_content->audio->stream(), buffers, ContentTime::from_frames (_position, 48000));
_position += N;
return N < 2000;
@@ -88,7 +90,7 @@ public:
void seek (ContentTime t, bool accurate)
{
AudioDecoder::seek (t, accurate);
- _position = t.frames_round (_test_audio_content->resampled_audio_frame_rate ());
+ _position = t.frames_round (_test_audio_content->audio->resampled_audio_frame_rate ());
}
private:
@@ -102,8 +104,8 @@ shared_ptr<TestAudioDecoder> decoder;
static ContentAudio
get (Frame from, Frame length)
{
- decoder->seek (ContentTime::from_frames (from, content->resampled_audio_frame_rate ()), true);
- ContentAudio ca = decoder->get_audio (content->audio_stream(), from, length, true);
+ decoder->seek (ContentTime::from_frames (from, content->audio->resampled_audio_frame_rate ()), true);
+ ContentAudio ca = decoder->get_audio (content->audio->stream(), from, length, true);
BOOST_CHECK_EQUAL (ca.frame, from);
return ca;
}
@@ -112,7 +114,7 @@ static void
check (Frame from, Frame length)
{
ContentAudio ca = get (from, length);
- for (int i = 0; i < content->audio_stream()->channels(); ++i) {
+ for (int i = 0; i < content->audio->stream()->channels(); ++i) {
for (int j = 0; j < length; ++j) {
BOOST_REQUIRE_EQUAL (ca.audio->data(i)[j], j + from);
}
@@ -125,20 +127,21 @@ BOOST_AUTO_TEST_CASE (audio_decoder_get_audio_test)
shared_ptr<Film> film = new_test_film ("audio_decoder_test");
content.reset (new TestAudioContent (film));
- decoder.reset (new TestAudioDecoder (content));
+ decoder.reset (new TestAudioDecoder (content, film->log()));
/* Simple reads */
+
check (0, 48000);
check (44, 9123);
check (9991, 22);
/* Read off the end */
- Frame const from = content->resampled_audio_frame_rate() * 61;
- Frame const length = content->resampled_audio_frame_rate() * 4;
+ Frame const from = content->audio->resampled_audio_frame_rate() * 61;
+ Frame const length = content->audio->resampled_audio_frame_rate() * 4;
ContentAudio ca = get (from, length);
- for (int i = 0; i < content->audio_stream()->channels(); ++i) {
+ for (int i = 0; i < content->audio->stream()->channels(); ++i) {
for (int j = 0; j < ca.audio->frames(); ++j) {
BOOST_REQUIRE_EQUAL (ca.audio->data(i)[j], j + from);
}
diff --git a/test/audio_delay_test.cc b/test/audio_delay_test.cc
index a455110b8..f12e8717e 100644
--- a/test/audio_delay_test.cc
+++ b/test/audio_delay_test.cc
@@ -33,6 +33,7 @@
#include "lib/dcp_content_type.h"
#include "lib/ratio.h"
#include "lib/film.h"
+#include "lib/audio_content.h"
#include "test.h"
#include <iostream>
@@ -53,7 +54,7 @@ void test_audio_delay (int delay_in_ms)
film->set_name (film_name);
shared_ptr<SndfileContent> content (new SndfileContent (film, "test/data/staircase.wav"));
- content->set_audio_delay (delay_in_ms);
+ content->audio->set_audio_delay (delay_in_ms);
film->examine_and_add_content (content);
wait_for_jobs ();
diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc
index 7e13b1c1a..84ec322f8 100644
--- a/test/dcp_subtitle_test.cc
+++ b/test/dcp_subtitle_test.cc
@@ -28,6 +28,7 @@
#include "lib/ratio.h"
#include "lib/dcp_decoder.h"
#include "lib/dcp_content_type.h"
+#include "lib/subtitle_content.h"
#include "test.h"
#include <iostream>
@@ -48,8 +49,8 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test)
BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (2));
- content->set_use_subtitles (true);
- content->set_burn_subtitles (false);
+ content->subtitle->set_use_subtitles (true);
+ content->subtitle->set_burn_subtitles (false);
film->make_dcp ();
wait_for_jobs ();
diff --git a/test/frame_rate_test.cc b/test/frame_rate_test.cc
index 78d092b94..4d865de7b 100644
--- a/test/frame_rate_test.cc
+++ b/test/frame_rate_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2016 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
@@ -30,6 +30,7 @@
#include "lib/ffmpeg_audio_stream.h"
#include "lib/frame_rate_change.h"
#include "lib/video_content.h"
+#include "lib/audio_content.h"
#include "test.h"
using boost::shared_ptr;
@@ -265,34 +266,34 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
content->video->_video_frame_rate = 24;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 48000);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 48000);
stream->_frame_rate = 44100;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 48000);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 48000);
stream->_frame_rate = 80000;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 96000);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 96000);
content->video->_video_frame_rate = 23.976;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 47952);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 47952);
content->video->_video_frame_rate = 29.97;
film->set_video_frame_rate (30);
BOOST_CHECK_EQUAL (film->video_frame_rate (), 30);
stream->_frame_rate = 48000;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 47952);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 47952);
content->video->_video_frame_rate = 25;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 50000);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 50000);
content->video->_video_frame_rate = 25;
film->set_video_frame_rate (24);
stream->_frame_rate = 44100;
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), 50000);
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), 50000);
/* Check some out-there conversions (not the best) */
@@ -302,5 +303,5 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
/* The FrameRateChange within resampled_audio_frame_rate should choose to double-up
the 14.99 fps video to 30 and then run it slow at 25.
*/
- BOOST_CHECK_EQUAL (content->resampled_audio_frame_rate(), lrint (48000 * 2 * 14.99 / 25));
+ BOOST_CHECK_EQUAL (content->audio->resampled_audio_frame_rate(), lrint (48000 * 2 * 14.99 / 25));
}
diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc
index fb5e26a2d..de56d476e 100644
--- a/test/isdcf_name_test.cc
+++ b/test/isdcf_name_test.cc
@@ -24,6 +24,8 @@
#include "lib/image_content.h"
#include "lib/sndfile_content.h"
#include "lib/video_content.h"
+#include "lib/audio_mapping.h"
+#include "lib/audio_content.h"
#include "test.h"
#include <iostream>
@@ -130,31 +132,31 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
wait_for_jobs ();
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_10_4K_DI_20140704_PP_SMPTE_OV");
- AudioMapping mapping = sound->audio_mapping ();
+ AudioMapping mapping = sound->audio->audio_mapping ();
mapping.set (0, dcp::LEFT, 1.0);
- sound->set_audio_mapping (mapping);
+ sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_20_4K_DI_20140704_PP_SMPTE_OV");
mapping.set (0, dcp::RIGHT, 1.0);
- sound->set_audio_mapping (mapping);
+ sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_30_4K_DI_20140704_PP_SMPTE_OV");
mapping.set (0, dcp::LFE, 1.0);
- sound->set_audio_mapping (mapping);
+ sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_31_4K_DI_20140704_PP_SMPTE_OV");
mapping.set (0, dcp::LS, 1.0);
- sound->set_audio_mapping (mapping);
+ sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_41_4K_DI_20140704_PP_SMPTE_OV");
mapping.set (0, dcp::RS, 1.0);
- sound->set_audio_mapping (mapping);
+ sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PP_SMPTE_OV");
mapping.set (0, dcp::HI, 1.0);
- sound->set_audio_mapping (mapping);
+ sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PP_SMPTE_OV");
film->set_audio_channels (8);
mapping.set (0, dcp::HI, 1.0);
- sound->set_audio_mapping (mapping);
+ sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_61_4K_DI_20140704_PP_SMPTE_OV");
mapping.set (0, dcp::VI, 1.0);
- sound->set_audio_mapping (mapping);
+ sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71_4K_DI_20140704_PP_SMPTE_OV");
}
diff --git a/test/recover_test.cc b/test/recover_test.cc
index b650aba64..006a21646 100644
--- a/test/recover_test.cc
+++ b/test/recover_test.cc
@@ -26,6 +26,7 @@
#include "lib/dcp_content_type.h"
#include "lib/image_content.h"
#include "lib/ffmpeg_content.h"
+#include "lib/video_content.h"
#include "lib/ratio.h"
#include <dcp/mono_picture_asset.h>
#include <dcp/stereo_picture_asset.h>
@@ -86,7 +87,7 @@ BOOST_AUTO_TEST_CASE (recover_test_3d)
film->set_three_d (true);
shared_ptr<ImageContent> content (new ImageContent (film, "test/data/3d_test"));
- content->set_video_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
+ content->video->set_video_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
film->examine_and_add_content (content);
wait_for_jobs ();
diff --git a/test/reels_test.cc b/test/reels_test.cc
index 223391fad..ac4fcdd99 100644
--- a/test/reels_test.cc
+++ b/test/reels_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2015-2016 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
@@ -23,6 +23,7 @@
#include "lib/image_content.h"
#include "lib/dcp_content_type.h"
#include "lib/dcp_content.h"
+#include "lib/video_content.h"
#include "lib/text_subtitle_content.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
@@ -88,21 +89,21 @@ BOOST_AUTO_TEST_CASE (reels_test2)
shared_ptr<ImageContent> c (new ImageContent (film, "test/data/flat_red.png"));
film->examine_and_add_content (c);
wait_for_jobs ();
- c->set_video_length (24);
+ c->video->set_video_length (24);
}
{
shared_ptr<ImageContent> c (new ImageContent (film, "test/data/flat_green.png"));
film->examine_and_add_content (c);
wait_for_jobs ();
- c->set_video_length (24);
+ c->video->set_video_length (24);
}
{
shared_ptr<ImageContent> c (new ImageContent (film, "test/data/flat_blue.png"));
film->examine_and_add_content (c);
wait_for_jobs ();
- c->set_video_length (24);
+ c->video->set_video_length (24);
}
film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
@@ -192,7 +193,7 @@ BOOST_AUTO_TEST_CASE (reels_test4)
content[i].reset (new ImageContent (film, "test/data/flat_green.png"));
film->examine_and_add_content (content[i]);
wait_for_jobs ();
- content[i]->set_video_length (24);
+ content[i]->video->set_video_length (24);
}
shared_ptr<TextSubtitleContent> subs (new TextSubtitleContent (film, "test/data/subrip3.srt"));
diff --git a/test/repeat_frame_test.cc b/test/repeat_frame_test.cc
index 2e325af25..cba5e0582 100644
--- a/test/repeat_frame_test.cc
+++ b/test/repeat_frame_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2016 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
@@ -30,6 +30,7 @@
#include "lib/ratio.h"
#include "lib/ffmpeg_content.h"
#include "lib/dcp_content_type.h"
+#include "lib/video_content.h"
using boost::shared_ptr;
@@ -44,7 +45,7 @@ BOOST_AUTO_TEST_CASE (repeat_frame_test)
wait_for_jobs ();
- c->set_scale (VideoContentScale (Ratio::from_id ("185")));
+ c->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
film->set_video_frame_rate (48);
film->make_dcp ();
@@ -53,4 +54,3 @@ BOOST_AUTO_TEST_CASE (repeat_frame_test)
/* Should be 32 frames of red */
check_dcp ("test/data/repeat_frame_test", film->dir (film->dcp_name ()));
}
-
diff --git a/test/scaling_test.cc b/test/scaling_test.cc
index b6b38e126..25359c605 100644
--- a/test/scaling_test.cc
+++ b/test/scaling_test.cc
@@ -26,14 +26,15 @@
#include "lib/ratio.h"
#include "lib/film.h"
#include "lib/dcp_content_type.h"
+#include "lib/video_content.h"
#include "test.h"
using std::string;
using boost::shared_ptr;
-static void scaling_test_for (shared_ptr<Film> film, shared_ptr<VideoContent> content, string image, string container)
+static void scaling_test_for (shared_ptr<Film> film, shared_ptr<Content> content, string image, string container)
{
- content->set_scale (VideoContentScale (Ratio::from_id (image)));
+ content->video->set_scale (VideoContentScale (Ratio::from_id (image)));
film->set_container (Ratio::from_id (container));
film->make_dcp ();
@@ -64,7 +65,7 @@ BOOST_AUTO_TEST_CASE (scaling_test)
wait_for_jobs ();
- imc->set_video_length (1);
+ imc->video->set_video_length (1);
/* F-133: 133 image in a flat container */
scaling_test_for (film, imc, "133", "185");
@@ -80,4 +81,3 @@ BOOST_AUTO_TEST_CASE (scaling_test)
/* S: scope image in a scope container */
scaling_test_for (film, imc, "239", "239");
}
-
diff --git a/test/seek_zero_test.cc b/test/seek_zero_test.cc
index ad8ecb09f..612a5f548 100644
--- a/test/seek_zero_test.cc
+++ b/test/seek_zero_test.cc
@@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE (seek_zero_test)
shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/count300bd48.m2ts"));
film->examine_and_add_content (content);
wait_for_jobs ();
- content->set_scale (VideoContentScale (Ratio::from_id ("185")));
+ content->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
/* Work out the first video frame index that we will be given, taking into account
* the difference between first video and first audio.
@@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE (seek_zero_test)
video_delay = ContentTime ();
}
- Frame const first_frame = video_delay.round_up (content->video_frame_rate ()).frames_round (content->video_frame_rate ());
+ Frame const first_frame = video_delay.round_up (content->video->video_frame_rate ()).frames_round (content->video->video_frame_rate ());
FFmpegDecoder decoder (content, film->log(), false);
list<ContentVideo> a = decoder.get_video (first_frame, true);
diff --git a/test/skip_frame_test.cc b/test/skip_frame_test.cc
index da3997fc7..6f3e2eff4 100644
--- a/test/skip_frame_test.cc
+++ b/test/skip_frame_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2016 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
@@ -30,6 +30,7 @@
#include "lib/ratio.h"
#include "lib/ffmpeg_content.h"
#include "lib/dcp_content_type.h"
+#include "lib/video_content.h"
using boost::shared_ptr;
@@ -44,7 +45,7 @@ BOOST_AUTO_TEST_CASE (skip_frame_test)
wait_for_jobs ();
- c->set_scale (VideoContentScale (Ratio::from_id ("185")));
+ c->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
film->write_metadata ();
film->set_video_frame_rate (24);
@@ -56,4 +57,3 @@ BOOST_AUTO_TEST_CASE (skip_frame_test)
*/
check_dcp ("test/data/skip_frame_test", film->dir (film->dcp_name ()));
}
-
diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc
index 918cdba79..b6dce58f4 100644
--- a/test/srt_subtitle_test.cc
+++ b/test/srt_subtitle_test.cc
@@ -26,6 +26,7 @@
#include "lib/dcp_content_type.h"
#include "lib/font.h"
#include "lib/ratio.h"
+#include "lib/subtitle_content.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
#include <boost/algorithm/string.hpp>
@@ -46,8 +47,8 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test)
film->examine_and_add_content (content);
wait_for_jobs ();
- content->set_use_subtitles (true);
- content->set_burn_subtitles (false);
+ content->subtitle->set_use_subtitles (true);
+ content->subtitle->set_burn_subtitles (false);
film->make_dcp ();
wait_for_jobs ();
@@ -66,10 +67,10 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test2)
film->examine_and_add_content (content);
wait_for_jobs ();
- content->set_use_subtitles (true);
- content->set_burn_subtitles (false);
+ content->subtitle->set_use_subtitles (true);
+ content->subtitle->set_burn_subtitles (false);
/* Use test/data/subrip2.srt as if it were a font file */
- content->fonts().front()->set_file (FontFiles::NORMAL, "test/data/subrip2.srt");
+ content->subtitle->fonts().front()->set_file (FontFiles::NORMAL, "test/data/subrip2.srt");
film->make_dcp ();
wait_for_jobs ();
@@ -91,8 +92,8 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test3)
film->examine_and_add_content (content);
wait_for_jobs ();
- content->set_use_subtitles (true);
- content->set_burn_subtitles (false);
+ content->subtitle->set_use_subtitles (true);
+ content->subtitle->set_burn_subtitles (false);
film->make_dcp ();
wait_for_jobs ();
diff --git a/test/threed_test.cc b/test/threed_test.cc
index d71ad5b77..05fd77a8a 100644
--- a/test/threed_test.cc
+++ b/test/threed_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2016 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
@@ -27,6 +27,7 @@
#include "lib/ratio.h"
#include "lib/dcp_content_type.h"
#include "lib/ffmpeg_content.h"
+#include "lib/video_content.h"
#include <iostream>
using std::cout;
@@ -37,12 +38,12 @@ BOOST_AUTO_TEST_CASE (threed_test)
shared_ptr<Film> film = new_test_film ("threed_test");
film->set_name ("test_film2");
shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
- c->set_video_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
+ c->video->set_video_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
film->examine_and_add_content (c);
wait_for_jobs ();
- c->set_scale (VideoContentScale (Ratio::from_id ("185")));
+ c->video->set_scale (VideoContentScale (Ratio::from_id ("185")));
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
diff --git a/test/time_calculation_test.cc b/test/time_calculation_test.cc
index 272d3edfe..7c8259f97 100644
--- a/test/time_calculation_test.cc
+++ b/test/time_calculation_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2015-2016 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
@@ -19,6 +19,7 @@
#include "lib/film.h"
#include "lib/ffmpeg_content.h"
+#include "lib/video_content.h"
#include "lib/player.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
@@ -127,19 +128,19 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
/* 25fps content, 25fps DCP */
film->set_video_frame_rate (25);
- BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video_length() / 25.0));
+ BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() / 25.0));
/* 25fps content, 24fps DCP; length should be increased */
film->set_video_frame_rate (24);
- BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video_length() / 24.0));
+ BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() / 24.0));
/* 25fps content, 30fps DCP; length should be decreased */
film->set_video_frame_rate (30);
- BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video_length() / 30.0));
+ BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() / 30.0));
/* 25fps content, 50fps DCP; length should be the same */
film->set_video_frame_rate (50);
- BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video_length() / 25.0));
+ BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() / 25.0));
/* 25fps content, 60fps DCP; length should be decreased */
film->set_video_frame_rate (60);
- BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video_length() * (50.0 / 60) / 25.0));
+ BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (content->video->video_length() * (50.0 / 60) / 25.0));
}
/** Test Player::dcp_to_content_video */
@@ -160,7 +161,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
/* Position 0, no trim, content rate = DCP rate */
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -172,7 +173,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
/* Position 3s, no trim, content rate = DCP rate */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -186,7 +187,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
/* Position 3s, 1.5s trim, content rate = DCP rate */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -203,7 +204,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (25);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -215,7 +216,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
/* Position 3s, no trim, content rate 24, DCP rate 25 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (25);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -231,7 +232,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
*/
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.6));
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (25);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -250,7 +251,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (48);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -262,7 +263,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
/* Position 3s, no trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (48);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -276,7 +277,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
/* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (48);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -294,7 +295,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (48);
+ content->video->set_video_frame_rate (48);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -306,7 +307,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
/* Position 3s, no trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (48);
+ content->video->set_video_frame_rate (48);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -320,7 +321,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
/* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->set_video_frame_rate (48);
+ content->video->set_video_frame_rate (48);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -334,7 +335,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
/* Position 0s, no trim, content rate 29.9978733, DCP rate 30 */
content->set_position (DCPTime::from_seconds (0));
content->set_trim_start (ContentTime::from_seconds (0));
- content->set_video_frame_rate (29.9978733);
+ content->video->set_video_frame_rate (29.9978733);
film->set_video_frame_rate (30);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -365,7 +366,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
/* Position 0, no trim, content rate = DCP rate */
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -377,7 +378,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
/* Position 3s, no trim, content rate = DCP rate */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -389,7 +390,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
/* Position 3s, 1.5s trim, content rate = DCP rate */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -405,7 +406,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (25);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -417,7 +418,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
/* Position 3s, no trim, content rate 24, DCP rate 25 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (25);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -429,7 +430,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
/* Position 3s, 1.6s trim, content rate 24, DCP rate 25, so the 1.6s trim is at 24fps */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.6));
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (25);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -447,7 +448,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (48);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -459,7 +460,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
/* Position 3s, no trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (48);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -471,7 +472,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
/* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (48);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -488,7 +489,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (48);
+ content->video->set_video_frame_rate (48);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -500,7 +501,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
/* Position 3s, no trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (48);
+ content->video->set_video_frame_rate (48);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -512,7 +513,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
/* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->set_video_frame_rate (48);
+ content->video->set_video_frame_rate (48);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
@@ -542,7 +543,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Position 0, no trim, video/audio content rate = video/audio DCP rate */
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
@@ -555,7 +556,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Position 3s, no trim, video/audio content rate = video/audio DCP rate */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
@@ -570,7 +571,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Position 3s, 1.5s trim, video/audio content rate = video/audio DCP rate */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
@@ -585,7 +586,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Position 0, no trim, content video rate 24, DCP video rate 25, both audio rates still 48k */
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (25);
stream->_frame_rate = 48000;
player->setup_pieces ();
@@ -598,7 +599,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Position 3s, no trim, content video rate 24, DCP rate 25, both audio rates still 48k. */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (25);
stream->_frame_rate = 48000;
player->setup_pieces ();
@@ -615,7 +616,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
*/
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.6));
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (25);
stream->_frame_rate = 48000;
player->setup_pieces ();
@@ -634,7 +635,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (48);
stream->_frame_rate = 48000;
player->setup_pieces ();
@@ -647,7 +648,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Position 3s, no trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
@@ -662,7 +663,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
@@ -680,7 +681,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (48);
stream->_frame_rate = 48000;
player->setup_pieces ();
@@ -693,7 +694,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Position 3s, no trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
@@ -708,7 +709,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
@@ -723,7 +724,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Position 0, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 44100;
player->setup_pieces ();
@@ -736,7 +737,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Position 3s, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 44100;
player->setup_pieces ();
@@ -751,7 +752,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Position 3s, 1.5s trim, video content rate = video DCP rate, content audio rate = 44.1k */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 44100;
player->setup_pieces ();
@@ -766,7 +767,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
/* Check with a large start trim */
content->set_position (DCPTime::from_seconds (0));
content->set_trim_start (ContentTime::from_seconds (54143));
- content->set_video_frame_rate (24);
+ content->video->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
diff --git a/test/video_content_scale_test.cc b/test/video_content_scale_test.cc
index 1acac8a37..78f3bf9b0 100644
--- a/test/video_content_scale_test.cc
+++ b/test/video_content_scale_test.cc
@@ -20,6 +20,7 @@
#include <boost/test/unit_test.hpp>
#include "lib/ffmpeg_content.h"
#include "lib/ratio.h"
+#include "lib/video_content.h"
using std::list;
using std::string;
@@ -88,7 +89,7 @@ test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop
doc->read_string(s.str ());
list<string> notes;
- shared_ptr<VideoContent> vc (new FFmpegContent (film, doc, 10, notes));
+ shared_ptr<FFmpegContent> vc (new FFmpegContent (film, doc, 10, notes));
optional<VideoContentScale> sc;
if (ratio) {
@@ -97,9 +98,9 @@ test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop
sc = VideoContentScale (scale);
}
- dcp::Size answer = sc.get().size (vc, display_size, film_size);
+ dcp::Size answer = sc.get().size (vc->video, display_size, film_size);
if (answer != correct) {
- cerr << "Testing " << vc->video_size().width << "x" << vc->video_size().height << "\n";
+ cerr << "Testing " << vc->video->video_size().width << "x" << vc->video->video_size().height << "\n";
cerr << "Testing " << display_size.width << "x" << display_size.height << "\n";
cerr << answer.width << "x" << answer.height << " instead of " << correct.width << "x" << correct.height << "\n";
}
diff --git a/test/video_decoder_fill_test.cc b/test/video_decoder_fill_test.cc
index 67e84b713..190a469d0 100644
--- a/test/video_decoder_fill_test.cc
+++ b/test/video_decoder_fill_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2016 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
@@ -20,6 +20,7 @@
#include <boost/test/unit_test.hpp>
#include "lib/image_decoder.h"
#include "lib/image_content.h"
+#include "lib/film.h"
#include "test.h"
#include <iostream>
@@ -31,7 +32,7 @@ BOOST_AUTO_TEST_CASE (video_decoder_fill_test1)
{
shared_ptr<Film> film = new_test_film ("video_decoder_fill_test");
shared_ptr<ImageContent> c (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
- ImageDecoder decoder (c);
+ ImageDecoder decoder (c, film->log());
decoder.fill_one_eye (0, 4, EYES_BOTH);
BOOST_CHECK_EQUAL (decoder._decoded_video.size(), 4U);
@@ -56,7 +57,7 @@ BOOST_AUTO_TEST_CASE (video_decoder_fill_test2)
{
shared_ptr<Film> film = new_test_film ("video_decoder_fill_test");
shared_ptr<ImageContent> c (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
- ImageDecoder decoder (c);
+ ImageDecoder decoder (c, film->log());
decoder.fill_both_eyes (0, 4, EYES_LEFT);
BOOST_CHECK_EQUAL (decoder._decoded_video.size(), 8);
diff --git a/test/xml_subtitle_test.cc b/test/xml_subtitle_test.cc
index 0d7384797..8b051d0d1 100644
--- a/test/xml_subtitle_test.cc
+++ b/test/xml_subtitle_test.cc
@@ -26,6 +26,7 @@
#include "lib/film.h"
#include "lib/ratio.h"
#include "lib/dcp_content_type.h"
+#include "lib/subtitle_content.h"
#include "test.h"
#include <iostream>
@@ -40,8 +41,8 @@ BOOST_AUTO_TEST_CASE (xml_subtitle_test)
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
film->set_name ("frobozz");
shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
- content->set_use_subtitles (true);
- content->set_burn_subtitles (false);
+ content->subtitle->set_use_subtitles (true);
+ content->subtitle->set_burn_subtitles (false);
film->examine_and_add_content (content);
wait_for_jobs ();
film->make_dcp ();
@@ -61,8 +62,8 @@ BOOST_AUTO_TEST_CASE (xml_subtitle_test2)
film->set_interop (true);
film->set_sequence (false);
shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
- content->set_use_subtitles (true);
- content->set_burn_subtitles (false);
+ content->subtitle->set_use_subtitles (true);
+ content->subtitle->set_burn_subtitles (false);
film->examine_and_add_content (content);
film->examine_and_add_content (content);
wait_for_jobs ();