<divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">// Copyright 2014 Google Inc. All rights reserved.</span></div>
<divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment">// Use of this source code is governed by a BSD-style</span></div>
<divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment">// license that can be found in the LICENSE file or at</span></div>
<divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment">// Defines command line flags for widevine_encryption.</span></div>
<divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="stringliteral">"Enable encryption with Widevine license server/proxy. User should "</span></div>
<divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> <spanclass="stringliteral">"provide either AES signing key (--aes_signing_key, "</span></div>
<divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="stringliteral">"--aes_signing_iv) or RSA signing key (--rsa_signing_key_path)."</span>);</div>
<divclass="line"><aname="l00023"></a><spanclass="lineno"> 23</span> <spanclass="stringliteral">"Enable decryption with Widevine license server/proxy. User should "</span></div>
<divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="stringliteral">"provide either AES signing key (--aes_signing_key, "</span></div>
<divclass="line"><aname="l00025"></a><spanclass="lineno"> 25</span> <spanclass="stringliteral">"--aes_signing_iv) or RSA signing key (--rsa_signing_key_path)."</span>);</div>
<divclass="line"><aname="l00028"></a><spanclass="lineno"> 28</span> <spanclass="stringliteral">"When using Widevine encryption, include an additional v1 PSSH box "</span></div>
<divclass="line"><aname="l00029"></a><spanclass="lineno"> 29</span> <spanclass="stringliteral">"for the common system ID that includes the key IDs. See: "</span></div>
<divclass="line"><aname="l00031"></a><spanclass="lineno"> 31</span> DEFINE_string(key_server_url, <spanclass="stringliteral">""</span>, <spanclass="stringliteral">"Key server url. Required for encryption and "</span></div>
<divclass="line"><aname="l00036"></a><spanclass="lineno"> 36</span> <spanclass="stringliteral">"The name of a stored policy, which specifies DRM content "</span></div>
<divclass="line"><aname="l00040"></a><spanclass="lineno"> 40</span> <spanclass="stringliteral">"The video track is considered SD if its max pixels per frame is "</span></div>
<divclass="line"><aname="l00041"></a><spanclass="lineno"> 41</span> <spanclass="stringliteral">"no higher than max_sd_pixels. Default: 442368 (768 x 576)."</span>);</div>
<divclass="line"><aname="l00044"></a><spanclass="lineno"> 44</span> <spanclass="stringliteral">"The video track is considered HD if its max pixels per frame is "</span></div>
<divclass="line"><aname="l00045"></a><spanclass="lineno"> 45</span> <spanclass="stringliteral">"higher than max_sd_pixels, but no higher than max_hd_pixels. "</span></div>
<divclass="line"><aname="l00046"></a><spanclass="lineno"> 46</span> <spanclass="stringliteral">"Default: 2073600 (1920 x 1080)."</span>);</div>
<divclass="line"><aname="l00049"></a><spanclass="lineno"> 49</span> <spanclass="stringliteral">"The video track is considered UHD1 if its max pixels per frame "</span></div>
<divclass="line"><aname="l00050"></a><spanclass="lineno"> 50</span> <spanclass="stringliteral">"is higher than max_hd_pixels, but no higher than max_uhd1_pixels."</span></div>
<divclass="line"><aname="l00051"></a><spanclass="lineno"> 51</span> <spanclass="stringliteral">" Otherwise it is UHD2. Default: 8847360 (4096 x 2160)."</span>);</div>
<divclass="line"><aname="l00052"></a><spanclass="lineno"> 52</span> DEFINE_string(signer, <spanclass="stringliteral">""</span>, <spanclass="stringliteral">"The name of the signer."</span>);</div>
<divclass="line"><aname="l00055"></a><spanclass="lineno"> 55</span> <spanclass="stringliteral">"AES signing key in hex string. --aes_signing_iv is required. "</span></div>
<divclass="line"><aname="l00056"></a><spanclass="lineno"> 56</span> <spanclass="stringliteral">"Exclusive with --rsa_signing_key_path."</span>);</div>
<divclass="line"><aname="l00057"></a><spanclass="lineno"> 57</span> DEFINE_hex_bytes(aes_signing_iv, <spanclass="stringliteral">""</span>, <spanclass="stringliteral">"AES signing iv in hex string."</span>);</div>
<divclass="line"><aname="l00064"></a><spanclass="lineno"> 64</span> <spanclass="stringliteral">"Crypto period duration in seconds. If it is non-zero, key "</span></div>
<divclass="line"><aname="l00065"></a><spanclass="lineno"> 65</span> <spanclass="stringliteral">"rotation is enabled."</span>);</div>
<divclass="line"><aname="l00066"></a><spanclass="lineno"> 66</span> DEFINE_hex_bytes(group_id, <spanclass="stringliteral">""</span>, <spanclass="stringliteral">"Identifier for a group of licenses (hex)."</span>);</div>
<divclass="line"><aname="l00080"></a><spanclass="lineno"> 80</span> <spanclass="comment">// key_server_url and signer (optional) are associated with</span></div>
<divclass="line"><aname="l00081"></a><spanclass="lineno"> 81</span> <spanclass="comment">// enable_widevine_encryption and enable_widevine_descryption.</span></div>
<divclass="line"><aname="l00099"></a><spanclass="lineno"> 99</span>  LOG(WARNING) <<<spanclass="stringliteral">"--signer is likely required with "</span></div>
<divclass="line"><aname="l00104"></a><spanclass="lineno"> 104</span> <spanclass="comment">// content_id and policy (optional) are associated with</span></div>
<divclass="line"><aname="l00121"></a><spanclass="lineno"> 121</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--include_common_pssh is only valid with "</span></div>
<divclass="line"><aname="l00127"></a><spanclass="lineno"> 127</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--max_sd_pixels must be positive."</span>);</div>
<divclass="line"><aname="l00131"></a><spanclass="lineno"> 131</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--max_hd_pixels must be positive."</span>);</div>
<divclass="line"><aname="l00135"></a><spanclass="lineno"> 135</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--max_uhd1_pixels must be positive."</span>);</div>
<divclass="line"><aname="l00139"></a><spanclass="lineno"> 139</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--max_hd_pixels must be greater than --max_sd_pixels."</span>);</div>
<divclass="line"><aname="l00143"></a><spanclass="lineno"> 143</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--max_uhd1_pixels must be greater than --max_hd_pixels."</span>);</div>
<divclass="line"><aname="l00151"></a><spanclass="lineno"> 151</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--aes_signing_key/iv is required if using aes signing."</span>);</div>
<divclass="line"><aname="l00158"></a><spanclass="lineno"> 158</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--signer is required if using aes/rsa signing."</span>);</div>
<divclass="line"><aname="l00163"></a><spanclass="lineno"> 163</span> <spanclass="stringliteral">"--aes_signing_key/iv or --rsa_signing_key_path is required with "</span></div>
<divclass="line"><aname="l00169"></a><spanclass="lineno"> 169</span> <spanclass="stringliteral">"Only one of --aes_signing_key/iv and --rsa_signing_key_path should be "</span></div>
<divclass="line"><aname="l00175"></a><spanclass="lineno"> 175</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--crypto_period_duration should not be negative."</span>);</div>