*/
-#include <boost/test/unit_test.hpp>
-#include "lib/film.h"
-#include "lib/ffmpeg_content.h"
#include "lib/dcp_content_type.h"
-#include "lib/video_content.h"
-#include "lib/ratio.h"
#include "lib/dcpomatic_log.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/film.h"
+#include "lib/ratio.h"
+#include "lib/video_content.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
-using std::shared_ptr;
using std::make_shared;
#include <boost/test/unit_test.hpp>
+using std::make_shared;
using std::string;
using std::vector;
-using std::make_shared;
using boost::optional;
-using std::shared_ptr;
BOOST_AUTO_TEST_CASE (atmos_passthrough_test)
using std::make_shared;
-using std::shared_ptr;
using std::vector;
using namespace dcpomatic;
using std::cout;
using std::make_shared;
-using std::shared_ptr;
using std::string;
using boost::lexical_cast;
using std::make_shared;
-using std::shared_ptr;
static void
using std::cerr;
using std::cout;
using std::make_shared;
-using std::shared_ptr;
#define CHECK_SAMPLE(c,f,r) \
#include <boost/test/unit_test.hpp>
-using std::shared_ptr;
using std::make_shared;
*/
+
#include "lib/audio_ring_buffers.h"
#include <boost/test/unit_test.hpp>
-#include <iostream>
-using std::cout;
+
using std::make_shared;
-using std::shared_ptr;
using namespace dcpomatic;
+
#define CANARY 9999
+
/* XXX: these tests don't check the timestamping in AudioRingBuffers */
/** Basic tests fetching the same number of channels as went in */
*/
+
/** @file test/burnt_subtitle_test.cc
* @brief Test the burning of subtitles into the DCP.
* @ingroup feature
*/
-#include "lib/plain_text_content.h"
+
+#include "lib/config.h"
+#include "lib/content_factory.h"
+#include "lib/dcp_content.h"
+#include "lib/dcp_content_type.h"
#include "lib/dcp_text_content.h"
#include "lib/film.h"
+#include "lib/log_entry.h"
+#include "lib/plain_text_content.h"
#include "lib/ratio.h"
-#include "lib/dcp_content_type.h"
#include "lib/text_content.h"
-#include "lib/dcp_content.h"
-#include "lib/content_factory.h"
-#include "lib/config.h"
-#include "lib/log_entry.h"
#include "test.h"
#include <dcp/dcp.h>
#include <dcp/cpl.h>
#include <dcp/reel_picture_asset.h>
#include <dcp/reel_mono_picture_asset.h>
#include <boost/test/unit_test.hpp>
-#include <iostream>
-using std::cout;
-using std::map;
-using std::shared_ptr;
+
using std::dynamic_pointer_cast;
using std::make_shared;
+using std::map;
using namespace dcpomatic;
+
/** Build a small DCP with no picture and a single subtitle overlaid onto it from a SubRip file */
BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip)
{
using std::make_shared;
-using std::shared_ptr;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
*/
+
#include "lib/film.h"
-#include "lib/text_content.h"
#include "lib/string_text_file_content.h"
+#include "lib/text_content.h"
#include "test.h"
-#include <dcp/dcp.h>
#include <dcp/cpl.h>
+#include <dcp/dcp.h>
#include <dcp/reel.h>
#include <dcp/reel_closed_caption_asset.h>
#include <boost/test/unit_test.hpp>
+
using std::list;
using std::make_shared;
-using std::shared_ptr;
+
/** Basic test that Interop closed captions are written */
BOOST_AUTO_TEST_CASE (closed_caption_test1)
using std::cout;
using std::make_shared;
-using std::shared_ptr;
BOOST_AUTO_TEST_CASE (colour_conversion_test1)
#include <boost/test/unit_test.hpp>
-using std::shared_ptr;
using namespace dcpomatic;
using std::make_shared;
-using std::shared_ptr;
using std::string;
using namespace boost::filesystem;
string const ov_name = "hash_added_to_imported_dcp_test_ov";
- shared_ptr<Film> ov = new_test_film2 (
+ auto ov = new_test_film2(
ov_name,
content_factory("test/data/flat_red.png")
);
using std::list;
+using std::make_shared;
using std::string;
using std::vector;
-using std::make_shared;
-using std::shared_ptr;
/* Check that DCPDecoder reuses old data when it should */
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs ());
- shared_ptr<DCPDecoder> decoder (new DCPDecoder (film, content, false, false, shared_ptr<DCPDecoder>()));
+ auto decoder = make_shared<DCPDecoder>(film, content, false, false, shared_ptr<DCPDecoder>());
decoder->only_text()->PlainStart.connect (bind (store, _1));
stored = optional<ContentStringText> ();
*/
-#include "lib/film.h"
-#include "lib/image_content.h"
-#include "lib/dcp_content_type.h"
#include "lib/compose.hpp"
#include "lib/config.h"
+#include "lib/dcp_content_type.h"
+#include "lib/film.h"
+#include "lib/image_content.h"
#include "test.h"
#include <dcp/cpl.h>
#include <dcp/reel.h>
using std::list;
-using std::string;
-using std::shared_ptr;
using std::make_shared;
+using std::string;
static string
using std::make_shared;
using std::string;
-using std::shared_ptr;
BOOST_AUTO_TEST_CASE (ffmpeg_audio_test)
*/
-#include <boost/test/unit_test.hpp>
-#include <boost/filesystem.hpp>
-#include <boost/algorithm/string.hpp>
-#include "lib/film.h"
+#include "lib/dcp_content_type.h"
#include "lib/ffmpeg_content.h"
+#include "lib/film.h"
#include "lib/ratio.h"
-#include "lib/dcp_content_type.h"
#include "lib/video_content.h"
#include "test.h"
+#include <boost/algorithm/string.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/test/unit_test.hpp>
using std::make_shared;
-using std::shared_ptr;
BOOST_AUTO_TEST_CASE (ffmpeg_dcp_test)
#include <boost/test/unit_test.hpp>
-using std::string;
-using std::shared_ptr;
using std::make_shared;
+using std::string;
using namespace dcpomatic;
/** 7.1/HI/VI (i.e. 12-channel) project */
BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test9)
{
- shared_ptr<Film> film = new_test_film ("ffmpeg_encoder_prores_test9");
- film->set_name ("ffmpeg_encoder_prores_test9");
auto c = make_shared<ImageContent>(TestPaths::private_data() / "bbc405.png");
+ auto film = new_test_film2("ffmpeg_encoder_prores_test9", { c });
+ film->set_name ("ffmpeg_encoder_prores_test9");
film->set_container (Ratio::from_id ("185"));
film->set_audio_channels (12);
using std::make_shared;
-using std::shared_ptr;
using namespace dcpomatic;
*/
-#include <boost/test/unit_test.hpp>
-#include "lib/film.h"
-#include "lib/ffmpeg_decoder.h"
-#include "lib/ffmpeg_content.h"
-#include "lib/ffmpeg_audio_stream.h"
#include "lib/audio_content.h"
+#include "lib/ffmpeg_audio_stream.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/ffmpeg_decoder.h"
+#include "lib/film.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
using std::make_shared;
using std::make_shared;
-using std::shared_ptr;
using std::string;
*/
+
/** @file test/frame_rate_test.cc
* @brief Tests for FrameRateChange and the computation of the best
* frame rate for the DCP.
* @ingroup feature
*/
-#include <boost/test/unit_test.hpp>
-#include "lib/film.h"
+
+#include "lib/audio_content.h"
#include "lib/config.h"
-#include "lib/ffmpeg_content.h"
-#include "lib/playlist.h"
#include "lib/ffmpeg_audio_stream.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/film.h"
#include "lib/frame_rate_change.h"
+#include "lib/playlist.h"
#include "lib/video_content.h"
-#include "lib/audio_content.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+
-using std::shared_ptr;
/* Test Playlist::best_dcp_frame_rate and FrameRateChange
with a single piece of content.
using std::string;
using std::list;
-using std::shared_ptr;
BOOST_AUTO_TEST_CASE (image_content_fade_test)
using std::make_shared;
-using std::shared_ptr;
static const boost::filesystem::path data_file0 = TestPaths::private_data() / "player_seek_test_0.png";
using std::dynamic_pointer_cast;
using std::make_shared;
using std::map;
-using std::shared_ptr;
using std::string;
using std::vector;
using std::make_shared;
-using std::shared_ptr;
/** Interrupt a DCP encode when it is in progress, as this used to (still does?)
using std::make_shared;
using std::string;
-using std::shared_ptr;
static void
using std::string;
using boost::optional;
-using std::shared_ptr;
/** Check that FFOC and LFOC are automatically added if not specified */
using std::dynamic_pointer_cast;
using std::make_shared;
-using std::shared_ptr;
/** Overlay two video-only bits of content, don't use the video on one and
using std::dynamic_pointer_cast;
using std::getline;
using std::ifstream;
-using std::shared_ptr;
using std::string;
using std::vector;
using boost::starts_with;
#include <dcp/openjpeg_image.h>
#include <dcp/reel.h>
#include <dcp/reel_mono_picture_asset.h>
-#include <boost/shared_ptr.hpp>
#include <boost/test/unit_test.hpp>
*/
-#include "test.h"
#include "lib/content.h"
#include "lib/content_factory.h"
#include "lib/film.h"
+#include "test.h"
#include <boost/test/unit_test.hpp>
-using std::shared_ptr;
-
-
BOOST_AUTO_TEST_CASE (pulldown_detect_test1)
{
- shared_ptr<Film> film = new_test_film2 ("pulldown_detect_test1");
- shared_ptr<Content> content = content_factory(TestPaths::private_data() / "greatbrain.mkv")[0];
- film->examine_and_add_content (content);
- BOOST_REQUIRE (!wait_for_jobs());
- BOOST_REQUIRE (static_cast<bool>(content->video_frame_rate()));
- BOOST_CHECK_CLOSE (content->video_frame_rate().get(), 23.976, 0.1);
+ auto content = content_factory(TestPaths::private_data() / "greatbrain.mkv");
+ auto film = new_test_film2("pulldown_detect_test1", content);
+
+ BOOST_REQUIRE(static_cast<bool>(content[0]->video_frame_rate()));
+ BOOST_CHECK_CLOSE(content[0]->video_frame_rate().get(), 23.976, 0.1);
}
using std::cout;
using std::make_shared;
-using std::shared_ptr;
using std::string;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
BOOST_AUTO_TEST_CASE (recover_test_2d)
{
- shared_ptr<Film> film = new_test_film ("recover_test_2d");
+ auto film = new_test_film("recover_test_2d");
film->set_interop (false);
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
film->set_container (Ratio::from_id ("185"));
film->set_name ("recover_test");
- shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/count300bd24.m2ts"));
+ auto content = make_shared<FFmpegContent>("test/data/count300bd24.m2ts");
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());
make_and_verify_dcp (film, { dcp::VerificationNote::Code::MISSING_FFEC_IN_FEATURE, dcp::VerificationNote::Code::MISSING_FFMC_IN_FEATURE });
- shared_ptr<dcp::MonoPictureAsset> A (new dcp::MonoPictureAsset ("build/test/recover_test_2d/original.mxf"));
- shared_ptr<dcp::MonoPictureAsset> B (new dcp::MonoPictureAsset (video));
+ auto A = make_shared<dcp::MonoPictureAsset>("build/test/recover_test_2d/original.mxf");
+ auto B = make_shared<dcp::MonoPictureAsset>(video);
dcp::EqualityOptions eq;
BOOST_CHECK (A->equals (B, eq, boost::bind (¬e, _1, _2)));
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
{
- shared_ptr<ImageContent> c (new ImageContent("test/data/flat_red.png"));
+ auto c = make_shared<ImageContent>("test/data/flat_red.png");
film->examine_and_add_content (c);
BOOST_REQUIRE (!wait_for_jobs());
c->video->set_length (24);
}
{
- shared_ptr<ImageContent> c (new ImageContent("test/data/flat_green.png"));
+ auto c = make_shared<ImageContent>("test/data/flat_green.png");
film->examine_and_add_content (c);
BOOST_REQUIRE (!wait_for_jobs());
c->video->set_length (24);
}
{
- shared_ptr<ImageContent> c (new ImageContent("test/data/flat_blue.png"));
+ auto c = make_shared<ImageContent>("test/data/flat_blue.png");
film->examine_and_add_content (c);
BOOST_REQUIRE (!wait_for_jobs());
c->video->set_length (24);
/* 4 piece of 1s-long content */
shared_ptr<ImageContent> content[4];
for (int i = 0; i < 4; ++i) {
- content[i].reset (new ImageContent("test/data/flat_green.png"));
+ content[i] = make_shared<ImageContent>("test/data/flat_green.png");
film->examine_and_add_content (content[i]);
BOOST_REQUIRE (!wait_for_jobs());
content[i]->video->set_length (24);
*/
-#include "lib/ffmpeg_content.h"
+#include "lib/config.h"
#include "lib/content_factory.h"
-#include "lib/text_content.h"
-#include "lib/job_manager.h"
-#include "lib/film.h"
#include "lib/dcp_content.h"
#include "lib/examine_content_job.h"
-#include "lib/config.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/film.h"
+#include "lib/job_manager.h"
+#include "lib/text_content.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
#include <iostream>
-using std::string;
-using std::vector;
-using std::shared_ptr;
using std::dynamic_pointer_cast;
using std::make_shared;
+using std::string;
+using std::vector;
using boost::optional;
#include <boost/test/unit_test.hpp>
-using std::shared_ptr;
using std::dynamic_pointer_cast;
using std::make_shared;
-using std::shared_ptr;
BOOST_AUTO_TEST_CASE (repeat_frame_test)
using std::dynamic_pointer_cast;
using std::make_shared;
-using std::shared_ptr;
void check_within_n (int64_t a, int64_t b, int64_t n)
using std::cout;
using std::make_shared;
using std::pair;
-using std::shared_ptr;
static void
-#include "lib/shuffler.h"
-#include "lib/piece.h"
+/*
+ Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
#include "lib/content_video.h"
+#include "lib/piece.h"
+#include "lib/shuffler.h"
#include <boost/test/unit_test.hpp>
+
using std::list;
+using std::make_shared;
using std::shared_ptr;
using std::weak_ptr;
using boost::optional;
static void
push (Shuffler& s, int frame, Eyes eyes)
{
- shared_ptr<Piece> piece (new Piece (shared_ptr<Content>(), shared_ptr<Decoder>(), FrameRateChange(24, 24)));
+ auto piece = make_shared<Piece>(shared_ptr<Content>(), shared_ptr<Decoder>(), FrameRateChange(24, 24));
ContentVideo cv;
cv.frame = frame;
cv.eyes = eyes;
using std::make_shared;
using std::string;
-using std::shared_ptr;
using boost::lexical_cast;
#include "lib/video_content.h"
-using std::shared_ptr;
using std::make_shared;
*/
-#include "lib/film.h"
-#include "lib/string_text_file_content.h"
#include "lib/dcp_content_type.h"
+#include "lib/film.h"
#include "lib/font.h"
#include "lib/ratio.h"
+#include "lib/string_text_file_content.h"
#include "lib/text_content.h"
#include "test.h"
#include <dcp/smpte_subtitle_asset.h>
#include <dcp/subtitle_string.h>
-#include <boost/test/unit_test.hpp>
#include <boost/algorithm/string.hpp>
+#include <boost/test/unit_test.hpp>
#include <list>
-using std::string;
using std::list;
-using std::shared_ptr;
using std::make_shared;
+using std::shared_ptr;
+using std::string;
using namespace dcpomatic;
*/
-#include "lib/film.h"
-#include "lib/string_text_file_content.h"
#include "lib/dcp_content_type.h"
+#include "lib/film.h"
#include "lib/font.h"
#include "lib/ratio.h"
+#include "lib/string_text_file_content.h"
#include "lib/text_content.h"
#include "test.h"
#include <dcp/interop_subtitle_asset.h>
#include <boost/algorithm/string.hpp>
-using std::string;
using std::list;
-using std::shared_ptr;
using std::make_shared;
+using std::string;
/** Make a DCP with subs from a .ssa file */
*/
+
/** @test test/stream_test.cc
* @brief Some simple tests of FFmpegAudioStream.
*/
-#include "lib/film.h"
-#include "lib/ffmpeg_content.h"
+
#include "lib/ffmpeg_audio_stream.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/film.h"
#include <libcxml/cxml.h>
#include <dcp/warnings.h>
LIBDCP_DISABLE_WARNINGS
LIBDCP_ENABLE_WARNINGS
#include <boost/test/unit_test.hpp>
-using std::pair;
+
using std::list;
-using std::shared_ptr;
+using std::pair;
+
BOOST_AUTO_TEST_CASE (stream_test)
{
xmlpp::Document doc;
- xmlpp::Element* root = doc.create_root_node ("FFmpegAudioStream");
+ auto root = doc.create_root_node("FFmpegAudioStream");
root->add_child("Name")->add_child_text ("hello there world");
root->add_child("Id")->add_child_text ("4");
root->add_child("FrameRate")->add_child_text ("44100");
/* This is the state file version 5 description of the mapping */
- xmlpp::Element* mapping = root->add_child("Mapping");
+ auto mapping = root->add_child("Mapping");
mapping->add_child("ContentChannels")->add_child_text ("2");
{
/* L -> L */
- xmlpp::Element* map = mapping->add_child ("Map");
+ auto map = mapping->add_child("Map");
map->add_child("ContentIndex")->add_child_text ("0");
map->add_child("DCP")->add_child_text ("0");
}
{
/* L -> C */
- xmlpp::Element* map = mapping->add_child ("Map");
+ auto map = mapping->add_child("Map");
map->add_child("ContentIndex")->add_child_text ("0");
map->add_child("DCP")->add_child_text ("2");
}
{
/* R -> R */
- xmlpp::Element* map = mapping->add_child ("Map");
+ auto map = mapping->add_child("Map");
map->add_child("ContentIndex")->add_child_text ("1");
map->add_child("DCP")->add_child_text ("1");
}
{
/* R -> C */
- xmlpp::Element* map = mapping->add_child ("Map");
+ auto map = mapping->add_child("Map");
map->add_child("ContentIndex")->add_child_text ("1");
map->add_child("DCP")->add_child_text ("2");
}
#include <boost/test/unit_test.hpp>
-using std::shared_ptr;
using std::dynamic_pointer_cast;
using std::make_shared;
-using std::shared_ptr;
BOOST_AUTO_TEST_CASE(full_dcp_subtitle_font_id_test)
using std::string;
using std::vector;
-using std::shared_ptr;
BOOST_AUTO_TEST_CASE (subtitle_language_interop_test)
using std::make_shared;
-using std::shared_ptr;
using std::vector;
using std::dynamic_pointer_cast;
using std::make_shared;
-using std::shared_ptr;
using std::string;
*/
#include "lib/content_factory.h"
+#include "lib/dcp_subtitle_content.h"
#include "lib/film.h"
#include "lib/image_content.h"
-#include "lib/dcp_subtitle_content.h"
#include "lib/text_content.h"
#include "lib/video_content.h"
#include "test.h"
using std::list;
-using std::string;
-using std::shared_ptr;
using std::make_shared;
+using std::string;
using boost::optional;
dcp::DCP dcp ("build/test/subtitle_reel_test/" + film->dcp_name());
dcp.read ();
BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1U);
- shared_ptr<dcp::CPL> cpl = dcp.cpls().front();
+ auto cpl = dcp.cpls().front();
auto reels = cpl->reels ();
BOOST_REQUIRE_EQUAL (reels.size(), 2U);
using std::make_shared;
-using std::shared_ptr;
/** Check for no crash when trimming DCP subtitles (#1275) */
*/
BOOST_AUTO_TEST_CASE (threed_test3)
{
- shared_ptr<Film> film = new_test_film2 ("threed_test3");
+ auto film = new_test_film2 ("threed_test3");
auto L = make_shared<FFmpegContent>("test/data/test.mp4");
film->examine_and_add_content (L);
auto R = make_shared<FFmpegContent>("test/data/test.mp4");
*/
BOOST_AUTO_TEST_CASE (threed_test_separate_files_slightly_different_lengths)
{
- shared_ptr<Film> film = new_test_film2 ("threed_test3");
+ auto film = new_test_film2("threed_test3");
auto L = make_shared<FFmpegContent>("test/data/test.mp4");
film->examine_and_add_content (L);
auto R = make_shared<FFmpegContent>("test/data/test.mp4");
*/
BOOST_AUTO_TEST_CASE (threed_test_separate_files_very_different_lengths)
{
- shared_ptr<Film> film = new_test_film2 ("threed_test3");
+ auto film = new_test_film2("threed_test3");
auto L = make_shared<FFmpegContent>("test/data/test.mp4");
film->examine_and_add_content (L);
auto R = make_shared<FFmpegContent>("test/data/test.mp4");
using std::list;
-using std::shared_ptr;
using std::string;
using std::vector;
#if BOOST_VERSION >= 106100
using std::make_shared;
-using std::shared_ptr;
using std::string;
using std::vector;
-#include "lib/film.h"
-#include "lib/video_mxf_content.h"
#include "lib/content_factory.h"
#include "lib/dcp_content_type.h"
+#include "lib/film.h"
#include "lib/ratio.h"
+#include "lib/video_mxf_content.h"
#include "test.h"
#include <dcp/mono_picture_asset.h>
#include <boost/test/unit_test.hpp>
-using std::make_shared;
-using std::shared_ptr;
using std::dynamic_pointer_cast;
+using std::make_shared;
static boost::filesystem::path ref_mxf = "test/data/scaling_test_185_185/j2c_6a2ffab1-9ea5-4428-9027-9d458363c95f.mxf";