<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="l00059"></a><spanclass="lineno"> 59</span> <spanclass="stringliteral">"AES signing iv in hex string."</span>);</div>
<divclass="line"><aname="l00066"></a><spanclass="lineno"> 66</span> <spanclass="stringliteral">"Crypto period duration in seconds. If it is non-zero, key "</span></div>
<divclass="line"><aname="l00067"></a><spanclass="lineno"> 67</span> <spanclass="stringliteral">"rotation is enabled."</span>);</div>
<divclass="line"><aname="l00070"></a><spanclass="lineno"> 70</span> <spanclass="stringliteral">"Choose protection scheme, 'cenc' or 'cbc1' or pattern-based "</span></div>
<divclass="line"><aname="l00071"></a><spanclass="lineno"> 71</span> <spanclass="stringliteral">"protection schemes 'cens' or 'cbcs'."</span>);</div>
<divclass="line"><aname="l00082"></a><spanclass="lineno"> 82</span> <spanclass="comment">// key_server_url and signer (optional) are associated with</span></div>
<divclass="line"><aname="l00083"></a><spanclass="lineno"> 83</span> <spanclass="comment">// enable_widevine_encryption and enable_widevine_descryption.</span></div>
<divclass="line"><aname="l00101"></a><spanclass="lineno"> 101</span>  LOG(WARNING) <<<spanclass="stringliteral">"--signer is likely required with "</span></div>
<divclass="line"><aname="l00106"></a><spanclass="lineno"> 106</span> <spanclass="comment">// content_id and policy (optional) are associated with</span></div>
<divclass="line"><aname="l00123"></a><spanclass="lineno"> 123</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="l00129"></a><spanclass="lineno"> 129</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--max_sd_pixels must be positive."</span>);</div>
<divclass="line"><aname="l00133"></a><spanclass="lineno"> 133</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--max_hd_pixels must be positive."</span>);</div>
<divclass="line"><aname="l00137"></a><spanclass="lineno"> 137</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--max_uhd1_pixels must be positive."</span>);</div>
<divclass="line"><aname="l00141"></a><spanclass="lineno"> 141</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="l00145"></a><spanclass="lineno"> 145</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> <spanclass="stringliteral">"--signer is specified and exclusive with --rsa_signing_key_path"</span>;</div>
<divclass="line"><aname="l00152"></a><spanclass="lineno"> 152</span> <spanclass="comment">// aes_signer_key and aes_signing_iv are associated with aes signing.</span></div>
<divclass="line"><aname="l00165"></a><spanclass="lineno"> 165</span> <spanclass="stringliteral">"--signer is specified and exclusive with --aes_signing_key/iv"</span>;</div>
<divclass="line"><aname="l00166"></a><spanclass="lineno"> 166</span> <spanclass="comment">// rsa_signing_key_path is associated with rsa_signing.</span></div>
<divclass="line"><aname="l00179"></a><spanclass="lineno"> 179</span> <spanclass="stringliteral">"--aes_signing_key/iv or --rsa_signing_key_path is required with "</span></div>
<divclass="line"><aname="l00185"></a><spanclass="lineno"> 185</span> <aclass="code"href="../../d8/daf/namespaceshaka.html#a54fadd9c7ef14b39cd0355a5c269c772">PrintError</a>(<spanclass="stringliteral">"--crypto_period_duration should not be negative."</span>);</div>