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/parse/cpl.cc | 5 ++++- src/parse/cpl.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/parse') diff --git a/src/parse/cpl.cc b/src/parse/cpl.cc index c4cf4374..e7ed4497 100644 --- a/src/parse/cpl.cc +++ b/src/parse/cpl.cc @@ -111,6 +111,8 @@ Picture::Picture (shared_ptr node) } + key_id = node->optional_string_child ("KeyId").get_value_or (""); + node->ignore_child ("Hash"); node->done (); @@ -124,7 +126,8 @@ MainSound::MainSound (shared_ptr node) intrinsic_duration = node->number_child ("IntrinsicDuration"); entry_point = node->number_child ("EntryPoint"); duration = node->number_child ("Duration"); - + key_id = node->optional_string_child ("KeyId").get_value_or (""); + node->ignore_child ("Hash"); node->ignore_child ("Language"); diff --git a/src/parse/cpl.h b/src/parse/cpl.h index 434a244b..04bf9351 100644 --- a/src/parse/cpl.h +++ b/src/parse/cpl.h @@ -48,6 +48,7 @@ public: int64_t duration; Fraction frame_rate; Fraction screen_aspect_ratio; + std::string key_id; }; @@ -80,6 +81,7 @@ public: int64_t intrinsic_duration; int64_t entry_point; int64_t duration; + std::string key_id; }; /** @brief A simple parser for and representation of a CPL \ node */ -- cgit v1.2.3