DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
dpvsimpledecode.h
Go to the documentation of this file.
1/*
2Copyright (C) 2002-2012 DarkPlaces contributors
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU General Public License
6as published by the Free Software Foundation; either version 2
7of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19*/
20
21#ifndef DPVSIMPLEDECODE_H
22#define DPVSIMPLEDECODE_H
23
24#include "qtypes.h"
25#include "qdefs.h"
26#include "cvar.h"
27#include "cl_video.h"
28#include "draw.h"
29
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
40
41// opening and closing streams
42
43// opens a stream
44void *dpvsimpledecode_open(clvideo_t *video, char *filename, const char **errorstring);
45
46// closes a stream
47void dpvsimpledecode_close(void *stream);
48
49// utilitarian functions
50
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
54// error message
55int dpvsimpledecode_error(void *stream, const char **errorstring);
56
57// returns the width of the image data
58unsigned int dpvsimpledecode_getwidth(void *stream);
59
60// returns the height of the image data
61unsigned int dpvsimpledecode_getheight(void *stream);
62
63// returns the framerate of the stream
64double dpvsimpledecode_getframerate(void *stream);
65
66// returns aspect ratio of the stream
67double dpvsimpledecode_getaspectratio(void *stream);
68
69// decodes a video frame to the supplied output pixels
70int dpvsimpledecode_video(void *stream, void *imagedata, unsigned int Rmask, unsigned int Gmask, unsigned int Bmask, unsigned int bytesperpixel, int imagebytesperrow);
71
72#endif
double dpvsimpledecode_getframerate(void *stream)
unsigned int dpvsimpledecode_getwidth(void *stream)
void * dpvsimpledecode_open(clvideo_t *video, char *filename, const char **errorstring)
int dpvsimpledecode_error(void *stream, const char **errorstring)
void dpvsimpledecode_close(void *stream)
double dpvsimpledecode_getaspectratio(void *stream)
int dpvsimpledecode_video(void *stream, void *imagedata, unsigned int Rmask, unsigned int Gmask, unsigned int Bmask, unsigned int bytesperpixel, int imagebytesperrow)
unsigned int dpvsimpledecode_getheight(void *stream)