2 #ifndef DPVSIMPLEDECODE_H
3 #define DPVSIMPLEDECODE_H
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
18 // opening and closing streams
21 void *dpvsimpledecode_open(clvideo_t *video, char *filename, const char **errorstring);
24 void dpvsimpledecode_close(void *stream);
26 // utilitarian functions
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
32 int dpvsimpledecode_error(void *stream, const char **errorstring);
34 // returns the width of the image data
35 unsigned int dpvsimpledecode_getwidth(void *stream);
37 // returns the height of the image data
38 unsigned int dpvsimpledecode_getheight(void *stream);
40 // returns the framerate of the stream
41 double dpvsimpledecode_getframerate(void *stream);
43 // returns aspect ratio of the stream
44 double dpvsimpledecode_getaspectratio(void *stream);
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);