7 #include "packager/app/crypto_flags.h"
11 DEFINE_string(protection_scheme,
13 "Specify a protection scheme, 'cenc' or 'cbc1' or pattern-based "
14 "protection schemes 'cens' or 'cbcs'.");
18 "Specify the count of the encrypted blocks in the protection pattern, "
19 "where block is of size 16-bytes. There are three common "
20 "patterns (crypt_byte_block:skip_byte_block): 1:9 (default), 5:5, 10:0. "
21 "Apply to video streams with 'cbcs' and 'cens' protection schemes only; "
22 "ignored otherwise.");
26 "Specify the count of the unencrypted blocks in the protection pattern. "
27 "Apply to video streams with 'cbcs' and 'cens' protection schemes only; "
28 "ignored otherwise.");
29 DEFINE_bool(vp9_subsample_encryption,
true,
"Enable VP9 subsample encryption.");
30 DEFINE_string(playready_extra_header_data,
32 "Extra XML data to add to PlayReady headers.");
34 bool ValueNotGreaterThanTen(
const char* flagname, int32_t value) {
36 fprintf(stderr,
"ERROR: %s must not be greater than 10.\n", flagname);
40 fprintf(stderr,
"ERROR: %s must be non-negative.\n", flagname);
46 bool ValueIsXml(
const char* flagname,
const std::string& value) {
50 if (value[0] !=
'<' || value[value.size() - 1] !=
'>') {
51 fprintf(stderr,
"ERROR: %s must be valid XML.\n", flagname);
57 DEFINE_validator(crypt_byte_block, &ValueNotGreaterThanTen);
58 DEFINE_validator(skip_byte_block, &ValueNotGreaterThanTen);
59 DEFINE_validator(playready_extra_header_data, &ValueIsXml);