diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-06 20:30:19 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-06 20:30:19 +0100 |
| commit | dcccb2dd1d180b8be67e539395dccbe82b0fb5a8 (patch) | |
| tree | 53b76a2df1343e5896bc9462ec8661179ede2ee3 /src/mxf_asset.cc | |
| parent | 5f71c3f0a7a041b3621f7325915d1105424f7e53 (diff) | |
Move some CPL writing from picture/sound assets to the MXF. Pick up key_id from CPL assets and hence provide and test for encrypted() method on DCP.
Diffstat (limited to 'src/mxf_asset.cc')
| -rw-r--r-- | src/mxf_asset.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mxf_asset.cc b/src/mxf_asset.cc index d52ab2cc..3cb13250 100644 --- a/src/mxf_asset.cc +++ b/src/mxf_asset.cc @@ -24,6 +24,7 @@ #include <iostream> #include <fstream> #include <boost/filesystem.hpp> +#include <boost/lexical_cast.hpp> #include <libxml++/nodes/element.h> #include "AS_DCP.h" #include "KM_prng.h" @@ -36,6 +37,7 @@ using std::string; using std::list; using boost::shared_ptr; +using boost::lexical_cast; using boost::dynamic_pointer_cast; using namespace libdcp; @@ -133,3 +135,18 @@ MXFAsset::add_typed_key_id (xmlpp::Element* parent) const typed_key_id->add_child("KeyType")->add_child_text(key_type ()); typed_key_id->add_child("KeyId")->add_child_text("urn:uuid:" + _key_id); } + +void +MXFAsset::write_to_cpl (xmlpp::Node* node) const +{ + xmlpp::Node* a = node->add_child (cpl_node_name ()); + a->add_child ("Id")->add_child_text ("urn:uuid:" + _uuid); + a->add_child ("AnnotationText")->add_child_text (_file_name); + a->add_child ("EditRate")->add_child_text (lexical_cast<string> (_edit_rate) + " 1"); + a->add_child ("IntrinsicDuration")->add_child_text (lexical_cast<string> (_intrinsic_duration)); + a->add_child ("EntryPoint")->add_child_text (lexical_cast<string> (_entry_point)); + a->add_child ("Duration")->add_child_text (lexical_cast<string> (_duration)); + if (_encrypted) { + a->add_child("KeyId")->add_child_text ("urn:uuid:" + _key_id); + } +} |
