summaryrefslogtreecommitdiff
path: root/src/cpl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-06 20:30:19 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-06 20:30:19 +0100
commitdcccb2dd1d180b8be67e539395dccbe82b0fb5a8 (patch)
tree53b76a2df1343e5896bc9462ec8661179ede2ee3 /src/cpl.cc
parent5f71c3f0a7a041b3621f7325915d1105424f7e53 (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/cpl.cc')
-rw-r--r--src/cpl.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index fd7b734e..7889b14c 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -110,6 +110,7 @@ CPL::CPL (string directory, string file, shared_ptr<const libdcp::parse::AssetMa
picture->set_entry_point (p->entry_point);
picture->set_duration (p->duration);
+ picture->set_key_id (p->key_id);
} catch (MXFFileError) {
if (require_mxfs) {
throw;
@@ -128,6 +129,7 @@ CPL::CPL (string directory, string file, shared_ptr<const libdcp::parse::AssetMa
picture->set_entry_point (p->entry_point);
picture->set_duration (p->duration);
+ picture->set_key_id (p->key_id);
} catch (MXFFileError) {
if (require_mxfs) {
@@ -148,6 +150,7 @@ CPL::CPL (string directory, string file, shared_ptr<const libdcp::parse::AssetMa
sound->set_entry_point ((*i)->asset_list->main_sound->entry_point);
sound->set_duration ((*i)->asset_list->main_sound->duration);
+ sound->set_key_id ((*i)->asset_list->main_sound->key_id);
} catch (MXFFileError) {
if (require_mxfs) {
throw;
@@ -465,3 +468,16 @@ CPL::make_kdm (
return doc;
}
+
+/** @return true if we have any encrypted content */
+bool
+CPL::encrypted () const
+{
+ for (list<shared_ptr<const Reel> >::const_iterator i = _reels.begin(); i != _reels.end(); ++i) {
+ if ((*i)->encrypted ()) {
+ return true;
+ }
+ }
+
+ return false;
+}