diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mxf.cc | 8 | ||||
| -rw-r--r-- | src/mxf.h | 14 |
2 files changed, 21 insertions, 1 deletions
@@ -57,6 +57,12 @@ using boost::shared_ptr; using boost::dynamic_pointer_cast; using namespace dcp; +MXF::MXF () + : _context_id (make_uuid ()) +{ + +} + void MXF::fill_writer_info (ASDCP::WriterInfo* writer_info, string id, Standard standard) const { @@ -76,7 +82,7 @@ MXF::fill_writer_info (ASDCP::WriterInfo* writer_info, string id, Standard stand writer_info->UsesHMAC = true; if (_key_id) { - Kumu::GenRandomUUID (writer_info->ContextID); + Kumu::hex2bin (_context_id.c_str(), writer_info->ContextID, Kumu::UUID_Length, &c); writer_info->EncryptedEssence = true; unsigned int c; @@ -61,6 +61,7 @@ class PictureAssetWriter; class MXF { public: + MXF (); virtual ~MXF () {} /** @return true if the data is encrypted */ @@ -87,6 +88,18 @@ public: return _key; } + /** Set the context ID to be used when encrypting. + * @param id New ID. + */ + void set_context_id (std::string id) { + _context_id = id; + } + + /** @return context ID used when encrypting; this starts off as a random value */ + std::string context_id () const { + return _context_id; + } + /** Set the metadata that is written to the MXF file. * @param m Metadata. */ @@ -114,6 +127,7 @@ protected: boost::optional<std::string> _key_id; /** Key used for encryption/decryption, if there is one */ boost::optional<Key> _key; + std::string _context_id; MXFMetadata _metadata; }; |
