summaryrefslogtreecommitdiff
path: root/src/smpte_subtitle_asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-13 23:35:39 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-13 23:35:39 +0100
commit563dbf02e9c7ab0066bcebbcde6c662df845695a (patch)
treec34ecf8b2fd76b1cbd8531b2a35d0bfa5fb3aa0e /src/smpte_subtitle_asset.cc
parent11777d1eacac733dbfc5a7eef9337458a922f63e (diff)
Enable encryption of SMPTE subtitles.
Separate out EncryptionContext class to use in SMPTESubtitleAsset::write().
Diffstat (limited to 'src/smpte_subtitle_asset.cc')
-rw-r--r--src/smpte_subtitle_asset.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc
index 0c0181f4..e0934ab5 100644
--- a/src/smpte_subtitle_asset.cc
+++ b/src/smpte_subtitle_asset.cc
@@ -44,6 +44,7 @@
#include "dcp_assert.h"
#include "util.h"
#include "compose.hpp"
+#include "encryption_context.h"
#include <asdcp/AS_DCP.h>
#include <asdcp/KM_util.h>
#include <libxml++/libxml++.h>
@@ -238,6 +239,8 @@ SMPTESubtitleAsset::xml_as_string () const
void
SMPTESubtitleAsset::write (boost::filesystem::path p) const
{
+ EncryptionContext enc (key (), SMPTE);
+
ASDCP::WriterInfo writer_info;
fill_writer_info (&writer_info, _id, SMPTE);
@@ -271,7 +274,7 @@ SMPTESubtitleAsset::write (boost::filesystem::path p) const
}
/* XXX: no encryption */
- r = writer.WriteTimedTextResource (xml_as_string ());
+ r = writer.WriteTimedTextResource (xml_as_string (), enc.encryption(), enc.hmac());
if (ASDCP_FAILURE (r)) {
boost::throw_exception (MXFFileError ("could not write XML to timed text resource", p.string(), r));
}
@@ -285,7 +288,7 @@ SMPTESubtitleAsset::write (boost::filesystem::path p) const
ASDCP::TimedText::FrameBuffer buffer;
buffer.SetData (j->data.data().get(), j->data.size());
buffer.Size (j->data.size());
- r = writer.WriteAncillaryResource (buffer);
+ r = writer.WriteAncillaryResource (buffer, enc.encryption(), enc.hmac());
if (ASDCP_FAILURE (r)) {
boost::throw_exception (MXFFileError ("could not write font to timed text resource", p.string(), r));
}