00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00030 #ifndef VPX_DECODER_H
00031 #define VPX_DECODER_H
00032 #include "vpx_codec.h"
00033
00042 #define VPX_DECODER_ABI_VERSION (2 + VPX_CODEC_ABI_VERSION)
00052 #define VPX_CODEC_CAP_PUT_SLICE 0x10000
00053 #define VPX_CODEC_CAP_PUT_FRAME 0x20000
00054 #define VPX_CODEC_CAP_POSTPROC 0x40000
00063 #define VPX_CODEC_USE_POSTPROC 0x10000
00071 typedef struct
00072 {
00073 unsigned int sz;
00074 unsigned int w;
00075 unsigned int h;
00076 unsigned int is_kf;
00077 } vpx_codec_stream_info_t;
00078
00079
00080
00081
00082
00083
00084
00085
00091 typedef struct vpx_codec_dec_cfg
00092 {
00093 unsigned int threads;
00094 unsigned int w;
00095 unsigned int h;
00096 } vpx_codec_dec_cfg_t;
00121 vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
00122 vpx_codec_iface_t *iface,
00123 vpx_codec_dec_cfg_t *cfg,
00124 vpx_codec_flags_t flags,
00125 int ver);
00126
00131 #define vpx_codec_dec_init(ctx, iface, cfg, flags) \
00132 vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION)
00133
00134
00152 vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
00153 const uint8_t *data,
00154 unsigned int data_sz,
00155 vpx_codec_stream_info_t *si);
00156
00157
00171 vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
00172 vpx_codec_stream_info_t *si);
00173
00174
00198 vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
00199 const uint8_t *data,
00200 unsigned int data_sz,
00201 void *user_priv,
00202 long deadline);
00203
00204
00220 vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
00221 vpx_codec_iter_t *iter);
00222
00223
00238 typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
00239 const vpx_image_t *img);
00240
00241
00257 vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
00258 vpx_codec_put_frame_cb_fn_t cb,
00259 void *user_priv);
00260
00261
00278 typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
00279 const vpx_image_t *img,
00280 const vpx_image_rect_t *valid,
00281 const vpx_image_rect_t *update);
00282
00283
00299 vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
00300 vpx_codec_put_slice_cb_fn_t cb,
00301 void *user_priv);
00302
00303
00308 #endif
00309
00310 #ifdef __cplusplus
00311 }
00312 #endif
00313
00314 #if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT
00315 #include "vpx_decoder_compat.h"
00316 #endif