From 2fa5b7bfeb3826c20f2fe80f272b556d61935063 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 12 Apr 2021 00:20:44 +0200 Subject: [PATCH] Split ReelClosedCaptionAsset into Interop and SMPTE parts. --- src/cpl.cc | 4 +- src/reel.cc | 31 +++++--- src/reel_asset.cc | 6 +- src/reel_asset.h | 2 +- src/reel_atmos_asset.cc | 2 +- src/reel_atmos_asset.h | 8 +- src/reel_closed_caption_asset.cc | 59 --------------- src/reel_closed_caption_asset.h | 18 ++--- src/reel_interop_closed_caption_asset.cc | 85 ++++++++++++++++++++++ src/reel_interop_closed_caption_asset.h | 73 +++++++++++++++++++ src/reel_smpte_closed_caption_asset.cc | 93 ++++++++++++++++++++++++ src/reel_smpte_closed_caption_asset.h | 79 ++++++++++++++++++++ src/wscript | 5 +- test/test.cc | 9 ++- test/verify_test.cc | 35 ++++----- 15 files changed, 395 insertions(+), 114 deletions(-) create mode 100644 src/reel_interop_closed_caption_asset.cc create mode 100644 src/reel_interop_closed_caption_asset.h create mode 100644 src/reel_smpte_closed_caption_asset.cc create mode 100644 src/reel_smpte_closed_caption_asset.h diff --git a/src/cpl.cc b/src/cpl.cc index 3867c238..1257484a 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -555,7 +555,9 @@ add_encryptable_assets (vector>& assets, vector> } } for (auto j: i->closed_captions()) { - assets.push_back (j); + if (auto enc = dynamic_pointer_cast(j)) { + assets.push_back (enc); + } } if (i->atmos ()) { assets.push_back (i->atmos()); diff --git a/src/reel.cc b/src/reel.cc index becac898..4baa2fc9 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -47,7 +47,9 @@ #include "reel_mono_picture_asset.h" #include "reel_stereo_picture_asset.h" #include "reel_sound_asset.h" +#include "reel_interop_closed_caption_asset.h" #include "reel_interop_subtitle_asset.h" +#include "reel_smpte_closed_caption_asset.h" #include "reel_smpte_subtitle_asset.h" #include "reel_subtitle_asset.h" #include "reel_markers_asset.h" @@ -115,7 +117,14 @@ Reel::Reel (std::shared_ptr node, dcp::Standard standard) closed_captions = asset_list->node_children ("ClosedCaption"); } for (auto i: closed_captions) { - _closed_captions.push_back (make_shared(i)); + switch (standard) { + case Standard::INTEROP: + _closed_captions.push_back (make_shared(i)); + break; + case Standard::SMPTE: + _closed_captions.push_back (make_shared(i)); + break; + } } auto atmos = asset_list->optional_node_child ("AuxData"); @@ -265,8 +274,10 @@ Reel::any_encrypted () const { auto ecc = false; for (auto i: _closed_captions) { - if (i->encrypted()) { - ecc = true; + if (auto enc = dynamic_pointer_cast(i)) { + if (enc->encrypted()) { + ecc = true; + } } } @@ -292,8 +303,10 @@ Reel::all_encrypted () const { auto ecc = true; for (auto i: _closed_captions) { - if (!i->encrypted()) { - ecc = false; + if (auto enc = dynamic_pointer_cast(i)) { + if (!enc->encrypted()) { + ecc = false; + } } } @@ -334,11 +347,9 @@ Reel::add (DecryptedKDM const & kdm) } } for (auto j: _closed_captions) { - if (i.id() == j->key_id()) { - auto s = dynamic_pointer_cast (j->asset()); - if (s) { - s->set_key (i.key()); - } + auto smpte = dynamic_pointer_cast(j); + if (smpte && i.id() == smpte->key_id()) { + smpte->smpte_asset()->set_key(i.key()); } } if (_atmos && i.id() == _atmos->key_id()) { diff --git a/src/reel_asset.cc b/src/reel_asset.cc index 0f47e08d..cd54ccba 100644 --- a/src/reel_asset.cc +++ b/src/reel_asset.cc @@ -85,8 +85,8 @@ ReelAsset::write_to_cpl_asset (xmlpp::Node* node, Standard standard, optionalset_attribute (attr.first, attr.second); } - auto const ns = cpl_node_namespace (standard); - if (!ns.first.empty ()) { + auto const ns = cpl_node_namespace (); + if (!ns.first.empty()) { a->set_namespace_declaration (ns.first, ns.second); } a->add_child("Id")->add_child_text ("urn:uuid:" + _id); @@ -114,7 +114,7 @@ ReelAsset::cpl_node_attribute (Standard) const pair -ReelAsset::cpl_node_namespace (Standard) const +ReelAsset::cpl_node_namespace () const { return make_pair ("", ""); } diff --git a/src/reel_asset.h b/src/reel_asset.h index ba08c267..00355335 100644 --- a/src/reel_asset.h +++ b/src/reel_asset.h @@ -137,7 +137,7 @@ protected: virtual std::pair cpl_node_attribute (Standard) const; /** @return Any namespace that should be used on the asset's node in the CPL */ - virtual std::pair cpl_node_namespace (Standard) const; + virtual std::pair cpl_node_namespace () const; xmlpp::Node* write_to_cpl_asset (xmlpp::Node* node, Standard standard, boost::optional hash) const; diff --git a/src/reel_atmos_asset.cc b/src/reel_atmos_asset.cc index bd354bf7..32ebbcf5 100644 --- a/src/reel_atmos_asset.cc +++ b/src/reel_atmos_asset.cc @@ -77,7 +77,7 @@ ReelAtmosAsset::cpl_node_name (Standard) const pair -ReelAtmosAsset::cpl_node_namespace (Standard) const +ReelAtmosAsset::cpl_node_namespace () const { return { "http://www.dolby.com/schemas/2012/AD", "axd" }; } diff --git a/src/reel_atmos_asset.h b/src/reel_atmos_asset.h index 1fd6ce49..6f452c3a 100644 --- a/src/reel_atmos_asset.h +++ b/src/reel_atmos_asset.h @@ -65,13 +65,13 @@ public: return asset_of_type (); } - xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const; + xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const override; bool equals (std::shared_ptr, EqualityOptions, NoteHandler) const; private: - std::string key_type () const; - std::string cpl_node_name (Standard standard) const; - std::pair cpl_node_namespace (Standard) const; + std::string key_type () const override; + std::string cpl_node_name (Standard standard) const override; + std::pair cpl_node_namespace () const override; }; diff --git a/src/reel_closed_caption_asset.cc b/src/reel_closed_caption_asset.cc index b751efaf..a29d6e37 100644 --- a/src/reel_closed_caption_asset.cc +++ b/src/reel_closed_caption_asset.cc @@ -56,7 +56,6 @@ using namespace dcp; ReelClosedCaptionAsset::ReelClosedCaptionAsset (std::shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) : ReelAsset (asset->id(), edit_rate, intrinsic_duration, entry_point) , ReelFileAsset (asset) - , ReelEncryptableAsset (dynamic_pointer_cast(asset) ? dynamic_pointer_cast(asset)->key_id() : optional()) { } @@ -65,66 +64,8 @@ ReelClosedCaptionAsset::ReelClosedCaptionAsset (std::shared_ptr a ReelClosedCaptionAsset::ReelClosedCaptionAsset (std::shared_ptr node) : ReelAsset (node) , ReelFileAsset (node) - , ReelEncryptableAsset (node) { _language = node->optional_string_child ("Language"); - node->done (); -} - - -string -ReelClosedCaptionAsset::cpl_node_name (Standard standard) const -{ - switch (standard) { - case Standard::INTEROP: - return "cc-cpl:MainClosedCaption"; - case Standard::SMPTE: - return "tt:ClosedCaption"; - } - - DCP_ASSERT (false); -} - - -pair -ReelClosedCaptionAsset::cpl_node_namespace (Standard standard) const -{ - switch (standard) { - case Standard::INTEROP: - return make_pair ("http://www.digicine.com/PROTO-ASDCP-CC-CPL-20070926#", "cc-cpl"); - case Standard::SMPTE: - return make_pair ("http://www.smpte-ra.org/schemas/429-12/2008/TT", "tt"); - } - - DCP_ASSERT (false); -} - - -string -ReelClosedCaptionAsset::key_type () const -{ - return "MDSK"; -} - - -xmlpp::Node * -ReelClosedCaptionAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const -{ - auto asset = write_to_cpl_asset (node, standard, hash()); - write_to_cpl_encryptable (asset); - - if (_language) { - switch (standard) { - case Standard::INTEROP: - asset->add_child("Language")->add_child_text(*_language); - break; - case Standard::SMPTE: - asset->add_child("Language", "tt")->add_child_text(*_language); - break; - } - } - - return asset; } diff --git a/src/reel_closed_caption_asset.h b/src/reel_closed_caption_asset.h index 80421ca2..44ae83f3 100644 --- a/src/reel_closed_caption_asset.h +++ b/src/reel_closed_caption_asset.h @@ -42,9 +42,9 @@ #include "language_tag.h" -#include "subtitle_asset.h" #include "reel_asset.h" -#include "reel_encryptable_asset.h" +#include "reel_file_asset.h" +#include "subtitle_asset.h" struct verify_invalid_language2; @@ -53,23 +53,19 @@ struct verify_invalid_language2; namespace dcp { -class SubtitleAsset; - - /** @class ReelClosedCaptionAsset * @brief Part of a Reel's description which refers to a closed caption XML/MXF file */ -class ReelClosedCaptionAsset : public ReelAsset, public ReelFileAsset, public ReelEncryptableAsset +class ReelClosedCaptionAsset : public ReelAsset, public ReelFileAsset { public: ReelClosedCaptionAsset (std::shared_ptr asset, Fraction edit_rate, int64_t instrinsic_duration, int64_t entry_point); explicit ReelClosedCaptionAsset (std::shared_ptr); - xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const; bool equals (std::shared_ptr, EqualityOptions, NoteHandler) const; std::shared_ptr asset () const { - return asset_of_type (); + return std::dynamic_pointer_cast(_asset_ref.asset()); } void set_language (dcp::LanguageTag l) { @@ -84,13 +80,9 @@ public: return _language; } -private: +protected: friend struct ::verify_invalid_language2; - std::string key_type () const; - std::string cpl_node_name (Standard standard) const; - std::pair cpl_node_namespace (Standard standard) const; - boost::optional _language; }; diff --git a/src/reel_interop_closed_caption_asset.cc b/src/reel_interop_closed_caption_asset.cc new file mode 100644 index 00000000..0730f77e --- /dev/null +++ b/src/reel_interop_closed_caption_asset.cc @@ -0,0 +1,85 @@ +/* + Copyright (C) 2021 Carl Hetherington + + This file is part of libdcp. + + libdcp 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. + + libdcp 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 libdcp. If not, see . + + In addition, as a special exception, the copyright holders give + permission to link the code of portions of this program with the + OpenSSL library under certain conditions as described in each + individual source file, and distribute linked combinations + including the two. + + You must obey the GNU General Public License in all respects + for all of the code used other than OpenSSL. If you modify + file(s) with this exception, you may extend this exception to your + version of the file(s), but you are not obligated to do so. If you + do not wish to do so, delete this exception statement from your + version. If you delete this exception statement from all source + files in the program, then also delete it here. +*/ + + +#include "reel_interop_closed_caption_asset.h" +#include + + +using std::make_pair; +using std::pair; +using std::shared_ptr; +using std::string; +using namespace dcp; + + +ReelInteropClosedCaptionAsset::ReelInteropClosedCaptionAsset (shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) + : ReelClosedCaptionAsset (asset, edit_rate, intrinsic_duration, entry_point) +{ + +} + + + +ReelInteropClosedCaptionAsset::ReelInteropClosedCaptionAsset (shared_ptr node) + : ReelClosedCaptionAsset (node) +{ + node->done (); +} + + +xmlpp::Node * +ReelInteropClosedCaptionAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const +{ + auto asset = write_to_cpl_asset (node, standard, hash()); + if (_language) { + asset->add_child("Language")->add_child_text(*_language); + } + + return asset; +} + + +string +ReelInteropClosedCaptionAsset::cpl_node_name (Standard) const +{ + return "cc-cpl:MainClosedCaption"; +} + + +pair +ReelInteropClosedCaptionAsset::cpl_node_namespace () const +{ + return make_pair("http://www.digicine.com/PROTO-ASDCP-CC-CPL-20070926#", "cc-cpl"); +} + diff --git a/src/reel_interop_closed_caption_asset.h b/src/reel_interop_closed_caption_asset.h new file mode 100644 index 00000000..8031142d --- /dev/null +++ b/src/reel_interop_closed_caption_asset.h @@ -0,0 +1,73 @@ +/* + Copyright (C) 2021 Carl Hetherington + + This file is part of libdcp. + + libdcp 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. + + libdcp 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 libdcp. If not, see . + + In addition, as a special exception, the copyright holders give + permission to link the code of portions of this program with the + OpenSSL library under certain conditions as described in each + individual source file, and distribute linked combinations + including the two. + + You must obey the GNU General Public License in all respects + for all of the code used other than OpenSSL. If you modify + file(s) with this exception, you may extend this exception to your + version of the file(s), but you are not obligated to do so. If you + do not wish to do so, delete this exception statement from your + version. If you delete this exception statement from all source + files in the program, then also delete it here. +*/ + + +/** @file src/reel_interop_closed_caption_asset.h + * @brief ReelInteropClosedCaptionAsset class + */ + + +#ifndef LIBDCP_REEL_INTEROP_CLOSED_CAPTION_ASSET_H +#define LIBDCP_REEL_INTEROP_CLOSED_CAPTION_ASSET_H + + +#include "interop_subtitle_asset.h" +#include "reel_closed_caption_asset.h" + + +namespace dcp { + + +class ReelInteropClosedCaptionAsset : public ReelClosedCaptionAsset +{ +public: + ReelInteropClosedCaptionAsset (std::shared_ptr asset, Fraction edit_rate, int64_t instrinsic_duration, int64_t entry_point); + explicit ReelInteropClosedCaptionAsset (std::shared_ptr); + + std::shared_ptr interop_asset () const { + return std::dynamic_pointer_cast(asset()); + } + + xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const; + +private: + std::string cpl_node_name (Standard) const; + std::pair cpl_node_namespace () const override; +}; + + +}; + + +#endif + diff --git a/src/reel_smpte_closed_caption_asset.cc b/src/reel_smpte_closed_caption_asset.cc new file mode 100644 index 00000000..44125037 --- /dev/null +++ b/src/reel_smpte_closed_caption_asset.cc @@ -0,0 +1,93 @@ +/* + Copyright (C) 2021 Carl Hetherington + + This file is part of libdcp. + + libdcp 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. + + libdcp 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 libdcp. If not, see . + + In addition, as a special exception, the copyright holders give + permission to link the code of portions of this program with the + OpenSSL library under certain conditions as described in each + individual source file, and distribute linked combinations + including the two. + + You must obey the GNU General Public License in all respects + for all of the code used other than OpenSSL. If you modify + file(s) with this exception, you may extend this exception to your + version of the file(s), but you are not obligated to do so. If you + do not wish to do so, delete this exception statement from your + version. If you delete this exception statement from all source + files in the program, then also delete it here. +*/ + + +/** @file src/reel_smpte_closed_caption_asset.cc + * @brief ReelSMPTEClosedCaptionAsset class + */ + + +#include "reel_smpte_closed_caption_asset.h" +#include + + +using std::make_pair; +using std::pair; +using std::shared_ptr; +using std::string; +using namespace dcp; + + +ReelSMPTEClosedCaptionAsset::ReelSMPTEClosedCaptionAsset (shared_ptr asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point) + : ReelClosedCaptionAsset (asset, edit_rate, intrinsic_duration, entry_point) + , ReelEncryptableAsset (asset->key_id()) +{ + +} + + +ReelSMPTEClosedCaptionAsset::ReelSMPTEClosedCaptionAsset (shared_ptr node) + : ReelClosedCaptionAsset (node) + , ReelEncryptableAsset (node) +{ + node->done (); +} + + +xmlpp::Node * +ReelSMPTEClosedCaptionAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const +{ + auto asset = write_to_cpl_asset (node, standard, hash()); + write_to_cpl_encryptable (asset); + + if (_language) { + asset->add_child("Language", "tt")->add_child_text(*_language); + } + + return asset; +} + + +string +ReelSMPTEClosedCaptionAsset::cpl_node_name (Standard) const +{ + return "tt:ClosedCaption"; +} + + +pair +ReelSMPTEClosedCaptionAsset::cpl_node_namespace () const +{ + return make_pair("http://www.smpte-ra.org/schemas/429-12/2008/TT", "tt"); +} + diff --git a/src/reel_smpte_closed_caption_asset.h b/src/reel_smpte_closed_caption_asset.h new file mode 100644 index 00000000..32fe5117 --- /dev/null +++ b/src/reel_smpte_closed_caption_asset.h @@ -0,0 +1,79 @@ +/* + Copyright (C) 2021 Carl Hetherington + + This file is part of libdcp. + + libdcp 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. + + libdcp 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 libdcp. If not, see . + + In addition, as a special exception, the copyright holders give + permission to link the code of portions of this program with the + OpenSSL library under certain conditions as described in each + individual source file, and distribute linked combinations + including the two. + + You must obey the GNU General Public License in all respects + for all of the code used other than OpenSSL. If you modify + file(s) with this exception, you may extend this exception to your + version of the file(s), but you are not obligated to do so. If you + do not wish to do so, delete this exception statement from your + version. If you delete this exception statement from all source + files in the program, then also delete it here. +*/ + + +/** @file src/reel_smpte_closed_caption_asset.h + * @brief ReelSMPTEClosedCaptionAsset class + */ + + +#ifndef LIBDCP_REEL_SMPTE_CLOSED_CAPTION_ASSET_H +#define LIBDCP_REEL_SMPTE_CLOSED_CAPTION_ASSET_H + + +#include "reel_encryptable_asset.h" +#include "reel_file_asset.h" +#include "reel_closed_caption_asset.h" +#include "smpte_subtitle_asset.h" + + +namespace dcp { + + +class ReelSMPTEClosedCaptionAsset : public ReelClosedCaptionAsset, public ReelEncryptableAsset +{ +public: + ReelSMPTEClosedCaptionAsset (std::shared_ptr asset, Fraction edit_rate, int64_t instrinsic_duration, int64_t entry_point); + explicit ReelSMPTEClosedCaptionAsset (std::shared_ptr); + + xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const override; + + std::shared_ptr smpte_asset () const { + return std::dynamic_pointer_cast(asset()); + } + +private: + std::string key_type () const override { + return "MDSK"; + } + + std::string cpl_node_name (Standard) const override; + std::pair cpl_node_namespace () const override; +}; + + +}; + + +#endif + diff --git a/src/wscript b/src/wscript index b50966e7..f6e0d15b 100644 --- a/src/wscript +++ b/src/wscript @@ -84,10 +84,12 @@ def build(bld): reel_closed_caption_asset.cc reel_encryptable_asset.cc reel_file_asset.cc + reel_interop_closed_caption_asset.cc reel_interop_subtitle_asset.cc reel_mono_picture_asset.cc reel_picture_asset.cc reel_markers_asset.cc + reel_smpte_closed_caption_asset.cc reel_smpte_subtitle_asset.cc reel_sound_asset.cc reel_stereo_picture_asset.cc @@ -171,14 +173,15 @@ def build(bld): reel.h reel_asset.h reel_atmos_asset.h - reel_closed_caption_asset.h reel_encryptable_asset.h reel_file_asset.h + reel_interop_closed_caption_asset.h reel_interop_subtitle_asset.h reel_markers_asset.h reel_mono_picture_asset.h reel_picture_asset.h reel_sound_asset.h + reel_smpte_closed_caption_asset.h reel_smpte_subtitle_asset.h reel_stereo_picture_asset.h reel_subtitle_asset.h diff --git a/test/test.cc b/test/test.cc index 3bebff53..d46c657b 100644 --- a/test/test.cc +++ b/test/test.cc @@ -45,11 +45,12 @@ #include "picture_asset_writer.h" #include "reel.h" #include "reel_asset.h" -#include "reel_closed_caption_asset.h" +#include "reel_interop_closed_caption_asset.h" #include "reel_interop_subtitle_asset.h" #include "reel_markers_asset.h" #include "reel_mono_picture_asset.h" #include "reel_mono_picture_asset.h" +#include "reel_smpte_closed_caption_asset.h" #include "reel_smpte_subtitle_asset.h" #include "reel_sound_asset.h" #include "smpte_subtitle_asset.h" @@ -459,8 +460,8 @@ make_simple_with_interop_ccaps (boost::filesystem::path path) subs->add (simple_subtitle()); subs->write (path / "ccap.xml"); - auto reel_caps = make_shared(subs, dcp::Fraction(24, 1), 240, 0); - dcp->cpls().front()->reels().front()->add (reel_caps); + auto reel_caps = make_shared(subs, dcp::Fraction(24, 1), 240, 0); + dcp->cpls()[0]->reels()[0]->add (reel_caps); return dcp; } @@ -477,7 +478,7 @@ make_simple_with_smpte_ccaps (boost::filesystem::path path) subs->add (simple_subtitle()); subs->write (path / "ccap.mxf"); - auto reel_caps = make_shared(subs, dcp::Fraction(24, 1), 192, 0); + auto reel_caps = make_shared(subs, dcp::Fraction(24, 1), 192, 0); dcp->cpls()[0]->reels()[0]->add(reel_caps); return dcp; diff --git a/test/verify_test.cc b/test/verify_test.cc index 162d2913..4e26c66e 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -41,12 +41,13 @@ #include "openjpeg_image.h" #include "raw_convert.h" #include "reel.h" -#include "reel_closed_caption_asset.h" +#include "reel_interop_closed_caption_asset.h" #include "reel_interop_subtitle_asset.h" #include "reel_markers_asset.h" #include "reel_mono_picture_asset.h" #include "reel_sound_asset.h" #include "reel_stereo_picture_asset.h" +#include "reel_smpte_closed_caption_asset.h" #include "reel_smpte_subtitle_asset.h" #include "smpte_subtitle_asset.h" #include "stereo_picture_asset.h" @@ -925,7 +926,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_language2) auto asset = make_shared(dir / "subs.mxf"); asset->_language = "wrong-andbad"; asset->write (dir / "subs.mxf"); - auto reel_asset = make_shared(asset, dcp::Fraction(24, 1), 6046, 0); + auto reel_asset = make_shared(asset, dcp::Fraction(24, 1), 6046, 0); reel_asset->_language = "badlang"; auto cpl = write_dcp_with_single_asset (dir, reel_asset); @@ -1177,7 +1178,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_closed_caption_xml_size_in_bytes) } asset->set_language (dcp::LanguageTag("de-DE")); asset->write (dir / "subs.mxf"); - auto reel_asset = make_shared(asset, dcp::Fraction(24, 1), 49148, 0); + auto reel_asset = make_shared(asset, dcp::Fraction(24, 1), 49148, 0); auto cpl = write_dcp_with_single_asset (dir, reel_asset); check_verify_result ( @@ -1239,7 +1240,7 @@ verify_timed_text_asset_too_large (string name) BOOST_AUTO_TEST_CASE (verify_subtitle_asset_too_large) { verify_timed_text_asset_too_large("verify_subtitle_asset_too_large"); - verify_timed_text_asset_too_large("verify_closed_caption_asset_too_large"); + verify_timed_text_asset_too_large("verify_closed_caption_asset_too_large"); } @@ -1349,7 +1350,7 @@ BOOST_AUTO_TEST_CASE (verify_multiple_closed_caption_languages_allowed) ccaps->set_language (dcp::LanguageTag("de-DE")); ccaps->add (simple_subtitle()); ccaps->write (path / "subs1.mxf"); - auto reel_ccaps = make_shared(ccaps, dcp::Fraction(24, 1), reel_length, 0); + auto reel_ccaps = make_shared(ccaps, dcp::Fraction(24, 1), reel_length, 0); cpl->reels()[0]->add(reel_ccaps); } @@ -1358,7 +1359,7 @@ BOOST_AUTO_TEST_CASE (verify_multiple_closed_caption_languages_allowed) ccaps->set_language (dcp::LanguageTag("en-US")); ccaps->add (simple_subtitle()); ccaps->write (path / "subs2.mxf"); - auto reel_ccaps = make_shared(ccaps, dcp::Fraction(24, 1), reel_length, 0); + auto reel_ccaps = make_shared(ccaps, dcp::Fraction(24, 1), reel_length, 0); cpl->reels()[1]->add(reel_ccaps); } @@ -1772,7 +1773,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_subtitle_line_length2) BOOST_AUTO_TEST_CASE (verify_valid_closed_caption_line_count1) { auto const dir = path ("build/test/verify_valid_closed_caption_line_count1"); - auto cpl = dcp_with_text ( + auto cpl = dcp_with_text ( dir, { { 96, 200, 0.0, "We" }, @@ -1792,7 +1793,7 @@ BOOST_AUTO_TEST_CASE (verify_valid_closed_caption_line_count1) BOOST_AUTO_TEST_CASE (verify_valid_closed_caption_line_count2) { auto const dir = path ("build/test/verify_valid_closed_caption_line_count2"); - auto cpl = dcp_with_text ( + auto cpl = dcp_with_text ( dir, { { 96, 200, 0.0, "We" }, @@ -1806,7 +1807,7 @@ BOOST_AUTO_TEST_CASE (verify_valid_closed_caption_line_count2) BOOST_AUTO_TEST_CASE (verify_invalid_closed_caption_line_count3) { auto const dir = path ("build/test/verify_invalid_closed_caption_line_count3"); - auto cpl = dcp_with_text ( + auto cpl = dcp_with_text ( dir, { { 96, 300, 0.0, "We" }, @@ -1826,7 +1827,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_closed_caption_line_count3) BOOST_AUTO_TEST_CASE (verify_valid_closed_caption_line_count4) { auto const dir = path ("build/test/verify_valid_closed_caption_line_count4"); - auto cpl = dcp_with_text ( + auto cpl = dcp_with_text ( dir, { { 96, 300, 0.0, "We" }, @@ -1841,7 +1842,7 @@ BOOST_AUTO_TEST_CASE (verify_valid_closed_caption_line_count4) BOOST_AUTO_TEST_CASE (verify_invalid_closed_caption_line_length) { auto const dir = path ("build/test/verify_invalid_closed_caption_line_length"); - auto cpl = dcp_with_text ( + auto cpl = dcp_with_text ( dir, { { 96, 300, 0.0, "0123456789012345678901234567890123" } @@ -2092,7 +2093,7 @@ verify_closed_captions_must_be_in_all_reels_check (path dir, int caps_in_reel1, ); for (int i = 0; i < caps_in_reel1; ++i) { - reel1->add (make_shared(subs, dcp::Fraction(24, 1), reel_length, 0)); + reel1->add (make_shared(subs, dcp::Fraction(24, 1), reel_length, 0)); } auto markers1 = make_shared(dcp::Fraction(24, 1), reel_length, 0); @@ -2107,7 +2108,7 @@ verify_closed_captions_must_be_in_all_reels_check (path dir, int caps_in_reel1, ); for (int i = 0; i < caps_in_reel2; ++i) { - reel2->add (make_shared(subs, dcp::Fraction(24, 1), reel_length, 0)); + reel2->add (make_shared(subs, dcp::Fraction(24, 1), reel_length, 0)); } auto markers2 = make_shared(dcp::Fraction(24, 1), reel_length, 0); @@ -2219,18 +2220,18 @@ BOOST_AUTO_TEST_CASE (verify_text_entry_point) } ); - verify_text_entry_point_check ( + verify_text_entry_point_check ( "build/test/verify_closed_caption_entry_point_must_be_present", dcp::VerificationNote::Code::MISSING_CLOSED_CAPTION_ENTRY_POINT, - [](shared_ptr asset) { + [](shared_ptr asset) { asset->unset_entry_point (); } ); - verify_text_entry_point_check ( + verify_text_entry_point_check ( "build/test/verify_closed_caption_entry_point_must_be_zero", dcp::VerificationNote::Code::INCORRECT_CLOSED_CAPTION_ENTRY_POINT, - [](shared_ptr asset) { + [](shared_ptr asset) { asset->set_entry_point (9); } ); -- 2.30.2