]> git.xonotic.org Git - xonotic/darkplaces.git/blob - cap.h
Add cvar snd_cdautopause: optional CD track pause during game pause
[xonotic/darkplaces.git] / cap.h
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
11 typedef enum capturevideoformat_e
12 {
13         CAPTUREVIDEOFORMAT_AVI_I420,
14         CAPTUREVIDEOFORMAT_OGG_VORBIS_THEORA
15 }
16 capturevideoformat_t;
17
18 typedef struct capturevideostate_s
19 {
20         double startrealtime;
21         double framerate;
22         int framestep;
23         int framestepframe;
24         qbool active;
25         qbool realtime;
26         qbool error;
27         int soundrate;
28         int soundchannels;
29         int frame;
30         double starttime;
31         double lastfpstime;
32         int lastfpsframe;
33         int soundsampleframe;
34         unsigned char *screenbuffer;
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 (*endvideo) (void);
55         void (*videoframes) (int num);
56         void (*soundframe) (const portable_sampleframe_t *paintbuffer, size_t length);
57
58         // format specific data
59         void *formatspecific;
60 }
61 capturevideostate_t;
62 #endif
63
64 #endif