}
}
for (auto j: i->closed_captions()) {
- assets.push_back (j);
+ if (auto enc = dynamic_pointer_cast<ReelEncryptableAsset>(j)) {
+ assets.push_back (enc);
+ }
}
if (i->atmos ()) {
assets.push_back (i->atmos());
#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"
closed_captions = asset_list->node_children ("ClosedCaption");
}
for (auto i: closed_captions) {
- _closed_captions.push_back (make_shared<ReelClosedCaptionAsset>(i));
+ switch (standard) {
+ case Standard::INTEROP:
+ _closed_captions.push_back (make_shared<ReelInteropClosedCaptionAsset>(i));
+ break;
+ case Standard::SMPTE:
+ _closed_captions.push_back (make_shared<ReelSMPTEClosedCaptionAsset>(i));
+ break;
+ }
}
auto atmos = asset_list->optional_node_child ("AuxData");
{
auto ecc = false;
for (auto i: _closed_captions) {
- if (i->encrypted()) {
- ecc = true;
+ if (auto enc = dynamic_pointer_cast<ReelEncryptableAsset>(i)) {
+ if (enc->encrypted()) {
+ ecc = true;
+ }
}
}
{
auto ecc = true;
for (auto i: _closed_captions) {
- if (!i->encrypted()) {
- ecc = false;
+ if (auto enc = dynamic_pointer_cast<ReelEncryptableAsset>(i)) {
+ if (!enc->encrypted()) {
+ ecc = false;
+ }
}
}
}
}
for (auto j: _closed_captions) {
- if (i.id() == j->key_id()) {
- auto s = dynamic_pointer_cast<SMPTESubtitleAsset> (j->asset());
- if (s) {
- s->set_key (i.key());
- }
+ auto smpte = dynamic_pointer_cast<ReelSMPTESubtitleAsset>(j);
+ if (smpte && i.id() == smpte->key_id()) {
+ smpte->smpte_asset()->set_key(i.key());
}
}
if (_atmos && i.id() == _atmos->key_id()) {
if (!attr.first.empty ()) {
a->set_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);
pair<string, string>
-ReelAsset::cpl_node_namespace (Standard) const
+ReelAsset::cpl_node_namespace () const
{
return make_pair ("", "");
}
virtual std::pair<std::string, std::string> cpl_node_attribute (Standard) const;
/** @return Any namespace that should be used on the asset's node in the CPL */
- virtual std::pair<std::string, std::string> cpl_node_namespace (Standard) const;
+ virtual std::pair<std::string, std::string> cpl_node_namespace () const;
xmlpp::Node* write_to_cpl_asset (xmlpp::Node* node, Standard standard, boost::optional<std::string> hash) const;
pair<string, string>
-ReelAtmosAsset::cpl_node_namespace (Standard) const
+ReelAtmosAsset::cpl_node_namespace () const
{
return { "http://www.dolby.com/schemas/2012/AD", "axd" };
}
return asset_of_type<AtmosAsset> ();
}
- 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<const ReelAtmosAsset>, EqualityOptions, NoteHandler) const;
private:
- std::string key_type () const;
- std::string cpl_node_name (Standard standard) const;
- std::pair<std::string, std::string> cpl_node_namespace (Standard) const;
+ std::string key_type () const override;
+ std::string cpl_node_name (Standard standard) const override;
+ std::pair<std::string, std::string> cpl_node_namespace () const override;
};
ReelClosedCaptionAsset::ReelClosedCaptionAsset (std::shared_ptr<SubtitleAsset> 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<SMPTESubtitleAsset>(asset) ? dynamic_pointer_cast<SMPTESubtitleAsset>(asset)->key_id() : optional<string>())
{
}
ReelClosedCaptionAsset::ReelClosedCaptionAsset (std::shared_ptr<const cxml::Node> 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<string, string>
-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;
}
#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;
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<SubtitleAsset> asset, Fraction edit_rate, int64_t instrinsic_duration, int64_t entry_point);
explicit ReelClosedCaptionAsset (std::shared_ptr<const cxml::Node>);
- xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const;
bool equals (std::shared_ptr<const ReelClosedCaptionAsset>, EqualityOptions, NoteHandler) const;
std::shared_ptr<SubtitleAsset> asset () const {
- return asset_of_type<SubtitleAsset> ();
+ return std::dynamic_pointer_cast<SubtitleAsset>(_asset_ref.asset());
}
void set_language (dcp::LanguageTag l) {
return _language;
}
-private:
+protected:
friend struct ::verify_invalid_language2;
- std::string key_type () const;
- std::string cpl_node_name (Standard standard) const;
- std::pair<std::string, std::string> cpl_node_namespace (Standard standard) const;
-
boost::optional<std::string> _language;
};
--- /dev/null
+/*
+ Copyright (C) 2021 Carl Hetherington <cth@carlh.net>
+
+ 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 <http://www.gnu.org/licenses/>.
+
+ 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 <libxml++/libxml++.h>
+
+
+using std::make_pair;
+using std::pair;
+using std::shared_ptr;
+using std::string;
+using namespace dcp;
+
+
+ReelInteropClosedCaptionAsset::ReelInteropClosedCaptionAsset (shared_ptr<InteropSubtitleAsset> asset, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point)
+ : ReelClosedCaptionAsset (asset, edit_rate, intrinsic_duration, entry_point)
+{
+
+}
+
+
+
+ReelInteropClosedCaptionAsset::ReelInteropClosedCaptionAsset (shared_ptr<const cxml::Node> 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<string, string>
+ReelInteropClosedCaptionAsset::cpl_node_namespace () const
+{
+ return make_pair("http://www.digicine.com/PROTO-ASDCP-CC-CPL-20070926#", "cc-cpl");
+}
+
--- /dev/null
+/*
+ Copyright (C) 2021 Carl Hetherington <cth@carlh.net>
+
+ 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 <http://www.gnu.org/licenses/>.
+
+ 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<InteropSubtitleAsset> asset, Fraction edit_rate, int64_t instrinsic_duration, int64_t entry_point);
+ explicit ReelInteropClosedCaptionAsset (std::shared_ptr<const cxml::Node>);
+
+ std::shared_ptr<InteropSubtitleAsset> interop_asset () const {
+ return std::dynamic_pointer_cast<InteropSubtitleAsset>(asset());
+ }
+
+ xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const;
+
+private:
+ std::string cpl_node_name (Standard) const;
+ std::pair<std::string, std::string> cpl_node_namespace () const override;
+};
+
+
+};
+
+
+#endif
+
--- /dev/null
+/*
+ Copyright (C) 2021 Carl Hetherington <cth@carlh.net>
+
+ 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 <http://www.gnu.org/licenses/>.
+
+ 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 <libxml++/libxml++.h>
+
+
+using std::make_pair;
+using std::pair;
+using std::shared_ptr;
+using std::string;
+using namespace dcp;
+
+
+ReelSMPTEClosedCaptionAsset::ReelSMPTEClosedCaptionAsset (shared_ptr<SMPTESubtitleAsset> 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<const cxml::Node> 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<string, string>
+ReelSMPTEClosedCaptionAsset::cpl_node_namespace () const
+{
+ return make_pair("http://www.smpte-ra.org/schemas/429-12/2008/TT", "tt");
+}
+
--- /dev/null
+/*
+ Copyright (C) 2021 Carl Hetherington <cth@carlh.net>
+
+ 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 <http://www.gnu.org/licenses/>.
+
+ 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<SMPTESubtitleAsset> asset, Fraction edit_rate, int64_t instrinsic_duration, int64_t entry_point);
+ explicit ReelSMPTEClosedCaptionAsset (std::shared_ptr<const cxml::Node>);
+
+ xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const override;
+
+ std::shared_ptr<SMPTESubtitleAsset> smpte_asset () const {
+ return std::dynamic_pointer_cast<SMPTESubtitleAsset>(asset());
+ }
+
+private:
+ std::string key_type () const override {
+ return "MDSK";
+ }
+
+ std::string cpl_node_name (Standard) const override;
+ std::pair<std::string, std::string> cpl_node_namespace () const override;
+};
+
+
+};
+
+
+#endif
+
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
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
#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"
subs->add (simple_subtitle());
subs->write (path / "ccap.xml");
- auto reel_caps = make_shared<dcp::ReelClosedCaptionAsset>(subs, dcp::Fraction(24, 1), 240, 0);
- dcp->cpls().front()->reels().front()->add (reel_caps);
+ auto reel_caps = make_shared<dcp::ReelInteropClosedCaptionAsset>(subs, dcp::Fraction(24, 1), 240, 0);
+ dcp->cpls()[0]->reels()[0]->add (reel_caps);
return dcp;
}
subs->add (simple_subtitle());
subs->write (path / "ccap.mxf");
- auto reel_caps = make_shared<dcp::ReelClosedCaptionAsset>(subs, dcp::Fraction(24, 1), 192, 0);
+ auto reel_caps = make_shared<dcp::ReelSMPTEClosedCaptionAsset>(subs, dcp::Fraction(24, 1), 192, 0);
dcp->cpls()[0]->reels()[0]->add(reel_caps);
return dcp;
#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"
auto asset = make_shared<dcp::SMPTESubtitleAsset>(dir / "subs.mxf");
asset->_language = "wrong-andbad";
asset->write (dir / "subs.mxf");
- auto reel_asset = make_shared<dcp::ReelClosedCaptionAsset>(asset, dcp::Fraction(24, 1), 6046, 0);
+ auto reel_asset = make_shared<dcp::ReelSMPTEClosedCaptionAsset>(asset, dcp::Fraction(24, 1), 6046, 0);
reel_asset->_language = "badlang";
auto cpl = write_dcp_with_single_asset (dir, reel_asset);
}
asset->set_language (dcp::LanguageTag("de-DE"));
asset->write (dir / "subs.mxf");
- auto reel_asset = make_shared<dcp::ReelClosedCaptionAsset>(asset, dcp::Fraction(24, 1), 49148, 0);
+ auto reel_asset = make_shared<dcp::ReelSMPTEClosedCaptionAsset>(asset, dcp::Fraction(24, 1), 49148, 0);
auto cpl = write_dcp_with_single_asset (dir, reel_asset);
check_verify_result (
BOOST_AUTO_TEST_CASE (verify_subtitle_asset_too_large)
{
verify_timed_text_asset_too_large<dcp::ReelSMPTESubtitleAsset>("verify_subtitle_asset_too_large");
- verify_timed_text_asset_too_large<dcp::ReelClosedCaptionAsset>("verify_closed_caption_asset_too_large");
+ verify_timed_text_asset_too_large<dcp::ReelSMPTEClosedCaptionAsset>("verify_closed_caption_asset_too_large");
}
ccaps->set_language (dcp::LanguageTag("de-DE"));
ccaps->add (simple_subtitle());
ccaps->write (path / "subs1.mxf");
- auto reel_ccaps = make_shared<dcp::ReelClosedCaptionAsset>(ccaps, dcp::Fraction(24, 1), reel_length, 0);
+ auto reel_ccaps = make_shared<dcp::ReelSMPTEClosedCaptionAsset>(ccaps, dcp::Fraction(24, 1), reel_length, 0);
cpl->reels()[0]->add(reel_ccaps);
}
ccaps->set_language (dcp::LanguageTag("en-US"));
ccaps->add (simple_subtitle());
ccaps->write (path / "subs2.mxf");
- auto reel_ccaps = make_shared<dcp::ReelClosedCaptionAsset>(ccaps, dcp::Fraction(24, 1), reel_length, 0);
+ auto reel_ccaps = make_shared<dcp::ReelSMPTEClosedCaptionAsset>(ccaps, dcp::Fraction(24, 1), reel_length, 0);
cpl->reels()[1]->add(reel_ccaps);
}
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<dcp::ReelClosedCaptionAsset> (
+ auto cpl = dcp_with_text<dcp::ReelSMPTEClosedCaptionAsset> (
dir,
{
{ 96, 200, 0.0, "We" },
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<dcp::ReelClosedCaptionAsset> (
+ auto cpl = dcp_with_text<dcp::ReelSMPTEClosedCaptionAsset> (
dir,
{
{ 96, 200, 0.0, "We" },
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<dcp::ReelClosedCaptionAsset> (
+ auto cpl = dcp_with_text<dcp::ReelSMPTEClosedCaptionAsset> (
dir,
{
{ 96, 300, 0.0, "We" },
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<dcp::ReelClosedCaptionAsset> (
+ auto cpl = dcp_with_text<dcp::ReelSMPTEClosedCaptionAsset> (
dir,
{
{ 96, 300, 0.0, "We" },
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<dcp::ReelClosedCaptionAsset> (
+ auto cpl = dcp_with_text<dcp::ReelSMPTEClosedCaptionAsset> (
dir,
{
{ 96, 300, 0.0, "0123456789012345678901234567890123" }
);
for (int i = 0; i < caps_in_reel1; ++i) {
- reel1->add (make_shared<dcp::ReelClosedCaptionAsset>(subs, dcp::Fraction(24, 1), reel_length, 0));
+ reel1->add (make_shared<dcp::ReelSMPTEClosedCaptionAsset>(subs, dcp::Fraction(24, 1), reel_length, 0));
}
auto markers1 = make_shared<dcp::ReelMarkersAsset>(dcp::Fraction(24, 1), reel_length, 0);
);
for (int i = 0; i < caps_in_reel2; ++i) {
- reel2->add (make_shared<dcp::ReelClosedCaptionAsset>(subs, dcp::Fraction(24, 1), reel_length, 0));
+ reel2->add (make_shared<dcp::ReelSMPTEClosedCaptionAsset>(subs, dcp::Fraction(24, 1), reel_length, 0));
}
auto markers2 = make_shared<dcp::ReelMarkersAsset>(dcp::Fraction(24, 1), reel_length, 0);
}
);
- verify_text_entry_point_check<dcp::ReelClosedCaptionAsset> (
+ verify_text_entry_point_check<dcp::ReelSMPTEClosedCaptionAsset> (
"build/test/verify_closed_caption_entry_point_must_be_present",
dcp::VerificationNote::Code::MISSING_CLOSED_CAPTION_ENTRY_POINT,
- [](shared_ptr<dcp::ReelClosedCaptionAsset> asset) {
+ [](shared_ptr<dcp::ReelSMPTEClosedCaptionAsset> asset) {
asset->unset_entry_point ();
}
);
- verify_text_entry_point_check<dcp::ReelClosedCaptionAsset> (
+ verify_text_entry_point_check<dcp::ReelSMPTEClosedCaptionAsset> (
"build/test/verify_closed_caption_entry_point_must_be_zero",
dcp::VerificationNote::Code::INCORRECT_CLOSED_CAPTION_ENTRY_POINT,
- [](shared_ptr<dcp::ReelClosedCaptionAsset> asset) {
+ [](shared_ptr<dcp::ReelSMPTEClosedCaptionAsset> asset) {
asset->set_entry_point (9);
}
);