<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.3"/> <title>WebM VP8 Codec SDK: External Memory Allocation Functions</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">WebM VP8 Codec SDK </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.3 --> <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> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Data Structures</a> | <a href="#typedef-members">Typedefs</a> | <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">External Memory Allocation Functions<div class="ingroups"><a class="el" href="group__codec.html">Common Algorithm Interface</a></div></div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Data Structures</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structvpx__codec__mmap.html">vpx_codec_mmap</a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Memory Map Entry. <a href="structvpx__codec__mmap.html#details">More...</a><br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a> Typedefs</h2></td></tr> <tr class="memitem:gaca7501932c5ec8a876729f661b752f07"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structvpx__codec__mmap.html">vpx_codec_mmap</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cap__xma.html#gaca7501932c5ec8a876729f661b752f07">vpx_codec_mmap_t</a></td></tr> <tr class="memdesc:gaca7501932c5ec8a876729f661b752f07"><td class="mdescLeft"> </td><td class="mdescRight">Memory Map Entry. <a href="#gaca7501932c5ec8a876729f661b752f07"></a><br/></td></tr> <tr class="separator:gaca7501932c5ec8a876729f661b752f07"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:ga802003c8ed203def368a361fe0e92f13"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__codec.html#gada1084710837ad363b92f2379dd2b8d2">vpx_codec_err_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cap__xma.html#ga802003c8ed203def368a361fe0e92f13">vpx_codec_get_mem_map</a> (<a class="el" href="group__codec.html#gad03e2dfa6ae511db7d25be6bbb336233">vpx_codec_ctx_t</a> *ctx, <a class="el" href="group__cap__xma.html#gaca7501932c5ec8a876729f661b752f07">vpx_codec_mmap_t</a> *mmap, <a class="el" href="group__codec.html#ga6ea348f76b1f8a1fe50e14db684146c6">vpx_codec_iter_t</a> *iter)</td></tr> <tr class="memdesc:ga802003c8ed203def368a361fe0e92f13"><td class="mdescLeft"> </td><td class="mdescRight">Iterate over the list of segments to allocate. <a href="#ga802003c8ed203def368a361fe0e92f13"></a><br/></td></tr> <tr class="separator:ga802003c8ed203def368a361fe0e92f13"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gac2df376a4d76282a5c117313182dcf53"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__codec.html#gada1084710837ad363b92f2379dd2b8d2">vpx_codec_err_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cap__xma.html#gac2df376a4d76282a5c117313182dcf53">vpx_codec_set_mem_map</a> (<a class="el" href="group__codec.html#gad03e2dfa6ae511db7d25be6bbb336233">vpx_codec_ctx_t</a> *ctx, <a class="el" href="group__cap__xma.html#gaca7501932c5ec8a876729f661b752f07">vpx_codec_mmap_t</a> *mmaps, unsigned int num_maps)</td></tr> <tr class="memdesc:gac2df376a4d76282a5c117313182dcf53"><td class="mdescLeft"> </td><td class="mdescRight">Identify allocated segments to codec instance. <a href="#gac2df376a4d76282a5c117313182dcf53"></a><br/></td></tr> <tr class="separator:gac2df376a4d76282a5c117313182dcf53"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <p>The following functions are required to be implemented for all codecs that advertise the VPX_CODEC_CAP_XMA capability. Calling these functions for codecs that don't advertise this capability will result in an error code being returned, usually VPX_CODEC_INCAPABLE </p> <h2 class="groupheader">Typedef Documentation</h2> <a class="anchor" id="gaca7501932c5ec8a876729f661b752f07"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef struct <a class="el" href="structvpx__codec__mmap.html">vpx_codec_mmap</a> <a class="el" href="group__cap__xma.html#gaca7501932c5ec8a876729f661b752f07">vpx_codec_mmap_t</a></td> </tr> </table> </div><div class="memdoc"> <p>Memory Map Entry. </p> <p>This structure is used to contain the properties of a memory segment. It is populated by the codec in the request phase, and by the calling application once the requested allocation has been performed.alias for struct <a class="el" href="structvpx__codec__mmap.html" title="Memory Map Entry.">vpx_codec_mmap</a> </p> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="ga802003c8ed203def368a361fe0e92f13"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__codec.html#gada1084710837ad363b92f2379dd2b8d2">vpx_codec_err_t</a> vpx_codec_get_mem_map </td> <td>(</td> <td class="paramtype"><a class="el" href="group__codec.html#gad03e2dfa6ae511db7d25be6bbb336233">vpx_codec_ctx_t</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group__cap__xma.html#gaca7501932c5ec8a876729f661b752f07">vpx_codec_mmap_t</a> * </td> <td class="paramname"><em>mmap</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group__codec.html#ga6ea348f76b1f8a1fe50e14db684146c6">vpx_codec_iter_t</a> * </td> <td class="paramname"><em>iter</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Iterate over the list of segments to allocate. </p> <pre class="fragment"> Iterates over a list of the segments to allocate. The iterator storage should be initialized to NULL to start the iteration. Iteration is complete when this function returns VPX_CODEC_LIST_END. The amount of memory needed to allocate is dependent upon the size of the encoded stream. In cases where the stream is not available at allocation time, a fixed size must be requested. The codec will not be able to operate on streams larger than the size used at allocation time. </pre><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>Pointer to this instance's context. </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">mmap</td><td>Pointer to the memory map entry to populate. </td></tr> <tr><td class="paramdir">[in,out]</td><td class="paramname">iter</td><td>Iterator storage, initialized to NULL</td></tr> </table> </dd> </dl> <dl class="retval"><dt>Return values</dt><dd> <table class="retval"> <tr><td class="paramname"><a class="el" href="group__codec.html#ggada1084710837ad363b92f2379dd2b8d2af1dcde74b1c5ff7b29f31246dfd90986" title="Operation completed without error.">VPX_CODEC_OK</a></td><td>The memory map entry was populated. </td></tr> <tr><td class="paramname"><a class="el" href="group__codec.html#ggada1084710837ad363b92f2379dd2b8d2abd8a8f9c2588adab5d764d957e265135" title="Unspecified error.">VPX_CODEC_ERROR</a></td><td>Codec does not support XMA mode. </td></tr> <tr><td class="paramname"><a class="el" href="group__codec.html#ggada1084710837ad363b92f2379dd2b8d2a96c6d2600dc0ec25c2cb798e8d2f4760" title="Memory operation failed.">VPX_CODEC_MEM_ERROR</a></td><td>Unable to determine segment size from stream info. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="gac2df376a4d76282a5c117313182dcf53"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__codec.html#gada1084710837ad363b92f2379dd2b8d2">vpx_codec_err_t</a> vpx_codec_set_mem_map </td> <td>(</td> <td class="paramtype"><a class="el" href="group__codec.html#gad03e2dfa6ae511db7d25be6bbb336233">vpx_codec_ctx_t</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group__cap__xma.html#gaca7501932c5ec8a876729f661b752f07">vpx_codec_mmap_t</a> * </td> <td class="paramname"><em>mmaps</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"><em>num_maps</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Identify allocated segments to codec instance. </p> <pre class="fragment"> Stores a list of allocated segments in the codec. Segments \ref MUST be passed in the order they are read from vpx_codec_get_mem_map(), but may be passed in groups of any size. Segments \ref MUST be set only once. The allocation function \ref MUST ensure that the vpx_codec_mmap_t::base member is non-NULL. If the segment requires cleanup handling (e.g., calling free() or close()) then the vpx_codec_mmap_t::dtor member \ref MUST be populated. </pre><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>Pointer to this instance's context. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">mmaps</td><td>Pointer to the first memory map entry in the list. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">num_maps</td><td>Number of entries being set at this time</td></tr> </table> </dd> </dl> <dl class="retval"><dt>Return values</dt><dd> <table class="retval"> <tr><td class="paramname"><a class="el" href="group__codec.html#ggada1084710837ad363b92f2379dd2b8d2af1dcde74b1c5ff7b29f31246dfd90986" title="Operation completed without error.">VPX_CODEC_OK</a></td><td>The segment was stored in the codec context. </td></tr> <tr><td class="paramname"><a class="el" href="group__codec.html#ggada1084710837ad363b92f2379dd2b8d2a4470784ba5a3ef84dc0697d5489dd292" title="Algorithm does not have required capability.">VPX_CODEC_INCAPABLE</a></td><td>Codec does not support XMA mode. </td></tr> <tr><td class="paramname"><a class="el" href="group__codec.html#ggada1084710837ad363b92f2379dd2b8d2a96c6d2600dc0ec25c2cb798e8d2f4760" title="Memory operation failed.">VPX_CODEC_MEM_ERROR</a></td><td>Segment base address was not set, or segment was already stored. </td></tr> </table> </dd> </dl> </div> </div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.3 </small></address> </body> </html>