This abstraction allows applications using this decoder to easily support multiple video formats with minimal code duplication. More...
Modules | |
Frame-Based Decoding Functions | |
The following function is required to be implemented for all decoders that advertise the VPX_CODEC_CAP_PUT_FRAME capability. | |
Slice-Based Decoding Functions | |
The following function is required to be implemented for all decoders that advertise the VPX_CODEC_CAP_PUT_SLICE capability. | |
External Frame Buffer Functions | |
The following function is required to be implemented for all decoders that advertise the VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER capability. | |
Files | |
file | vpx_decoder.h |
Describes the decoder algorithm interface to applications. | |
file | vpx_decoder.h |
Describes the decoder algorithm interface to applications. | |
Classes | |
struct | vpx_codec_stream_info |
Stream properties. More... | |
struct | vpx_codec_dec_cfg |
Initialization Configurations. More... | |
Typedefs | |
typedef struct vpx_codec_stream_info | vpx_codec_stream_info_t |
Stream properties. More... | |
typedef struct vpx_codec_dec_cfg | vpx_codec_dec_cfg_t |
Initialization Configurations. More... | |
typedef struct vpx_codec_stream_info | vpx_codec_stream_info_t |
Stream properties. More... | |
typedef struct vpx_codec_dec_cfg | vpx_codec_dec_cfg_t |
Initialization Configurations. More... | |
Functions | |
vpx_codec_err_t | vpx_codec_dec_init_ver (vpx_codec_ctx_t *ctx, vpx_codec_iface_t *iface, const vpx_codec_dec_cfg_t *cfg, vpx_codec_flags_t flags, int ver) |
Initialize a decoder instance. More... | |
vpx_codec_err_t | vpx_codec_peek_stream_info (vpx_codec_iface_t *iface, const uint8_t *data, unsigned int data_sz, vpx_codec_stream_info_t *si) |
Parse stream info from a buffer. More... | |
vpx_codec_err_t | vpx_codec_get_stream_info (vpx_codec_ctx_t *ctx, vpx_codec_stream_info_t *si) |
Return information about the current stream. More... | |
vpx_codec_err_t | vpx_codec_decode (vpx_codec_ctx_t *ctx, const uint8_t *data, unsigned int data_sz, void *user_priv, long deadline) |
Decode data. More... | |
vpx_image_t * | vpx_codec_get_frame (vpx_codec_ctx_t *ctx, vpx_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.
typedef struct vpx_codec_dec_cfg vpx_codec_dec_cfg_t |
Initialization Configurations.
This structure is used to pass init time configuration options to the decoder. alias for struct vpx_codec_dec_cfg
typedef struct vpx_codec_dec_cfg vpx_codec_dec_cfg_t |
Initialization Configurations.
This structure is used to pass init time configuration options to the decoder. alias for struct vpx_codec_dec_cfg
typedef struct vpx_codec_stream_info vpx_codec_stream_info_t |
Stream properties.
This structure is used to query or set properties of the decoded stream. Algorithms may extend this structure with data specific to their bitstream by setting the sz member appropriately.
typedef struct vpx_codec_stream_info vpx_codec_stream_info_t |
Stream properties.
This structure is used to query or set properties of the decoded stream. Algorithms may extend this structure with data specific to their bitstream by setting the sz member appropriately.
vpx_codec_err_t vpx_codec_dec_init_ver | ( | vpx_codec_ctx_t * | ctx, |
vpx_codec_iface_t * | iface, | ||
const vpx_codec_dec_cfg_t * | cfg, | ||
vpx_codec_flags_t | flags, | ||
int | ver | ||
) |
Initialize a decoder instance.
Initializes a decoder context using the given interface. Applications should call the vpx_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 VPX_CODEC_USE_* flags |
[in] | ver | ABI version number. Must be set to VPX_DECODER_ABI_VERSION |
VPX_CODEC_OK | The decoder algorithm initialized. |
VPX_CODEC_MEM_ERROR | Memory allocation failed. |
vpx_codec_err_t vpx_codec_decode | ( | vpx_codec_ctx_t * | ctx, |
const uint8_t * | data, | ||
unsigned int | data_sz, | ||
void * | user_priv, | ||
long | deadline | ||
) |
Decode data.
Processes a buffer of coded data. If the processing results in a new decoded frame becoming available, put_slice and put_frame callbacks may be invoked, as appropriate. Encoded data MUST be passed in DTS (decode time stamp) order. Frames produced will always be in PTS (presentation time stamp) order. If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled, data and data_sz can contain a fragment of the encoded frame. Fragment #n must contain at least partition #n, but can also contain subsequent partitions (#n+1 - #n+i), and if so, fragments #n+1, .., #n+i must be empty. When no more data is available, this function should be called with NULL as data and 0 as data_sz. The memory passed to this function must be available until the frame has been decoded.
[in] | ctx | Pointer to this instance's context |
[in] | data | Pointer to this block of new coded data. If NULL, the put_frame callback is invoked 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. |
[in] | deadline | Soft deadline the decoder should attempt to meet, in us. Set to zero for unlimited. |
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. If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled, data and data_sz can contain a fragment of the encoded frame. Fragment #n must contain at least partition #n, but can also contain subsequent partitions (#n+1 - #n+i), and if so, fragments #n+1, .., #n+i must be empty. When no more data is available, this function should be called with NULL as data and 0 as data_sz. The memory passed to this function must be available until the frame has been decoded.
[in] | ctx | Pointer to this instance's context |
[in] | data | Pointer to this block of new coded data. If NULL, a VPX_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. |
[in] | deadline | Soft deadline the decoder should attempt to meet, in us. Set to zero for unlimited. |
vpx_image_t * vpx_codec_get_frame | ( | vpx_codec_ctx_t * | ctx, |
vpx_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 vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode.
[in] | ctx | Pointer to this instance's context |
[in,out] | iter | Iterator storage, initialized to NULL |
vpx_codec_err_t vpx_codec_get_stream_info | ( | vpx_codec_ctx_t * | ctx, |
vpx_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. The size member MUST be properly initialized, but MAY be clobbered by the algorithm. This parameter MAY be NULL. |
VPX_CODEC_OK | Bitstream is parsable and stream information updated |
vpx_codec_err_t vpx_codec_peek_stream_info | ( | vpx_codec_iface_t * | iface, |
const uint8_t * | data, | ||
unsigned int | data_sz, | ||
vpx_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 size member MUST be properly initialized, but MAY be clobbered by the algorithm. This parameter MAY be NULL. |
VPX_CODEC_OK | Bitstream is parsable and stream information updated |