00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef VPX_DECODER_H
00011 #define VPX_DECODER_H
00012
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
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
00055 #define VPX_CODEC_CAP_ERROR_CONCEALMENT 0x80000
00057 #define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000
00067 #define VPX_CODEC_CAP_FRAME_THREADING 0x200000
00070 #define VPX_CODEC_USE_POSTPROC 0x10000
00071 #define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000
00073 #define VPX_CODEC_USE_INPUT_FRAGMENTS 0x40000
00076 #define VPX_CODEC_USE_FRAME_THREADING 0x80000
00085 typedef struct vpx_codec_stream_info {
00086 unsigned int sz;
00087 unsigned int w;
00088 unsigned int h;
00089 unsigned int is_kf;
00090 } vpx_codec_stream_info_t;
00091
00092
00093
00094
00095
00096
00097
00098
00104 typedef struct vpx_codec_dec_cfg {
00105 unsigned int threads;
00106 unsigned int w;
00107 unsigned int h;
00108 } vpx_codec_dec_cfg_t;
00137 vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
00138 vpx_codec_iface_t *iface,
00139 vpx_codec_dec_cfg_t *cfg,
00140 vpx_codec_flags_t flags,
00141 int ver);
00142
00147 #define vpx_codec_dec_init(ctx, iface, cfg, flags) \
00148 vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION)
00149
00150
00168 vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
00169 const uint8_t *data,
00170 unsigned int data_sz,
00171 vpx_codec_stream_info_t *si);
00172
00173
00187 vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
00188 vpx_codec_stream_info_t *si);
00189
00190
00221 vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx,
00222 const uint8_t *data,
00223 unsigned int data_sz,
00224 void *user_priv,
00225 long deadline);
00226
00227
00243 vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx,
00244 vpx_codec_iter_t *iter);
00245
00246
00261 typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
00262 const vpx_image_t *img);
00263
00264
00280 vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
00281 vpx_codec_put_frame_cb_fn_t cb,
00282 void *user_priv);
00283
00284
00301 typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
00302 const vpx_image_t *img,
00303 const vpx_image_rect_t *valid,
00304 const vpx_image_rect_t *update);
00305
00306
00322 vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
00323 vpx_codec_put_slice_cb_fn_t cb,
00324 void *user_priv);
00325
00326
00330 #ifdef __cplusplus
00331 }
00332 #endif
00333 #endif
00334