]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - dpvsimpledecode.h
Bugfix: Don't use OpenGL 3.2 core context just yet - more fixes needed first.
[xonotic/darkplaces.git] / dpvsimpledecode.h
1
2 #ifndef DPVSIMPLEDECODE_H
3 #define DPVSIMPLEDECODE_H
4
5 #include "cl_video.h"
6
7 #define DPVSIMPLEDECODEERROR_NONE 0
8 #define DPVSIMPLEDECODEERROR_EOF 1
9 #define DPVSIMPLEDECODEERROR_READERROR 2
10 #define DPVSIMPLEDECODEERROR_SOUNDBUFFERTOOSMALL 3
11 #define DPVSIMPLEDECODEERROR_INVALIDRMASK 4
12 #define DPVSIMPLEDECODEERROR_INVALIDGMASK 5
13 #define DPVSIMPLEDECODEERROR_INVALIDBMASK 6
14 #define DPVSIMPLEDECODEERROR_COLORMASKSOVERLAP 7
15 #define DPVSIMPLEDECODEERROR_COLORMASKSEXCEEDBPP 8
16 #define DPVSIMPLEDECODEERROR_UNSUPPORTEDBPP 9
17
18 // opening and closing streams
19
20 // opens a stream
21 void *dpvsimpledecode_open(clvideo_t *video, char *filename, const char **errorstring);
22
23 // closes a stream
24 void dpvsimpledecode_close(void *stream);
25
26 // utilitarian functions
27
28 // returns the current error number for the stream, and resets the error
29 // number to DPVDECODEERROR_NONE
30 // if the supplied string pointer variable is not NULL, it will be set to the
31 // error message
32 int dpvsimpledecode_error(void *stream, const char **errorstring);
33
34 // returns the width of the image data
35 unsigned int dpvsimpledecode_getwidth(void *stream);
36
37 // returns the height of the image data
38 unsigned int dpvsimpledecode_getheight(void *stream);
39
40 // returns the framerate of the stream
41 double dpvsimpledecode_getframerate(void *stream);
42
43 // returns aspect ratio of the stream
44 double dpvsimpledecode_getaspectratio(void *stream);
45
46 // decodes a video frame to the supplied output pixels
47 int dpvsimpledecode_video(void *stream, void *imagedata, unsigned int Rmask, unsigned int Gmask, unsigned int Bmask, unsigned int bytesperpixel, int imagebytesperrow);
48
49 #endif