WebM VP8 Codec SDK
vpx/vpx_decoder.h
Go to the documentation of this file.
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_PARTITION   0x100000 
00068 #define VPX_CODEC_USE_POSTPROC   0x10000 
00069 #define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 
00071 #define VPX_CODEC_USE_INPUT_PARTITION   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; 
00131     vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t      *ctx,
00132                                            vpx_codec_iface_t    *iface,
00133                                            vpx_codec_dec_cfg_t  *cfg,
00134                                            vpx_codec_flags_t     flags,
00135                                            int                   ver);
00136 
00141 #define vpx_codec_dec_init(ctx, iface, cfg, flags) \
00142     vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION)
00143 
00144 
00162     vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t       *iface,
00163             const uint8_t           *data,
00164             unsigned int             data_sz,
00165             vpx_codec_stream_info_t *si);
00166 
00167 
00181     vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t         *ctx,
00182             vpx_codec_stream_info_t *si);
00183 
00184 
00213     vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t    *ctx,
00214                                      const uint8_t        *data,
00215                                      unsigned int            data_sz,
00216                                      void               *user_priv,
00217                                      long                deadline);
00218 
00219 
00235     vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t  *ctx,
00236                                      vpx_codec_iter_t *iter);
00237 
00238 
00253     typedef void (*vpx_codec_put_frame_cb_fn_t)(void        *user_priv,
00254             const vpx_image_t *img);
00255 
00256 
00272     vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t             *ctx,
00273             vpx_codec_put_frame_cb_fn_t  cb,
00274             void                        *user_priv);
00275 
00276 
00293     typedef void (*vpx_codec_put_slice_cb_fn_t)(void         *user_priv,
00294             const vpx_image_t      *img,
00295             const vpx_image_rect_t *valid,
00296             const vpx_image_rect_t *update);
00297 
00298 
00314     vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t             *ctx,
00315             vpx_codec_put_slice_cb_fn_t  cb,
00316             void                        *user_priv);
00317 
00318 
00323 #endif
00324 
00325 #ifdef __cplusplus
00326 }
00327 #endif
00328 
00329 #if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT
00330 #include "vpx_decoder_compat.h"
00331 #endif