aom_decoder.h
Go to the documentation of this file.
/*
* Copyright (c) 2016, Alliance for Open Media. All rights reserved.
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
#ifndef AOM_AOM_AOM_DECODER_H_
#define AOM_AOM_AOM_DECODER_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "aom/aom_codec.h" // IWYU pragma: export
#include "aom/aom_frame_buffer.h"
#define AOM_DECODER_ABI_VERSION \
(6 + AOM_CODEC_ABI_VERSION)
#define AOM_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x200000
typedef struct aom_codec_stream_info {
unsigned int w;
unsigned int h;
unsigned int is_kf;
unsigned int number_spatial_layers;
unsigned int number_temporal_layers;
unsigned int is_annexb;
} aom_codec_stream_info_t;
/* REQUIRED FUNCTIONS
*
* The following functions are required to be implemented for all decoders.
* They represent the base case functionality expected of all decoders.
*/
typedef struct aom_codec_dec_cfg {
unsigned int threads;
unsigned int w;
unsigned int h;
unsigned int allow_lowbitdepth;
} aom_codec_dec_cfg_t;
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);
#define aom_codec_dec_init(ctx, iface, cfg, flags) \
aom_codec_dec_init_ver(ctx, iface, cfg, flags, AOM_DECODER_ABI_VERSION)
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);
aom_codec_err_t aom_codec_get_stream_info(aom_codec_ctx_t *ctx,
aom_codec_stream_info_t *si);
aom_codec_err_t aom_codec_decode(aom_codec_ctx_t *ctx, const uint8_t *data,
size_t data_sz, void *user_priv);
aom_image_t *aom_codec_get_frame(aom_codec_ctx_t *ctx, aom_codec_iter_t *iter);
aom_codec_err_t aom_codec_set_frame_buffer_functions(
aom_codec_ctx_t *ctx, aom_get_frame_buffer_cb_fn_t cb_get,
aom_release_frame_buffer_cb_fn_t cb_release, void *cb_priv);
#ifdef __cplusplus
}
#endif
#endif // AOM_AOM_AOM_DECODER_H_
aom_codec.h
Describes the codec algorithm interface to applications.
aom_frame_buffer.h
Describes the decoder external frame buffer interface.
aom_get_frame_buffer_cb_fn_t
int(* aom_get_frame_buffer_cb_fn_t)(void *priv, size_t min_size, aom_codec_frame_buffer_t *fb)
get frame buffer callback prototype
Definition aom_frame_buffer.h:64
aom_release_frame_buffer_cb_fn_t
int(* aom_release_frame_buffer_cb_fn_t)(void *priv, aom_codec_frame_buffer_t *fb)
release frame buffer callback prototype
Definition aom_frame_buffer.h:77
aom_image_t
struct aom_image aom_image_t
Image Descriptor.
aom_codec_set_frame_buffer_functions
aom_codec_err_t aom_codec_set_frame_buffer_functions(aom_codec_ctx_t *ctx, aom_get_frame_buffer_cb_fn_t cb_get, aom_release_frame_buffer_cb_fn_t cb_release, void *cb_priv)
Pass in external frame buffers for the decoder to use.
aom_codec_flags_t
long aom_codec_flags_t
Initialization-time Feature Enabling.
Definition aom_codec.h:232
aom_codec_ctx_t
struct aom_codec_ctx aom_codec_ctx_t
Codec context structure.
aom_codec_iface_t
const struct aom_codec_iface aom_codec_iface_t
Codec interface structure.
Definition aom_codec.h:271
aom_codec_err_t
aom_codec_err_t
Algorithm return codes.
Definition aom_codec.h:155
aom_codec_iter_t
const void * aom_codec_iter_t
Iterator.
Definition aom_codec.h:305
aom_codec_peek_stream_info
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.
aom_codec_get_stream_info
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.
aom_codec_stream_info_t
struct aom_codec_stream_info aom_codec_stream_info_t
Initialization-time Feature Enabling.
aom_codec_get_frame
aom_image_t * aom_codec_get_frame(aom_codec_ctx_t *ctx, aom_codec_iter_t *iter)
Decoded frames iterator.
aom_codec_decode
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.
aom_codec_dec_init_ver
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.
aom_codec_dec_cfg_t
struct aom_codec_dec_cfg aom_codec_dec_cfg_t
Initialization Configurations.
aom_codec_dec_cfg
Initialization Configurations.
Definition aom_decoder.h:91
aom_codec_dec_cfg::w
unsigned int w
Definition aom_decoder.h:93
aom_codec_dec_cfg::h
unsigned int h
Definition aom_decoder.h:94
aom_codec_dec_cfg::threads
unsigned int threads
Definition aom_decoder.h:92
aom_codec_dec_cfg::allow_lowbitdepth
unsigned int allow_lowbitdepth
Definition aom_decoder.h:95
aom_codec_stream_info
Initialization-time Feature Enabling.
Definition aom_decoder.h:71
aom_codec_stream_info::is_kf
unsigned int is_kf
Definition aom_decoder.h:74
aom_codec_stream_info::is_annexb
unsigned int is_annexb
Definition aom_decoder.h:77
aom_codec_stream_info::h
unsigned int h
Definition aom_decoder.h:73
aom_codec_stream_info::number_temporal_layers
unsigned int number_temporal_layers
Definition aom_decoder.h:76
aom_codec_stream_info::w
unsigned int w
Definition aom_decoder.h:72
aom_codec_stream_info::number_spatial_layers
unsigned int number_spatial_layers
Definition aom_decoder.h:75