diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-04-13 23:36:22 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-04-13 23:36:22 +0200 |
| commit | 488e3d1bd5e6b17d49f6db4df14c64f4b64db89b (patch) | |
| tree | 641fcf167b845df6eca68c54fdf1110a7a07a739 /src/reel_file_asset.h | |
| parent | 51ae14c7e304d4fbc8d7524d584f3f4762d51f67 (diff) | |
Remove ReelEncryptableAsset and tidy up a bit.
Diffstat (limited to 'src/reel_file_asset.h')
| -rw-r--r-- | src/reel_file_asset.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/reel_file_asset.h b/src/reel_file_asset.h index 042f94b4..6ef917ab 100644 --- a/src/reel_file_asset.h +++ b/src/reel_file_asset.h @@ -53,9 +53,11 @@ namespace dcp { class ReelFileAsset : public ReelAsset { public: - ReelFileAsset (std::shared_ptr<Asset> asset, std::string id, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); + ReelFileAsset (std::shared_ptr<Asset> asset, boost::optional<std::string> key_id, std::string id, Fraction edit_rate, int64_t intrinsic_duration, int64_t entry_point); explicit ReelFileAsset (std::shared_ptr<const cxml::Node> node); + virtual xmlpp::Node* write_to_cpl (xmlpp::Node* node, Standard standard) const override; + /** @return a Ref to our actual asset */ Ref const & asset_ref () const { return _asset_ref; @@ -79,6 +81,22 @@ public: bool file_asset_equals (std::shared_ptr<const ReelFileAsset> other, EqualityOptions opt, NoteHandler note) const; + virtual boost::optional<std::string> key_type () const { + return boost::none; + } + + bool encryptable () const override { + return static_cast<bool>(key_type()); + } + + boost::optional<std::string> key_id () const { + return _key_id; + } + + bool encrypted () const { + return static_cast<bool>(key_id()); + } + protected: template <class T> @@ -98,6 +116,7 @@ protected: /** Either our asset's computed hash or the hash read in from the CPL, if it's present */ boost::optional<std::string> _hash; + boost::optional<std::string> _key_id; ///< The <KeyId> from the reel's entry for this asset, if there is one }; |
