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