Classes | Defines | Typedefs | Functions

External Memory Allocation Functions
[Common Algorithm InterfaceDecoder Algorithm Interface]

Collaboration diagram for External Memory Allocation Functions:

Classes

struct  vpx_codec_mmap
 Memory Map Entry. More...

Defines

#define VPX_DEC_MEM_ZERO   0x1
 Memory Map Entry.
#define VPX_DEC_MEM_WRONLY   0x2
 Segment need not be readable.
#define VPX_DEC_MEM_FAST   0x4
 Place in fast memory, if available.
#define vpx_dec_xma_init(ctx, iface)   vpx_dec_xma_init_ver(ctx, iface, VPX_DECODER_ABI_VERSION)

Typedefs

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

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.
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.
vpx_dec_err_t vpx_dec_xma_init_ver (vpx_dec_ctx_t *ctx, vpx_dec_iface_t *iface, int ver) DEPRECATED
 Initialize a decoder instance in external allocation mode.
vpx_dec_err_t vpx_dec_get_mem_map (vpx_dec_ctx_t *ctx, vpx_dec_mmap_t *mmap, const vpx_dec_stream_info_t *si, vpx_dec_iter_t *iter) DEPRECATED
 Iterate over the list of segments to allocate.
vpx_dec_err_t vpx_dec_set_mem_map (vpx_dec_ctx_t *ctx, vpx_dec_mmap_t *mmaps, unsigned int num_maps) DEPRECATED
 Identify allocated segments to decoder instance.

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

The following functions are required to be implemented for all decoders that advertise the VPX_DEC_CAP_XMA capability. Calling these functions for codecs that don't advertise this capability will result in an error code being returned, usually VPX_DEC_ERROR


Define Documentation

#define VPX_DEC_MEM_FAST   0x4

Place in fast memory, if available.

#define VPX_DEC_MEM_WRONLY   0x2

Segment need not be readable.

#define VPX_DEC_MEM_ZERO   0x1

Memory Map Entry.

This structure is used to contain the properties of a memory segment. It is populated by the decoder in the request phase, and by the calling application once the requested allocation has been performed. Segment must be zeroed by allocation

#define vpx_dec_xma_init (   ctx,
  iface 
)    vpx_dec_xma_init_ver(ctx, iface, VPX_DECODER_ABI_VERSION)

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 dependant 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] ctx Pointer to this instance's context.
[out] mmap Pointer to the memory map entry to populate.
[in,out] iter Iterator storage, initialized to NULL
Return values:
VPX_CODEC_OK The memory map entry was populated.
VPX_CODEC_ERROR Codec does not support XMA mode.
VPX_CODEC_MEM_ERROR Unable 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 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 MUST be set only once. The allocation function MUST ensure that the vpx_codec_mmap_t::base member is non-NULL. If the segment requires cleanup handling (eg, calling free() or close()) then the vpx_codec_mmap_t::dtor member MUST be populated.

Parameters:
[in] ctx Pointer to this instance's context.
[in] mmaps Pointer to the first memory map entry in the list.
[in] num_maps Number of entries being set at this time
Return values:
VPX_CODEC_OK The segment was stored in the codec context.
VPX_CODEC_INCAPABLE Codec does not support XMA mode.
VPX_CODEC_MEM_ERROR Segment base address was not set, or segment was already stored.
vpx_dec_err_t vpx_dec_get_mem_map ( vpx_dec_ctx_t ctx,
vpx_dec_mmap_t mmap,
const vpx_dec_stream_info_t si,
vpx_dec_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_DEC_LIST_END. The amount of memory needed to allocate is dependant upon the size of the encoded stream. This means that the stream info structure must be known at allocation time. It can be populated with the vpx_dec_peek_stream_info() function. In cases where the stream to be decoded is not available at allocation time, a fixed size must be requested. The decoder will not be able to decode streams larger than the size used at allocation time.

Parameters:
[in] ctx Pointer to this instance's context.
[out] mmap Pointer to the memory map entry to populate.
[in] si Pointer to the stream info.
in out] iter Iterator storage, initialized to NULL
Return values:
VPX_DEC_OK The memory map entry was populated.
VPX_DEC_ERROR Decoder does not support XMA mode.
VPX_DEC_MEM_ERROR Unable to determine segment size from stream info.
vpx_dec_err_t vpx_dec_set_mem_map ( vpx_dec_ctx_t ctx,
vpx_dec_mmap_t mmaps,
unsigned int  num_maps 
)

Identify allocated segments to decoder instance.

Stores a list of allocated segments in the decoder. Segments MUST be passed in the order they are read from vpx_dec_get_mem_map(), but may be passed in groups of any size. Segments MUST be set only once. The allocation function MUST ensure that the vpx_dec_mmap_t::base member is non-NULL. If the segment requires cleanup handling (eg, calling free() or close()) then the vpx_dec_mmap_t::dtor member MUST be populated.

Parameters:
[in] ctx Pointer to this instance's context.
[in] mmaps Pointer to the first memory map entry in the list.
[in] num_maps Number of entries being set at this time
Return values:
VPX_DEC_OK The segment was stored in the decoder context.
VPX_DEC_ERROR Decoder does not support XMA mode.
VPX_DEC_MEM_ERROR Segment base address was not set, or segment was already stored.
vpx_dec_err_t vpx_dec_xma_init_ver ( vpx_dec_ctx_t ctx,
vpx_dec_iface_t iface,
int  ver 
)

Initialize a decoder instance in external allocation mode.

Initializes a decoder context using the given interface. Applications should call the vpx_dec_xma_init convenience macro instead of this function directly, to ensure that the ABI version number parameter is properly initialized.

Parameters:
[in] ctx Pointer to this instance's context.
[in] iface Pointer to the alogrithm interface to use.
[in] ver ABI version number. Must be set to VPX_DECODER_ABI_VERSION
Return values:
VPX_DEC_OK The decoder algorithm initialized.
VPX_DEC_ERROR Decoder does not support XMA mode.