00001 /* 00002 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 00003 * 00004 * Use of this source code is governed by a BSD-style license 00005 * that can be found in the LICENSE file in the root of the source 00006 * tree. An additional intellectual property rights grant can be found 00007 * in the file PATENTS. All contributing project authors may 00008 * be found in the AUTHORS file in the root of the source tree. 00009 */ 00010 00011 00027 #ifdef __cplusplus 00028 extern "C" { 00029 #endif 00030 00031 #ifndef VPX_DECODER_H 00032 #define VPX_DECODER_H 00033 #include "vpx_codec.h" 00034 00043 #define VPX_DECODER_ABI_VERSION (2 + VPX_CODEC_ABI_VERSION) 00053 #define VPX_CODEC_CAP_PUT_SLICE 0x10000 00054 #define VPX_CODEC_CAP_PUT_FRAME 0x20000 00055 #define VPX_CODEC_CAP_POSTPROC 0x40000 00056 #define VPX_CODEC_CAP_ERROR_CONCEALMENT 0x80000 00058 #define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 00068 #define VPX_CODEC_USE_POSTPROC 0x10000 00069 #define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 00071 #define VPX_CODEC_USE_INPUT_FRAGMENTS 0x40000 00081 typedef struct vpx_codec_stream_info 00082 { 00083 unsigned int sz; 00084 unsigned int w; 00085 unsigned int h; 00086 unsigned int is_kf; 00087 } vpx_codec_stream_info_t; 00088 00089 /* REQUIRED FUNCTIONS 00090 * 00091 * The following functions are required to be implemented for all decoders. 00092 * They represent the base case functionality expected of all decoders. 00093 */ 00094 00095 00101 typedef struct vpx_codec_dec_cfg 00102 { 00103 unsigned int threads; 00104 unsigned int w; 00105 unsigned int h; 00106 } 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 vpx_codec_dec_cfg_t *cfg, 00138 vpx_codec_flags_t flags, 00139 int ver); 00140 00145 #define vpx_codec_dec_init(ctx, iface, cfg, flags) \ 00146 vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION) 00147 00148 00166 vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface, 00167 const uint8_t *data, 00168 unsigned int data_sz, 00169 vpx_codec_stream_info_t *si); 00170 00171 00185 vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx, 00186 vpx_codec_stream_info_t *si); 00187 00188 00219 vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, 00220 const uint8_t *data, 00221 unsigned int data_sz, 00222 void *user_priv, 00223 long deadline); 00224 00225 00241 vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, 00242 vpx_codec_iter_t *iter); 00243 00244 00259 typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv, 00260 const vpx_image_t *img); 00261 00262 00278 vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx, 00279 vpx_codec_put_frame_cb_fn_t cb, 00280 void *user_priv); 00281 00282 00299 typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv, 00300 const vpx_image_t *img, 00301 const vpx_image_rect_t *valid, 00302 const vpx_image_rect_t *update); 00303 00304 00320 vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx, 00321 vpx_codec_put_slice_cb_fn_t cb, 00322 void *user_priv); 00323 00324 00329 #endif 00330 00331 #ifdef __cplusplus 00332 } 00333 #endif
1.6.3