Repository URL to install this package:
Version:
7:2.7.1-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"/>
<title>FFmpeg: Decoding</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<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">2.7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<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><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>
<div class="header">
<div class="summary">
<a href="#groups">Modules</a> |
<a href="#define-members">Defines</a> |
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Decoding</div> </div>
<div class="ingroups"><a class="el" href="group__libavc.html">Encoding/Decoding Library</a></div></div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="groups"></a>
Modules</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__parsing.html">Frame parsing</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga9207dd7cb4ee4416f8fd1f7a63af34b7">FF_INPUT_BUFFER_PADDING_SIZE</a>   32</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Required number of additionally allocated bytes at the end of the input bitstream for decoding. <a href="#ga9207dd7cb4ee4416f8fd1f7a63af34b7"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga352363bce7d3ed82c101b3bc001d1c16">AVDiscard</a> { <br/>
  <a class="el" href="group__lavc__decoding.html#gga352363bce7d3ed82c101b3bc001d1c16a93d0436f7651b58debe3f995e2582dcd">AVDISCARD_NONE</a> = -16,
<a class="el" href="group__lavc__decoding.html#gga352363bce7d3ed82c101b3bc001d1c16a81453d8c452e8ee794daf7fde1c80b5b">AVDISCARD_DEFAULT</a> = 0,
<a class="el" href="group__lavc__decoding.html#gga352363bce7d3ed82c101b3bc001d1c16ac5a5a87ffcd6fb2362ac18449d29bde8">AVDISCARD_NONREF</a> = 8,
<a class="el" href="group__lavc__decoding.html#gga352363bce7d3ed82c101b3bc001d1c16a776541ad00a4f13c3fdcd363988bffb3">AVDISCARD_BIDIR</a> = 16,
<br/>
  <a class="el" href="group__lavc__decoding.html#gga352363bce7d3ed82c101b3bc001d1c16aabee31ca5c7c140d3a84b848164eeaf8">AVDISCARD_NONINTRA</a> = 24,
<a class="el" href="group__lavc__decoding.html#gga352363bce7d3ed82c101b3bc001d1c16a31c8164477d9f571f82003065d2ab6f1">AVDISCARD_NONKEY</a> = 32,
<a class="el" href="group__lavc__decoding.html#gga352363bce7d3ed82c101b3bc001d1c16a07517e3890ba7e19a612945483dc066a">AVDISCARD_ALL</a> = 48
<br/>
}</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structAVCodec.html">AVCodec</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga19a0ca553277f019dd5b0fec6e1f9dca">avcodec_find_decoder</a> (enum <a class="el" href="group__lavc__core.html#gaadca229ad2c20e060a14fec08a5cc7ce">AVCodecID</a> id)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Find a registered decoder with a matching codec ID. <a href="#ga19a0ca553277f019dd5b0fec6e1f9dca"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structAVCodec.html">AVCodec</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga776f2359007e8457799503068419e791">avcodec_find_decoder_by_name</a> (const char *name)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Find a registered decoder with the specified name. <a href="#ga776f2359007e8457799503068419e791"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga666e4cc55f8a14c3b1ea66aaef2f6970">avcodec_default_get_buffer</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *s, <a class="el" href="structAVFrame.html">AVFrame</a> *pic)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga4544e55d2417bfe6e746dcaf2195dde0">avcodec_default_release_buffer</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *s, <a class="el" href="structAVFrame.html">AVFrame</a> *pic)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga3f7158d88758be42cc1ab6b9e6df9f0d">avcodec_default_reget_buffer</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *s, <a class="el" href="structAVFrame.html">AVFrame</a> *pic)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga09dee227d3666720eff1f6913d11699d">avcodec_default_get_buffer2</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *s, <a class="el" href="structAVFrame.html">AVFrame</a> *<a class="el" href="extract__mvs_8c.html#ad7d33d579a8d4241a5e643e39287a209">frame</a>, int flags)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">The default callback for <a class="el" href="structAVCodecContext.html#a7c93198032a3a728b13cb7d7e637d295" title="This callback is called at the beginning of each frame to get data buffer(s) for it.">AVCodecContext.get_buffer2()</a>. <a href="#ga09dee227d3666720eff1f6913d11699d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#gaad92aaeee369795273fc6cfc6ef3b189">avcodec_get_edge_width</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the amount of padding in pixels which the get_buffer callback must provide around the edge of the image for codecs which do not have the CODEC_FLAG_EMU_EDGE flag. <a href="#gaad92aaeee369795273fc6cfc6ef3b189"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga48432a3760eec9fce0f0ef7b298859f1">avcodec_align_dimensions</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *s, int *<a class="el" href="demuxing__decoding_8c.html#a2474a5474cbff19523a51eb1de01cda4">width</a>, int *<a class="el" href="demuxing__decoding_8c.html#ad12fc34ce789bce6c8a05d8a17138534">height</a>)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Modify width and height values so that they will result in a memory buffer that is acceptable for the codec if you do not use any horizontal padding. <a href="#ga48432a3760eec9fce0f0ef7b298859f1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga34e3269dc1b9e2c98e9371241722e7e2">avcodec_align_dimensions2</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *s, int *<a class="el" href="demuxing__decoding_8c.html#a2474a5474cbff19523a51eb1de01cda4">width</a>, int *<a class="el" href="demuxing__decoding_8c.html#ad12fc34ce789bce6c8a05d8a17138534">height</a>, int linesize_align[<a class="el" href="frame_8h.html#add80189702cf0f5ea82718576fb43201">AV_NUM_DATA_POINTERS</a>])</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Modify width and height values so that they will result in a memory buffer that is acceptable for the codec if you also ensure that all line sizes are a multiple of the respective linesize_align[i]. <a href="#ga34e3269dc1b9e2c98e9371241722e7e2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga29744651709d05d125982e6ca20fcd95">avcodec_enum_to_chroma_pos</a> (int *xpos, int *ypos, enum <a class="el" href="pixfmt_8h.html#a1f86ed1b6a420faccacf77c98db6c1ff">AVChromaLocation</a> pos)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Converts AVChromaLocation to swscale x/y chroma position. <a href="#ga29744651709d05d125982e6ca20fcd95"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum <a class="el" href="pixfmt_8h.html#a1f86ed1b6a420faccacf77c98db6c1ff">AVChromaLocation</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga30c6c7e3af6c589814d5135561b69980">avcodec_chroma_pos_to_enum</a> (int xpos, int ypos)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Converts swscale x/y chroma position to AVChromaLocation. <a href="#ga30c6c7e3af6c589814d5135561b69980"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#gac552241713bbc0eae2206a75d211daf4">avcodec_decode_audio3</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *avctx, int16_t *samples, int *frame_size_ptr, <a class="el" href="structAVPacket.html">AVPacket</a> *avpkt)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wrapper function which calls avcodec_decode_audio4. <a href="#gac552241713bbc0eae2206a75d211daf4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga834bb1b062fbcc2de4cf7fb93f154a3e">avcodec_decode_audio4</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *avctx, <a class="el" href="structAVFrame.html">AVFrame</a> *<a class="el" href="extract__mvs_8c.html#ad7d33d579a8d4241a5e643e39287a209">frame</a>, int *got_frame_ptr, const <a class="el" href="structAVPacket.html">AVPacket</a> *avpkt)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Decode the audio frame of size avpkt->size from avpkt->data into frame. <a href="#ga834bb1b062fbcc2de4cf7fb93f154a3e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga99ee61b6dcffb7817a275d39da58cc74">avcodec_decode_video2</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *avctx, <a class="el" href="structAVFrame.html">AVFrame</a> *picture, int *got_picture_ptr, const <a class="el" href="structAVPacket.html">AVPacket</a> *avpkt)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Decode the video frame of size avpkt->size from avpkt->data into picture. <a href="#ga99ee61b6dcffb7817a275d39da58cc74"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__lavc__decoding.html#ga47db1b7f294b9f92684401b9c66a7c4b">avcodec_decode_subtitle2</a> (<a class="el" href="structAVCodecContext.html">AVCodecContext</a> *avctx, <a class="el" href="structAVSubtitle.html">AVSubtitle</a> *sub, int *got_sub_ptr, <a class="el" href="structAVPacket.html">AVPacket</a> *avpkt)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Decode a subtitle message. <a href="#ga47db1b7f294b9f92684401b9c66a7c4b"></a><br/></td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga9207dd7cb4ee4416f8fd1f7a63af34b7"></a><!-- doxytag: member="avcodec.h::FF_INPUT_BUFFER_PADDING_SIZE" ref="ga9207dd7cb4ee4416f8fd1f7a63af34b7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define <a class="el" href="group__lavc__decoding.html#ga9207dd7cb4ee4416f8fd1f7a63af34b7">FF_INPUT_BUFFER_PADDING_SIZE</a>   32</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Required number of additionally allocated bytes at the end of the input bitstream for decoding. </p>
<p>This is mainly needed because some optimized bitstream readers read 32 or 64 bit at once and could read over the end.<br/>
Note: If the first 23 bits of the additional bytes are not 0, then damaged MPEG bitstreams could cause overread and segfault. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="decoding_encoding_8c-example.html#a46">decoding_encoding.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="libavcodec_2avcodec_8h_source.html#l00630">630</a> of file <a class="el" href="libavcodec_2avcodec_8h_source.html">avcodec.h</a>.</p>
<p>Referenced by <a class="el" href="decoding__encoding_8c_source.html#l00242">audio_decode_example()</a>, and <a class="el" href="decoding__encoding_8c_source.html#l00534">video_decode_example()</a>.</p>
</div>
</div>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="ga352363bce7d3ed82c101b3bc001d1c16"></a><!-- doxytag: member="avcodec.h::AVDiscard" ref="ga352363bce7d3ed82c101b3bc001d1c16" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group__lavc__decoding.html#ga352363bce7d3ed82c101b3bc001d1c16">AVDiscard</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="gga352363bce7d3ed82c101b3bc001d1c16a93d0436f7651b58debe3f995e2582dcd"></a><!-- doxytag: member="AVDISCARD_NONE" ref="gga352363bce7d3ed82c101b3bc001d1c16a93d0436f7651b58debe3f995e2582dcd" args="" -->AVDISCARD_NONE</em> </td><td>
<p>discard nothing </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga352363bce7d3ed82c101b3bc001d1c16a81453d8c452e8ee794daf7fde1c80b5b"></a><!-- doxytag: member="AVDISCARD_DEFAULT" ref="gga352363bce7d3ed82c101b3bc001d1c16a81453d8c452e8ee794daf7fde1c80b5b" args="" -->AVDISCARD_DEFAULT</em> </td><td>
<p>discard useless packets like 0 size packets in avi </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga352363bce7d3ed82c101b3bc001d1c16ac5a5a87ffcd6fb2362ac18449d29bde8"></a><!-- doxytag: member="AVDISCARD_NONREF" ref="gga352363bce7d3ed82c101b3bc001d1c16ac5a5a87ffcd6fb2362ac18449d29bde8" args="" -->AVDISCARD_NONREF</em> </td><td>
<p>discard all non reference </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga352363bce7d3ed82c101b3bc001d1c16a776541ad00a4f13c3fdcd363988bffb3"></a><!-- doxytag: member="AVDISCARD_BIDIR" ref="gga352363bce7d3ed82c101b3bc001d1c16a776541ad00a4f13c3fdcd363988bffb3" args="" -->AVDISCARD_BIDIR</em> </td><td>
<p>discard all bidirectional frames </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga352363bce7d3ed82c101b3bc001d1c16aabee31ca5c7c140d3a84b848164eeaf8"></a><!-- doxytag: member="AVDISCARD_NONINTRA" ref="gga352363bce7d3ed82c101b3bc001d1c16aabee31ca5c7c140d3a84b848164eeaf8" args="" -->AVDISCARD_NONINTRA</em> </td><td>
<p>discard all non intra frames </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga352363bce7d3ed82c101b3bc001d1c16a31c8164477d9f571f82003065d2ab6f1"></a><!-- doxytag: member="AVDISCARD_NONKEY" ref="gga352363bce7d3ed82c101b3bc001d1c16a31c8164477d9f571f82003065d2ab6f1" args="" -->AVDISCARD_NONKEY</em> </td><td>
<p>discard all frames except keyframes </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga352363bce7d3ed82c101b3bc001d1c16a07517e3890ba7e19a612945483dc066a"></a><!-- doxytag: member="AVDISCARD_ALL" ref="gga352363bce7d3ed82c101b3bc001d1c16a07517e3890ba7e19a612945483dc066a" args="" -->AVDISCARD_ALL</em> </td><td>
<p>discard all </p>
</td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="libavcodec_2avcodec_8h_source.html#l00660">660</a> of file <a class="el" href="libavcodec_2avcodec_8h_source.html">avcodec.h</a>.</p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga19a0ca553277f019dd5b0fec6e1f9dca"></a><!-- doxytag: member="avcodec.h::avcodec_find_decoder" ref="ga19a0ca553277f019dd5b0fec6e1f9dca" args="(enum AVCodecID id)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structAVCodec.html">AVCodec</a>* <a class="el" href="group__lavc__decoding.html#ga19a0ca553277f019dd5b0fec6e1f9dca">avcodec_find_decoder</a> </td>
<td>(</td>
<td class="paramtype">enum <a class="el" href="group__lavc__core.html#gaadca229ad2c20e060a14fec08a5cc7ce">AVCodecID</a> </td>
<td class="paramname"><em>id</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Find a registered decoder with a matching codec ID. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">id</td><td>AVCodecID of the requested decoder </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A decoder if one was found, NULL otherwise. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="decoding_encoding_8c-example.html#a47">decoding_encoding.c</a>, <a class="el" href="demuxing_decoding_8c-example.html#a60">demuxing_decoding.c</a>, <a class="el" href="transcode_aac_8c-example.html#a10">transcode_aac.c</a>, and <a class="el" href="transcoding_8c-example.html#a24">transcoding.c</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="decoding__encoding_8c_source.html#l00242">audio_decode_example()</a>, <a class="el" href="demuxing__decoding_8c_source.html#l00156">open_codec_context()</a>, <a class="el" href="transcode__aac_8c_source.html#l00061">open_input_file()</a>, and <a class="el" href="decoding__encoding_8c_source.html#l00534">video_decode_example()</a>.</p>
</div>
</div>
<a class="anchor" id="ga776f2359007e8457799503068419e791"></a><!-- doxytag: member="avcodec.h::avcodec_find_decoder_by_name" ref="ga776f2359007e8457799503068419e791" args="(const char *name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structAVCodec.html">AVCodec</a>* <a class="el" href="group__lavc__decoding.html#ga776f2359007e8457799503068419e791">avcodec_find_decoder_by_name</a> </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>name</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Find a registered decoder with the specified name. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">name</td><td>name of the requested decoder </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A decoder if one was found, NULL otherwise. </dd></dl>
</div>
</div>
<a class="anchor" id="ga666e4cc55f8a14c3b1ea66aaef2f6970"></a><!-- doxytag: member="avcodec.h::avcodec_default_get_buffer" ref="ga666e4cc55f8a14c3b1ea66aaef2f6970" args="(AVCodecContext *s, AVFrame *pic)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> int <a class="el" href="group__lavc__decoding.html#ga666e4cc55f8a14c3b1ea66aaef2f6970">avcodec_default_get_buffer</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> * </td>
<td class="paramname"><em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structAVFrame.html">AVFrame</a> * </td>
<td class="paramname"><em>pic</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="ga4544e55d2417bfe6e746dcaf2195dde0"></a><!-- doxytag: member="avcodec.h::avcodec_default_release_buffer" ref="ga4544e55d2417bfe6e746dcaf2195dde0" args="(AVCodecContext *s, AVFrame *pic)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> void <a class="el" href="group__lavc__decoding.html#ga4544e55d2417bfe6e746dcaf2195dde0">avcodec_default_release_buffer</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> * </td>
<td class="paramname"><em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structAVFrame.html">AVFrame</a> * </td>
<td class="paramname"><em>pic</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="ga3f7158d88758be42cc1ab6b9e6df9f0d"></a><!-- doxytag: member="avcodec.h::avcodec_default_reget_buffer" ref="ga3f7158d88758be42cc1ab6b9e6df9f0d" args="(AVCodecContext *s, AVFrame *pic)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> int <a class="el" href="group__lavc__decoding.html#ga3f7158d88758be42cc1ab6b9e6df9f0d">avcodec_default_reget_buffer</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> * </td>
<td class="paramname"><em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structAVFrame.html">AVFrame</a> * </td>
<td class="paramname"><em>pic</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="ga09dee227d3666720eff1f6913d11699d"></a><!-- doxytag: member="avcodec.h::avcodec_default_get_buffer2" ref="ga09dee227d3666720eff1f6913d11699d" args="(AVCodecContext *s, AVFrame *frame, int flags)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__lavc__decoding.html#ga09dee227d3666720eff1f6913d11699d">avcodec_default_get_buffer2</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> * </td>
<td class="paramname"><em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structAVFrame.html">AVFrame</a> * </td>
<td class="paramname"><em>frame</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>flags</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The default callback for <a class="el" href="structAVCodecContext.html#a7c93198032a3a728b13cb7d7e637d295" title="This callback is called at the beginning of each frame to get data buffer(s) for it.">AVCodecContext.get_buffer2()</a>. </p>
<p>It is made public so it can be called by custom get_buffer2() implementations for decoders without CODEC_CAP_DR1 set. </p>
</div>
</div>
<a class="anchor" id="gaad92aaeee369795273fc6cfc6ef3b189"></a><!-- doxytag: member="avcodec.h::avcodec_get_edge_width" ref="gaad92aaeee369795273fc6cfc6ef3b189" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> unsigned <a class="el" href="group__lavc__decoding.html#gaad92aaeee369795273fc6cfc6ef3b189">avcodec_get_edge_width</a> </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the amount of padding in pixels which the get_buffer callback must provide around the edge of the image for codecs which do not have the CODEC_FLAG_EMU_EDGE flag. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Required padding in pixels.</dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000015">Deprecated:</a></b></dt><dd>CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer needed </dd></dl>
</div>
</div>
<a class="anchor" id="ga48432a3760eec9fce0f0ef7b298859f1"></a><!-- doxytag: member="avcodec.h::avcodec_align_dimensions" ref="ga48432a3760eec9fce0f0ef7b298859f1" args="(AVCodecContext *s, int *width, int *height)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="group__lavc__decoding.html#ga48432a3760eec9fce0f0ef7b298859f1">avcodec_align_dimensions</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> * </td>
<td class="paramname"><em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>width</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>height</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Modify width and height values so that they will result in a memory buffer that is acceptable for the codec if you do not use any horizontal padding. </p>
<p>May only be used if a codec with CODEC_CAP_DR1 has been opened. </p>
</div>
</div>
<a class="anchor" id="ga34e3269dc1b9e2c98e9371241722e7e2"></a><!-- doxytag: member="avcodec.h::avcodec_align_dimensions2" ref="ga34e3269dc1b9e2c98e9371241722e7e2" args="(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS])" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="group__lavc__decoding.html#ga34e3269dc1b9e2c98e9371241722e7e2">avcodec_align_dimensions2</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> * </td>
<td class="paramname"><em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>width</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>height</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>linesize_align</em>[AV_NUM_DATA_POINTERS] </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Modify width and height values so that they will result in a memory buffer that is acceptable for the codec if you also ensure that all line sizes are a multiple of the respective linesize_align[i]. </p>
<p>May only be used if a codec with CODEC_CAP_DR1 has been opened. </p>
</div>
</div>
<a class="anchor" id="ga29744651709d05d125982e6ca20fcd95"></a><!-- doxytag: member="avcodec.h::avcodec_enum_to_chroma_pos" ref="ga29744651709d05d125982e6ca20fcd95" args="(int *xpos, int *ypos, enum AVChromaLocation pos)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__lavc__decoding.html#ga29744651709d05d125982e6ca20fcd95">avcodec_enum_to_chroma_pos</a> </td>
<td>(</td>
<td class="paramtype">int * </td>
<td class="paramname"><em>xpos</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>ypos</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">enum <a class="el" href="pixfmt_8h.html#a1f86ed1b6a420faccacf77c98db6c1ff">AVChromaLocation</a> </td>
<td class="paramname"><em>pos</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Converts AVChromaLocation to swscale x/y chroma position. </p>
<p>The positions represent the chroma (0,0) position in a coordinates system with luma (0,0) representing the origin and luma(1,1) representing 256,256</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">xpos</td><td>horizontal chroma sample position </td></tr>
<tr><td class="paramname">ypos</td><td>vertical chroma sample position </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga30c6c7e3af6c589814d5135561b69980"></a><!-- doxytag: member="avcodec.h::avcodec_chroma_pos_to_enum" ref="ga30c6c7e3af6c589814d5135561b69980" args="(int xpos, int ypos)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="pixfmt_8h.html#a1f86ed1b6a420faccacf77c98db6c1ff">AVChromaLocation</a> <a class="el" href="group__lavc__decoding.html#ga30c6c7e3af6c589814d5135561b69980">avcodec_chroma_pos_to_enum</a> </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>xpos</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>ypos</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Converts swscale x/y chroma position to AVChromaLocation. </p>
<p>The positions represent the chroma (0,0) position in a coordinates system with luma (0,0) representing the origin and luma(1,1) representing 256,256</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">xpos</td><td>horizontal chroma sample position </td></tr>
<tr><td class="paramname">ypos</td><td>vertical chroma sample position </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="gac552241713bbc0eae2206a75d211daf4"></a><!-- doxytag: member="avcodec.h::avcodec_decode_audio3" ref="gac552241713bbc0eae2206a75d211daf4" args="(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="attributes_8h.html#aa6d076561d3a9eea4729ee632652de02">attribute_deprecated</a> int <a class="el" href="group__lavc__decoding.html#gac552241713bbc0eae2206a75d211daf4">avcodec_decode_audio3</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> * </td>
<td class="paramname"><em>avctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int16_t * </td>
<td class="paramname"><em>samples</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>frame_size_ptr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structAVPacket.html">AVPacket</a> * </td>
<td class="paramname"><em>avpkt</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wrapper function which calls avcodec_decode_audio4. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000016">Deprecated:</a></b></dt><dd>Use avcodec_decode_audio4 instead.</dd></dl>
<p>Decode the audio frame of size avpkt->size from avpkt->data into samples. Some decoders may support multiple frames in a single <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a>, such decoders would then just decode the first frame. In this case, avcodec_decode_audio3 has to be called again with an <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a> that contains the remaining data in order to decode the second frame etc. If no frame could be outputted, frame_size_ptr is zero. Otherwise, it is the decompressed frame size in bytes.</p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>You must set frame_size_ptr to the allocated size of the output buffer before calling <a class="el" href="group__lavc__decoding.html#gac552241713bbc0eae2206a75d211daf4" title="Wrapper function which calls avcodec_decode_audio4.">avcodec_decode_audio3()</a>.</dd>
<dd>
The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than the actual read bytes because some optimized bitstream readers read 32 or 64 bits at once and could read over the end.</dd>
<dd>
The end of the input buffer avpkt->data should be set to 0 to ensure that no overreading happens for damaged MPEG streams.</dd>
<dd>
You must not provide a custom get_buffer() when using <a class="el" href="group__lavc__decoding.html#gac552241713bbc0eae2206a75d211daf4" title="Wrapper function which calls avcodec_decode_audio4.">avcodec_decode_audio3()</a>. Doing so will override it with avcodec_default_get_buffer. Use <a class="el" href="group__lavc__decoding.html#ga834bb1b062fbcc2de4cf7fb93f154a3e" title="Decode the audio frame of size avpkt->size from avpkt->data into frame.">avcodec_decode_audio4()</a> instead, which does allow the application to provide a custom get_buffer().</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>You might have to align the input buffer avpkt->data and output buffer samples. The alignment requirements depend on the CPU: On some CPUs it isn't necessary at all, on others it won't work at all if not aligned and on others it will work but it will have an impact on performance.</dd></dl>
<p>In practice, avpkt->data should have 4 byte alignment at minimum and samples should be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do).</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Codecs which have the CODEC_CAP_DELAY capability set have a delay between input and output, these need to be fed with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir"></td><td class="paramname">avctx</td><td>the codec context </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">samples</td><td>the output buffer, sample type in avctx->sample_fmt If the sample format is planar, each channel plane will be the same size, with no padding between channels. </td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">frame_size_ptr</td><td>the output buffer size in bytes </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">avpkt</td><td>The input <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a> containing the input buffer. You can create such packet with <a class="el" href="group__lavc__packet.html#gac9cb9756175b96e7441575803757fb73" title="Initialize optional fields of a packet with default values.">av_init_packet()</a> and by then setting data and size, some decoders might in addition need other fields. All decoders are designed to use the least fields possible though. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On error a negative value is returned, otherwise the number of bytes used or zero if no frame data was decompressed (used) from the input <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="ga834bb1b062fbcc2de4cf7fb93f154a3e"></a><!-- doxytag: member="avcodec.h::avcodec_decode_audio4" ref="ga834bb1b062fbcc2de4cf7fb93f154a3e" args="(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, const AVPacket *avpkt)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__lavc__decoding.html#ga834bb1b062fbcc2de4cf7fb93f154a3e">avcodec_decode_audio4</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> * </td>
<td class="paramname"><em>avctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structAVFrame.html">AVFrame</a> * </td>
<td class="paramname"><em>frame</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>got_frame_ptr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="structAVPacket.html">AVPacket</a> * </td>
<td class="paramname"><em>avpkt</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Decode the audio frame of size avpkt->size from avpkt->data into frame. </p>
<p>Some decoders may support multiple frames in a single <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a>. Such decoders would then just decode the first frame and the return value would be less than the packet size. In this case, avcodec_decode_audio4 has to be called again with an <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a> containing the remaining data in order to decode the second frame, etc... Even if no frames are returned, the packet needs to be fed to the decoder with remaining data until it is completely consumed or an error occurs.</p>
<p>Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input and output. This means that for some packets they will not immediately produce decoded output and need to be flushed at the end of decoding to get all the decoded data. Flushing is done by calling this function with packets with avpkt->data set to NULL and avpkt->size set to 0 until it stops returning samples. It is safe to flush even those decoders that are not marked with CODEC_CAP_DELAY, then no samples will be returned.</p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE larger than the actual read bytes because some optimized bitstream readers read 32 or 64 bits at once and could read over the end.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>The <a class="el" href="structAVCodecContext.html" title="main external API structure.">AVCodecContext</a> MUST have been opened with <a class="el" href="group__lavc__core.html#ga11f785a188d7d9df71621001465b0f1d">avcodec_open2()</a> before packets may be fed to the decoder.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir"></td><td class="paramname">avctx</td><td>the codec context </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">frame</td><td>The <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> in which to store decoded audio samples. The decoder will allocate a buffer for the decoded frame by calling the <a class="el" href="structAVCodecContext.html#a7c93198032a3a728b13cb7d7e637d295" title="This callback is called at the beginning of each frame to get data buffer(s) for it.">AVCodecContext.get_buffer2()</a> callback. When <a class="el" href="structAVCodecContext.html#ab16d1e0c729a7b63d918d5ec027ba064" title="If non-zero, the decoded audio and video frames returned from avcodec_decode_video2() and avcodec_dec...">AVCodecContext.refcounted_frames</a> is set to 1, the frame is reference counted and the returned reference belongs to the caller. The caller must release the frame using <a class="el" href="group__lavu__frame.html#ga0a2b687f9c1c5ed0089b01fd61227108" title="Unreference all the buffers referenced by frame and reset the frame fields.">av_frame_unref()</a> when the frame is no longer needed. The caller may safely write to the frame if <a class="el" href="group__lavu__frame.html#ga3ba755bada5c3c8883361ef43fb5fb7a" title="Check if the frame data is writable.">av_frame_is_writable()</a> returns 1. When <a class="el" href="structAVCodecContext.html#ab16d1e0c729a7b63d918d5ec027ba064" title="If non-zero, the decoded audio and video frames returned from avcodec_decode_video2() and avcodec_dec...">AVCodecContext.refcounted_frames</a> is set to 0, the returned reference belongs to the decoder and is valid only until the next call to this function or until closing or flushing the decoder. The caller may not write to it. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">got_frame_ptr</td><td>Zero if no frame could be decoded, otherwise it is non-zero. Note that this field being set to zero does not mean that an error has occurred. For decoders with CODEC_CAP_DELAY set, no given decode call is guaranteed to produce a frame. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">avpkt</td><td>The input <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a> containing the input buffer. At least avpkt->data and avpkt->size should be set. Some decoders might also require additional fields to be set. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A negative error code is returned if an error occurred during decoding, otherwise the number of bytes consumed from the input <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a> is returned. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="decoding_encoding_8c-example.html#a48">decoding_encoding.c</a>, <a class="el" href="demuxing_decoding_8c-example.html#a47">demuxing_decoding.c</a>, <a class="el" href="filtering_audio_8c-example.html#a77">filtering_audio.c</a>, <a class="el" href="transcode_aac_8c-example.html#a61">transcode_aac.c</a>, and <a class="el" href="transcoding_8c-example.html#a120">transcoding.c</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="decoding__encoding_8c_source.html#l00242">audio_decode_example()</a>, <a class="el" href="transcode__aac_8c_source.html#l00303">decode_audio_frame()</a>, <a class="el" href="demuxing__decoding_8c_source.html#l00070">decode_packet()</a>, and <a class="el" href="filtering__audio_8c_source.html#l00212">main()</a>.</p>
</div>
</div>
<a class="anchor" id="ga99ee61b6dcffb7817a275d39da58cc74"></a><!-- doxytag: member="avcodec.h::avcodec_decode_video2" ref="ga99ee61b6dcffb7817a275d39da58cc74" args="(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const AVPacket *avpkt)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__lavc__decoding.html#ga99ee61b6dcffb7817a275d39da58cc74">avcodec_decode_video2</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> * </td>
<td class="paramname"><em>avctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structAVFrame.html">AVFrame</a> * </td>
<td class="paramname"><em>picture</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>got_picture_ptr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="structAVPacket.html">AVPacket</a> * </td>
<td class="paramname"><em>avpkt</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Decode the video frame of size avpkt->size from avpkt->data into picture. </p>
<p>Some decoders may support multiple frames in a single <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a>, such decoders would then just decode the first frame.</p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than the actual read bytes because some optimized bitstream readers read 32 or 64 bits at once and could read over the end.</dd>
<dd>
The end of the input buffer buf should be set to 0 to ensure that no overreading happens for damaged MPEG streams.</dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>Codecs which have the CODEC_CAP_DELAY capability set have a delay between input and output, these need to be fed with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames.</dd>
<dd>
The <a class="el" href="structAVCodecContext.html" title="main external API structure.">AVCodecContext</a> MUST have been opened with <a class="el" href="group__lavc__core.html#ga11f785a188d7d9df71621001465b0f1d">avcodec_open2()</a> before packets may be fed to the decoder.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir"></td><td class="paramname">avctx</td><td>the codec context </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">picture</td><td>The <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> in which the decoded video frame will be stored. Use <a class="el" href="group__lavu__frame.html#gac700017c5270c79c1e1befdeeb008b2f" title="Allocate an AVFrame and set its fields to default values.">av_frame_alloc()</a> to get an <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a>. The codec will allocate memory for the actual bitmap by calling the <a class="el" href="structAVCodecContext.html#a7c93198032a3a728b13cb7d7e637d295" title="This callback is called at the beginning of each frame to get data buffer(s) for it.">AVCodecContext.get_buffer2()</a> callback. When <a class="el" href="structAVCodecContext.html#ab16d1e0c729a7b63d918d5ec027ba064" title="If non-zero, the decoded audio and video frames returned from avcodec_decode_video2() and avcodec_dec...">AVCodecContext.refcounted_frames</a> is set to 1, the frame is reference counted and the returned reference belongs to the caller. The caller must release the frame using <a class="el" href="group__lavu__frame.html#ga0a2b687f9c1c5ed0089b01fd61227108" title="Unreference all the buffers referenced by frame and reset the frame fields.">av_frame_unref()</a> when the frame is no longer needed. The caller may safely write to the frame if <a class="el" href="group__lavu__frame.html#ga3ba755bada5c3c8883361ef43fb5fb7a" title="Check if the frame data is writable.">av_frame_is_writable()</a> returns 1. When <a class="el" href="structAVCodecContext.html#ab16d1e0c729a7b63d918d5ec027ba064" title="If non-zero, the decoded audio and video frames returned from avcodec_decode_video2() and avcodec_dec...">AVCodecContext.refcounted_frames</a> is set to 0, the returned reference belongs to the decoder and is valid only until the next call to this function or until closing or flushing the decoder. The caller may not write to it.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">avpkt</td><td>The input <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a> containing the input buffer. You can create such packet with <a class="el" href="group__lavc__packet.html#gac9cb9756175b96e7441575803757fb73" title="Initialize optional fields of a packet with default values.">av_init_packet()</a> and by then setting data and size, some decoders might in addition need other fields like flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least fields possible. </td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">got_picture_ptr</td><td>Zero if no frame could be decompressed, otherwise, it is nonzero. </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>On error a negative value is returned, otherwise the number of bytes used or zero if no frame could be decompressed. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="decoding_encoding_8c-example.html#a75">decoding_encoding.c</a>, <a class="el" href="demuxing_decoding_8c-example.html#a34">demuxing_decoding.c</a>, <a class="el" href="filtering_video_8c-example.html#a70">filtering_video.c</a>, and <a class="el" href="transcoding_8c-example.html#a119">transcoding.c</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="demuxing__decoding_8c_source.html#l00070">decode_packet()</a>, <a class="el" href="decoding__encoding_8c_source.html#l00506">decode_write_frame()</a>, and <a class="el" href="filtering__video_8c_source.html#l00203">main()</a>.</p>
</div>
</div>
<a class="anchor" id="ga47db1b7f294b9f92684401b9c66a7c4b"></a><!-- doxytag: member="avcodec.h::avcodec_decode_subtitle2" ref="ga47db1b7f294b9f92684401b9c66a7c4b" args="(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="group__lavc__decoding.html#ga47db1b7f294b9f92684401b9c66a7c4b">avcodec_decode_subtitle2</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structAVCodecContext.html">AVCodecContext</a> * </td>
<td class="paramname"><em>avctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structAVSubtitle.html">AVSubtitle</a> * </td>
<td class="paramname"><em>sub</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>got_sub_ptr</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structAVPacket.html">AVPacket</a> * </td>
<td class="paramname"><em>avpkt</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Decode a subtitle message. </p>
<p>Return a negative value on error, otherwise return the number of bytes used. If no subtitle could be decompressed, got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for simplicity, because the performance difference is expect to be negligible and reusing a get_buffer written for video codecs would probably perform badly due to a potentially very different allocation pattern.</p>
<p>Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input and output. This means that for some packets they will not immediately produce decoded output and need to be flushed at the end of decoding to get all the decoded data. Flushing is done by calling this function with packets with avpkt->data set to NULL and avpkt->size set to 0 until it stops returning subtitles. It is safe to flush even those decoders that are not marked with CODEC_CAP_DELAY, then no subtitles will be returned.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>The <a class="el" href="structAVCodecContext.html" title="main external API structure.">AVCodecContext</a> MUST have been opened with <a class="el" href="group__lavc__core.html#ga11f785a188d7d9df71621001465b0f1d">avcodec_open2()</a> before packets may be fed to the decoder.</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir"></td><td class="paramname">avctx</td><td>the codec context </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">sub</td><td>The Preallocated <a class="el" href="structAVSubtitle.html">AVSubtitle</a> in which the decoded subtitle will be stored, must be freed with avsubtitle_free if *got_sub_ptr is set. </td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">got_sub_ptr</td><td>Zero if no subtitle could be decompressed, otherwise, it is nonzero. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">avpkt</td><td>The input <a class="el" href="structAVPacket.html" title="This structure stores compressed data.">AVPacket</a> containing the input buffer. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
<!-- 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>Defines</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>
<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.7.6.1
</small></address>
</body>
</html>