shaka-packager/docs/d9/d13/classshaka_1_1media_1_1Buff...

285 lines
18 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::BufferReader 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="../../d9/d13/classshaka_1_1media_1_1BufferReader.html">BufferReader</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="../../d9/dc4/classshaka_1_1media_1_1BufferReader-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">shaka::media::BufferReader Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="../../de/d3e/buffer__reader_8h_source.html">buffer_reader.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for shaka::media::BufferReader:</div>
<div class="dyncontent">
<div class="center">
<img src="../../d9/d13/classshaka_1_1media_1_1BufferReader.png" usemap="#shaka::media::BufferReader_map" alt=""/>
<map id="shaka::media::BufferReader_map" name="shaka::media::BufferReader_map">
<area href="../../d1/dee/classshaka_1_1media_1_1mp4_1_1BoxReader.html" title="Class for reading MP4 boxes. " alt="shaka::media::mp4::BoxReader" shape="rect" coords="0,56,181,80"/>
</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:a94771befc54d444630ade726689b7bf7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a94771befc54d444630ade726689b7bf7"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d13/classshaka_1_1media_1_1BufferReader.html#a94771befc54d444630ade726689b7bf7">BufferReader</a> (const uint8_t *buf, size_t size)</td></tr>
<tr class="memdesc:a94771befc54d444630ade726689b7bf7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a <a class="el" href="../../d9/d13/classshaka_1_1media_1_1BufferReader.html">BufferReader</a> from a raw buffer. <br/></td></tr>
<tr class="separator:a94771befc54d444630ade726689b7bf7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a208f2fda9ea3e79583284c951642c356"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d13/classshaka_1_1media_1_1BufferReader.html#a208f2fda9ea3e79583284c951642c356">HasBytes</a> (size_t count)</td></tr>
<tr class="separator:a208f2fda9ea3e79583284c951642c356"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b4d02b2edaa39f8fc096b6f149764e0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8b4d02b2edaa39f8fc096b6f149764e0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>ReadToVector</b> (std::vector&lt; uint8_t &gt; *t, size_t count) WARN_UNUSED_RESULT</td></tr>
<tr class="separator:a8b4d02b2edaa39f8fc096b6f149764e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a888127e78a76a19d0749c5b01451b493"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a888127e78a76a19d0749c5b01451b493"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>ReadToString</b> (std::string *str, size_t size) WARN_UNUSED_RESULT</td></tr>
<tr class="separator:a888127e78a76a19d0749c5b01451b493"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b15dfcd6ff891a9cb7b76f48d91d15d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d13/classshaka_1_1media_1_1BufferReader.html#a2b15dfcd6ff891a9cb7b76f48d91d15d">SkipBytes</a> (size_t num_bytes) WARN_UNUSED_RESULT</td></tr>
<tr class="separator:a2b15dfcd6ff891a9cb7b76f48d91d15d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae6bf752cf5fb4f8ab9d81f173513a6e0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae6bf752cf5fb4f8ab9d81f173513a6e0"></a>
const uint8_t *&#160;</td><td class="memItemRight" valign="bottom"><b>data</b> () const </td></tr>
<tr class="separator:ae6bf752cf5fb4f8ab9d81f173513a6e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0330cc5148ab6caaab419c6a99dbf078"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0330cc5148ab6caaab419c6a99dbf078"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><b>size</b> () const </td></tr>
<tr class="separator:a0330cc5148ab6caaab419c6a99dbf078"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1655078d96e5f7a03428020424e030b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1655078d96e5f7a03428020424e030b7"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>set_size</b> (size_t size)</td></tr>
<tr class="separator:a1655078d96e5f7a03428020424e030b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab160ceeeb466e6cb4b6e7faf2be3bb28"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab160ceeeb466e6cb4b6e7faf2be3bb28"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><b>pos</b> () const </td></tr>
<tr class="separator:ab160ceeeb466e6cb4b6e7faf2be3bb28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr class="memitem:a65b65ad5a5ebc9d66182c38ec9876c05"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d13/classshaka_1_1media_1_1BufferReader.html#a65b65ad5a5ebc9d66182c38ec9876c05">Read1</a> (uint8_t *v) WARN_UNUSED_RESULT</td></tr>
<tr class="separator:a65b65ad5a5ebc9d66182c38ec9876c05"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c0cd94e66518ac4bab45de8d9925339"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0c0cd94e66518ac4bab45de8d9925339"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>Read2</b> (uint16_t *v) WARN_UNUSED_RESULT</td></tr>
<tr class="separator:a0c0cd94e66518ac4bab45de8d9925339"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19eb7704f5ddbed3157c2e5ac8c7ef90"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a19eb7704f5ddbed3157c2e5ac8c7ef90"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>Read2s</b> (int16_t *v) WARN_UNUSED_RESULT</td></tr>
<tr class="separator:a19eb7704f5ddbed3157c2e5ac8c7ef90"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab96a57f54c9b6133f6d3e8e286c8e344"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab96a57f54c9b6133f6d3e8e286c8e344"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>Read4</b> (uint32_t *v) WARN_UNUSED_RESULT</td></tr>
<tr class="separator:ab96a57f54c9b6133f6d3e8e286c8e344"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee877a7aaed1d54d0d27926535b510c8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aee877a7aaed1d54d0d27926535b510c8"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>Read4s</b> (int32_t *v) WARN_UNUSED_RESULT</td></tr>
<tr class="separator:aee877a7aaed1d54d0d27926535b510c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af35eef03acef17082419d761019422ca"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af35eef03acef17082419d761019422ca"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>Read8</b> (uint64_t *v) WARN_UNUSED_RESULT</td></tr>
<tr class="separator:af35eef03acef17082419d761019422ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85912ce8cb834cda8ab3c462eaa612e8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a85912ce8cb834cda8ab3c462eaa612e8"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>Read8s</b> (int64_t *v) WARN_UNUSED_RESULT</td></tr>
<tr class="separator:a85912ce8cb834cda8ab3c462eaa612e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr class="memitem:ac98c6631c07300a6b78ec58bfd4ced30"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d13/classshaka_1_1media_1_1BufferReader.html#ac98c6631c07300a6b78ec58bfd4ced30">ReadNBytesInto8</a> (uint64_t *v, size_t num_bytes) WARN_UNUSED_RESULT</td></tr>
<tr class="separator:ac98c6631c07300a6b78ec58bfd4ced30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2e3aa35e13ae225dc1159e159ca086a1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2e3aa35e13ae225dc1159e159ca086a1"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>ReadNBytesInto8s</b> (int64_t *v, size_t num_bytes) WARN_UNUSED_RESULT</td></tr>
<tr class="separator:a2e3aa35e13ae225dc1159e159ca086a1"><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 simple buffer reader implementation, which reads data of various types from a fixed byte array. </p>
<p>Definition at line <a class="el" href="../../de/d3e/buffer__reader_8h_source.html#l00023">23</a> of file <a class="el" href="../../de/d3e/buffer__reader_8h_source.html">buffer_reader.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a208f2fda9ea3e79583284c951642c356"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool shaka::media::BufferReader::HasBytes </td>
<td>(</td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>count</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">
<dl class="section return"><dt>Returns</dt><dd>true if there are more than <em>count</em> bytes in the stream, false otherwise. </dd></dl>
<p>Definition at line <a class="el" href="../../de/d3e/buffer__reader_8h_source.html#l00032">32</a> of file <a class="el" href="../../de/d3e/buffer__reader_8h_source.html">buffer_reader.h</a>.</p>
</div>
</div>
<a class="anchor" id="a65b65ad5a5ebc9d66182c38ec9876c05"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool shaka::media::BufferReader::Read1 </td>
<td>(</td>
<td class="paramtype">uint8_t *&#160;</td>
<td class="paramname"><em>v</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Read a value from the stream, performing endian correction, and advance the stream pointer. </p>
<dl class="section return"><dt>Returns</dt><dd>false if there are not enough bytes in the buffer. </dd></dl>
<p>Definition at line <a class="el" href="../../dd/dbc/buffer__reader_8cc_source.html#l00014">14</a> of file <a class="el" href="../../dd/dbc/buffer__reader_8cc_source.html">buffer_reader.cc</a>.</p>
</div>
</div>
<a class="anchor" id="ac98c6631c07300a6b78ec58bfd4ced30"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool shaka::media::BufferReader::ReadNBytesInto8 </td>
<td>(</td>
<td class="paramtype">uint64_t *&#160;</td>
<td class="paramname"><em>v</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>num_bytes</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Read N-byte integer of the corresponding signedness and store it in the 8-byte return type. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">num_bytes</td><td>should not be larger than 8 bytes. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>false if there are not enough bytes in the buffer, true otherwise. </dd></dl>
<p>Definition at line <a class="el" href="../../dd/dbc/buffer__reader_8cc_source.html#l00040">40</a> of file <a class="el" href="../../dd/dbc/buffer__reader_8cc_source.html">buffer_reader.cc</a>.</p>
</div>
</div>
<a class="anchor" id="a2b15dfcd6ff891a9cb7b76f48d91d15d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool shaka::media::BufferReader::SkipBytes </td>
<td>(</td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>num_bytes</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Advance the stream by this many bytes. </p>
<dl class="section return"><dt>Returns</dt><dd>false if there are not enough bytes in the buffer, true otherwise. </dd></dl>
<p>Definition at line <a class="el" href="../../dd/dbc/buffer__reader_8cc_source.html#l00065">65</a> of file <a class="el" href="../../dd/dbc/buffer__reader_8cc_source.html">buffer_reader.cc</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>media/base/<a class="el" href="../../de/d3e/buffer__reader_8h_source.html">buffer_reader.h</a></li>
<li>media/base/<a class="el" href="../../dd/dbc/buffer__reader_8cc_source.html">buffer_reader.cc</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Jun 20 2017 14:39:24 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>