Skip to content

Latest commit

 

History

History
85 lines (70 loc) · 2.72 KB

theoraplay.h

File metadata and controls

85 lines (70 loc) · 2.72 KB
 
Jun 10, 2011
Jun 10, 2011
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
* TheoraPlay; multithreaded Ogg Theora/Ogg Vorbis decoding.
*
* Please see the file LICENSE.txt in the source's root directory.
*
* This file written by Ryan C. Gordon.
*/
#ifndef _INCL_THEORAPLAY_H_
#define _INCL_THEORAPLAY_H_
#ifdef __cplusplus
extern "C" {
#endif
Jun 23, 2011
Jun 23, 2011
16
17
18
19
20
21
22
23
typedef struct THEORAPLAY_Io THEORAPLAY_Io;
struct THEORAPLAY_Io
{
long (*read)(THEORAPLAY_Io *io, void *buf, long buflen);
void (*close)(THEORAPLAY_Io *io);
void *userdata;
};
Jun 10, 2011
Jun 10, 2011
24
25
typedef struct THEORAPLAY_Decoder THEORAPLAY_Decoder;
Jun 15, 2011
Jun 15, 2011
26
27
28
29
/* YV12 is YCrCb, not YCbCr; that's what SDL uses for YV12 overlays. */
typedef enum THEORAPLAY_VideoFormat
{
THEORAPLAY_VIDFMT_YV12, /* NTSC colorspace, planar YCrCb 4:2:0 */
Jun 19, 2011
Jun 19, 2011
30
THEORAPLAY_VIDFMT_IYUV, /* NTSC colorspace, planar YCbCr 4:2:0 */
Jun 15, 2011
Jun 15, 2011
31
32
33
34
THEORAPLAY_VIDFMT_RGB, /* 24 bits packed pixel RGB */
THEORAPLAY_VIDFMT_RGBA /* 32 bits packed pixel RGBA (full alpha). */
} THEORAPLAY_VideoFormat;
Jun 15, 2011
Jun 15, 2011
35
typedef struct THEORAPLAY_VideoFrame
Jun 10, 2011
Jun 10, 2011
36
37
{
unsigned int playms;
Jun 11, 2011
Jun 11, 2011
38
double fps;
Jun 10, 2011
Jun 10, 2011
39
40
unsigned int width;
unsigned int height;
Jun 15, 2011
Jun 15, 2011
41
42
THEORAPLAY_VideoFormat format;
unsigned char *pixels;
Jun 15, 2011
Jun 15, 2011
43
44
struct THEORAPLAY_VideoFrame *next;
} THEORAPLAY_VideoFrame;
Jun 10, 2011
Jun 10, 2011
45
Jun 15, 2011
Jun 15, 2011
46
typedef struct THEORAPLAY_AudioPacket
Jun 10, 2011
Jun 10, 2011
47
{
Jan 7, 2012
Jan 7, 2012
48
unsigned int playms; /* playback start time in milliseconds. */
Jun 10, 2011
Jun 10, 2011
49
int channels;
Jun 11, 2011
Jun 11, 2011
50
int freq;
Jun 10, 2011
Jun 10, 2011
51
int frames;
Jan 7, 2012
Jan 7, 2012
52
float *samples; /* frames * channels float32 samples. */
Jun 15, 2011
Jun 15, 2011
53
54
struct THEORAPLAY_AudioPacket *next;
} THEORAPLAY_AudioPacket;
Jun 10, 2011
Jun 10, 2011
55
Jun 23, 2011
Jun 23, 2011
56
57
58
59
THEORAPLAY_Decoder *THEORAPLAY_startDecodeFile(const char *fname,
const unsigned int maxframes,
THEORAPLAY_VideoFormat vidfmt);
THEORAPLAY_Decoder *THEORAPLAY_startDecode(THEORAPLAY_Io *io,
Jun 15, 2011
Jun 15, 2011
60
61
const unsigned int maxframes,
THEORAPLAY_VideoFormat vidfmt);
Jun 10, 2011
Jun 10, 2011
62
void THEORAPLAY_stopDecode(THEORAPLAY_Decoder *decoder);
Jun 24, 2011
Jun 24, 2011
63
Jun 10, 2011
Jun 10, 2011
64
int THEORAPLAY_isDecoding(THEORAPLAY_Decoder *decoder);
Jun 10, 2011
Jun 10, 2011
65
int THEORAPLAY_decodingError(THEORAPLAY_Decoder *decoder);
Jun 24, 2011
Jun 24, 2011
66
67
68
69
70
int THEORAPLAY_isInitialized(THEORAPLAY_Decoder *decoder);
int THEORAPLAY_hasVideoStream(THEORAPLAY_Decoder *decoder);
int THEORAPLAY_hasAudioStream(THEORAPLAY_Decoder *decoder);
unsigned int THEORAPLAY_availableVideo(THEORAPLAY_Decoder *decoder);
unsigned int THEORAPLAY_availableAudio(THEORAPLAY_Decoder *decoder);
Jun 10, 2011
Jun 10, 2011
71
Jun 15, 2011
Jun 15, 2011
72
73
const THEORAPLAY_AudioPacket *THEORAPLAY_getAudio(THEORAPLAY_Decoder *decoder);
void THEORAPLAY_freeAudio(const THEORAPLAY_AudioPacket *item);
Jun 10, 2011
Jun 10, 2011
74
Jun 15, 2011
Jun 15, 2011
75
76
const THEORAPLAY_VideoFrame *THEORAPLAY_getVideo(THEORAPLAY_Decoder *decoder);
void THEORAPLAY_freeVideo(const THEORAPLAY_VideoFrame *item);
Jun 10, 2011
Jun 10, 2011
77
78
79
80
81
82
83
84
#ifdef __cplusplus
}
#endif
#endif /* include-once blocker. */
/* end of theoraplay.h ... */