summaryrefslogtreecommitdiff
path: root/src/cpl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-05-24 23:02:38 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-24 23:02:38 +0100
commitcb7c3db37d196b6e9ddad60937bd5314a95eadb2 (patch)
treeb686e05142b39208e4af8ab0a01e3b47c5256378 /src/cpl.cc
parent096b175a661234d9e02a852cce9f56c4577b8259 (diff)
parent85c699d29aab7ca7f7218b3f7f859e10c9025e37 (diff)
Merge branch '1.0' of ssh://main.carlh.net/home/carl/git/libdcp into 1.0
Diffstat (limited to 'src/cpl.cc')
-rw-r--r--src/cpl.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index c408fe97..0d8221e2 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -45,6 +45,9 @@ using boost::optional;
using boost::dynamic_pointer_cast;
using namespace dcp;
+static string const cpl_interop_ns = "http://www.digicine.com/PROTO-ASDCP-CPL-20040511#";
+static string const cpl_smpte_ns = "http://www.smpte-ra.org/schemas/429-7/2006/CPL";
+
CPL::CPL (string annotation_text, ContentKind content_kind)
: _annotation_text (annotation_text)
/* default _content_title_text to _annotation_text */
@@ -67,6 +70,14 @@ CPL::CPL (boost::filesystem::path file)
cxml::Document f ("CompositionPlaylist");
f.read_file (file);
+ if (f.namespace_uri() == cpl_interop_ns) {
+ _standard = INTEROP;
+ } else if (f.namespace_uri() == cpl_smpte_ns) {
+ _standard = SMPTE;
+ } else {
+ boost::throw_exception (XMLError ("Unrecognised CPL namespace " + f.namespace_uri()));
+ }
+
_id = remove_urn_uuid (f.string_child ("Id"));
_annotation_text = f.optional_string_child ("AnnotationText").get_value_or ("");
_metadata.issuer = f.optional_string_child ("Issuer").get_value_or ("");
@@ -110,9 +121,9 @@ CPL::write_xml (boost::filesystem::path file, Standard standard, shared_ptr<cons
xmlpp::Document doc;
xmlpp::Element* root;
if (standard == INTEROP) {
- root = doc.create_root_node ("CompositionPlaylist", "http://www.digicine.com/PROTO-ASDCP-CPL-20040511#");
+ root = doc.create_root_node ("CompositionPlaylist", cpl_interop_ns);
} else {
- root = doc.create_root_node ("CompositionPlaylist", "http://www.smpte-ra.org/schemas/429-7/2006/CPL");
+ root = doc.create_root_node ("CompositionPlaylist", cpl_smpte_ns);
}
if (signer) {