497{
502 double aspect;
503 char vabuf[1024];
504
506
507 cls.capturevideo.format = CAPTUREVIDEOFORMAT_AVI_I420;
508 cls.capturevideo.formatextension =
"avi";
509 cls.capturevideo.videofile =
FS_OpenRealFile(
va(vabuf,
sizeof(vabuf),
"%s.%s",
cls.capturevideo.basename,
cls.capturevideo.formatextension),
"wb",
false);
510 if (!
cls.capturevideo.videofile)
511 {
512 Con_Printf(
CON_ERROR "Failed to open video file \"%s\", cancelling video capture.\n", vabuf);
513 cls.capturevideo.error =
true;
514 return;
515 }
520 {
524
526
536 if (
cls.capturevideo.soundrate)
538 else
548
556
571
585
587 {
601 }
602
624 if (
cls.capturevideo.soundrate)
625 {
626
647
657
659 {
673 }
675 }
676
677 format->videofile_ix_master_audio_inuse =
format->videofile_ix_master_video_inuse = 0;
678
679
686
687
689
694
695#if 0
699 {
700 const char *junkfiller = "[ DarkPlaces junk data ]";
704 }
706#endif
708
710 format->videofile_ix_movistart =
format->riffstackstartoffset[1];
711
713 if (
format->riffstacklevel != 2)
714 Sys_Error(
"SCR_CaptureVideo_BeginVideo: broken AVI writing code (stack level is %i (should be 2) at end of headers)\n",
format->riffstacklevel);
715
717 {
718
720
722 }
723 }
724}
static void SCR_CaptureVideo_RIFF_WriteFourCC(const char *chunkfourcc)
static void SCR_CaptureVideo_Avi_VideoFrames(int num, u8 *in)
static void SCR_CaptureVideo_RIFF_Write32(int n)
static void SCR_CaptureVideo_RIFF_WriteTerminatedString(const char *string)
static void SCR_CaptureVideo_RIFF_Pop(void)
static void SCR_CaptureVideo_RIFF_Start(void)
#define LOAD_FORMATSPECIFIC_AVI()
static fs_offset_t SCR_CaptureVideo_RIFF_GetPosition(void)
static void SCR_CaptureVideo_Avi_EndVideo(void)
static void SCR_CaptureVideo_RIFF_Flush(void)
static void SCR_CaptureVideo_RIFF_WriteBytes(const unsigned char *data, size_t size)
static void SCR_CaptureVideo_RIFF_Write16(int n)
#define AVI_MASTER_INDEX_SIZE
static void SCR_CaptureVideo_Avi_SoundFrame(const portable_sampleframe_t *paintbuffer, size_t length)
static void SCR_CaptureVideo_RIFF_Push(const char *chunkfourcc, const char *listtypefourcc, fs_offset_t sizeHint)
char * va(char *buf, size_t buflen, const char *format,...)
void FindFraction(double val, int *num, int *denom, int denomMax)
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
char engineversion[128]
version string for the corner of the console, crash messages, status command, etc
int FS_Seek(qfile_t *file, fs_offset_t offset, int whence)
qfile_t * FS_OpenRealFile(const char *filepath, const char *mode, qbool quiet)
GLenum GLsizei GLsizei height
GLint GLint GLint GLsizei GLsizei GLenum format
viddef_mode_t mode
currently active video mode
void Sys_Error(const char *error,...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN
Causes the entire program to exit ASAP.
viddef_t vid
global video state
#define Mem_Alloc(pool, size)