Repository URL to install this package:
|
Version:
8:3.0.2-1ubuntu3 ▾
|
<!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>FFmpeg: libavutil/fifo.h Source File</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">FFmpeg
 <span id="projectnumber">3.0.2</span>
</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 Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</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="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</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"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Pages</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="dir_8d855866ba5d436d839c7fc557836cd9.html">libavutil</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">fifo.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="fifo_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * This file is part of FFmpeg.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * FFmpeg is free software; you can redistribute it and/or</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * License as published by the Free Software Foundation; either</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> *</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * FFmpeg is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * Lesser General Public License for more details.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * License along with FFmpeg; if not, write to the Free Software</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"></span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> * @file</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> * a very simple circular buffer FIFO implementation</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#ifndef AVUTIL_FIFO_H</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor"></span><span class="preprocessor">#define AVUTIL_FIFO_H</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor"></span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <stdint.h></span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "<a class="code" href="avutil_8h.html">avutil.h</a>"</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "<a class="code" href="attributes_8h.html">attributes.h</a>"</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="structAVFifoBuffer.html"> 31</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> {</div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="structAVFifoBuffer.html#a7ca29002daed8cd1bf486019f3a64fb1"> 32</a></span>  uint8_t *<a class="code" href="structAVFifoBuffer.html#a7ca29002daed8cd1bf486019f3a64fb1">buffer</a>;</div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="structAVFifoBuffer.html#a17c13f1f8557d63a3e031af1fdd80039"> 33</a></span>  uint8_t *<a class="code" href="structAVFifoBuffer.html#a3f75cfeac9302cdaf7badcfcba1a2193">rptr</a>, *<a class="code" href="structAVFifoBuffer.html#a17c13f1f8557d63a3e031af1fdd80039">wptr</a>, *<a class="code" href="structAVFifoBuffer.html#ad33d3db46bc5644805e2c8df0adedfb4">end</a>;</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="structAVFifoBuffer.html#ac2c3c492ec54ed30f1eb3ec8095f557c"> 34</a></span>  uint32_t <a class="code" href="structAVFifoBuffer.html#aa45e40b2e1d183fe73df52b91605034d">rndx</a>, <a class="code" href="structAVFifoBuffer.html#ac2c3c492ec54ed30f1eb3ec8095f557c">wndx</a>;</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> } <a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a>;</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment"></span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment"> * Initialize an AVFifoBuffer.</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment"> * @param size of FIFO</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment"> * @return AVFifoBuffer or NULL in case of memory allocation failure</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *<a class="code" href="fifo_8h.html#adae9b18c5eed14fe851c5bb984ce374b">av_fifo_alloc</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size);</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment"></span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="comment"> * Initialize an AVFifoBuffer.</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="comment"> * @param nmemb number of elements</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="comment"> * @param size size of the single element</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="comment"> * @return AVFifoBuffer or NULL in case of memory allocation failure</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *<a class="code" href="fifo_8h.html#ada874c149988db27a46f8f5447cef478">av_fifo_alloc_array</a>(<span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size);</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="comment"></span></div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="comment"> * Free an AVFifoBuffer.</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="comment"> * @param f AVFifoBuffer to free</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">void</span> <a class="code" href="fifo_8h.html#ac41532c140aacb9ad12a22c859f944aa">av_fifo_free</a>(<a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *f);</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="comment"></span></div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="comment"> * Free an AVFifoBuffer and reset pointer to NULL.</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="comment"> * @param f AVFifoBuffer to free</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="keywordtype">void</span> <a class="code" href="fifo_8h.html#a612be59edb6ab388a82d1487d1bd0c4d">av_fifo_freep</a>(<a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> **f);</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="comment"></span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment"> * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="comment"> * @param f AVFifoBuffer to reset</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="keywordtype">void</span> <a class="code" href="fifo_8h.html#a2f257d5cd93686b047c9b29ef6493e51">av_fifo_reset</a>(<a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *f);</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="comment"></span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="comment"> * Return the amount of data in bytes in the AVFifoBuffer, that is the</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="comment"> * amount of data you can read from it.</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="comment"> * @param f AVFifoBuffer to read from</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="comment"> * @return size</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <span class="keywordtype">int</span> <a class="code" href="fifo_8h.html#a81f4cea70d96846df7111daccc5ecce2">av_fifo_size</a>(<span class="keyword">const</span> <a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *f);</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="comment"></span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="comment"> * Return the amount of space in bytes in the AVFifoBuffer, that is the</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="comment"> * amount of data you can write into it.</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="comment"> * @param f AVFifoBuffer to write into</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="comment"> * @return size</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <span class="keywordtype">int</span> <a class="code" href="fifo_8h.html#ac1e0d8ee7f1568cb40fa95a740c60f13">av_fifo_space</a>(<span class="keyword">const</span> <a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *f);</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="comment"></span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="comment"> * Feed data at specific position from an AVFifoBuffer to a user-supplied callback.</span></div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="comment"> * Similar as av_fifo_gereric_read but without discarding data.</span></div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="comment"> * @param f AVFifoBuffer to read from</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="comment"> * @param offset offset from current read position</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> <span class="comment"> * @param buf_size number of bytes to read</span></div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> <span class="comment"> * @param func generic read function</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> <span class="comment"> * @param dest data destination</span></div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> <span class="keywordtype">int</span> <a class="code" href="fifo_8h.html#ae44de4980b66c0695a4cf7808c140181">av_fifo_generic_peek_at</a>(<a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *f, <span class="keywordtype">void</span> *dest, <span class="keywordtype">int</span> offset, <span class="keywordtype">int</span> buf_size, <span class="keywordtype">void</span> (*func)(<span class="keywordtype">void</span>*, <span class="keywordtype">void</span>*, <span class="keywordtype">int</span>));</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="comment"></span></div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="comment"> * Feed data from an AVFifoBuffer to a user-supplied callback.</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="comment"> * Similar as av_fifo_gereric_read but without discarding data.</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="comment"> * @param f AVFifoBuffer to read from</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="comment"> * @param buf_size number of bytes to read</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span> <span class="comment"> * @param func generic read function</span></div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span> <span class="comment"> * @param dest data destination</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span> <span class="keywordtype">int</span> <a class="code" href="fifo_8h.html#a9fbc6be8766f3389eda0e37ca92cee65">av_fifo_generic_peek</a>(<a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *f, <span class="keywordtype">void</span> *dest, <span class="keywordtype">int</span> buf_size, <span class="keywordtype">void</span> (*func)(<span class="keywordtype">void</span>*, <span class="keywordtype">void</span>*, <span class="keywordtype">int</span>));</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="comment"></span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> <span class="comment"> * Feed data from an AVFifoBuffer to a user-supplied callback.</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span> <span class="comment"> * @param f AVFifoBuffer to read from</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="comment"> * @param buf_size number of bytes to read</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="comment"> * @param func generic read function</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="comment"> * @param dest data destination</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="keywordtype">int</span> <a class="code" href="fifo_8h.html#ab708d2f19b7a9592caa278256787adb6">av_fifo_generic_read</a>(<a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *f, <span class="keywordtype">void</span> *dest, <span class="keywordtype">int</span> buf_size, <span class="keywordtype">void</span> (*func)(<span class="keywordtype">void</span>*, <span class="keywordtype">void</span>*, <span class="keywordtype">int</span>));</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span> <span class="comment"></span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment"> * Feed data from a user-supplied callback to an AVFifoBuffer.</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment"> * @param f AVFifoBuffer to write to</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment"> * @param src data source; non-const since it may be used as a</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="comment"> * modifiable context by the function defined in func</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <span class="comment"> * @param size number of bytes to write</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> <span class="comment"> * @param func generic write function; the first parameter is src,</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="comment"> * the second is dest_buf, the third is dest_buf_size.</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span> <span class="comment"> * func must return the number of bytes written to dest_buf, or <= 0 to</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="comment"> * indicate no more data available to write.</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="comment"> * If func is NULL, src is interpreted as a simple byte array for source data.</span></div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="comment"> * @return the number of bytes written to the FIFO</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="keywordtype">int</span> <a class="code" href="fifo_8h.html#ae95c15dcdd266b4005f8919e4f571180">av_fifo_generic_write</a>(<a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *f, <span class="keywordtype">void</span> *src, <span class="keywordtype">int</span> size, <span class="keywordtype">int</span> (*func)(<span class="keywordtype">void</span>*, <span class="keywordtype">void</span>*, <span class="keywordtype">int</span>));</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="comment"></span></div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="comment"> * Resize an AVFifoBuffer.</span></div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span> <span class="comment"> * In case of reallocation failure, the old FIFO is kept unchanged.</span></div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> <span class="comment"> *</span></div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> <span class="comment"> * @param f AVFifoBuffer to resize</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span> <span class="comment"> * @param size new AVFifoBuffer size in bytes</span></div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span> <span class="comment"> * @return <0 for failure, >=0 otherwise</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span> <span class="keywordtype">int</span> <a class="code" href="fifo_8h.html#af50c043864cf09925aa4986e00a57067">av_fifo_realloc2</a>(<a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *f, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size);</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span> <span class="comment"></span></div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span> <span class="comment"> * Enlarge an AVFifoBuffer.</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span> <span class="comment"> * In case of reallocation failure, the old FIFO is kept unchanged.</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span> <span class="comment"> * The new fifo size may be larger than the requested size.</span></div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span> <span class="comment"> *</span></div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span> <span class="comment"> * @param f AVFifoBuffer to resize</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span> <span class="comment"> * @param additional_space the amount of space in bytes to allocate in addition to av_fifo_size()</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span> <span class="comment"> * @return <0 for failure, >=0 otherwise</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span> <span class="keywordtype">int</span> <a class="code" href="fifo_8h.html#a44a36b44adf5b278eeea1cb6d5b7033b">av_fifo_grow</a>(<a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *f, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> additional_space);</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> <span class="comment"></span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span> <span class="comment"> * Read and discard the specified amount of data from an AVFifoBuffer.</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span> <span class="comment"> * @param f AVFifoBuffer to read from</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span> <span class="comment"> * @param size amount of data to read in bytes</span></div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span> <span class="keywordtype">void</span> <a class="code" href="fifo_8h.html#a037f66cc2b92aebbc363617387d39f6f">av_fifo_drain</a>(<a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *f, <span class="keywordtype">int</span> size);</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span> <span class="comment"></span></div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span> <span class="comment">/**</span></div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span> <span class="comment"> * Return a pointer to the data stored in a FIFO buffer at a certain offset.</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span> <span class="comment"> * The FIFO buffer is not modified.</span></div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span> <span class="comment"> *</span></div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span> <span class="comment"> * @param f AVFifoBuffer to peek at, f must be non-NULL</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span> <span class="comment"> * @param offs an offset in bytes, its absolute value must be less</span></div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span> <span class="comment"> * than the used buffer size or the returned pointer will</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span> <span class="comment"> * point outside to the buffer data.</span></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span> <span class="comment"> * The used buffer size can be checked with av_fifo_size().</span></div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span> <span class="comment"> */</span></div>
<div class="line"><a name="l00169"></a><span class="lineno"><a class="line" href="fifo_8h.html#aa0212ac6ff8feab8846b9cc6df49149c"> 169</a></span> <span class="keyword">static</span> <span class="keyword">inline</span> uint8_t *<a class="code" href="fifo_8h.html#aa0212ac6ff8feab8846b9cc6df49149c">av_fifo_peek2</a>(<span class="keyword">const</span> <a class="code" href="structAVFifoBuffer.html">AVFifoBuffer</a> *f, <span class="keywordtype">int</span> offs)</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span> {</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  uint8_t *ptr = f-><a class="code" href="structAVFifoBuffer.html#a3f75cfeac9302cdaf7badcfcba1a2193">rptr</a> + offs;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="keywordflow">if</span> (ptr >= f-><a class="code" href="structAVFifoBuffer.html#ad33d3db46bc5644805e2c8df0adedfb4">end</a>)</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  ptr = f-><a class="code" href="structAVFifoBuffer.html#a7ca29002daed8cd1bf486019f3a64fb1">buffer</a> + (ptr - f-><a class="code" href="structAVFifoBuffer.html#ad33d3db46bc5644805e2c8df0adedfb4">end</a>);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ptr < f->buffer)</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  ptr = f-><a class="code" href="structAVFifoBuffer.html#ad33d3db46bc5644805e2c8df0adedfb4">end</a> - (f-><a class="code" href="structAVFifoBuffer.html#a7ca29002daed8cd1bf486019f3a64fb1">buffer</a> - ptr);</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keywordflow">return</span> ptr;</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span> }</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span> </div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span> <span class="preprocessor">#endif </span><span class="comment">/* AVUTIL_FIFO_H */</span><span class="preprocessor"></span></div>
<div class="ttc" id="structAVFifoBuffer_html_a17c13f1f8557d63a3e031af1fdd80039"><div class="ttname"><a href="structAVFifoBuffer.html#a17c13f1f8557d63a3e031af1fdd80039">AVFifoBuffer::wptr</a></div><div class="ttdeci">uint8_t * wptr</div><div class="ttdef"><b>Definition:</b> <a href="fifo_8h_source.html#l00033">fifo.h:33</a></div></div>
<div class="ttc" id="fifo_8h_html_ab708d2f19b7a9592caa278256787adb6"><div class="ttname"><a href="fifo_8h.html#ab708d2f19b7a9592caa278256787adb6">av_fifo_generic_read</a></div><div class="ttdeci">int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void(*func)(void *, void *, int))</div><div class="ttdoc">Feed data from an AVFifoBuffer to a user-supplied callback. </div></div>
<div class="ttc" id="fifo_8h_html_af50c043864cf09925aa4986e00a57067"><div class="ttname"><a href="fifo_8h.html#af50c043864cf09925aa4986e00a57067">av_fifo_realloc2</a></div><div class="ttdeci">int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size)</div><div class="ttdoc">Resize an AVFifoBuffer. </div></div>
<div class="ttc" id="avutil_8h_html"><div class="ttname"><a href="avutil_8h.html">avutil.h</a></div><div class="ttdoc">external API header </div></div>
<div class="ttc" id="structAVFifoBuffer_html_aa45e40b2e1d183fe73df52b91605034d"><div class="ttname"><a href="structAVFifoBuffer.html#aa45e40b2e1d183fe73df52b91605034d">AVFifoBuffer::rndx</a></div><div class="ttdeci">uint32_t rndx</div><div class="ttdef"><b>Definition:</b> <a href="fifo_8h_source.html#l00034">fifo.h:34</a></div></div>
<div class="ttc" id="attributes_8h_html"><div class="ttname"><a href="attributes_8h.html">attributes.h</a></div><div class="ttdoc">Macro definitions for various function/variable attributes. </div></div>
<div class="ttc" id="fifo_8h_html_ae44de4980b66c0695a4cf7808c140181"><div class="ttname"><a href="fifo_8h.html#ae44de4980b66c0695a4cf7808c140181">av_fifo_generic_peek_at</a></div><div class="ttdeci">int av_fifo_generic_peek_at(AVFifoBuffer *f, void *dest, int offset, int buf_size, void(*func)(void *, void *, int))</div><div class="ttdoc">Feed data at specific position from an AVFifoBuffer to a user-supplied callback. </div></div>
<div class="ttc" id="fifo_8h_html_adae9b18c5eed14fe851c5bb984ce374b"><div class="ttname"><a href="fifo_8h.html#adae9b18c5eed14fe851c5bb984ce374b">av_fifo_alloc</a></div><div class="ttdeci">AVFifoBuffer * av_fifo_alloc(unsigned int size)</div><div class="ttdoc">Initialize an AVFifoBuffer. </div></div>
<div class="ttc" id="fifo_8h_html_ae95c15dcdd266b4005f8919e4f571180"><div class="ttname"><a href="fifo_8h.html#ae95c15dcdd266b4005f8919e4f571180">av_fifo_generic_write</a></div><div class="ttdeci">int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int(*func)(void *, void *, int))</div><div class="ttdoc">Feed data from a user-supplied callback to an AVFifoBuffer. </div></div>
<div class="ttc" id="fifo_8h_html_a81f4cea70d96846df7111daccc5ecce2"><div class="ttname"><a href="fifo_8h.html#a81f4cea70d96846df7111daccc5ecce2">av_fifo_size</a></div><div class="ttdeci">int av_fifo_size(const AVFifoBuffer *f)</div><div class="ttdoc">Return the amount of data in bytes in the AVFifoBuffer, that is the amount of data you can read from ...</div></div>
<div class="ttc" id="fifo_8h_html_aa0212ac6ff8feab8846b9cc6df49149c"><div class="ttname"><a href="fifo_8h.html#aa0212ac6ff8feab8846b9cc6df49149c">av_fifo_peek2</a></div><div class="ttdeci">static uint8_t * av_fifo_peek2(const AVFifoBuffer *f, int offs)</div><div class="ttdoc">Return a pointer to the data stored in a FIFO buffer at a certain offset. </div><div class="ttdef"><b>Definition:</b> <a href="fifo_8h_source.html#l00169">fifo.h:169</a></div></div>
<div class="ttc" id="fifo_8h_html_a612be59edb6ab388a82d1487d1bd0c4d"><div class="ttname"><a href="fifo_8h.html#a612be59edb6ab388a82d1487d1bd0c4d">av_fifo_freep</a></div><div class="ttdeci">void av_fifo_freep(AVFifoBuffer **f)</div><div class="ttdoc">Free an AVFifoBuffer and reset pointer to NULL. </div></div>
<div class="ttc" id="structAVFifoBuffer_html_ad33d3db46bc5644805e2c8df0adedfb4"><div class="ttname"><a href="structAVFifoBuffer.html#ad33d3db46bc5644805e2c8df0adedfb4">AVFifoBuffer::end</a></div><div class="ttdeci">uint8_t * end</div><div class="ttdef"><b>Definition:</b> <a href="fifo_8h_source.html#l00033">fifo.h:33</a></div></div>
<div class="ttc" id="fifo_8h_html_ada874c149988db27a46f8f5447cef478"><div class="ttname"><a href="fifo_8h.html#ada874c149988db27a46f8f5447cef478">av_fifo_alloc_array</a></div><div class="ttdeci">AVFifoBuffer * av_fifo_alloc_array(size_t nmemb, size_t size)</div><div class="ttdoc">Initialize an AVFifoBuffer. </div></div>
<div class="ttc" id="structAVFifoBuffer_html_a3f75cfeac9302cdaf7badcfcba1a2193"><div class="ttname"><a href="structAVFifoBuffer.html#a3f75cfeac9302cdaf7badcfcba1a2193">AVFifoBuffer::rptr</a></div><div class="ttdeci">uint8_t * rptr</div><div class="ttdef"><b>Definition:</b> <a href="fifo_8h_source.html#l00033">fifo.h:33</a></div></div>
<div class="ttc" id="structAVFifoBuffer_html"><div class="ttname"><a href="structAVFifoBuffer.html">AVFifoBuffer</a></div><div class="ttdef"><b>Definition:</b> <a href="fifo_8h_source.html#l00031">fifo.h:31</a></div></div>
<div class="ttc" id="fifo_8h_html_a9fbc6be8766f3389eda0e37ca92cee65"><div class="ttname"><a href="fifo_8h.html#a9fbc6be8766f3389eda0e37ca92cee65">av_fifo_generic_peek</a></div><div class="ttdeci">int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size, void(*func)(void *, void *, int))</div><div class="ttdoc">Feed data from an AVFifoBuffer to a user-supplied callback. </div></div>
<div class="ttc" id="fifo_8h_html_ac1e0d8ee7f1568cb40fa95a740c60f13"><div class="ttname"><a href="fifo_8h.html#ac1e0d8ee7f1568cb40fa95a740c60f13">av_fifo_space</a></div><div class="ttdeci">int av_fifo_space(const AVFifoBuffer *f)</div><div class="ttdoc">Return the amount of space in bytes in the AVFifoBuffer, that is the amount of data you can write int...</div></div>
<div class="ttc" id="structAVFifoBuffer_html_a7ca29002daed8cd1bf486019f3a64fb1"><div class="ttname"><a href="structAVFifoBuffer.html#a7ca29002daed8cd1bf486019f3a64fb1">AVFifoBuffer::buffer</a></div><div class="ttdeci">uint8_t * buffer</div><div class="ttdef"><b>Definition:</b> <a href="fifo_8h_source.html#l00032">fifo.h:32</a></div></div>
<div class="ttc" id="fifo_8h_html_ac41532c140aacb9ad12a22c859f944aa"><div class="ttname"><a href="fifo_8h.html#ac41532c140aacb9ad12a22c859f944aa">av_fifo_free</a></div><div class="ttdeci">void av_fifo_free(AVFifoBuffer *f)</div><div class="ttdoc">Free an AVFifoBuffer. </div></div>
<div class="ttc" id="fifo_8h_html_a44a36b44adf5b278eeea1cb6d5b7033b"><div class="ttname"><a href="fifo_8h.html#a44a36b44adf5b278eeea1cb6d5b7033b">av_fifo_grow</a></div><div class="ttdeci">int av_fifo_grow(AVFifoBuffer *f, unsigned int additional_space)</div><div class="ttdoc">Enlarge an AVFifoBuffer. </div></div>
<div class="ttc" id="structAVFifoBuffer_html_ac2c3c492ec54ed30f1eb3ec8095f557c"><div class="ttname"><a href="structAVFifoBuffer.html#ac2c3c492ec54ed30f1eb3ec8095f557c">AVFifoBuffer::wndx</a></div><div class="ttdeci">uint32_t wndx</div><div class="ttdef"><b>Definition:</b> <a href="fifo_8h_source.html#l00034">fifo.h:34</a></div></div>
<div class="ttc" id="fifo_8h_html_a037f66cc2b92aebbc363617387d39f6f"><div class="ttname"><a href="fifo_8h.html#a037f66cc2b92aebbc363617387d39f6f">av_fifo_drain</a></div><div class="ttdeci">void av_fifo_drain(AVFifoBuffer *f, int size)</div><div class="ttdoc">Read and discard the specified amount of data from an AVFifoBuffer. </div></div>
<div class="ttc" id="fifo_8h_html_a2f257d5cd93686b047c9b29ef6493e51"><div class="ttname"><a href="fifo_8h.html#a2f257d5cd93686b047c9b29ef6493e51">av_fifo_reset</a></div><div class="ttdeci">void av_fifo_reset(AVFifoBuffer *f)</div><div class="ttdoc">Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied...</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>