WebM VP8 Codec SDK
Data Structures | Typedefs | Functions
External Memory Allocation Functions

Data Structures

struct  vpx_codec_mmap
 Memory Map Entry. More...
 

Typedefs

typedef struct vpx_codec_mmap vpx_codec_mmap_t
 Memory Map Entry. More...
 

Functions

vpx_codec_err_t vpx_codec_get_mem_map (vpx_codec_ctx_t *ctx, vpx_codec_mmap_t *mmap, vpx_codec_iter_t *iter)
 Iterate over the list of segments to allocate. More...
 
vpx_codec_err_t vpx_codec_set_mem_map (vpx_codec_ctx_t *ctx, vpx_codec_mmap_t *mmaps, unsigned int num_maps)
 Identify allocated segments to codec instance. More...
 

Detailed Description

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

Typedef Documentation

Memory Map Entry.

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 vpx_codec_mmap

Function Documentation

vpx_codec_err_t vpx_codec_get_mem_map ( vpx_codec_ctx_t ctx,
vpx_codec_mmap_t mmap,
vpx_codec_iter_t iter 
)

Iterate over the list of segments to allocate.

   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.
Parameters
[in]ctxPointer to this instance's context.
[out]mmapPointer to the memory map entry to populate.
[in,out]iterIterator storage, initialized to NULL
Return values
VPX_CODEC_OKThe memory map entry was populated.
VPX_CODEC_ERRORCodec does not support XMA mode.
VPX_CODEC_MEM_ERRORUnable to determine segment size from stream info.
vpx_codec_err_t vpx_codec_set_mem_map ( vpx_codec_ctx_t ctx,
vpx_codec_mmap_t mmaps,
unsigned int  num_maps 
)

Identify allocated segments to codec instance.

   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.
Parameters
[in]ctxPointer to this instance's context.
[in]mmapsPointer to the first memory map entry in the list.
[in]num_mapsNumber of entries being set at this time
Return values
VPX_CODEC_OKThe segment was stored in the codec context.
VPX_CODEC_INCAPABLECodec does not support XMA mode.
VPX_CODEC_MEM_ERRORSegment base address was not set, or segment was already stored.