DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
cap.h
Go to the documentation of this file.
1#ifndef CAP_H
2#define CAP_H
3
4#ifdef CONFIG_VIDEO_CAPTURE
5
6#include "qtypes.h"
7#include "qdefs.h"
8#include "fs.h"
9#include "snd_main.h"
10#include "glquake.h"
11
12typedef enum capturevideoformat_e
13{
14 CAPTUREVIDEOFORMAT_AVI_I420,
15 CAPTUREVIDEOFORMAT_OGG_VORBIS_THEORA
16}
17capturevideoformat_t;
18
19typedef struct capturevideostate_s
20{
21 double startrealtime;
22 double framerate;
23 int framestep;
24 int framestepframe;
25 qbool active;
26 qbool realtime;
28 int soundrate;
29 int soundchannels;
30 int frame;
31 double starttime;
32 double lastfpstime;
33 int lastfpsframe;
34 int soundsampleframe;
35 unsigned char *outbuffer;
36 char basename[MAX_QPATH];
37 int width, height;
38
39 // precomputed RGB to YUV tables
40 // converts the RGB values to YUV (see cap_avi.c for how to use them)
41 short rgbtoyuvscaletable[3][3][256];
42 unsigned char yuvnormalizetable[3][256];
43
44 // precomputed gamma ramp (only needed if the capturevideo module uses RGB output)
45 // note: to map from these values to RGB24, you have to multiply by 255.0/65535.0, then add 0.5, then cast to integer
46 unsigned short vidramp[256 * 3];
47
48 // stuff to be filled in by the video format module
49 capturevideoformat_t format;
50 const char *formatextension;
51 qfile_t *videofile;
52 // always use this:
53 // cls.capturevideo.videofile = FS_OpenRealFile(va(vabuf, sizeof(vabuf), "%s.%s", cls.capturevideo.basename, cls.capturevideo.formatextension), "wb", false);
54 void (*writeEndVideo) (void);
55 void (*writeVideoFrame) (int num, u8 *in);
56 void (*writeSoundFrame) (const portable_sampleframe_t *paintbuffer, size_t length);
57
58 // format specific data
59 void *formatspecific;
60
61 // GL backend
62#define PBO_COUNT 3 // bones_was_here: slightly faster than double buffering
63 GLuint PBOs[PBO_COUNT];
64 GLuint PBOindex;
65 GLuint FBO;
66 GLuint FBOtex;
67}
68capturevideostate_t;
69#endif
70
71#endif
void() predraw
float frame
unsigned int GLuint
Definition glquake.h:54
GLenum GLsizei width
Definition glquake.h:622
GLenum GLsizei GLsizei height
Definition glquake.h:622
GLenum GLuint GLenum GLsizei length
Definition glquake.h:657
GLint GLint GLint GLsizei GLsizei GLenum format
Definition glquake.h:649
void error(string err,...)
#define MAX_QPATH
max length of a quake game pathname
Definition qdefs.h:169
uint8_t u8
Definition qtypes.h:35
bool qbool
Definition qtypes.h:9
static portable_sampleframe_t paintbuffer[PAINTBUFFER_SIZE]
Definition snd_mix.c:26
exported for capturevideo so ogg can see all channels
Definition snd_main.h:196