shaka-packager/docs/db/dd0/classshaka_1_1media_1_1RawK...

365 lines
19 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Shaka Packager SDK: shaka::media::RawKeySource Class Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Shaka Packager SDK
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="../../d8/daf/namespaceshaka.html">shaka</a></li><li class="navelem"><b>media</b></li><li class="navelem"><a class="el" href="../../db/dd0/classshaka_1_1media_1_1RawKeySource.html">RawKeySource</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="../../d6/d6b/classshaka_1_1media_1_1RawKeySource-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">shaka::media::RawKeySource Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A key source that uses raw keys for encryption.
<a href="../../db/dd0/classshaka_1_1media_1_1RawKeySource.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="../../dd/d60/raw__key__source_8h_source.html">raw_key_source.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for shaka::media::RawKeySource:</div>
<div class="dyncontent">
<div class="center">
<img src="../../db/dd0/classshaka_1_1media_1_1RawKeySource.png" usemap="#shaka::media::RawKeySource_map" alt=""/>
<map id="shaka::media::RawKeySource_map" name="shaka::media::RawKeySource_map">
<area href="../../d1/d1f/classshaka_1_1media_1_1KeySource.html" title="KeySource is responsible for encryption key acquisition." alt="shaka::media::KeySource" shape="rect" coords="0,0,177,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">KeySource implementation overrides.</div></td></tr>
<tr class="memitem:a0849f7000c4ab37139cc9c9ea1a031f3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd0/classshaka_1_1media_1_1RawKeySource.html#a0849f7000c4ab37139cc9c9ea1a031f3">FetchKeys</a> (EmeInitDataType init_data_type, const std::vector&lt; uint8_t &gt; &amp;init_data) override</td></tr>
<tr class="separator:a0849f7000c4ab37139cc9c9ea1a031f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a29b20968ba46f1ad3c206b8173fa6f7a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd0/classshaka_1_1media_1_1RawKeySource.html#a29b20968ba46f1ad3c206b8173fa6f7a">GetKey</a> (const std::string &amp;stream_label, <a class="el" href="../../dd/dbd/structshaka_1_1media_1_1EncryptionKey.html">EncryptionKey</a> *key) override</td></tr>
<tr class="separator:a29b20968ba46f1ad3c206b8173fa6f7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5b34dcc690e695f64846a8293335967"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd0/classshaka_1_1media_1_1RawKeySource.html#aa5b34dcc690e695f64846a8293335967">GetKey</a> (const std::vector&lt; uint8_t &gt; &amp;key_id, <a class="el" href="../../dd/dbd/structshaka_1_1media_1_1EncryptionKey.html">EncryptionKey</a> *key) override</td></tr>
<tr class="separator:aa5b34dcc690e695f64846a8293335967"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7518bb799554beefebda75eb76aafbd5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd0/classshaka_1_1media_1_1RawKeySource.html#a7518bb799554beefebda75eb76aafbd5">GetCryptoPeriodKey</a> (uint32_t crypto_period_index, uint32_t crypto_period_duration_in_seconds, const std::string &amp;stream_label, <a class="el" href="../../dd/dbd/structshaka_1_1media_1_1EncryptionKey.html">EncryptionKey</a> *key) override</td></tr>
<tr class="separator:a7518bb799554beefebda75eb76aafbd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:aea32604de0ad9489731d188c50e7accf"><td class="memItemLeft" align="right" valign="top">static std::unique_ptr&lt; <a class="el" href="../../db/dd0/classshaka_1_1media_1_1RawKeySource.html">RawKeySource</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/dd0/classshaka_1_1media_1_1RawKeySource.html#aea32604de0ad9489731d188c50e7accf">Create</a> (const <a class="el" href="../../d0/db4/structshaka_1_1RawKeyParams.html">RawKeyParams</a> &amp;raw_key)</td></tr>
<tr class="separator:aea32604de0ad9489731d188c50e7accf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A key source that uses raw keys for encryption. </p>
<p class="definition">Definition at line <a class="el" href="../../dd/d60/raw__key__source_8h_source.html#l00021">21</a> of file <a class="el" href="../../dd/d60/raw__key__source_8h_source.html">raw_key_source.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="aea32604de0ad9489731d188c50e7accf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aea32604de0ad9489731d188c50e7accf">&#9670;&nbsp;</a></span>Create()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::unique_ptr&lt; <a class="el" href="../../db/dd0/classshaka_1_1media_1_1RawKeySource.html">RawKeySource</a> &gt; shaka::media::RawKeySource::Create </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="../../d0/db4/structshaka_1_1RawKeyParams.html">RawKeyParams</a> &amp;&#160;</td>
<td class="paramname"><em>raw_key</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a new <a class="el" href="../../db/dd0/classshaka_1_1media_1_1RawKeySource.html" title="A key source that uses raw keys for encryption.">RawKeySource</a> from the given data. Returns null if the parameter is malformed. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">raw_key</td><td>contains parameters to setup the key source. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="../../d4/dd6/raw__key__source_8cc_source.html#l00085">85</a> of file <a class="el" href="../../d4/dd6/raw__key__source_8cc_source.html">raw_key_source.cc</a>.</p>
</div>
</div>
<a id="a0849f7000c4ab37139cc9c9ea1a031f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0849f7000c4ab37139cc9c9ea1a031f3">&#9670;&nbsp;</a></span>FetchKeys()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a> shaka::media::RawKeySource::FetchKeys </td>
<td>(</td>
<td class="paramtype">EmeInitDataType&#160;</td>
<td class="paramname"><em>init_data_type</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; uint8_t &gt; &amp;&#160;</td>
<td class="paramname"><em>init_data</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Fetch keys based on the specified encrypted media init data. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">init_data_type</td><td>specifies the encrypted media init data type. </td></tr>
<tr><td class="paramname">init_data</td><td>contains the init data. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>OK on success, an error status otherwise. </dd></dl>
<p>Implements <a class="el" href="../../d1/d1f/classshaka_1_1media_1_1KeySource.html#a38dc8e7c48f86e2b3ab3c1ffe0d7916f">shaka::media::KeySource</a>.</p>
<p class="definition">Definition at line <a class="el" href="../../d4/dd6/raw__key__source_8cc_source.html#l00024">24</a> of file <a class="el" href="../../d4/dd6/raw__key__source_8cc_source.html">raw_key_source.cc</a>.</p>
</div>
</div>
<a id="a7518bb799554beefebda75eb76aafbd5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7518bb799554beefebda75eb76aafbd5">&#9670;&nbsp;</a></span>GetCryptoPeriodKey()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a> shaka::media::RawKeySource::GetCryptoPeriodKey </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>crypto_period_index</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>crypto_period_duration_in_seconds</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>stream_label</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="../../dd/dbd/structshaka_1_1media_1_1EncryptionKey.html">EncryptionKey</a> *&#160;</td>
<td class="paramname"><em>key</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get encryption key of the specified track type at the specified index. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">crypto_period_index</td><td>is the sequence number of the key rotation period for which the key is being retrieved. </td></tr>
<tr><td class="paramname">crypto_period_duration_in_seconds</td><td>is the duration of the crypto period in seconds. </td></tr>
<tr><td class="paramname">stream_label</td><td>is the label of stream for which retrieving the key. </td></tr>
<tr><td class="paramname">key</td><td>is a pointer to the <a class="el" href="../../dd/dbd/structshaka_1_1media_1_1EncryptionKey.html">EncryptionKey</a> which will hold the retrieved key. Owner retains ownership, and may not be NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>OK on success, an error status otherwise. </dd></dl>
<p>Implements <a class="el" href="../../d1/d1f/classshaka_1_1media_1_1KeySource.html#aef67793f02b0cd34b57993fab9f789ae">shaka::media::KeySource</a>.</p>
<p class="definition">Definition at line <a class="el" href="../../d4/dd6/raw__key__source_8cc_source.html#l00061">61</a> of file <a class="el" href="../../d4/dd6/raw__key__source_8cc_source.html">raw_key_source.cc</a>.</p>
</div>
</div>
<a id="a29b20968ba46f1ad3c206b8173fa6f7a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a29b20968ba46f1ad3c206b8173fa6f7a">&#9670;&nbsp;</a></span>GetKey() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a> shaka::media::RawKeySource::GetKey </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>stream_label</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="../../dd/dbd/structshaka_1_1media_1_1EncryptionKey.html">EncryptionKey</a> *&#160;</td>
<td class="paramname"><em>key</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get encryption key of the specified stream label. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">stream_label</td><td>is the label of stream for which retrieving the key. </td></tr>
<tr><td class="paramname">key</td><td>is a pointer to the <a class="el" href="../../dd/dbd/structshaka_1_1media_1_1EncryptionKey.html">EncryptionKey</a> which will hold the retrieved key. Owner retains ownership, and may not be NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>OK on success, an error status otherwise. </dd></dl>
<p>Implements <a class="el" href="../../d1/d1f/classshaka_1_1media_1_1KeySource.html#af56c833453d65297c4dc96c9d2f83e1a">shaka::media::KeySource</a>.</p>
<p class="definition">Definition at line <a class="el" href="../../d4/dd6/raw__key__source_8cc_source.html#l00030">30</a> of file <a class="el" href="../../d4/dd6/raw__key__source_8cc_source.html">raw_key_source.cc</a>.</p>
</div>
</div>
<a id="aa5b34dcc690e695f64846a8293335967"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5b34dcc690e695f64846a8293335967">&#9670;&nbsp;</a></span>GetKey() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a> shaka::media::RawKeySource::GetKey </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; uint8_t &gt; &amp;&#160;</td>
<td class="paramname"><em>key_id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="../../dd/dbd/structshaka_1_1media_1_1EncryptionKey.html">EncryptionKey</a> *&#160;</td>
<td class="paramname"><em>key</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the encryption key specified by the CENC key ID. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">key_id</td><td>is the unique identifier for the key being retreived. </td></tr>
<tr><td class="paramname">key</td><td>is a pointer to the <a class="el" href="../../dd/dbd/structshaka_1_1media_1_1EncryptionKey.html">EncryptionKey</a> which will hold the retrieved key. Owner retains ownership, and may not be NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>OK on success, or an error status otherwise. </dd></dl>
<p>Implements <a class="el" href="../../d1/d1f/classshaka_1_1media_1_1KeySource.html#ae33f2cdbd045572095acd7b8d6c1a789">shaka::media::KeySource</a>.</p>
<p class="definition">Definition at line <a class="el" href="../../d4/dd6/raw__key__source_8cc_source.html#l00047">47</a> of file <a class="el" href="../../d4/dd6/raw__key__source_8cc_source.html">raw_key_source.cc</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>packager/media/base/<a class="el" href="../../dd/d60/raw__key__source_8h_source.html">raw_key_source.h</a></li>
<li>packager/media/base/<a class="el" href="../../d4/dd6/raw__key__source_8cc_source.html">raw_key_source.cc</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Jun 22 2021 00:16:05 for Shaka Packager SDK by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>