shaka-packager/docs/d7/de0/classshaka_1_1media_1_1Http...

408 lines
20 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.6"/>
<title>DASH Media Packaging SDK: shaka::media::HttpKeyFetcher 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/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</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 style="padding-left: 0.5em;">
<div id="projectname">DASH Media Packaging SDK
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
<li><a href="../../namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="../../annotated.html"><span>Classes</span></a></li>
<li><a href="../../files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="../../search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="../../annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="../../classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="../../hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="../../functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a></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="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html">HttpKeyFetcher</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="../../d0/d0e/classshaka_1_1media_1_1HttpKeyFetcher-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">shaka::media::HttpKeyFetcher Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="../../db/d71/http__key__fetcher_8h_source.html">http_key_fetcher.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for shaka::media::HttpKeyFetcher:</div>
<div class="dyncontent">
<div class="center">
<img src="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.png" usemap="#shaka::media::HttpKeyFetcher_map" alt=""/>
<map id="shaka::media::HttpKeyFetcher_map" name="shaka::media::HttpKeyFetcher_map">
<area href="../../df/d66/classshaka_1_1media_1_1KeyFetcher.html" title="Base class for fetching keys from the license service. " alt="shaka::media::KeyFetcher" shape="rect" coords="0,0,178,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 class="memitem:a02561dcbbaf66152dce3ebd466810f15"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a02561dcbbaf66152dce3ebd466810f15"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#a02561dcbbaf66152dce3ebd466810f15">HttpKeyFetcher</a> ()</td></tr>
<tr class="memdesc:a02561dcbbaf66152dce3ebd466810f15"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a fetcher with no timeout. <br/></td></tr>
<tr class="separator:a02561dcbbaf66152dce3ebd466810f15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11829a5c6e3507998c4d93c83c3069a4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#a11829a5c6e3507998c4d93c83c3069a4">HttpKeyFetcher</a> (uint32_t timeout_in_seconds)</td></tr>
<tr class="separator:a11829a5c6e3507998c4d93c83c3069a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="member-group"></a>
KeyFetcher implementation overrides.</h2></td></tr>
<tr class="memitem:ab8e9b01fac00aa5dafb8983acd7a297b"><td class="memItemLeft" align="right" valign="top">Status&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#ab8e9b01fac00aa5dafb8983acd7a297b">FetchKeys</a> (const std::string &amp;url, const std::string &amp;request, std::string *response) override</td></tr>
<tr class="separator:ab8e9b01fac00aa5dafb8983acd7a297b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b5b2c193d6055ca49d2d6af2b2ac4cc"><td class="memItemLeft" align="right" valign="top">virtual Status&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#a6b5b2c193d6055ca49d2d6af2b2ac4cc">Get</a> (const std::string &amp;url, std::string *response)</td></tr>
<tr class="separator:a6b5b2c193d6055ca49d2d6af2b2ac4cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31e904e2f802e5626c4420675c76d513"><td class="memItemLeft" align="right" valign="top">virtual Status&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#a31e904e2f802e5626c4420675c76d513">Post</a> (const std::string &amp;url, const std::string &amp;data, std::string *response)</td></tr>
<tr class="separator:a31e904e2f802e5626c4420675c76d513"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ed8d56dddc800d76b57ed3674f01270"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#a2ed8d56dddc800d76b57ed3674f01270">SetClientCertInfo</a> (const std::string &amp;cert_file, const std::string &amp;private_key_file, const std::string &amp;private_key_password)</td></tr>
<tr class="separator:a2ed8d56dddc800d76b57ed3674f01270"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8420a100f8ff8e86c6bc95642ce29d0b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html#a8420a100f8ff8e86c6bc95642ce29d0b">SetCaFile</a> (const std::string &amp;ca_file)</td></tr>
<tr class="separator:a8420a100f8ff8e86c6bc95642ce29d0b"><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 <a class="el" href="../../df/d66/classshaka_1_1media_1_1KeyFetcher.html" title="Base class for fetching keys from the license service. ">KeyFetcher</a> implementation that retrieves keys over HTTP(s). This class is not fully thread safe. It can be used in multi-thread environment once constructed, but it may not be safe to create a <a class="el" href="../../d7/de0/classshaka_1_1media_1_1HttpKeyFetcher.html">HttpKeyFetcher</a> object when any other thread is running due to use of curl_global_init. </p>
<p>Definition at line <a class="el" href="../../db/d71/http__key__fetcher_8h_source.html#l00026">26</a> of file <a class="el" href="../../db/d71/http__key__fetcher_8h_source.html">http_key_fetcher.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a11829a5c6e3507998c4d93c83c3069a4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">shaka::media::HttpKeyFetcher::HttpKeyFetcher </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>timeout_in_seconds</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a fetcher with timeout. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">timeout_in_seconds</td><td>specifies the timeout in seconds. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html#l00079">79</a> of file <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html">http_key_fetcher.cc</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ab8e9b01fac00aa5dafb8983acd7a297b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Status shaka::media::HttpKeyFetcher::FetchKeys </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>service_address</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>request</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string *&#160;</td>
<td class="paramname"><em>response</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 from license service. |response| is owned by caller. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">service_address</td><td>license service address. </td></tr>
<tr><td class="paramname">request</td><td>JSON formatted request. </td></tr>
<tr><td class="paramname">response</td><td>JSON formatted response. Owned by caller. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>OK on success. </dd></dl>
<p>Implements <a class="el" href="../../df/d66/classshaka_1_1media_1_1KeyFetcher.html#aa3c6011a0dd7c8e7f53dbaf48b92718d">shaka::media::KeyFetcher</a>.</p>
<p>Definition at line <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html#l00084">84</a> of file <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html">http_key_fetcher.cc</a>.</p>
</div>
</div>
<a class="anchor" id="a6b5b2c193d6055ca49d2d6af2b2ac4cc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Status shaka::media::HttpKeyFetcher::Get </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>url</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string *&#160;</td>
<td class="paramname"><em>response</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">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Fetch content using HTTP GET. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir"></td><td class="paramname">url</td><td>specifies the content URL. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">response</td><td>will contain the body of the http response on success. It should not be NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>OK on success. </dd></dl>
<p>Definition at line <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html#l00090">90</a> of file <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html">http_key_fetcher.cc</a>.</p>
</div>
</div>
<a class="anchor" id="a31e904e2f802e5626c4420675c76d513"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Status shaka::media::HttpKeyFetcher::Post </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>url</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">std::string *&#160;</td>
<td class="paramname"><em>response</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">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Fetch content using HTTP POST. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir"></td><td class="paramname">url</td><td>specifies the content URL. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">response</td><td>will contain the body of the http response on success. It should not be NULL. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>OK on success. </dd></dl>
<p>Definition at line <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html#l00094">94</a> of file <a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html">http_key_fetcher.cc</a>.</p>
</div>
</div>
<a class="anchor" id="a8420a100f8ff8e86c6bc95642ce29d0b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void shaka::media::HttpKeyFetcher::SetCaFile </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>ca_file</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the Certifiate Authority file information for http requests. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ca_file</td><td>absolute path to the client certificate </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="../../db/d71/http__key__fetcher_8h_source.html#l00070">70</a> of file <a class="el" href="../../db/d71/http__key__fetcher_8h_source.html">http_key_fetcher.h</a>.</p>
</div>
</div>
<a class="anchor" id="a2ed8d56dddc800d76b57ed3674f01270"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void shaka::media::HttpKeyFetcher::SetClientCertInfo </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>cert_file</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>private_key_file</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>private_key_password</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">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets client certificate information for http requests. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">cert_file</td><td>absolute path to the client certificate. </td></tr>
<tr><td class="paramname">private_key_file</td><td>absolute path to the client certificate private key file. </td></tr>
<tr><td class="paramname">private_key_password</td><td>private key password. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="../../db/d71/http__key__fetcher_8h_source.html#l00061">61</a> of file <a class="el" href="../../db/d71/http__key__fetcher_8h_source.html">http_key_fetcher.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>media/base/<a class="el" href="../../db/d71/http__key__fetcher_8h_source.html">http_key_fetcher.h</a></li>
<li>media/base/<a class="el" href="../../de/d70/http__key__fetcher_8cc_source.html">http_key_fetcher.cc</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Jul 13 2017 21:49:22 for DASH Media Packaging SDK by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>