" -h, --help show this help\n"
" -n, --name <name> film name\n"
" -t, --template <name> template name\n"
+ " --no-encrypt make an unencrypted DCP\n"
" -e, --encrypt make an encrypted DCP\n"
" -c, --dcp-content-type <type> FTR, SHR, TLR, TST, XSN, RTG, TSR, POL, PSA or ADV\n"
" -f, --dcp-frame-rate <rate> set DCP video frame rate (otherwise guessed from content)\n"
return;
}
- if (a == "-e" || a == "--encrypt") {
+ if (a == "--no-encrypt") {
+ _no_encrypt = claimed = true;
+ } else if (a == "-e" || a == "--encrypt") {
_encrypt = claimed = true;
} else if (a == "--no-use-isdcf-name") {
_no_use_isdcf_name = claimed = true;
error = String::compose("%1: specify one of --twod or --threed, not both", argv[0]);
}
+ if (_no_encrypt && _encrypt) {
+ error = String::compose("%1: specify one of --no-encrypt or --encrypt, not both", argv[0]);
+ }
+
if (content.empty()) {
error = String::compose("%1: no content specified", argv[0]);
return;
film->set_dcp_content_type(_dcp_content_type);
film->set_interop(_standard == dcp::Standard::INTEROP);
film->set_use_isdcf_name(!_no_use_isdcf_name);
- film->set_encrypted(_encrypt);
+ if (_no_encrypt) {
+ film->set_encrypted(false);
+ } else if (_encrypt) {
+ film->set_encrypted(true);
+ }
if (_twod) {
film->set_three_d(false);
} else if (_threed) {
cc = run ("dcpomatic2_create x --standard SMPTEX");
BOOST_CHECK (cc.error);
+ cc = run("dcpomatic2_create x --no-encrypt");
+ BOOST_CHECK(cc._no_encrypt);
+
+ cc = run("dcpomatic2_create x --encrypt");
+ BOOST_CHECK(cc._encrypt);
+
+ cc = run("dcpomatic2_create x --no-encrypt --encrypt");
+ BOOST_CHECK(cc.error);
+
cc = run("dcpomatic2_create x --twod");
BOOST_CHECK(cc._twod);
Config::override_path = "test/data";
- auto cc = run("dcpomatic2_create test/data/flat_red.png --template 2d");
+ auto cc = run("dcpomatic2_create test/data/flat_red.png");
auto film = cc.make_film();
BOOST_CHECK(!film->three_d());
+ cc = run("dcpomatic2_create test/data/flat_red.png --template 2d");
+ film = cc.make_film();
+ BOOST_CHECK(!film->three_d());
+
cc = run("dcpomatic2_create test/data/flat_red.png --template 2d --threed");
film = cc.make_film();
BOOST_CHECK(film->three_d());
cc = run("dcpomatic2_create test/data/flat_red.png --template 3d --twod");
film = cc.make_film();
BOOST_CHECK(!film->three_d());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png");
+ film = cc.make_film();
+ BOOST_CHECK(!film->encrypted());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png --template unencrypted");
+ film = cc.make_film();
+ BOOST_CHECK(!film->encrypted());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png --template unencrypted --encrypt");
+ film = cc.make_film();
+ BOOST_CHECK(film->encrypted());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png --template encrypted");
+ film = cc.make_film();
+ BOOST_CHECK(film->encrypted());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png --template encrypted --no-encrypt");
+ film = cc.make_film();
+ BOOST_CHECK(!film->encrypted());
}