libtheora  1.2.0
theoradec.h
Go to the documentation of this file.
1 /********************************************************************
2  * *
3  * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
4  * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5  * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
7  * *
8  * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 *
9  * by the Xiph.Org Foundation https://www.xiph.org/ *
10  * *
11  ********************************************************************
12 
13  function:
14 
15  ********************************************************************/
16 
20 #if !defined(OGG_THEORA_THEORADEC_HEADER)
21 # define OGG_THEORA_THEORADEC_HEADER (1)
22 # include <stddef.h>
23 # include <ogg/ogg.h>
24 # include "codec.h"
25 
26 #if defined(__cplusplus)
27 extern "C" {
28 #endif
29 
30 
31 
49 #define TH_DECCTL_GET_PPLEVEL_MAX (1)
50 
66 #define TH_DECCTL_SET_PPLEVEL (3)
67 
78 #define TH_DECCTL_SET_GRANPOS (5)
79 
92 #define TH_DECCTL_SET_STRIPE_CB (7)
93 
96 #define TH_DECCTL_SET_TELEMETRY_MBMODE (9)
97 
99 #define TH_DECCTL_SET_TELEMETRY_MV (11)
100 
102 #define TH_DECCTL_SET_TELEMETRY_QI (13)
103 
105 #define TH_DECCTL_SET_TELEMETRY_BITS (15)
106 
141 typedef void (*th_stripe_decoded_func)(void *_ctx,th_ycbcr_buffer _buf,
142  int _yfrag0,int _yfrag_end);
143 
145 typedef struct{
148  void *ctx;
152 
153 
154 
162 typedef struct th_dec_ctx th_dec_ctx;
234 extern int th_decode_headerin(th_info *_info,th_comment *_tc,
235  th_setup_info **_setup,ogg_packet *_op);
258 extern th_dec_ctx *th_decode_alloc(const th_info *_info,
259  const th_setup_info *_setup);
265 extern void th_setup_free(th_setup_info *_setup);
277 extern int th_decode_ctl(th_dec_ctx *_dec,int _req,void *_buf,
278  size_t _buf_sz);
301 extern int th_decode_packetin(th_dec_ctx *_dec,const ogg_packet *_op,
302  ogg_int64_t *_granpos);
318 extern int th_decode_ycbcr_out(th_dec_ctx *_dec,
319  th_ycbcr_buffer _ycbcr);
322 extern void th_decode_free(th_dec_ctx *_dec);
325 
326 
327 
328 #if defined(__cplusplus)
329 }
330 #endif
331 
332 #endif /* OGG_THEORA_THEORADEC_HEADER */
Theora bitstream information.
Definition: codec.h:206
The comment information.
Definition: codec.h:325
th_dec_ctx * th_decode_alloc(const th_info *_info, const th_setup_info *_setup)
Allocates a decoder instance.
void(* th_stripe_decoded_func)(void *_ctx, th_ycbcr_buffer _buf, int _yfrag0, int _yfrag_end)
A callback function for striped decode.
Definition: theoradec.h:141
The shared libtheoradec and libtheoraenc C API.
int th_decode_ctl(th_dec_ctx *_dec, int _req, void *_buf, size_t _buf_sz)
Decoder control function.
void th_decode_free(th_dec_ctx *_dec)
Frees an allocated decoder instance.
void * ctx
An application-provided context pointer.
Definition: theoradec.h:148
void th_setup_free(th_setup_info *_setup)
Releases all storage used for the decoder setup information.
struct th_setup_info th_setup_info
Setup information.
Definition: theoradec.h:169
th_img_plane th_ycbcr_buffer[3]
A complete image buffer for an uncompressed frame.
Definition: codec.h:170
int th_decode_ycbcr_out(th_dec_ctx *_dec, th_ycbcr_buffer _ycbcr)
Outputs the next available frame of decoded Y'CbCr data.
th_stripe_decoded_func stripe_decoded
The callback function pointer.
Definition: theoradec.h:150
int th_decode_headerin(th_info *_info, th_comment *_tc, th_setup_info **_setup, ogg_packet *_op)
Decodes the header packets of a Theora stream.
struct th_dec_ctx th_dec_ctx
The decoder context.
Definition: theoradec.h:162
int th_decode_packetin(th_dec_ctx *_dec, const ogg_packet *_op, ogg_int64_t *_granpos)
Submits a packet containing encoded video data to the decoder.
The striped decode callback data to pass to TH_DECCTL_SET_STRIPE_CB.
Definition: theoradec.h:145