WebM VP8 Codec SDK
|
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 00064 #define VPX_CODEC_USE_POSTPROC 0x10000 00072 typedef struct vpx_codec_stream_info 00073 { 00074 unsigned int sz; 00075 unsigned int w; 00076 unsigned int h; 00077 unsigned int is_kf; 00078 } vpx_codec_stream_info_t; 00079 00080 /* REQUIRED FUNCTIONS 00081 * 00082 * The following functions are required to be implemented for all decoders. 00083 * They represent the base case functionality expected of all decoders. 00084 */ 00085 00086 00092 typedef struct vpx_codec_dec_cfg 00093 { 00094 unsigned int threads; 00095 unsigned int w; 00096 unsigned int h; 00097 } vpx_codec_dec_cfg_t; 00122 vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx, 00123 vpx_codec_iface_t *iface, 00124 vpx_codec_dec_cfg_t *cfg, 00125 vpx_codec_flags_t flags, 00126 int ver); 00127 00132 #define vpx_codec_dec_init(ctx, iface, cfg, flags) \ 00133 vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION) 00134 00135 00153 vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface, 00154 const uint8_t *data, 00155 unsigned int data_sz, 00156 vpx_codec_stream_info_t *si); 00157 00158 00172 vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx, 00173 vpx_codec_stream_info_t *si); 00174 00175 00199 vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, 00200 const uint8_t *data, 00201 unsigned int data_sz, 00202 void *user_priv, 00203 long deadline); 00204 00205 00221 vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, 00222 vpx_codec_iter_t *iter); 00223 00224 00239 typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv, 00240 const vpx_image_t *img); 00241 00242 00258 vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx, 00259 vpx_codec_put_frame_cb_fn_t cb, 00260 void *user_priv); 00261 00262 00279 typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv, 00280 const vpx_image_t *img, 00281 const vpx_image_rect_t *valid, 00282 const vpx_image_rect_t *update); 00283 00284 00300 vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx, 00301 vpx_codec_put_slice_cb_fn_t cb, 00302 void *user_priv); 00303 00304 00309 #endif 00310 00311 #ifdef __cplusplus 00312 } 00313 #endif 00314 00315 #if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT 00316 #include "vpx_decoder_compat.h" 00317 #endif