#include "lib/audio_content.h"
-#include "lib/film.h"
+#include "lib/content_factory.h"
+#include "lib/dcp_content.h"
#include "lib/dcp_content_type.h"
+#include "lib/film.h"
#include "lib/ratio.h"
-#include "lib/content_factory.h"
+#include "lib/text_content.h"
#include "lib/video_content.h"
#include "test.h"
#include <dcp/cpl.h>
+#include <dcp/mono_j2k_picture_asset.h>
+#include <dcp/mono_j2k_picture_frame.h>
+#include <dcp/openjpeg_image.h>
#include <dcp/reel.h>
-#include <dcp/reel_sound_asset.h>
#include <dcp/reel_picture_asset.h>
+#include <dcp/reel_sound_asset.h>
#include <dcp/sound_asset.h>
-#include <dcp/mono_picture_asset.h>
-#include <dcp/mono_picture_frame.h>
-#include <dcp/openjpeg_image.h>
#include <boost/test/unit_test.hpp>
#include <iostream>
-using std::list;
using std::cout;
-using std::shared_ptr;
using std::dynamic_pointer_cast;
+using std::list;
+using std::make_shared;
+using std::shared_ptr;
using namespace dcpomatic;
film->set_sequence (false);
/* Staircase at an offset of 2000 samples, trimmed both start and end, with a gain of exactly 2 (linear) */
- auto staircase = content_factory("test/data/staircase.wav").front();
+ auto staircase = content_factory("test/data/staircase.wav")[0];
film->examine_and_add_content (staircase);
BOOST_REQUIRE (!wait_for_jobs());
staircase->set_position (film, DCPTime::from_frames(2000, film->audio_frame_rate()));
- staircase->set_trim_start (ContentTime::from_frames(12, 48000));
+ staircase->set_trim_start(film, ContentTime::from_frames(12, 48000));
staircase->set_trim_end (ContentTime::from_frames (35, 48000));
staircase->audio->set_gain (20 * log10(2));
/* And again at an offset of 50000 samples, trimmed both start and end, with a gain of exactly 2 (linear) */
- staircase = content_factory("test/data/staircase.wav").front();
+ staircase = content_factory("test/data/staircase.wav")[0];
film->examine_and_add_content (staircase);
BOOST_REQUIRE (!wait_for_jobs());
staircase->set_position (film, DCPTime::from_frames(50000, film->audio_frame_rate()));
- staircase->set_trim_start (ContentTime::from_frames(12, 48000));
+ staircase->set_trim_start(film, ContentTime::from_frames(12, 48000));
staircase->set_trim_end (ContentTime::from_frames(35, 48000));
staircase->audio->set_gain (20 * log10(2));
/* 1s of red at 5s in */
- auto red = content_factory("test/data/flat_red.png").front();
+ auto red = content_factory("test/data/flat_red.png")[0];
film->examine_and_add_content (red);
BOOST_REQUIRE (!wait_for_jobs());
red->set_position (film, DCPTime::from_seconds(5));
auto reel_picture = reels.front()->main_picture();
BOOST_REQUIRE (reel_picture);
- auto picture = dynamic_pointer_cast<dcp::MonoPictureAsset> (reel_picture->asset());
+ auto picture = dynamic_pointer_cast<dcp::MonoJ2KPictureAsset>(reel_picture->asset());
BOOST_REQUIRE (picture);
BOOST_CHECK_EQUAL (picture->intrinsic_duration(), 144);
for (int c = 0; c < 3; ++c) {
for (int y = 0; y < size.height; ++y) {
for (int x = 0; x < size.width; ++x) {
- BOOST_REQUIRE (image->data(c)[y * size.height + x] <= 3);
+ BOOST_REQUIRE (image->data(c)[y * size.height + x] <= 5);
}
}
}
}
}
+
+
+BOOST_AUTO_TEST_CASE(multi_reel_interop_ccap_test)
+{
+ auto pic1 = content_factory("test/data/flat_red.png").front();
+ auto ccap1 = content_factory("test/data/15s.srt").front();
+ auto pic2 = content_factory("test/data/flat_red.png").front();
+ auto ccap2 = content_factory("test/data/15s.srt").front();
+ auto film1 = new_test_film2("multi_reel_interop_ccap_test1", { pic1, ccap1, pic2, ccap2 });
+ film1->set_interop(true);
+ film1->set_reel_type(ReelType::BY_VIDEO_CONTENT);
+ ccap1->text[0]->set_type(TextType::CLOSED_CAPTION);
+ pic1->video->set_length(15 * 24);
+ ccap2->text[0]->set_type(TextType::CLOSED_CAPTION);
+ pic2->video->set_length(15 * 24);
+ make_and_verify_dcp(film1, { dcp::VerificationNote::Code::INVALID_STANDARD, dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING });
+
+ auto reload = make_shared<DCPContent>(film1->dir(film1->dcp_name()));
+ auto film2 = new_test_film2("multi_reel_interop_ccap_test2", { reload });
+ for (auto i: reload->text) {
+ i->set_use(true);
+ }
+ film2->set_interop(true);
+ make_and_verify_dcp(film2, { dcp::VerificationNote::Code::INVALID_STANDARD, dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING });
+}
+