From 63bab3a5f4abc7c5ef8562f3048b55cb3a24c71f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 16 Apr 2019 13:35:54 +0100 Subject: Initial work on 'ECinema' KDMs. --- src/tools/dcpomatic_ecinema.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/tools') diff --git a/src/tools/dcpomatic_ecinema.cc b/src/tools/dcpomatic_ecinema.cc index 64874cbef..76305d12d 100644 --- a/src/tools/dcpomatic_ecinema.cc +++ b/src/tools/dcpomatic_ecinema.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington + Copyright (C) 2018-2019 Carl Hetherington This file is part of DCP-o-matic. @@ -19,11 +19,16 @@ */ #include "lib/version.h" +#include "lib/decrypted_ecinema_kdm.h" +#include "lib/config.h" +#include extern "C" { #include +#include } #include #include +#include #include #include #include @@ -41,6 +46,7 @@ help (string n) cerr << "Syntax: " << n << " [OPTION] \n" << " -v, --version show DCP-o-matic version\n" << " -h, --help show this help\n" + << " -o, --output output directory\n" << "\n" << " is the unencrypted .mp4 file.\n"; } @@ -83,7 +89,7 @@ main (int argc, char* argv[]) } if (!output) { - cerr << "You must specify --output or -o\n"; + cerr << "You must specify --output-media or -o\n"; exit (EXIT_FAILURE); } @@ -146,7 +152,11 @@ main (int argc, char* argv[]) exit (EXIT_FAILURE); } - if (avformat_write_header (output_fc, 0) < 0) { + dcp::Key key (AES_CTR_KEY_SIZE); + AVDictionary* options = 0; + av_dict_set (&options, "encryption_key", key.hex().c_str(), 0); + + if (avformat_write_header (output_fc, &options) < 0) { cerr << "Could not write header to output.\n"; exit (EXIT_FAILURE); } @@ -169,4 +179,6 @@ main (int argc, char* argv[]) avformat_free_context (input_fc); avformat_free_context (output_fc); + + DecryptedECinemaKDM kdm (key); } -- cgit v1.2.3