00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef VPX_VPX_DECODER_H_
00011 #define VPX_VPX_DECODER_H_
00012
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00032 #include "./vpx_codec.h"
00033 #include "./vpx_frame_buffer.h"
00034
00043 #define VPX_DECODER_ABI_VERSION \
00044 (3 + VPX_CODEC_ABI_VERSION)
00054 #define VPX_CODEC_CAP_PUT_SLICE 0x10000
00055 #define VPX_CODEC_CAP_PUT_FRAME 0x20000
00056 #define VPX_CODEC_CAP_POSTPROC 0x40000
00058 #define VPX_CODEC_CAP_ERROR_CONCEALMENT 0x80000
00059
00060 #define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000
00061
00070 #define VPX_CODEC_CAP_FRAME_THREADING 0x200000
00071
00072 #define VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x400000
00073
00074 #define VPX_CODEC_USE_POSTPROC 0x10000
00076 #define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000
00077
00079 #define VPX_CODEC_USE_INPUT_FRAGMENTS 0x40000
00080
00081 #define VPX_CODEC_USE_FRAME_THREADING 0x80000
00082
00089 typedef struct vpx_codec_stream_info {
00090 unsigned int sz;
00091 unsigned int w;
00092 unsigned int h;
00093 unsigned int is_kf;
00094 } vpx_codec_stream_info_t;
00095
00096
00097
00098
00099
00100
00101
00107 typedef struct vpx_codec_dec_cfg {
00108 unsigned int threads;
00109 unsigned int w;
00110 unsigned int h;
00111 } vpx_codec_dec_cfg_t;
00135 vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
00136 vpx_codec_iface_t *iface,
00137 const vpx_codec_dec_cfg_t *cfg,
00138 vpx_codec_flags_t flags, int ver);
00139
00144 #define vpx_codec_dec_init(ctx, iface, cfg, flags) \
00145 vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION)
00146
00164 vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
00165 const uint8_t *data,
00166 unsigned int data_sz,
00167 vpx_codec_stream_info_t *si);
00168
00182 vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
00183 vpx_codec_stream_info_t *si);
00184
00215 vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, const uint8_t *data,
00216 unsigned int data_sz, void *user_priv,
00217 long deadline);
00218
00235 vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, vpx_codec_iter_t *iter);
00236
00252 typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv,
00253 const vpx_image_t *img);
00254
00270 vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx,
00271 vpx_codec_put_frame_cb_fn_t cb,
00272 void *user_priv);
00273
00291 typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv,
00292 const vpx_image_t *img,
00293 const vpx_image_rect_t *valid,
00294 const vpx_image_rect_t *update);
00295
00311 vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx,
00312 vpx_codec_put_slice_cb_fn_t cb,
00313 void *user_priv);
00314
00355 vpx_codec_err_t vpx_codec_set_frame_buffer_functions(
00356 vpx_codec_ctx_t *ctx, vpx_get_frame_buffer_cb_fn_t cb_get,
00357 vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv);
00358
00362 #ifdef __cplusplus
00363 }
00364 #endif
00365 #endif // VPX_VPX_DECODER_H_