293 lines
17 KiB
HTML
293 lines
17 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::BufferWriter 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/d41/classshaka_1_1media_1_1BufferWriter.html">BufferWriter</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="../../d2/da9/classshaka_1_1media_1_1BufferWriter-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">shaka::media::BufferWriter Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p><code>#include <<a class="el" href="../../dd/dd2/buffer__writer_8h_source.html">buffer_writer.h</a>></code></p>
|
|
<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:a01d91524fd5c5491bafcc1cff16db916"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d41/classshaka_1_1media_1_1BufferWriter.html#a01d91524fd5c5491bafcc1cff16db916">BufferWriter</a> (size_t reserved_size_in_bytes)</td></tr>
|
|
<tr class="separator:a01d91524fd5c5491bafcc1cff16db916"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae44b09c03c9b8f0fbf58deb80355f299"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d41/classshaka_1_1media_1_1BufferWriter.html#ae44b09c03c9b8f0fbf58deb80355f299">AppendNBytes</a> (uint64_t v, size_t num_bytes)</td></tr>
|
|
<tr class="separator:ae44b09c03c9b8f0fbf58deb80355f299"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a697768457da5482cb8fbc5d542985e92"><td class="memItemLeft" align="right" valign="top"><a id="a697768457da5482cb8fbc5d542985e92"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>AppendVector</b> (const std::vector< uint8_t > &v)</td></tr>
|
|
<tr class="separator:a697768457da5482cb8fbc5d542985e92"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae3e6f1b9982c52c55c86ca8969e74fe7"><td class="memItemLeft" align="right" valign="top"><a id="ae3e6f1b9982c52c55c86ca8969e74fe7"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>AppendArray</b> (const uint8_t *buf, size_t size)</td></tr>
|
|
<tr class="separator:ae3e6f1b9982c52c55c86ca8969e74fe7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae4f794dddb2197605629d9ac33836f65"><td class="memItemLeft" align="right" valign="top"><a id="ae4f794dddb2197605629d9ac33836f65"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>AppendBuffer</b> (const <a class="el" href="../../dc/d41/classshaka_1_1media_1_1BufferWriter.html">BufferWriter</a> &buffer)</td></tr>
|
|
<tr class="separator:ae4f794dddb2197605629d9ac33836f65"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0c82a43b9b4381a222cac25aabb71114"><td class="memItemLeft" align="right" valign="top"><a id="a0c82a43b9b4381a222cac25aabb71114"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>Swap</b> (<a class="el" href="../../dc/d41/classshaka_1_1media_1_1BufferWriter.html">BufferWriter</a> *buffer)</td></tr>
|
|
<tr class="separator:a0c82a43b9b4381a222cac25aabb71114"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:afeb292c178bd21d47dd84710fe274d22"><td class="memItemLeft" align="right" valign="top"><a id="afeb292c178bd21d47dd84710fe274d22"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>SwapBuffer</b> (std::vector< uint8_t > *buffer)</td></tr>
|
|
<tr class="separator:afeb292c178bd21d47dd84710fe274d22"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3bcbf8dde71ad8ac98bf6274b847cc83"><td class="memItemLeft" align="right" valign="top"><a id="a3bcbf8dde71ad8ac98bf6274b847cc83"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>Clear</b> ()</td></tr>
|
|
<tr class="separator:a3bcbf8dde71ad8ac98bf6274b847cc83"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a25aa1f20cb2f29430dc5def3c023547f"><td class="memItemLeft" align="right" valign="top"><a id="a25aa1f20cb2f29430dc5def3c023547f"></a>
|
|
size_t </td><td class="memItemRight" valign="bottom"><b>Size</b> () const</td></tr>
|
|
<tr class="separator:a25aa1f20cb2f29430dc5def3c023547f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:abe93b64e488c65f8c1595191d659f7dc"><td class="memItemLeft" align="right" valign="top">const uint8_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d41/classshaka_1_1media_1_1BufferWriter.html#abe93b64e488c65f8c1595191d659f7dc">Buffer</a> () const</td></tr>
|
|
<tr class="separator:abe93b64e488c65f8c1595191d659f7dc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a868dba843fcf923dd140fdda859a3a6d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d41/classshaka_1_1media_1_1BufferWriter.html#a868dba843fcf923dd140fdda859a3a6d">WriteToFile</a> (<a class="el" href="../../d3/d73/classshaka_1_1File.html">File</a> *file)</td></tr>
|
|
<tr class="separator:a868dba843fcf923dd140fdda859a3a6d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
|
|
<tr class="memitem:abd8854feedd8b45146eb04dacf7d5b2f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d41/classshaka_1_1media_1_1BufferWriter.html#abd8854feedd8b45146eb04dacf7d5b2f">AppendInt</a> (uint8_t v)</td></tr>
|
|
<tr class="separator:abd8854feedd8b45146eb04dacf7d5b2f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:abcc99a3ba412a7e67b699fbc3bbe97cd"><td class="memItemLeft" align="right" valign="top"><a id="abcc99a3ba412a7e67b699fbc3bbe97cd"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>AppendInt</b> (uint16_t v)</td></tr>
|
|
<tr class="separator:abcc99a3ba412a7e67b699fbc3bbe97cd"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:acccb1ec2840bd2cab8d47b8eb9efe0eb"><td class="memItemLeft" align="right" valign="top"><a id="acccb1ec2840bd2cab8d47b8eb9efe0eb"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>AppendInt</b> (uint32_t v)</td></tr>
|
|
<tr class="separator:acccb1ec2840bd2cab8d47b8eb9efe0eb"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac0416c01d8c887024556b478c606e002"><td class="memItemLeft" align="right" valign="top"><a id="ac0416c01d8c887024556b478c606e002"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>AppendInt</b> (uint64_t v)</td></tr>
|
|
<tr class="separator:ac0416c01d8c887024556b478c606e002"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a98426eb6587c144f44e0fd36bbab2d15"><td class="memItemLeft" align="right" valign="top"><a id="a98426eb6587c144f44e0fd36bbab2d15"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>AppendInt</b> (int16_t v)</td></tr>
|
|
<tr class="separator:a98426eb6587c144f44e0fd36bbab2d15"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4a3d4183a1ff6aca62db4a20af2b84a0"><td class="memItemLeft" align="right" valign="top"><a id="a4a3d4183a1ff6aca62db4a20af2b84a0"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>AppendInt</b> (int32_t v)</td></tr>
|
|
<tr class="separator:a4a3d4183a1ff6aca62db4a20af2b84a0"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aad58ece192586d2972c1ef56dde3dec1"><td class="memItemLeft" align="right" valign="top"><a id="aad58ece192586d2972c1ef56dde3dec1"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><b>AppendInt</b> (int64_t v)</td></tr>
|
|
<tr class="separator:aad58ece192586d2972c1ef56dde3dec1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>A simple buffer writer implementation which appends various data types to buffer. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../dd/dd2/buffer__writer_8h_source.html#l00023">23</a> of file <a class="el" href="../../dd/dd2/buffer__writer_8h_source.html">buffer_writer.h</a>.</p>
|
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="a01d91524fd5c5491bafcc1cff16db916"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a01d91524fd5c5491bafcc1cff16db916">◆ </a></span>BufferWriter()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">shaka::media::BufferWriter::BufferWriter </td>
|
|
<td>(</td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"><em>reserved_size_in_bytes</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>Construct the object with a reserved capacity. </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">reserved_size_in_bytes</td><td>is intended for optimization and is not a hard limit. It does not affect the actual size of the buffer, which still starts from zero. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../dd/dd3/buffer__writer_8cc_source.html#l00020">20</a> of file <a class="el" href="../../dd/dd3/buffer__writer_8cc_source.html">buffer_writer.cc</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="abd8854feedd8b45146eb04dacf7d5b2f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#abd8854feedd8b45146eb04dacf7d5b2f">◆ </a></span>AppendInt()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void shaka::media::BufferWriter::AppendInt </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint8_t </td>
|
|
<td class="paramname"><em>v</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>These convenience functions append the integers (in network byte order, i.e. big endian) of various size and signedness to the end of the buffer. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../dd/dd3/buffer__writer_8cc_source.html#l00025">25</a> of file <a class="el" href="../../dd/dd3/buffer__writer_8cc_source.html">buffer_writer.cc</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ae44b09c03c9b8f0fbf58deb80355f299"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae44b09c03c9b8f0fbf58deb80355f299">◆ </a></span>AppendNBytes()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void shaka::media::BufferWriter::AppendNBytes </td>
|
|
<td>(</td>
|
|
<td class="paramtype">uint64_t </td>
|
|
<td class="paramname"><em>v</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"><em>num_bytes</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Append the least significant <em>num_bytes</em> of <em>v</em> to buffer. </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">num_bytes</td><td>should not be larger than sizeof(<em>v</em>), i.e. 8 on a 64-bit system. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../dd/dd3/buffer__writer_8cc_source.html#l00047">47</a> of file <a class="el" href="../../dd/dd3/buffer__writer_8cc_source.html">buffer_writer.cc</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="abe93b64e488c65f8c1595191d659f7dc"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#abe93b64e488c65f8c1595191d659f7dc">◆ </a></span>Buffer()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const uint8_t* shaka::media::BufferWriter::Buffer </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>Underlying buffer. Behavior is undefined if the buffer size is 0. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../dd/dd2/buffer__writer_8h_source.html#l00060">60</a> of file <a class="el" href="../../dd/dd2/buffer__writer_8h_source.html">buffer_writer.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a868dba843fcf923dd140fdda859a3a6d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a868dba843fcf923dd140fdda859a3a6d">◆ </a></span>WriteToFile()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="../../d2/d20/classshaka_1_1Status.html">Status</a> shaka::media::BufferWriter::WriteToFile </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="../../d3/d73/classshaka_1_1File.html">File</a> * </td>
|
|
<td class="paramname"><em>file</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Write the buffer to file. The internal buffer will be cleared after writing. </p><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">file</td><td>should not be NULL. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>OK on success. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="../../dd/dd3/buffer__writer_8cc_source.html#l00066">66</a> of file <a class="el" href="../../dd/dd3/buffer__writer_8cc_source.html">buffer_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="../../dd/dd2/buffer__writer_8h_source.html">buffer_writer.h</a></li>
|
|
<li>packager/media/base/<a class="el" href="../../dd/dd3/buffer__writer_8cc_source.html">buffer_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  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.13
|
|
</small></address>
|
|
</body>
|
|
</html>
|