2 #ifndef DPVSIMPLEDECODE_H
3 #define DPVSIMPLEDECODE_H
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
22 // opening and closing streams
25 void *dpvsimpledecode_open(clvideo_t *video, char *filename, const char **errorstring);
28 void dpvsimpledecode_close(void *stream);
30 // utilitarian functions
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
36 int dpvsimpledecode_error(void *stream, const char **errorstring);
38 // returns the width of the image data
39 unsigned int dpvsimpledecode_getwidth(void *stream);
41 // returns the height of the image data
42 unsigned int dpvsimpledecode_getheight(void *stream);
44 // returns the framerate of the stream
45 double dpvsimpledecode_getframerate(void *stream);
47 // returns aspect ratio of the stream
48 double dpvsimpledecode_getaspectratio(void *stream);
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);