]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
client: Add cap.h and move capture struct to it.
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 29 Sep 2020 19:19:04 +0000 (19:19 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 29 Sep 2020 19:19:04 +0000 (19:19 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12967 d7cf8633-e32d-0410-b094-e92efae38249

cap.h [new file with mode: 0644]
client.h
darkplaces-sdl2-vs2017.vcxproj
darkplaces-sdl2-vs2019.vcxproj

diff --git a/cap.h b/cap.h
new file mode 100644 (file)
index 0000000..fe5da56
--- /dev/null
+++ b/cap.h
@@ -0,0 +1,64 @@
+#ifndef CAP_H
+#define CAP_H
+
+#ifdef CONFIG_VIDEO_CAPTURE
+
+#include "qtypes.h"
+#include "qdefs.h"
+#include "fs.h"
+#include "snd_main.h"
+
+typedef enum capturevideoformat_e
+{
+       CAPTUREVIDEOFORMAT_AVI_I420,
+       CAPTUREVIDEOFORMAT_OGG_VORBIS_THEORA
+}
+capturevideoformat_t;
+
+typedef struct capturevideostate_s
+{
+       double startrealtime;
+       double framerate;
+       int framestep;
+       int framestepframe;
+       qbool active;
+       qbool realtime;
+       qbool error;
+       int soundrate;
+       int soundchannels;
+       int frame;
+       double starttime;
+       double lastfpstime;
+       int lastfpsframe;
+       int soundsampleframe;
+       unsigned char *screenbuffer;
+       unsigned char *outbuffer;
+       char basename[MAX_QPATH];
+       int width, height;
+
+       // precomputed RGB to YUV tables
+       // converts the RGB values to YUV (see cap_avi.c for how to use them)
+       short rgbtoyuvscaletable[3][3][256];
+       unsigned char yuvnormalizetable[3][256];
+
+       // precomputed gamma ramp (only needed if the capturevideo module uses RGB output)
+       // 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
+       unsigned short vidramp[256 * 3];
+
+       // stuff to be filled in by the video format module
+       capturevideoformat_t format;
+       const char *formatextension;
+       qfile_t *videofile;
+               // always use this:
+               //   cls.capturevideo.videofile = FS_OpenRealFile(va(vabuf, sizeof(vabuf), "%s.%s", cls.capturevideo.basename, cls.capturevideo.formatextension), "wb", false);
+       void (*endvideo) (void);
+       void (*videoframes) (int num);
+       void (*soundframe) (const portable_sampleframe_t *paintbuffer, size_t length);
+
+       // format specific data
+       void *formatspecific;
+}
+capturevideostate_t;
+#endif
+
+#endif
index 8f361356f18d3492773955592b2887c4f3a6f01c..d167350041f6eb3397666fae4ab993fa916dd789 100644 (file)
--- a/client.h
+++ b/client.h
@@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "matrixlib.h"
 #include "snd_main.h"
 #include "view.h"
+#include "cap.h"
 
 // NOTE: r_stat_name[] must match this indexing
 typedef enum r_stat_e
@@ -739,60 +740,6 @@ typedef enum qw_downloadtype_e
 }
 qw_downloadtype_t;
 
-#ifdef CONFIG_VIDEO_CAPTURE
-typedef enum capturevideoformat_e
-{
-       CAPTUREVIDEOFORMAT_AVI_I420,
-       CAPTUREVIDEOFORMAT_OGG_VORBIS_THEORA
-}
-capturevideoformat_t;
-
-typedef struct capturevideostate_s
-{
-       double startrealtime;
-       double framerate;
-       int framestep;
-       int framestepframe;
-       qbool active;
-       qbool realtime;
-       qbool error;
-       int soundrate;
-       int soundchannels;
-       int frame;
-       double starttime;
-       double lastfpstime;
-       int lastfpsframe;
-       int soundsampleframe;
-       unsigned char *screenbuffer;
-       unsigned char *outbuffer;
-       char basename[MAX_QPATH];
-       int width, height;
-
-       // precomputed RGB to YUV tables
-       // converts the RGB values to YUV (see cap_avi.c for how to use them)
-       short rgbtoyuvscaletable[3][3][256];
-       unsigned char yuvnormalizetable[3][256];
-
-       // precomputed gamma ramp (only needed if the capturevideo module uses RGB output)
-       // 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
-       unsigned short vidramp[256 * 3];
-
-       // stuff to be filled in by the video format module
-       capturevideoformat_t format;
-       const char *formatextension;
-       qfile_t *videofile;
-               // always use this:
-               //   cls.capturevideo.videofile = FS_OpenRealFile(va(vabuf, sizeof(vabuf), "%s.%s", cls.capturevideo.basename, cls.capturevideo.formatextension), "wb", false);
-       void (*endvideo) (void);
-       void (*videoframes) (int num);
-       void (*soundframe) (const portable_sampleframe_t *paintbuffer, size_t length);
-
-       // format specific data
-       void *formatspecific;
-}
-capturevideostate_t;
-#endif
-
 #define CL_MAX_DOWNLOADACKS 4
 
 typedef struct cl_downloadack_s
index b29dd39909794e19bd4d55a35260dbe471900fc1..9e639574d4ad03f4b5377647ccb8c828f5746d96 100644 (file)
   <ItemGroup>\r
     <ClInclude Include="bih.h" />\r
     <ClInclude Include="bspfile.h" />\r
+    <ClInclude Include="cap.h" />\r
     <ClInclude Include="cap_avi.h" />\r
     <ClInclude Include="cap_ogg.h" />\r
     <ClInclude Include="cdaudio.h" />\r
index 88960827edd12b1502dc6ef82fb2573e23e26a93..0c89882b9078158dc1b8eb1a8c428d7e9829f26f 100644 (file)
   <ItemGroup>\r
     <ClInclude Include="bih.h" />\r
     <ClInclude Include="bspfile.h" />\r
+    <ClInclude Include="cap.h" />\r
     <ClInclude Include="cap_avi.h" />\r
     <ClInclude Include="cap_ogg.h" />\r
     <ClInclude Include="cdaudio.h" />\r