From dcccb2dd1d180b8be67e539395dccbe82b0fb5a8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 6 Jul 2013 20:30:19 +0100 Subject: 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. --- src/cpl.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/cpl.cc') 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_ptrset_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_ptrset_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_ptrset_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 >::const_iterator i = _reels.begin(); i != _reels.end(); ++i) { + if ((*i)->encrypted ()) { + return true; + } + } + + return false; +} -- cgit v1.2.3