Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
ffmpeg-doc / usr / share / doc / ffmpeg-doc / api / group__lswr.html
Size: Mime:
<!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: Libswresample</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
   &#160;<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&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;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="#files">Files</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Libswresample</div>  </div>
</div><!--header-->
<div class="contents">

<p>Libswresample (lswr) is a library that handles audio resampling, sample format conversion and mixing.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="files"></a>
Files</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="swresample_8h.html">swresample.h</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>libswresample public header </p>
<br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The libswresample context.  <a href="#ga4aa775b7fba31d2c8dc14c7b7e282863"></a><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">const <a class="el" href="structAVClass.html">AVClass</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga6ca0298348b382cf0fe67d7f339a17f3">swr_get_class</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the <a class="el" href="structAVClass.html" title="Describe the class of an AVClass context structure.">AVClass</a> for SwrContext.  <a href="#ga6ca0298348b382cf0fe67d7f339a17f3"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Option constants</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrpa7f26de0633f7745117b919eca2482d2"></a>These constants are used for the <a class="el" href="group__avoptions.html">AVOptions</a> interface for lswr. </p>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga387e613b19e5269a46d9ff1a5ee3fcd4">SwrDitherType</a> { <br/>
&#160;&#160;<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4afacc17a82581598f762a8036ba559836">SWR_DITHER_NONE</a> =  0, 
<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4a0fec2dd28b1357b50e9807ca6ecee83a">SWR_DITHER_RECTANGULAR</a>, 
<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4ae4635dc355dc680eeb211e7af17ddfd2">SWR_DITHER_TRIANGULAR</a>, 
<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4a91276f2e437aa9d0d8bdffabe24f5532">SWR_DITHER_TRIANGULAR_HIGHPASS</a>, 
<br/>
&#160;&#160;<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4ae6858a54f5b2e1bffa9aaef20b2593c0">SWR_DITHER_NS</a> =  64, 
<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4a6f6072071262f7f05a52057cfe48df87">SWR_DITHER_NS_LIPSHITZ</a>, 
<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4ae197d7fc5592652aaa8edf1067c56af9">SWR_DITHER_NS_F_WEIGHTED</a>, 
<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4a60eeb8ca5de47916a81f2c3a6534eed4">SWR_DITHER_NS_MODIFIED_E_WEIGHTED</a>, 
<br/>
&#160;&#160;<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4ad13d2ff2831d463eb46ca4c46dfec7b0">SWR_DITHER_NS_IMPROVED_E_WEIGHTED</a>, 
<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4ae3aba4bf43c2210a148b11c0215b5d24">SWR_DITHER_NS_SHIBATA</a>, 
<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4af275c21089abbf78a6623544f34d76f9">SWR_DITHER_NS_LOW_SHIBATA</a>, 
<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4ac569828a706ccf22a8d5810c973c8f17">SWR_DITHER_NS_HIGH_SHIBATA</a>, 
<br/>
&#160;&#160;<a class="el" href="group__lswr.html#gga387e613b19e5269a46d9ff1a5ee3fcd4aacbdf2f91bb14cf390116492115fb8ea">SWR_DITHER_NB</a>
<br/>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Dithering algorithms.  <a href="group__lswr.html#ga387e613b19e5269a46d9ff1a5ee3fcd4">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga87f9e023bbe780d3ccf17dfc7abed580">SwrEngine</a> { <a class="el" href="group__lswr.html#gga87f9e023bbe780d3ccf17dfc7abed580a11652db5af0c279d79deba1c577c9729">SWR_ENGINE_SWR</a>, 
<a class="el" href="group__lswr.html#gga87f9e023bbe780d3ccf17dfc7abed580a2933f5b0b96829095a04a8acd19b27e7">SWR_ENGINE_SOXR</a>, 
<a class="el" href="group__lswr.html#gga87f9e023bbe780d3ccf17dfc7abed580a865af2e70ebb85b3cafb93f1854dbef9">SWR_ENGINE_NB</a>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Resampling Engines.  <a href="group__lswr.html#ga87f9e023bbe780d3ccf17dfc7abed580">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga2176b2a3a8b809788f6e7ccdc238b6be">SwrFilterType</a> { <a class="el" href="group__lswr.html#gga2176b2a3a8b809788f6e7ccdc238b6bea1a6413b9888bac851e2ee4f991f01d0c">SWR_FILTER_TYPE_CUBIC</a>, 
<a class="el" href="group__lswr.html#gga2176b2a3a8b809788f6e7ccdc238b6bea17f5dd4512b4abc2285905293a81cf55">SWR_FILTER_TYPE_BLACKMAN_NUTTALL</a>, 
<a class="el" href="group__lswr.html#gga2176b2a3a8b809788f6e7ccdc238b6bea8f492a5dc94b6e41a37f190c5492bf3f">SWR_FILTER_TYPE_KAISER</a>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Resampling Filter Types.  <a href="group__lswr.html#ga2176b2a3a8b809788f6e7ccdc238b6be">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga2226aca7f49137f3f29b6f731a985916">SWR_FLAG_RESAMPLE</a>&#160;&#160;&#160;1</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Force resampling even if equal sample rate.  <a href="#ga2226aca7f49137f3f29b6f731a985916"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
SwrContext constructor functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#gaf58c4ff10f73d74bdab8e5aa7193147c">swr_alloc</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate SwrContext.  <a href="#gaf58c4ff10f73d74bdab8e5aa7193147c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67">swr_init</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize context after user parameters have been set.  <a href="#gae173e8ed91717700471a1dcd06f00f67"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#gab11b02705e97404b6d74b18b2fcfdfcf">swr_is_initialized</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Check whether an swr context has been initialized or not.  <a href="#gab11b02705e97404b6d74b18b2fcfdfcf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#gad7f29022726c871aadf935281a9813bc">swr_alloc_set_opts</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s, int64_t out_ch_layout, enum <a class="el" href="group__lavu__sampfmts.html#gaf9a51ca15301871723577c730b5865c5">AVSampleFormat</a> out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum <a class="el" href="group__lavu__sampfmts.html#gaf9a51ca15301871723577c730b5865c5">AVSampleFormat</a> in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate SwrContext if needed and set/reset common parameters.  <a href="#gad7f29022726c871aadf935281a9813bc"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
SwrContext destructor functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga818f7d78b1ad7d8d5b70de374b668c34">swr_free</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> **s)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Free the given SwrContext and set the pointer to NULL.  <a href="#ga818f7d78b1ad7d8d5b70de374b668c34"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#gaa4bf1048740dfc08d68aba9f1b4db22e">swr_close</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes the context so that <a class="el" href="group__lswr.html#gab11b02705e97404b6d74b18b2fcfdfcf" title="Check whether an swr context has been initialized or not.">swr_is_initialized()</a> returns 0.  <a href="#gaa4bf1048740dfc08d68aba9f1b4db22e"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Core conversion functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a">swr_convert</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s, uint8_t **out, int out_count, const uint8_t **in, int in_count)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert audio.  <a href="#gaa5bb6cab830146efa8c760fa66ee582a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#gaad9811626c6c01a241f6bf46aff27333">swr_next_pts</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s, int64_t <a class="el" href="transcode__aac_8c.html#a4fbb704fb96c36a78a36eee010306ce7">pts</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate) units.  <a href="#gaad9811626c6c01a241f6bf46aff27333"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Low-level option setting functions</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrpf66d1ff8fedfec3d224b7f4e324f89bf"></a>These functons provide a means to set low-level options that is not possible with the <a class="el" href="structAVOption.html" title="AVOption.">AVOption</a> API. </p>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#gab7f21690522b85d7757e13fa9853d4d8">swr_set_compensation</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s, int sample_delta, int compensation_distance)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Activate resampling compensation ("soft" compensation).  <a href="#gab7f21690522b85d7757e13fa9853d4d8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga1b528050b5f5b704aecbfbc257a17ef0">swr_set_channel_mapping</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s, const int *channel_map)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set a customized input channel mapping.  <a href="#ga1b528050b5f5b704aecbfbc257a17ef0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#gaf9064d65b1e654dc78f7d6bcd2e8c747">swr_set_matrix</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s, const double *matrix, int stride)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set a customized remix matrix.  <a href="#gaf9064d65b1e654dc78f7d6bcd2e8c747"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Sample handling functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga43d7ba4507891fc25aacbbea5cdfb065">swr_drop_output</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s, int count)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Drops the specified number of output samples.  <a href="#ga43d7ba4507891fc25aacbbea5cdfb065"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga4733ed4779ed3e30379de2a6ef8de837">swr_inject_silence</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s, int count)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Injects the specified number of silence samples.  <a href="#ga4733ed4779ed3e30379de2a6ef8de837"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga5121a5a7890a2d23b72dc871dd0ebb06">swr_get_delay</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s, int64_t base)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the delay the next input sample will experience relative to the next output sample.  <a href="#ga5121a5a7890a2d23b72dc871dd0ebb06"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga97a8d5f6abe3bcdfb6072412f17285a4">swr_get_out_samples</a> (struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *s, int in_samples)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Find an upper bound on the number of samples that the next swr_convert call will output, if called with in_samples of input samples.  <a href="#ga97a8d5f6abe3bcdfb6072412f17285a4"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Configuration accessors</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#gaed39c2153a1e26b4ef656ec8c765a2e3">swresample_version</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the <a class="el" href="libswresample_2version_8h.html#a6172452a08ba6386e2265bd34769982b">LIBSWRESAMPLE_VERSION_INT</a> constant.  <a href="#gaed39c2153a1e26b4ef656ec8c765a2e3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#gad602fde7a824753d5adc57e7f1372e27">swresample_configuration</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the swr build-time configuration.  <a href="#gad602fde7a824753d5adc57e7f1372e27"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga29c5657b18632e206a99d1ae27225499">swresample_license</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the swr license.  <a href="#ga29c5657b18632e206a99d1ae27225499"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
AVFrame based API</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#gac482028c01d95580106183aa84b0930c">swr_convert_frame</a> (<a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *swr, <a class="el" href="structAVFrame.html">AVFrame</a> *output, const <a class="el" href="structAVFrame.html">AVFrame</a> *input)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert the samples in the input <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> and write them to the output <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a>.  <a href="#gac482028c01d95580106183aa84b0930c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__lswr.html#ga73ade2cf6934765cf518c6c917b77c76">swr_config_frame</a> (<a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *swr, const <a class="el" href="structAVFrame.html">AVFrame</a> *out, const <a class="el" href="structAVFrame.html">AVFrame</a> *in)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure or reconfigure the SwrContext using the information provided by the AVFrames.  <a href="#ga73ade2cf6934765cf518c6c917b77c76"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Libswresample (lswr) is a library that handles audio resampling, sample format conversion and mixing. </p>
<p>Interaction with lswr is done through SwrContext, which is allocated with <a class="el" href="group__lswr.html#gaf58c4ff10f73d74bdab8e5aa7193147c" title="Allocate SwrContext.">swr_alloc()</a> or <a class="el" href="group__lswr.html#gad7f29022726c871aadf935281a9813bc" title="Allocate SwrContext if needed and set/reset common parameters.">swr_alloc_set_opts()</a>. It is opaque, so all parameters must be set with the <a class="el" href="group__avoptions.html">AVOptions</a> API.</p>
<p>The first thing you will need to do in order to use lswr is to allocate SwrContext. This can be done with <a class="el" href="group__lswr.html#gaf58c4ff10f73d74bdab8e5aa7193147c" title="Allocate SwrContext.">swr_alloc()</a> or <a class="el" href="group__lswr.html#gad7f29022726c871aadf935281a9813bc" title="Allocate SwrContext if needed and set/reset common parameters.">swr_alloc_set_opts()</a>. If you are using the former, you must set options through the <a class="el" href="group__avoptions.html">AVOptions</a> API. The latter function provides the same feature, but it allows you to set some common options in the same statement.</p>
<p>For example the following code will setup conversion from planar float sample format to interleaved signed 16-bit integer, downsampling from 48kHz to 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing matrix). This is using the <a class="el" href="group__lswr.html#gaf58c4ff10f73d74bdab8e5aa7193147c" title="Allocate SwrContext.">swr_alloc()</a> function. </p>
<div class="fragment"><pre class="fragment"> <a class="code" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863" title="The libswresample context.">SwrContext</a> *swr = <a class="code" href="group__lswr.html#gaf58c4ff10f73d74bdab8e5aa7193147c" title="Allocate SwrContext.">swr_alloc</a>();
 <a class="code" href="group__opt__set__funcs.html#gaf25f11e11068f2c41197ba072f25d2a4">av_opt_set_channel_layout</a>(swr, <span class="stringliteral">&quot;in_channel_layout&quot;</span>,  <a class="code" href="group__channel__mask__c.html#gac36a042dc21866f9043ce930f300d0df">AV_CH_LAYOUT_5POINT1</a>, 0);
 <a class="code" href="group__opt__set__funcs.html#gaf25f11e11068f2c41197ba072f25d2a4">av_opt_set_channel_layout</a>(swr, <span class="stringliteral">&quot;out_channel_layout&quot;</span>, <a class="code" href="group__channel__mask__c.html#gabc6d6651bba254cd0fa2c42a57228e65">AV_CH_LAYOUT_STEREO</a>,  0);
 <a class="code" href="group__opt__set__funcs.html#ga3adf7185c21cc080890a5ec02c2e56b2">av_opt_set_int</a>(swr, <span class="stringliteral">&quot;in_sample_rate&quot;</span>,     48000,                0);
 <a class="code" href="group__opt__set__funcs.html#ga3adf7185c21cc080890a5ec02c2e56b2">av_opt_set_int</a>(swr, <span class="stringliteral">&quot;out_sample_rate&quot;</span>,    44100,                0);
 <a class="code" href="group__opt__set__funcs.html#gad446f7a7b92442e464d43e400e661040">av_opt_set_sample_fmt</a>(swr, <span class="stringliteral">&quot;in_sample_fmt&quot;</span>,  <a class="code" href="group__lavu__sampfmts.html#ggaf9a51ca15301871723577c730b5865c5a2d21c520e4ab21100b6440ec2d81ba1b" title="float, planar">AV_SAMPLE_FMT_FLTP</a>, 0);
 <a class="code" href="group__opt__set__funcs.html#gad446f7a7b92442e464d43e400e661040">av_opt_set_sample_fmt</a>(swr, <span class="stringliteral">&quot;out_sample_fmt&quot;</span>, <a class="code" href="group__lavu__sampfmts.html#ggaf9a51ca15301871723577c730b5865c5aea6132df57aebc3f76e10665395c46af" title="signed 16 bits">AV_SAMPLE_FMT_S16</a>,  0);
</pre></div><p>The same job can be done using <a class="el" href="group__lswr.html#gad7f29022726c871aadf935281a9813bc" title="Allocate SwrContext if needed and set/reset common parameters.">swr_alloc_set_opts()</a> as well: </p>
<div class="fragment"><pre class="fragment"> <a class="code" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863" title="The libswresample context.">SwrContext</a> *swr = <a class="code" href="group__lswr.html#gad7f29022726c871aadf935281a9813bc" title="Allocate SwrContext if needed and set/reset common parameters.">swr_alloc_set_opts</a>(NULL,  <span class="comment">// we&#39;re allocating a new context</span>
                       <a class="code" href="group__channel__mask__c.html#gabc6d6651bba254cd0fa2c42a57228e65">AV_CH_LAYOUT_STEREO</a>,  <span class="comment">// out_ch_layout</span>
                       <a class="code" href="group__lavu__sampfmts.html#ggaf9a51ca15301871723577c730b5865c5aea6132df57aebc3f76e10665395c46af" title="signed 16 bits">AV_SAMPLE_FMT_S16</a>,    <span class="comment">// out_sample_fmt</span>
                       44100,                <span class="comment">// out_sample_rate</span>
                       <a class="code" href="group__channel__mask__c.html#gac36a042dc21866f9043ce930f300d0df">AV_CH_LAYOUT_5POINT1</a>, <span class="comment">// in_ch_layout</span>
                       <a class="code" href="group__lavu__sampfmts.html#ggaf9a51ca15301871723577c730b5865c5a2d21c520e4ab21100b6440ec2d81ba1b" title="float, planar">AV_SAMPLE_FMT_FLTP</a>,   <span class="comment">// in_sample_fmt</span>
                       48000,                <span class="comment">// in_sample_rate</span>
                       0,                    <span class="comment">// log_offset</span>
                       NULL);                <span class="comment">// log_ctx</span>
</pre></div><p>Once all values have been set, it must be initialized with <a class="el" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67" title="Initialize context after user parameters have been set.">swr_init()</a>. If you need to change the conversion parameters, you can change the parameters using AVOptions, as described above in the first example; or by using <a class="el" href="group__lswr.html#gad7f29022726c871aadf935281a9813bc" title="Allocate SwrContext if needed and set/reset common parameters.">swr_alloc_set_opts()</a>, but with the first argument the allocated context. You must then call <a class="el" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67" title="Initialize context after user parameters have been set.">swr_init()</a> again.</p>
<p>The conversion itself is done by repeatedly calling <a class="el" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a" title="Convert audio.">swr_convert()</a>. Note that the samples may get buffered in swr if you provide insufficient output space or if sample rate conversion is done, which requires "future" samples. Samples that do not require future input can be retrieved at any time by using <a class="el" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a" title="Convert audio.">swr_convert()</a> (in_count can be set to 0). At the end of conversion the resampling buffer can be flushed by calling <a class="el" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a" title="Convert audio.">swr_convert()</a> with NULL in and 0 in_count.</p>
<p>The samples used in the conversion process can be managed with the libavutil <a class="el" href="group__lavu__sampmanip.html">samples manipulation</a> API, including <a class="el" href="group__lavu__sampmanip.html#ga4db4c77f928d32c7d8854732f50b8c04" title="Allocate a samples buffer for nb_samples samples, and fill data pointers and linesize accordingly...">av_samples_alloc()</a> function used in the following example.</p>
<p>The delay between input and output, can at any time be found by using <a class="el" href="group__lswr.html#ga5121a5a7890a2d23b72dc871dd0ebb06" title="Gets the delay the next input sample will experience relative to the next output sample.">swr_get_delay()</a>.</p>
<p>The following code demonstrates the conversion loop assuming the parameters from above and caller-defined functions <a class="el" href="filter__audio_8c.html#a4209191767f4a5779718e9f691a6de53">get_input()</a> and handle_output(): </p>
<div class="fragment"><pre class="fragment"> uint8_t **input;
 <span class="keywordtype">int</span> in_samples;

 <span class="keywordflow">while</span> (<a class="code" href="filter__audio_8c.html#a4209191767f4a5779718e9f691a6de53">get_input</a>(&amp;input, &amp;in_samples)) {
     uint8_t *output;
     <span class="keywordtype">int</span> out_samples = <a class="code" href="group__lavu__math.html#gad686ab94939ed4c65218309e94bdca72" title="Rescale a 64-bit integer with specified rounding.">av_rescale_rnd</a>(<a class="code" href="group__lswr.html#ga5121a5a7890a2d23b72dc871dd0ebb06" title="Gets the delay the next input sample will experience relative to the next output sample.">swr_get_delay</a>(swr, 48000) +
                                      in_samples, 44100, 48000, <a class="code" href="group__lavu__math.html#gga921d656eaf2c4d6800a734a13af021d0aa1d28e08e2f8b49b256e056f93038c1a" title="Round toward +infinity.">AV_ROUND_UP</a>);
     <a class="code" href="group__lavu__sampmanip.html#ga4db4c77f928d32c7d8854732f50b8c04" title="Allocate a samples buffer for nb_samples samples, and fill data pointers and linesize accordingly...">av_samples_alloc</a>(&amp;output, NULL, 2, out_samples,
                      <a class="code" href="group__lavu__sampfmts.html#ggaf9a51ca15301871723577c730b5865c5aea6132df57aebc3f76e10665395c46af" title="signed 16 bits">AV_SAMPLE_FMT_S16</a>, 0);
     out_samples = <a class="code" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a" title="Convert audio.">swr_convert</a>(swr, &amp;output, out_samples,
                                      input, in_samples);
     handle_output(output, out_samples);
     <a class="code" href="group__lavu__mem.html#ga0cc84043ea2167ad005c86e11d0bcdba" title="Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...">av_freep</a>(&amp;output);
 }
</pre></div><p>When the conversion is finished, the conversion context and everything associated with it must be freed with <a class="el" href="group__lswr.html#ga818f7d78b1ad7d8d5b70de374b668c34" title="Free the given SwrContext and set the pointer to NULL.">swr_free()</a>. A <a class="el" href="group__lswr.html#gaa4bf1048740dfc08d68aba9f1b4db22e" title="Closes the context so that swr_is_initialized() returns 0.">swr_close()</a> function is also available, but it exists mainly for compatibility with libavresample, and is not required to be called.</p>
<p>There will be no memory leak if the data is not completely flushed before <a class="el" href="group__lswr.html#ga818f7d78b1ad7d8d5b70de374b668c34" title="Free the given SwrContext and set the pointer to NULL.">swr_free()</a>. </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga2226aca7f49137f3f29b6f731a985916"></a><!-- doxytag: member="swresample.h::SWR_FLAG_RESAMPLE" ref="ga2226aca7f49137f3f29b6f731a985916" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="group__lswr.html#ga2226aca7f49137f3f29b6f731a985916">SWR_FLAG_RESAMPLE</a>&#160;&#160;&#160;1</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Force resampling even if equal sample rate. </p>

<p>Definition at line <a class="el" href="swresample_8h_source.html#l00140">140</a> of file <a class="el" href="swresample_8h_source.html">swresample.h</a>.</p>

</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ga4aa775b7fba31d2c8dc14c7b7e282863"></a><!-- doxytag: member="swresample.h::SwrContext" ref="ga4aa775b7fba31d2c8dc14c7b7e282863" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The libswresample context. </p>
<p>Unlike libavcodec and libavformat, this structure is opaque. This means that if you would like to set options, you must use the <a class="el" href="group__avoptions.html">AVOptions</a> API and cannot directly set values to members of the structure. </p>

<p>Definition at line <a class="el" href="swresample_8h_source.html#l00186">186</a> of file <a class="el" href="swresample_8h_source.html">swresample.h</a>.</p>

</div>
</div>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="ga387e613b19e5269a46d9ff1a5ee3fcd4"></a><!-- doxytag: member="swresample.h::SwrDitherType" ref="ga387e613b19e5269a46d9ff1a5ee3fcd4" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__lswr.html#ga387e613b19e5269a46d9ff1a5ee3fcd4">SwrDitherType</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Dithering algorithms. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4afacc17a82581598f762a8036ba559836"></a><!-- doxytag: member="SWR_DITHER_NONE" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4afacc17a82581598f762a8036ba559836" args="" -->SWR_DITHER_NONE</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4a0fec2dd28b1357b50e9807ca6ecee83a"></a><!-- doxytag: member="SWR_DITHER_RECTANGULAR" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4a0fec2dd28b1357b50e9807ca6ecee83a" args="" -->SWR_DITHER_RECTANGULAR</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4ae4635dc355dc680eeb211e7af17ddfd2"></a><!-- doxytag: member="SWR_DITHER_TRIANGULAR" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4ae4635dc355dc680eeb211e7af17ddfd2" args="" -->SWR_DITHER_TRIANGULAR</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4a91276f2e437aa9d0d8bdffabe24f5532"></a><!-- doxytag: member="SWR_DITHER_TRIANGULAR_HIGHPASS" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4a91276f2e437aa9d0d8bdffabe24f5532" args="" -->SWR_DITHER_TRIANGULAR_HIGHPASS</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4ae6858a54f5b2e1bffa9aaef20b2593c0"></a><!-- doxytag: member="SWR_DITHER_NS" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4ae6858a54f5b2e1bffa9aaef20b2593c0" args="" -->SWR_DITHER_NS</em>&nbsp;</td><td>
<p>not part of API/ABI </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4a6f6072071262f7f05a52057cfe48df87"></a><!-- doxytag: member="SWR_DITHER_NS_LIPSHITZ" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4a6f6072071262f7f05a52057cfe48df87" args="" -->SWR_DITHER_NS_LIPSHITZ</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4ae197d7fc5592652aaa8edf1067c56af9"></a><!-- doxytag: member="SWR_DITHER_NS_F_WEIGHTED" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4ae197d7fc5592652aaa8edf1067c56af9" args="" -->SWR_DITHER_NS_F_WEIGHTED</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4a60eeb8ca5de47916a81f2c3a6534eed4"></a><!-- doxytag: member="SWR_DITHER_NS_MODIFIED_E_WEIGHTED" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4a60eeb8ca5de47916a81f2c3a6534eed4" args="" -->SWR_DITHER_NS_MODIFIED_E_WEIGHTED</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4ad13d2ff2831d463eb46ca4c46dfec7b0"></a><!-- doxytag: member="SWR_DITHER_NS_IMPROVED_E_WEIGHTED" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4ad13d2ff2831d463eb46ca4c46dfec7b0" args="" -->SWR_DITHER_NS_IMPROVED_E_WEIGHTED</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4ae3aba4bf43c2210a148b11c0215b5d24"></a><!-- doxytag: member="SWR_DITHER_NS_SHIBATA" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4ae3aba4bf43c2210a148b11c0215b5d24" args="" -->SWR_DITHER_NS_SHIBATA</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4af275c21089abbf78a6623544f34d76f9"></a><!-- doxytag: member="SWR_DITHER_NS_LOW_SHIBATA" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4af275c21089abbf78a6623544f34d76f9" args="" -->SWR_DITHER_NS_LOW_SHIBATA</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4ac569828a706ccf22a8d5810c973c8f17"></a><!-- doxytag: member="SWR_DITHER_NS_HIGH_SHIBATA" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4ac569828a706ccf22a8d5810c973c8f17" args="" -->SWR_DITHER_NS_HIGH_SHIBATA</em>&nbsp;</td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga387e613b19e5269a46d9ff1a5ee3fcd4aacbdf2f91bb14cf390116492115fb8ea"></a><!-- doxytag: member="SWR_DITHER_NB" ref="gga387e613b19e5269a46d9ff1a5ee3fcd4aacbdf2f91bb14cf390116492115fb8ea" args="" -->SWR_DITHER_NB</em>&nbsp;</td><td>
<p>not part of API/ABI </p>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="swresample_8h_source.html#l00145">145</a> of file <a class="el" href="swresample_8h_source.html">swresample.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga87f9e023bbe780d3ccf17dfc7abed580"></a><!-- doxytag: member="swresample.h::SwrEngine" ref="ga87f9e023bbe780d3ccf17dfc7abed580" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__lswr.html#ga87f9e023bbe780d3ccf17dfc7abed580">SwrEngine</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Resampling Engines. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="gga87f9e023bbe780d3ccf17dfc7abed580a11652db5af0c279d79deba1c577c9729"></a><!-- doxytag: member="SWR_ENGINE_SWR" ref="gga87f9e023bbe780d3ccf17dfc7abed580a11652db5af0c279d79deba1c577c9729" args="" -->SWR_ENGINE_SWR</em>&nbsp;</td><td>
<p>SW Resampler. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga87f9e023bbe780d3ccf17dfc7abed580a2933f5b0b96829095a04a8acd19b27e7"></a><!-- doxytag: member="SWR_ENGINE_SOXR" ref="gga87f9e023bbe780d3ccf17dfc7abed580a2933f5b0b96829095a04a8acd19b27e7" args="" -->SWR_ENGINE_SOXR</em>&nbsp;</td><td>
<p>SoX Resampler. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga87f9e023bbe780d3ccf17dfc7abed580a865af2e70ebb85b3cafb93f1854dbef9"></a><!-- doxytag: member="SWR_ENGINE_NB" ref="gga87f9e023bbe780d3ccf17dfc7abed580a865af2e70ebb85b3cafb93f1854dbef9" args="" -->SWR_ENGINE_NB</em>&nbsp;</td><td>
<p>not part of API/ABI </p>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="swresample_8h_source.html#l00163">163</a> of file <a class="el" href="swresample_8h_source.html">swresample.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga2176b2a3a8b809788f6e7ccdc238b6be"></a><!-- doxytag: member="swresample.h::SwrFilterType" ref="ga2176b2a3a8b809788f6e7ccdc238b6be" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__lswr.html#ga2176b2a3a8b809788f6e7ccdc238b6be">SwrFilterType</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Resampling Filter Types. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="gga2176b2a3a8b809788f6e7ccdc238b6bea1a6413b9888bac851e2ee4f991f01d0c"></a><!-- doxytag: member="SWR_FILTER_TYPE_CUBIC" ref="gga2176b2a3a8b809788f6e7ccdc238b6bea1a6413b9888bac851e2ee4f991f01d0c" args="" -->SWR_FILTER_TYPE_CUBIC</em>&nbsp;</td><td>
<p>Cubic. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga2176b2a3a8b809788f6e7ccdc238b6bea17f5dd4512b4abc2285905293a81cf55"></a><!-- doxytag: member="SWR_FILTER_TYPE_BLACKMAN_NUTTALL" ref="gga2176b2a3a8b809788f6e7ccdc238b6bea17f5dd4512b4abc2285905293a81cf55" args="" -->SWR_FILTER_TYPE_BLACKMAN_NUTTALL</em>&nbsp;</td><td>
<p>Blackman Nuttall Windowed Sinc. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga2176b2a3a8b809788f6e7ccdc238b6bea8f492a5dc94b6e41a37f190c5492bf3f"></a><!-- doxytag: member="SWR_FILTER_TYPE_KAISER" ref="gga2176b2a3a8b809788f6e7ccdc238b6bea8f492a5dc94b6e41a37f190c5492bf3f" args="" -->SWR_FILTER_TYPE_KAISER</em>&nbsp;</td><td>
<p>Kaiser Windowed Sinc. </p>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="swresample_8h_source.html#l00170">170</a> of file <a class="el" href="swresample_8h_source.html">swresample.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga6ca0298348b382cf0fe67d7f339a17f3"></a><!-- doxytag: member="swresample.h::swr_get_class" ref="ga6ca0298348b382cf0fe67d7f339a17f3" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structAVClass.html">AVClass</a>* <a class="el" href="group__lswr.html#ga6ca0298348b382cf0fe67d7f339a17f3">swr_get_class</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the <a class="el" href="structAVClass.html" title="Describe the class of an AVClass context structure.">AVClass</a> for SwrContext. </p>
<p>It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__avoptions.html#gae31ae7fb20113b00108d0ecf53f25664" title="Look for an option in an object.">av_opt_find()</a>. </dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the <a class="el" href="structAVClass.html" title="Describe the class of an AVClass context structure.">AVClass</a> of SwrContext </dd></dl>

</div>
</div>
<a class="anchor" id="gaf58c4ff10f73d74bdab8e5aa7193147c"></a><!-- doxytag: member="swresample.h::swr_alloc" ref="gaf58c4ff10f73d74bdab8e5aa7193147c" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a>* <a class="el" href="group__lswr.html#gaf58c4ff10f73d74bdab8e5aa7193147c">swr_alloc</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Allocate SwrContext. </p>
<p>If you use this function you will need to set the parameters (manually or with <a class="el" href="group__lswr.html#gad7f29022726c871aadf935281a9813bc" title="Allocate SwrContext if needed and set/reset common parameters.">swr_alloc_set_opts()</a>) before calling <a class="el" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67" title="Initialize context after user parameters have been set.">swr_init()</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__lswr.html#gad7f29022726c871aadf935281a9813bc" title="Allocate SwrContext if needed and set/reset common parameters.">swr_alloc_set_opts()</a>, <a class="el" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67" title="Initialize context after user parameters have been set.">swr_init()</a>, <a class="el" href="group__lswr.html#ga818f7d78b1ad7d8d5b70de374b668c34" title="Free the given SwrContext and set the pointer to NULL.">swr_free()</a> </dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NULL on error, allocated context otherwise </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="muxing_8c-example.html#a85">muxing.c</a>, and <a class="el" href="resampling_audio_8c-example.html#a14">resampling_audio.c</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="resampling__audio_8c_source.html#l00081">main()</a>, and <a class="el" href="muxing_8c_source.html#l00209">open_audio()</a>.</p>

</div>
</div>
<a class="anchor" id="gae173e8ed91717700471a1dcd06f00f67"></a><!-- doxytag: member="swresample.h::swr_init" ref="gae173e8ed91717700471a1dcd06f00f67" args="(struct SwrContext *s)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67">swr_init</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize context after user parameters have been set. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>The context must be configured using the <a class="el" href="structAVOption.html" title="AVOption.">AVOption</a> API.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__opt__set__funcs.html#ga3adf7185c21cc080890a5ec02c2e56b2">av_opt_set_int()</a> </dd>
<dd>
<a class="el" href="group__avoptions.html#gaf1a88e8f152d7835f111b1ef8813fb2e" title="Set all the options from a given dictionary on an object.">av_opt_set_dict()</a></dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">s</td><td>Swr context to initialize </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>AVERROR error code in case of failure. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="muxing_8c-example.html#a88">muxing.c</a>, <a class="el" href="resampling_audio_8c-example.html#a17">resampling_audio.c</a>, and <a class="el" href="transcode_aac_8c-example.html#a52">transcode_aac.c</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="transcode__aac_8c_source.html#l00237">init_resampler()</a>, <a class="el" href="resampling__audio_8c_source.html#l00081">main()</a>, and <a class="el" href="muxing_8c_source.html#l00209">open_audio()</a>.</p>

</div>
</div>
<a class="anchor" id="gab11b02705e97404b6d74b18b2fcfdfcf"></a><!-- doxytag: member="swresample.h::swr_is_initialized" ref="gab11b02705e97404b6d74b18b2fcfdfcf" args="(struct SwrContext *s)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lswr.html#gab11b02705e97404b6d74b18b2fcfdfcf">swr_is_initialized</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Check whether an swr context has been initialized or not. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">s</td><td>Swr context to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67" title="Initialize context after user parameters have been set.">swr_init()</a> </dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>positive if it has been initialized, 0 if not initialized </dd></dl>

</div>
</div>
<a class="anchor" id="gad7f29022726c871aadf935281a9813bc"></a><!-- doxytag: member="swresample.h::swr_alloc_set_opts" ref="gad7f29022726c871aadf935281a9813bc" args="(struct SwrContext *s, int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a>* <a class="el" href="group__lswr.html#gad7f29022726c871aadf935281a9813bc">swr_alloc_set_opts</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int64_t&#160;</td>
          <td class="paramname"><em>out_ch_layout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="group__lavu__sampfmts.html#gaf9a51ca15301871723577c730b5865c5">AVSampleFormat</a>&#160;</td>
          <td class="paramname"><em>out_sample_fmt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>out_sample_rate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int64_t&#160;</td>
          <td class="paramname"><em>in_ch_layout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="group__lavu__sampfmts.html#gaf9a51ca15301871723577c730b5865c5">AVSampleFormat</a>&#160;</td>
          <td class="paramname"><em>in_sample_fmt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>in_sample_rate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>log_offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>log_ctx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [read]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Allocate SwrContext if needed and set/reset common parameters. </p>
<p>This function does not require s to be allocated with <a class="el" href="group__lswr.html#gaf58c4ff10f73d74bdab8e5aa7193147c" title="Allocate SwrContext.">swr_alloc()</a>. On the other hand, <a class="el" href="group__lswr.html#gaf58c4ff10f73d74bdab8e5aa7193147c" title="Allocate SwrContext.">swr_alloc()</a> can use <a class="el" href="group__lswr.html#gad7f29022726c871aadf935281a9813bc" title="Allocate SwrContext if needed and set/reset common parameters.">swr_alloc_set_opts()</a> to set the parameters on the allocated context.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>existing Swr context if available, or NULL if not </td></tr>
    <tr><td class="paramname">out_ch_layout</td><td>output channel layout (AV_CH_LAYOUT_*) </td></tr>
    <tr><td class="paramname">out_sample_fmt</td><td>output sample format (AV_SAMPLE_FMT_*). </td></tr>
    <tr><td class="paramname">out_sample_rate</td><td>output sample rate (frequency in Hz) </td></tr>
    <tr><td class="paramname">in_ch_layout</td><td>input channel layout (AV_CH_LAYOUT_*) </td></tr>
    <tr><td class="paramname">in_sample_fmt</td><td>input sample format (AV_SAMPLE_FMT_*). </td></tr>
    <tr><td class="paramname">in_sample_rate</td><td>input sample rate (frequency in Hz) </td></tr>
    <tr><td class="paramname">log_offset</td><td>logging level offset </td></tr>
    <tr><td class="paramname">log_ctx</td><td>parent logging context, can be NULL</td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67" title="Initialize context after user parameters have been set.">swr_init()</a>, <a class="el" href="group__lswr.html#ga818f7d78b1ad7d8d5b70de374b668c34" title="Free the given SwrContext and set the pointer to NULL.">swr_free()</a> </dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NULL on error, allocated context otherwise </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="transcode_aac_8c-example.html#a49">transcode_aac.c</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="transcode__aac_8c_source.html#l00237">init_resampler()</a>.</p>

</div>
</div>
<a class="anchor" id="ga818f7d78b1ad7d8d5b70de374b668c34"></a><!-- doxytag: member="swresample.h::swr_free" ref="ga818f7d78b1ad7d8d5b70de374b668c34" args="(struct SwrContext **s)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__lswr.html#ga818f7d78b1ad7d8d5b70de374b668c34">swr_free</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> **&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Free the given SwrContext and set the pointer to NULL. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">s</td><td>a pointer to a pointer to Swr context </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="muxing_8c-example.html#a130">muxing.c</a>, <a class="el" href="resampling_audio_8c-example.html#a27">resampling_audio.c</a>, and <a class="el" href="transcode_aac_8c-example.html#a53">transcode_aac.c</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="muxing_8c_source.html#l00544">close_stream()</a>, <a class="el" href="transcode__aac_8c_source.html#l00237">init_resampler()</a>, and <a class="el" href="resampling__audio_8c_source.html#l00081">main()</a>.</p>

</div>
</div>
<a class="anchor" id="gaa4bf1048740dfc08d68aba9f1b4db22e"></a><!-- doxytag: member="swresample.h::swr_close" ref="gaa4bf1048740dfc08d68aba9f1b4db22e" args="(struct SwrContext *s)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group__lswr.html#gaa4bf1048740dfc08d68aba9f1b4db22e">swr_close</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Closes the context so that <a class="el" href="group__lswr.html#gab11b02705e97404b6d74b18b2fcfdfcf" title="Check whether an swr context has been initialized or not.">swr_is_initialized()</a> returns 0. </p>
<p>The context can be brought back to life by running <a class="el" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67" title="Initialize context after user parameters have been set.">swr_init()</a>, <a class="el" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67" title="Initialize context after user parameters have been set.">swr_init()</a> can also be used without <a class="el" href="group__lswr.html#gaa4bf1048740dfc08d68aba9f1b4db22e" title="Closes the context so that swr_is_initialized() returns 0.">swr_close()</a>. This function is mainly provided for simplifying the usecase where one tries to support libavresample and libswresample.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">s</td><td>Swr context to be closed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaa5bb6cab830146efa8c760fa66ee582a"></a><!-- doxytag: member="swresample.h::swr_convert" ref="gaa5bb6cab830146efa8c760fa66ee582a" args="(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in, int in_count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a">swr_convert</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t **&#160;</td>
          <td class="paramname"><em>out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>out_count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t **&#160;</td>
          <td class="paramname"><em>in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>in_count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Convert audio. </p>
<p>in and in_count can be set to 0 to flush the last few samples out at the end.</p>
<p>If more input is provided than output space, then the input will be buffered. You can avoid this buffering by using <a class="el" href="group__lswr.html#ga97a8d5f6abe3bcdfb6072412f17285a4" title="Find an upper bound on the number of samples that the next swr_convert call will output, if called with in_samples of input samples.">swr_get_out_samples()</a> to retrieve an upper bound on the required number of output samples for the given number of input samples. Conversion will run directly without copying whenever possible.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>allocated Swr context, with parameters set </td></tr>
    <tr><td class="paramname">out</td><td>output buffers, only the first one need be set in case of packed audio </td></tr>
    <tr><td class="paramname">out_count</td><td>amount of space available for output in samples per channel </td></tr>
    <tr><td class="paramname">in</td><td>input buffers, only the first one need to be set in case of packed audio </td></tr>
    <tr><td class="paramname">in_count</td><td>number of input samples available in one channel</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>number of samples output per channel, negative value on error </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="muxing_8c-example.html#a101">muxing.c</a>, <a class="el" href="resampling_audio_8c-example.html#a25">resampling_audio.c</a>, and <a class="el" href="transcode_aac_8c-example.html#a67">transcode_aac.c</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="transcode__aac_8c_source.html#l00394">convert_samples()</a>, <a class="el" href="resampling__audio_8c_source.html#l00081">main()</a>, and <a class="el" href="muxing_8c_source.html#l00296">write_audio_frame()</a>.</p>

</div>
</div>
<a class="anchor" id="gaad9811626c6c01a241f6bf46aff27333"></a><!-- doxytag: member="swresample.h::swr_next_pts" ref="gaad9811626c6c01a241f6bf46aff27333" args="(struct SwrContext *s, int64_t pts)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int64_t <a class="el" href="group__lswr.html#gaad9811626c6c01a241f6bf46aff27333">swr_next_pts</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int64_t&#160;</td>
          <td class="paramname"><em>pts</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate) units. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>There are 2 slightly differently behaving modes. <ul>
<li>When automatic timestamp compensation is not used, (min_compensation &gt;= FLT_MAX) in this case timestamps will be passed through with delays compensated </li>
<li>When automatic timestamp compensation is used, (min_compensation &lt; FLT_MAX) in this case the output timestamps will match output sample numbers. See ffmpeg-resampler(1) for the two modes of compensation.</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s[in]</td><td>initialized Swr context </td></tr>
    <tr><td class="paramname">pts[in]</td><td>timestamp for the next input sample, INT64_MIN if unknown </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__lswr.html#gab7f21690522b85d7757e13fa9853d4d8" title="Activate resampling compensation (&quot;soft&quot; compensation).">swr_set_compensation()</a>, <a class="el" href="group__lswr.html#ga43d7ba4507891fc25aacbbea5cdfb065" title="Drops the specified number of output samples.">swr_drop_output()</a>, and <a class="el" href="group__lswr.html#ga4733ed4779ed3e30379de2a6ef8de837" title="Injects the specified number of silence samples.">swr_inject_silence()</a> are function used internally for timestamp compensation. </dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the output timestamp for the next output sample </dd></dl>

</div>
</div>
<a class="anchor" id="gab7f21690522b85d7757e13fa9853d4d8"></a><!-- doxytag: member="swresample.h::swr_set_compensation" ref="gab7f21690522b85d7757e13fa9853d4d8" args="(struct SwrContext *s, int sample_delta, int compensation_distance)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lswr.html#gab7f21690522b85d7757e13fa9853d4d8">swr_set_compensation</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>sample_delta</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>compensation_distance</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Activate resampling compensation ("soft" compensation). </p>
<p>This function is internally called when needed in <a class="el" href="group__lswr.html#gaad9811626c6c01a241f6bf46aff27333" title="Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate...">swr_next_pts()</a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">s</td><td>allocated Swr context. If it is not initialized, or SWR_FLAG_RESAMPLE is not set, <a class="el" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67" title="Initialize context after user parameters have been set.">swr_init()</a> is called with the flag set. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sample_delta</td><td>delta in PTS per sample </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">compensation_distance</td><td>number of samples to compensate for </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>&gt;= 0 on success, AVERROR error codes if: <ul>
<li><code>s</code> is NULL, </li>
<li><code>compensation_distance</code> is less than 0, </li>
<li><code>compensation_distance</code> is 0 but sample_delta is not, </li>
<li>compensation unsupported by resampler, or </li>
<li><a class="el" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67" title="Initialize context after user parameters have been set.">swr_init()</a> fails when called. </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="ga1b528050b5f5b704aecbfbc257a17ef0"></a><!-- doxytag: member="swresample.h::swr_set_channel_mapping" ref="ga1b528050b5f5b704aecbfbc257a17ef0" args="(struct SwrContext *s, const int *channel_map)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lswr.html#ga1b528050b5f5b704aecbfbc257a17ef0">swr_set_channel_mapping</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int *&#160;</td>
          <td class="paramname"><em>channel_map</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set a customized input channel mapping. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">s</td><td>allocated Swr context, not yet initialized </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">channel_map</td><td>customized input channel mapping (array of channel indexes, -1 for a muted channel) </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>&gt;= 0 on success, or AVERROR error code in case of failure. </dd></dl>

</div>
</div>
<a class="anchor" id="gaf9064d65b1e654dc78f7d6bcd2e8c747"></a><!-- doxytag: member="swresample.h::swr_set_matrix" ref="gaf9064d65b1e654dc78f7d6bcd2e8c747" args="(struct SwrContext *s, const double *matrix, int stride)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lswr.html#gaf9064d65b1e654dc78f7d6bcd2e8c747">swr_set_matrix</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double *&#160;</td>
          <td class="paramname"><em>matrix</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stride</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set a customized remix matrix. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>allocated Swr context, not yet initialized </td></tr>
    <tr><td class="paramname">matrix</td><td>remix coefficients; matrix[i + stride * o] is the weight of input channel i in output channel o </td></tr>
    <tr><td class="paramname">stride</td><td>offset between lines of the matrix </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>&gt;= 0 on success, or AVERROR error code in case of failure. </dd></dl>

</div>
</div>
<a class="anchor" id="ga43d7ba4507891fc25aacbbea5cdfb065"></a><!-- doxytag: member="swresample.h::swr_drop_output" ref="ga43d7ba4507891fc25aacbbea5cdfb065" args="(struct SwrContext *s, int count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lswr.html#ga43d7ba4507891fc25aacbbea5cdfb065">swr_drop_output</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Drops the specified number of output samples. </p>
<p>This function, along with <a class="el" href="group__lswr.html#ga4733ed4779ed3e30379de2a6ef8de837" title="Injects the specified number of silence samples.">swr_inject_silence()</a>, is called by <a class="el" href="group__lswr.html#gaad9811626c6c01a241f6bf46aff27333" title="Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate...">swr_next_pts()</a> if needed for "hard" compensation.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>allocated Swr context </td></tr>
    <tr><td class="paramname">count</td><td>number of samples to be dropped</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>&gt;= 0 on success, or a negative AVERROR code on failure </dd></dl>

</div>
</div>
<a class="anchor" id="ga4733ed4779ed3e30379de2a6ef8de837"></a><!-- doxytag: member="swresample.h::swr_inject_silence" ref="ga4733ed4779ed3e30379de2a6ef8de837" args="(struct SwrContext *s, int count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lswr.html#ga4733ed4779ed3e30379de2a6ef8de837">swr_inject_silence</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Injects the specified number of silence samples. </p>
<p>This function, along with <a class="el" href="group__lswr.html#ga43d7ba4507891fc25aacbbea5cdfb065" title="Drops the specified number of output samples.">swr_drop_output()</a>, is called by <a class="el" href="group__lswr.html#gaad9811626c6c01a241f6bf46aff27333" title="Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate...">swr_next_pts()</a> if needed for "hard" compensation.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>allocated Swr context </td></tr>
    <tr><td class="paramname">count</td><td>number of samples to be dropped</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>&gt;= 0 on success, or a negative AVERROR code on failure </dd></dl>

</div>
</div>
<a class="anchor" id="ga5121a5a7890a2d23b72dc871dd0ebb06"></a><!-- doxytag: member="swresample.h::swr_get_delay" ref="ga5121a5a7890a2d23b72dc871dd0ebb06" args="(struct SwrContext *s, int64_t base)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int64_t <a class="el" href="group__lswr.html#ga5121a5a7890a2d23b72dc871dd0ebb06">swr_get_delay</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int64_t&#160;</td>
          <td class="paramname"><em>base</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Gets the delay the next input sample will experience relative to the next output sample. </p>
<p>Swresample can buffer data if more input has been provided than available output space, also converting between sample rates needs a delay. This function returns the sum of all such delays. The exact delay is not necessarily an integer value in either input or output sample rate. Especially when downsampling by a large value, the output sample rate may be a poor choice to represent the delay, similarly for upsampling and the input sample rate.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>swr context </td></tr>
    <tr><td class="paramname">base</td><td>timebase in which the returned delay will be: <ul>
<li>if it's set to 1 the returned delay is in seconds </li>
<li>if it's set to 1000 the returned delay is in milliseconds </li>
<li>if it's set to the input sample rate then the returned delay is in input samples </li>
<li>if it's set to the output sample rate then the returned delay is in output samples </li>
<li>if it's the least common multiple of in_sample_rate and out_sample_rate then an exact rounding-free delay will be returned </li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the delay in 1 / <code>base</code> units. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="muxing_8c-example.html#a97">muxing.c</a>, and <a class="el" href="resampling_audio_8c-example.html#a22">resampling_audio.c</a>.</dd>
</dl>
<p>Referenced by <a class="el" href="resampling__audio_8c_source.html#l00081">main()</a>, and <a class="el" href="muxing_8c_source.html#l00296">write_audio_frame()</a>.</p>

</div>
</div>
<a class="anchor" id="ga97a8d5f6abe3bcdfb6072412f17285a4"></a><!-- doxytag: member="swresample.h::swr_get_out_samples" ref="ga97a8d5f6abe3bcdfb6072412f17285a4" args="(struct SwrContext *s, int in_samples)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lswr.html#ga97a8d5f6abe3bcdfb6072412f17285a4">swr_get_out_samples</a> </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>in_samples</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Find an upper bound on the number of samples that the next swr_convert call will output, if called with in_samples of input samples. </p>
<p>This depends on the internal state, and anything changing the internal state (like further <a class="el" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a" title="Convert audio.">swr_convert()</a> calls) will may change the number of samples <a class="el" href="group__lswr.html#ga97a8d5f6abe3bcdfb6072412f17285a4" title="Find an upper bound on the number of samples that the next swr_convert call will output, if called with in_samples of input samples.">swr_get_out_samples()</a> returns for the same number of input samples.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">in_samples</td><td>number of input samples. </td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>Note:</b></dt><dd>any call to <a class="el" href="group__lswr.html#ga4733ed4779ed3e30379de2a6ef8de837" title="Injects the specified number of silence samples.">swr_inject_silence()</a>, <a class="el" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a" title="Convert audio.">swr_convert()</a>, <a class="el" href="group__lswr.html#gaad9811626c6c01a241f6bf46aff27333" title="Convert the next timestamp from input to output timestamps are in 1/(in_sample_rate * out_sample_rate...">swr_next_pts()</a> or <a class="el" href="group__lswr.html#gab7f21690522b85d7757e13fa9853d4d8" title="Activate resampling compensation (&quot;soft&quot; compensation).">swr_set_compensation()</a> invalidates this limit </dd>
<dd>
it is recommended to pass the correct available buffer size to all functions like <a class="el" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a" title="Convert audio.">swr_convert()</a> even if <a class="el" href="group__lswr.html#ga97a8d5f6abe3bcdfb6072412f17285a4" title="Find an upper bound on the number of samples that the next swr_convert call will output, if called with in_samples of input samples.">swr_get_out_samples()</a> indicates that less would be used. </dd></dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>an upper bound on the number of samples that the next swr_convert will output or a negative value to indicate an error </dd></dl>

</div>
</div>
<a class="anchor" id="gaed39c2153a1e26b4ef656ec8c765a2e3"></a><!-- doxytag: member="swresample.h::swresample_version" ref="gaed39c2153a1e26b4ef656ec8c765a2e3" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned <a class="el" href="group__lswr.html#gaed39c2153a1e26b4ef656ec8c765a2e3">swresample_version</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the <a class="el" href="libswresample_2version_8h.html#a6172452a08ba6386e2265bd34769982b">LIBSWRESAMPLE_VERSION_INT</a> constant. </p>
<p>This is useful to check if the build-time libswresample has the same version as the run-time one.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the unsigned int-typed version </dd></dl>

</div>
</div>
<a class="anchor" id="gad602fde7a824753d5adc57e7f1372e27"></a><!-- doxytag: member="swresample.h::swresample_configuration" ref="gad602fde7a824753d5adc57e7f1372e27" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* <a class="el" href="group__lswr.html#gad602fde7a824753d5adc57e7f1372e27">swresample_configuration</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the swr build-time configuration. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the build-time <code></code>./configure flags </dd></dl>

</div>
</div>
<a class="anchor" id="ga29c5657b18632e206a99d1ae27225499"></a><!-- doxytag: member="swresample.h::swresample_license" ref="ga29c5657b18632e206a99d1ae27225499" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* <a class="el" href="group__lswr.html#ga29c5657b18632e206a99d1ae27225499">swresample_license</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the swr license. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>the license of libswresample, determined at build-time </dd></dl>

</div>
</div>
<a class="anchor" id="gac482028c01d95580106183aa84b0930c"></a><!-- doxytag: member="swresample.h::swr_convert_frame" ref="gac482028c01d95580106183aa84b0930c" args="(SwrContext *swr, AVFrame *output, const AVFrame *input)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lswr.html#gac482028c01d95580106183aa84b0930c">swr_convert_frame</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>swr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structAVFrame.html">AVFrame</a> *&#160;</td>
          <td class="paramname"><em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structAVFrame.html">AVFrame</a> *&#160;</td>
          <td class="paramname"><em>input</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Convert the samples in the input <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> and write them to the output <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a>. </p>
<p>Input and output AVFrames must have channel_layout, sample_rate and format set.</p>
<p>If the output <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> does not have the data pointers allocated the nb_samples field will be set using <a class="el" href="group__lavu__frame.html#ga6b1acbfa82c79bf7fd78d868572f0ceb" title="Allocate new buffer(s) for audio or video data.">av_frame_get_buffer()</a> is called to allocate the frame.</p>
<p>The output <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> can be NULL or have fewer allocated samples than required. In this case, any remaining samples not written to the output will be added to an internal FIFO buffer, to be returned at the next call to this function or to <a class="el" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a" title="Convert audio.">swr_convert()</a>.</p>
<p>If converting sample rate, there may be data remaining in the internal resampling delay buffer. <a class="el" href="group__lswr.html#ga5121a5a7890a2d23b72dc871dd0ebb06" title="Gets the delay the next input sample will experience relative to the next output sample.">swr_get_delay()</a> tells the number of remaining samples. To get this data as output, call this function or <a class="el" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a" title="Convert audio.">swr_convert()</a> with NULL input.</p>
<p>If the SwrContext configuration does not match the output and input <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> settings the conversion does not take place and depending on which <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> is not matching AVERROR_OUTPUT_CHANGED, AVERROR_INPUT_CHANGED or the result of a bitwise-OR of them is returned.</p>
<dl class="see"><dt><b>See also:</b></dt><dd>swr_delay() </dd>
<dd>
<a class="el" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a" title="Convert audio.">swr_convert()</a> </dd>
<dd>
<a class="el" href="group__lswr.html#ga5121a5a7890a2d23b72dc871dd0ebb06" title="Gets the delay the next input sample will experience relative to the next output sample.">swr_get_delay()</a></dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">swr</td><td>audio resample context </td></tr>
    <tr><td class="paramname">output</td><td>output <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> </td></tr>
    <tr><td class="paramname">input</td><td>input <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, AVERROR on failure or nonmatching configuration. </dd></dl>

</div>
</div>
<a class="anchor" id="ga73ade2cf6934765cf518c6c917b77c76"></a><!-- doxytag: member="swresample.h::swr_config_frame" ref="ga73ade2cf6934765cf518c6c917b77c76" args="(SwrContext *swr, const AVFrame *out, const AVFrame *in)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__lswr.html#ga73ade2cf6934765cf518c6c917b77c76">swr_config_frame</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863">SwrContext</a> *&#160;</td>
          <td class="paramname"><em>swr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structAVFrame.html">AVFrame</a> *&#160;</td>
          <td class="paramname"><em>out</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structAVFrame.html">AVFrame</a> *&#160;</td>
          <td class="paramname"><em>in</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Configure or reconfigure the SwrContext using the information provided by the AVFrames. </p>
<p>The original resampling context is reset even on failure. The function calls <a class="el" href="group__lswr.html#gaa4bf1048740dfc08d68aba9f1b4db22e" title="Closes the context so that swr_is_initialized() returns 0.">swr_close()</a> internally if the context is open.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__lswr.html#gaa4bf1048740dfc08d68aba9f1b4db22e" title="Closes the context so that swr_is_initialized() returns 0.">swr_close()</a>;</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">swr</td><td>audio resample context </td></tr>
    <tr><td class="paramname">output</td><td>output <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> </td></tr>
    <tr><td class="paramname">input</td><td>input <a class="el" href="structAVFrame.html" title="This structure describes decoded (raw) audio or video data.">AVFrame</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, AVERROR on failure. </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">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</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 &#160;<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>