try {
list<KDMWithMetadataPtr> kdms;
for (auto i: screens) {
- auto p = kdm_for_screen(film, cpl, i, valid_from, valid_to, formulation, disable_forensic_marking_picture, disable_forensic_marking_audio, period_checks);
+ std::function<dcp::DecryptedKDM (dcp::LocalTime, dcp::LocalTime)> make_kdm = [film, cpl](dcp::LocalTime begin, dcp::LocalTime end) {
+ return film->make_kdm(cpl, begin, end);
+ };
+ auto p = kdm_for_screen(make_kdm, i, valid_from, valid_to, formulation, disable_forensic_marking_picture, disable_forensic_marking_audio, period_checks);
if (p) {
kdms.push_back (p);
}
KDMWithMetadataPtr
kdm_for_screen (
- shared_ptr<const Film> film,
- boost::filesystem::path cpl,
+ std::function<dcp::DecryptedKDM (dcp::LocalTime, dcp::LocalTime)> make_kdm,
shared_ptr<const dcpomatic::Screen> screen,
boost::posix_time::ptime valid_from,
boost::posix_time::ptime valid_to,
throw InvalidSignerError();
}
- auto const decrypted_kdm = film->make_kdm(cpl, begin, end);
- auto kdm = decrypted_kdm.encrypt(signer, screen->recipient.get(), screen->trusted_device_thumbprints(), formulation, disable_forensic_marking_picture, disable_forensic_marking_audio);
+ auto kdm = make_kdm(begin, end).encrypt(
+ signer, screen->recipient.get(), screen->trusted_device_thumbprints(), formulation, disable_forensic_marking_picture, disable_forensic_marking_audio
+ );
dcp::NameFormat::Map name_values;
if (cinema) {
#include "kdm_util.h"
#include "trusted_device.h"
#include <dcp/certificate.h>
+#include <dcp/decrypted_kdm.h>
#include <libcxml/cxml.h>
#include <boost/optional.hpp>
#include <string>
KDMWithMetadataPtr
kdm_for_screen (
- std::shared_ptr<const Film> film,
- boost::filesystem::path cpl,
+ std::function<dcp::DecryptedKDM (dcp::LocalTime, dcp::LocalTime)> make_kdm,
std::shared_ptr<const dcpomatic::Screen> screen,
boost::posix_time::ptime valid_from,
boost::posix_time::ptime valid_to,
vector<KDMCertificatePeriod> period_checks;
+ std::function<dcp::DecryptedKDM (dcp::LocalTime, dcp::LocalTime)> make_kdm = [film, this](dcp::LocalTime begin, dcp::LocalTime end) {
+ return film->make_kdm(_cpl->cpl(), begin, end);
+ };
+
for (auto i: _screens->screens()) {
- auto p = kdm_for_screen(film, _cpl->cpl(), i, _timing->from(), _timing->until(), _output->formulation(), !_output->forensic_mark_video(), for_audio, period_checks);
+ auto p = kdm_for_screen(make_kdm, i, _timing->from(), _timing->until(), _output->formulation(), !_output->forensic_mark_video(), for_audio, period_checks);
if (p) {
kdms.push_back (p);
}
std::vector<KDMCertificatePeriod> period_checks;
auto cpl = cpls.front().cpl_file;
+ std::function<dcp::DecryptedKDM (dcp::LocalTime, dcp::LocalTime)> make_kdm = [film, cpl](dcp::LocalTime begin, dcp::LocalTime end) {
+ return film->make_kdm(cpl, begin, end);
+ };
auto kdm = kdm_for_screen (
- film,
- cpls.front().cpl_file,
+ make_kdm,
cinema_a_screen_1,
boost::posix_time::time_from_string(from_string),
boost::posix_time::time_from_string(until_string),
std::vector<KDMCertificatePeriod> period_checks;
list<KDMWithMetadataPtr> kdms;
+
+ std::function<dcp::DecryptedKDM (dcp::LocalTime, dcp::LocalTime)> make_kdm = [film, cpls](dcp::LocalTime begin, dcp::LocalTime end) {
+ return film->make_kdm(cpls.front().cpl_file, begin, end);
+ };
+
for (auto i: screens) {
auto kdm = kdm_for_screen (
- film,
- cpls.front().cpl_file,
+ make_kdm,
i,
boost::posix_time::time_from_string(from_string),
boost::posix_time::time_from_string(until_string),