shaka-packager/docs/dc/d76/classshaka_1_1media_1_1BitW...

233 lines
11 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.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Shaka Packager SDK: shaka::media::BitWriter 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.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('../../',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</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="../../dc/d76/classshaka_1_1media_1_1BitWriter.html">BitWriter</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="../../d9/dc7/classshaka_1_1media_1_1BitWriter-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">shaka::media::BitWriter Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<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:a09495a53bd1f1885dcc328b1621041f4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d76/classshaka_1_1media_1_1BitWriter.html#a09495a53bd1f1885dcc328b1621041f4">BitWriter</a> (std::vector&lt; uint8_t &gt; *storage)</td></tr>
<tr class="separator:a09495a53bd1f1885dcc328b1621041f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee5f905e55f262e38f5df506611663f1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d76/classshaka_1_1media_1_1BitWriter.html#aee5f905e55f262e38f5df506611663f1">WriteBits</a> (uint32_t bits, size_t number_of_bits)</td></tr>
<tr class="separator:aee5f905e55f262e38f5df506611663f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c14f04a0bb3090edb3ac0fffa346bc1"><td class="memItemLeft" align="right" valign="top"><a id="a1c14f04a0bb3090edb3ac0fffa346bc1"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d76/classshaka_1_1media_1_1BitWriter.html#a1c14f04a0bb3090edb3ac0fffa346bc1">Flush</a> ()</td></tr>
<tr class="memdesc:a1c14f04a0bb3090edb3ac0fffa346bc1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write pending bits, and align bitstream with extra zero bits. <br /></td></tr>
<tr class="separator:a1c14f04a0bb3090edb3ac0fffa346bc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66164c7c6fcd524dd1f87b07f4c2e7fd"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d76/classshaka_1_1media_1_1BitWriter.html#a66164c7c6fcd524dd1f87b07f4c2e7fd">BitPos</a> () const</td></tr>
<tr class="separator:a66164c7c6fcd524dd1f87b07f4c2e7fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab523b5008232852ede4f31c1d4b2644"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d76/classshaka_1_1media_1_1BitWriter.html#aab523b5008232852ede4f31c1d4b2644">BytePos</a> () const</td></tr>
<tr class="separator:aab523b5008232852ede4f31c1d4b2644"><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 class="definition">Definition at line <a class="el" href="../../d0/dbc/bit__writer_8h_source.html#l00019">19</a> of file <a class="el" href="../../d0/dbc/bit__writer_8h_source.html">bit_writer.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a09495a53bd1f1885dcc328b1621041f4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a09495a53bd1f1885dcc328b1621041f4">&#9670;&nbsp;</a></span>BitWriter()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">shaka::media::BitWriter::BitWriter </td>
<td>(</td>
<td class="paramtype">std::vector&lt; uint8_t &gt; *&#160;</td>
<td class="paramname"><em>storage</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructor a <a class="el" href="../../dc/d76/classshaka_1_1media_1_1BitWriter.html">BitWriter</a> instance which writes to the provided storage. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">storage</td><td>points to vector this <a class="el" href="../../dc/d76/classshaka_1_1media_1_1BitWriter.html">BitWriter</a> writes to. Cannot be nullptr. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="../../dd/d58/bit__writer_8cc_source.html#l00012">12</a> of file <a class="el" href="../../dd/d58/bit__writer_8cc_source.html">bit_writer.cc</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a66164c7c6fcd524dd1f87b07f4c2e7fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a66164c7c6fcd524dd1f87b07f4c2e7fd">&#9670;&nbsp;</a></span>BitPos()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t shaka::media::BitWriter::BitPos </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</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>last written position, in bits. </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d0/dbc/bit__writer_8h_source.html#l00039">39</a> of file <a class="el" href="../../d0/dbc/bit__writer_8h_source.html">bit_writer.h</a>.</p>
</div>
</div>
<a id="aab523b5008232852ede4f31c1d4b2644"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aab523b5008232852ede4f31c1d4b2644">&#9670;&nbsp;</a></span>BytePos()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t shaka::media::BitWriter::BytePos </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</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>last written position, in bytes. </dd></dl>
<p class="definition">Definition at line <a class="el" href="../../d0/dbc/bit__writer_8h_source.html#l00042">42</a> of file <a class="el" href="../../d0/dbc/bit__writer_8h_source.html">bit_writer.h</a>.</p>
</div>
</div>
<a id="aee5f905e55f262e38f5df506611663f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aee5f905e55f262e38f5df506611663f1">&#9670;&nbsp;</a></span>WriteBits()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void shaka::media::BitWriter::WriteBits </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>bits</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>number_of_bits</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Appends the sequence 'bits' of length 'number_of_bits' &lt;= 32. Note that 'bits' should contain at most 'number_of_bits' bits, i.e. bits should be less than 1 &lt;&lt; number_of_bits. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">bits</td><td>is the data to write. </td></tr>
<tr><td class="paramname">number_of_bits</td><td>is the number of LSB to write, capped at 32. Cannot be zero. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="../../dd/d58/bit__writer_8cc_source.html#l00015">15</a> of file <a class="el" href="../../dd/d58/bit__writer_8cc_source.html">bit_writer.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="../../d0/dbc/bit__writer_8h_source.html">bit_writer.h</a></li>
<li>packager/media/base/<a class="el" href="../../dd/d58/bit__writer_8cc_source.html">bit_writer.cc</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Feb 10 2018 15:36:48 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.13
</small></address>
</body>
</html>