2 Copyright (C) 2002-2012 DarkPlaces contributors
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #ifndef DPVSIMPLEDECODE_H
22 #define DPVSIMPLEDECODE_H
30 #define DPVSIMPLEDECODEERROR_NONE 0
31 #define DPVSIMPLEDECODEERROR_EOF 1
32 #define DPVSIMPLEDECODEERROR_READERROR 2
33 #define DPVSIMPLEDECODEERROR_SOUNDBUFFERTOOSMALL 3
34 #define DPVSIMPLEDECODEERROR_INVALIDRMASK 4
35 #define DPVSIMPLEDECODEERROR_INVALIDGMASK 5
36 #define DPVSIMPLEDECODEERROR_INVALIDBMASK 6
37 #define DPVSIMPLEDECODEERROR_COLORMASKSOVERLAP 7
38 #define DPVSIMPLEDECODEERROR_COLORMASKSEXCEEDBPP 8
39 #define DPVSIMPLEDECODEERROR_UNSUPPORTEDBPP 9
41 // opening and closing streams
44 void *dpvsimpledecode_open(clvideo_t *video, char *filename, const char **errorstring);
47 void dpvsimpledecode_close(void *stream);
49 // utilitarian functions
51 // returns the current error number for the stream, and resets the error
52 // number to DPVDECODEERROR_NONE
53 // if the supplied string pointer variable is not NULL, it will be set to the
55 int dpvsimpledecode_error(void *stream, const char **errorstring);
57 // returns the width of the image data
58 unsigned int dpvsimpledecode_getwidth(void *stream);
60 // returns the height of the image data
61 unsigned int dpvsimpledecode_getheight(void *stream);
63 // returns the framerate of the stream
64 double dpvsimpledecode_getframerate(void *stream);
66 // returns aspect ratio of the stream
67 double dpvsimpledecode_getaspectratio(void *stream);
69 // decodes a video frame to the supplied output pixels
70 int dpvsimpledecode_video(void *stream, void *imagedata, unsigned int Rmask, unsigned int Gmask, unsigned int Bmask, unsigned int bytesperpixel, int imagebytesperrow);