AOMedia Codec SDK
|
Modules | |
Frame-Based Decoding Functions | |
The following functions are required to be implemented for all decoders that advertise the AOM_CODEC_CAP_PUT_FRAME capability. Calling these functions for codecs that don't advertise this capability will result in an error code being returned, usually AOM_CODEC_ERROR. | |
Slice-Based Decoding Functions | |
The following functions are required to be implemented for all decoders that advertise the AOM_CODEC_CAP_PUT_SLICE capability. Calling these functions for codecs that don't advertise this capability will result in an error code being returned, usually AOM_CODEC_ERROR. | |
External Frame Buffer Functions | |
The following section is required to be implemented for all decoders that advertise the AOM_CODEC_CAP_EXTERNAL_FRAME_BUFFER capability. Calling this function for codecs that don't advertise this capability will result in an error code being returned, usually AOM_CODEC_ERROR. | |
Files | |
file | aom_decoder.h |
Describes the decoder algorithm interface to applications. | |
Data Structures | |
struct | aom_codec_stream_info |
Stream properties. More... | |
struct | aom_codec_dec_cfg |
Initialization Configurations. More... | |
Macros | |
#define | AOM_DECODER_ABI_VERSION |
Current ABI version number. | |
#define | AOM_CODEC_CAP_PUT_SLICE 0x10000 |
Decoder capabilities bitfield. More... | |
#define | AOM_CODEC_CAP_PUT_FRAME 0x20000 |
#define | AOM_CODEC_CAP_POSTPROC 0x40000 |
#define | AOM_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x200000 |
Initialization-time Feature Enabling. More... | |
#define | AOM_CODEC_USE_POSTPROC 0x10000 |
#define | aom_codec_dec_init(ctx, iface, cfg, flags) aom_codec_dec_init_ver(ctx, iface, cfg, flags, AOM_DECODER_ABI_VERSION) |
Convenience macro for aom_codec_dec_init_ver() More... | |
Typedefs | |
typedef struct aom_codec_stream_info | aom_codec_stream_info_t |
Stream properties. More... | |
typedef struct aom_codec_dec_cfg | aom_codec_dec_cfg_t |
Initialization Configurations. More... | |
Functions | |
aom_codec_err_t | aom_codec_dec_init_ver (aom_codec_ctx_t *ctx, aom_codec_iface_t *iface, const aom_codec_dec_cfg_t *cfg, aom_codec_flags_t flags, int ver) |
Initialize a decoder instance. More... | |
aom_codec_err_t | aom_codec_peek_stream_info (aom_codec_iface_t *iface, const uint8_t *data, size_t data_sz, aom_codec_stream_info_t *si) |
Parse stream info from a buffer. More... | |
aom_codec_err_t | aom_codec_get_stream_info (aom_codec_ctx_t *ctx, aom_codec_stream_info_t *si) |
Return information about the current stream. More... | |
aom_codec_err_t | aom_codec_decode (aom_codec_ctx_t *ctx, const uint8_t *data, size_t data_sz, void *user_priv) |
Decode data. More... | |
aom_image_t * | aom_codec_get_frame (aom_codec_ctx_t *ctx, aom_codec_iter_t *iter) |
Decoded frames iterator. More... | |
This abstraction allows applications using this decoder to easily support multiple video formats with minimal code duplication. This section describes the interface common to all decoders.
#define AOM_CODEC_CAP_PUT_SLICE 0x10000 |
Decoder capabilities bitfield.
Each decoder advertises the capabilities it supports as part of its aom_codec_iface_t interface structure. Capabilities are extra interfaces or functionality, and are not required to be supported by a decoder.
The available flags are specified by AOM_CODEC_CAP_* defines. Will issue put_slice callbacks
#define AOM_CODEC_CAP_PUT_FRAME 0x20000 |
Will issue put_frame callbacks
#define AOM_CODEC_CAP_POSTPROC 0x40000 |
Can postprocess decoded frame
#define AOM_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x200000 |
Initialization-time Feature Enabling.
Certain codec features must be known at initialization time, to allow for proper memory allocation.
The available flags are specified by AOM_CODEC_USE_* defines.
brief Can support external frame buffers
#define AOM_CODEC_USE_POSTPROC 0x10000 |
Postprocess decoded frame
#define aom_codec_dec_init | ( | ctx, | |
iface, | |||
cfg, | |||
flags | |||
) | aom_codec_dec_init_ver(ctx, iface, cfg, flags, AOM_DECODER_ABI_VERSION) |
Convenience macro for aom_codec_dec_init_ver()
Ensures the ABI version parameter is properly set.
typedef struct aom_codec_stream_info aom_codec_stream_info_t |
Stream properties.
This structure is used to query or set properties of the decoded stream.
typedef struct aom_codec_dec_cfg aom_codec_dec_cfg_t |
Initialization Configurations.
This structure is used to pass init time configuration options to the decoder. alias for struct aom_codec_dec_cfg
aom_codec_err_t aom_codec_dec_init_ver | ( | aom_codec_ctx_t * | ctx, |
aom_codec_iface_t * | iface, | ||
const aom_codec_dec_cfg_t * | cfg, | ||
aom_codec_flags_t | flags, | ||
int | ver | ||
) |
Initialize a decoder instance.
Initializes a decoder context using the given interface. Applications should call the aom_codec_dec_init convenience macro instead of this function directly, to ensure that the ABI version number parameter is properly initialized.
If the library was configured with –disable-multithread, this call is not thread safe and should be guarded with a lock if being used in a multithreaded context.
[in] | ctx | Pointer to this instance's context. |
[in] | iface | Pointer to the algorithm interface to use. |
[in] | cfg | Configuration to use, if known. May be NULL. |
[in] | flags | Bitfield of AOM_CODEC_USE_* flags |
[in] | ver | ABI version number. Must be set to AOM_DECODER_ABI_VERSION |
AOM_CODEC_OK | The decoder algorithm initialized. |
AOM_CODEC_MEM_ERROR | Memory allocation failed. |
aom_codec_err_t aom_codec_peek_stream_info | ( | aom_codec_iface_t * | iface, |
const uint8_t * | data, | ||
size_t | data_sz, | ||
aom_codec_stream_info_t * | si | ||
) |
Parse stream info from a buffer.
Performs high level parsing of the bitstream. Construction of a decoder context is not necessary. Can be used to determine if the bitstream is of the proper format, and to extract information from the stream.
[in] | iface | Pointer to the algorithm interface |
[in] | data | Pointer to a block of data to parse |
[in] | data_sz | Size of the data buffer |
[in,out] | si | Pointer to stream info to update. The is_annexb member MUST be properly initialized. This function sets the rest of the members. |
AOM_CODEC_OK | Bitstream is parsable and stream information updated. |
AOM_CODEC_INVALID_PARAM | One of the arguments is invalid, for example a NULL pointer. |
AOM_CODEC_UNSUP_BITSTREAM | The decoder didn't recognize the coded data, or the buffer was too short. |
aom_codec_err_t aom_codec_get_stream_info | ( | aom_codec_ctx_t * | ctx, |
aom_codec_stream_info_t * | si | ||
) |
Return information about the current stream.
Returns information about the stream that has been parsed during decoding.
[in] | ctx | Pointer to this instance's context |
[in,out] | si | Pointer to stream info to update. |
AOM_CODEC_OK | Bitstream is parsable and stream information updated. |
AOM_CODEC_INVALID_PARAM | One of the arguments is invalid, for example a NULL pointer. |
AOM_CODEC_UNSUP_BITSTREAM | The decoder couldn't parse the submitted data. |
aom_codec_err_t aom_codec_decode | ( | aom_codec_ctx_t * | ctx, |
const uint8_t * | data, | ||
size_t | data_sz, | ||
void * | user_priv | ||
) |
Decode data.
Processes a buffer of coded data. If the processing results in a new decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be generated, as appropriate. Encoded data MUST be passed in DTS (decode time stamp) order. Frames produced will always be in PTS (presentation time stamp) order.
[in] | ctx | Pointer to this instance's context |
[in] | data | Pointer to this block of new coded data. If NULL, a AOM_CODEC_CB_PUT_FRAME event is posted for the previously decoded frame. |
[in] | data_sz | Size of the coded data, in bytes. |
[in] | user_priv | Application specific data to associate with this frame. |
aom_image_t* aom_codec_get_frame | ( | aom_codec_ctx_t * | ctx, |
aom_codec_iter_t * | iter | ||
) |
Decoded frames iterator.
Iterates over a list of the frames available for display. The iterator storage should be initialized to NULL to start the iteration. Iteration is complete when this function returns NULL.
The list of available frames becomes valid upon completion of the aom_codec_decode call, and remains valid until the next call to aom_codec_decode.
[in] | ctx | Pointer to this instance's context |
[in,out] | iter | Iterator storage, initialized to NULL |