![]() |
DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
|
|
#include "quakedef.h"
#include "cl_video.h"
#include "dpvsimpledecode.h"
#include "cl_video_libavw.h"
Go to the source code of this file.
Data Structures | |
struct | cl_video_subtitle_info_t |
Variables | |
static int | cl_num_videos |
cvar_t | cl_video_brightness = {CF_CLIENT | CF_ARCHIVE, "cl_video_brightness", "1", "brightness of video, 1 = fullbright, 0.75 - 3/4 etc."} |
cvar_t | cl_video_fadein = {CF_CLIENT | CF_ARCHIVE, "cl_video_fadein", "0", "fading-from-black effect once video is started, in seconds"} |
cvar_t | cl_video_fadeout = {CF_CLIENT | CF_ARCHIVE, "cl_video_fadeout", "0", "fading-to-black effect once video is ended, in seconds"} |
cvar_t | cl_video_keepaspectratio = {CF_CLIENT | CF_ARCHIVE, "cl_video_keepaspectratio", "0", "keeps aspect ratio of fullscreen videos, leaving black color on unfilled areas, a value of 2 let video to be stretched horizontally with top & bottom being sliced out"} |
cvar_t | cl_video_scale = {CF_CLIENT | CF_ARCHIVE, "cl_video_scale", "1", "scale of video, 1 = fullscreen, 0.75 - 3/4 of screen etc."} |
cvar_t | cl_video_scale_vpos = {CF_CLIENT | CF_ARCHIVE, "cl_video_scale_vpos", "0", "vertical align of scaled video, -1 is top, 1 is bottom"} |
cvar_t | cl_video_stipple = {CF_CLIENT | CF_ARCHIVE, "cl_video_stipple", "0", "draw interlacing-like effect on videos, similar to scr_stipple but static and used only with video playing."} |
cvar_t | cl_video_subtitles = {CF_CLIENT | CF_ARCHIVE, "cl_video_subtitles", "0", "show subtitles for videos (if they are present)"} |
cvar_t | cl_video_subtitles_lines = {CF_CLIENT | CF_ARCHIVE, "cl_video_subtitles_lines", "4", "how many lines to occupy for subtitles"} |
cvar_t | cl_video_subtitles_textsize = {CF_CLIENT | CF_ARCHIVE, "cl_video_subtitles_textsize", "16", "textsize for subtitles"} |
static int | cl_videobmask |
static int | cl_videobytesperpixel |
static int | cl_videogmask |
int | cl_videoplaying = false |
static int | cl_videormask |
static clvideo_t | cl_videos [MAXCLVIDEOS] |
static rtexturepool_t * | cl_videotexturepool |
cvar_t | v_glslgamma_video = {CF_CLIENT | CF_ARCHIVE, "v_glslgamma_video", "1", "applies GLSL gamma to played video, could be a fraction, requires r_glslgamma_2d 1."} |
Definition at line 327 of file cl_video.c.
References clvideo_t::close, CLVIDEO_FIRSTFRAME, CLVIDEO_UNUSED, i, NULL, clvideo_t::state, clvideo_t::stream, clvideo_t::subtitle_text, clvideo_t::subtitles, clvideo_t::suspended, UnlinkVideoTexture(), and Z_Free.
Referenced by CL_PurgeOwner(), CL_Video_Shutdown(), CL_VideoStart(), CL_VideoStop(), and VM_cin_close().
Definition at line 460 of file cl_video.c.
References a, cl_video_subtitle_info_t::alignment, b, bound, clvideo_t::cachepic, CL_DrawVideo_DisplaySubtitleLine(), CL_DrawVideo_WordWidthFunc(), CL_GetVideoBySlot(), cl_video_brightness, cl_video_fadein, cl_video_fadeout, cl_video_keepaspectratio, cl_video_scale, cl_video_scale_vpos, cl_video_stipple, cl_video_subtitles, cl_video_subtitles_lines, cl_video_subtitles_textsize, cl_videoplaying, COM_Wordwrap(), Con_Print(), Cvar_SetValueQuick(), DRAWFLAG_NOGAMMA, DrawQ_Fill(), DrawQ_SuperPic(), float, cl_video_subtitle_info_t::font, FONT_NOTIFY, cl_video_subtitle_info_t::fontsize, clvideo_t::framenum, clvideo_t::framerate, clvideo_t::getaspectratio, cl_video_subtitle_info_t::height, viddef_mode_t::height, host, i, cvar_t::integer, max, min, viddef_t::mode, pow(), px, host_static_t::realtime, scr_stipple, clvideo_t::starttime, clvideo_t::stream, strlen(), clvideo_t::subtitle_end, clvideo_t::subtitle_start, clvideo_t::subtitle_text, clvideo_t::subtitles, cl_video_subtitle_info_t::textalpha, v_glslgamma_video, cvar_t::value, vid, vid_conheight, vid_conwidth, cl_video_subtitle_info_t::width, viddef_mode_t::width, cl_video_subtitle_info_t::x, and cl_video_subtitle_info_t::y.
Referenced by SCR_DrawScreen().
|
static |
Definition at line 447 of file cl_video.c.
References cl_video_subtitle_info_t::alignment, DrawQ_String(), cl_video_subtitle_info_t::font, cl_video_subtitle_info_t::fontsize, int(), length, NULL, cl_video_subtitle_info_t::textalpha, cl_video_subtitle_info_t::width, width, cl_video_subtitle_info_t::x, x, and cl_video_subtitle_info_t::y.
Referenced by CL_DrawVideo().
|
static |
Definition at line 433 of file cl_video.c.
References DrawQ_TextWidth(), DrawQ_TextWidth_UntilWidth(), cl_video_subtitle_info_t::font, cl_video_subtitle_info_t::fontsize, length, dp_font_t::maxwidth, NULL, and w.
Referenced by CL_DrawVideo().
clvideo_t * CL_GetVideoByName | ( | const char * | name | ) |
Definition at line 284 of file cl_video.c.
References CL_GetVideoBySlot(), cl_num_videos, cl_videos, CLVIDEO_UNUSED, i, name, and NULL.
Referenced by VM_cin_close(), VM_cin_getstate(), VM_cin_restart(), and VM_cin_setstate().
Definition at line 267 of file cl_video.c.
References cl_videos, CLVIDEO_RESETONWAKEUP, clvideo_t::framenum, host, clvideo_t::lasttime, NULL, host_static_t::realtime, clvideo_t::state, clvideo_t::suspended, and WakeVideo().
Referenced by CL_DrawVideo(), and CL_GetVideoByName().
clvideo_t * CL_OpenVideo | ( | const char * | filename, |
const char * | name, | ||
int | owner, | ||
const char * | subtitlesfile ) |
Definition at line 245 of file cl_video.c.
References cl_num_videos, cl_videos, CLVIDEOPREFIX, Con_DPrintf(), CON_ERROR, Con_Printf(), FindUnusedVid(), max, name, NULL, OpenVideo(), and owner.
Referenced by VM_cin_open().
|
static |
Definition at line 613 of file cl_video.c.
References CL_StartVideo(), CL_VideoStart(), cmd(), Cmd_Argc(), Cmd_Argv(), Con_Print(), dpsnprintf(), FS_FileExtension(), MAX_QPATH, name, and Sys_CheckParm().
Referenced by CL_Video_Init().
Definition at line 411 of file cl_video.c.
References CL_CloseVideo(), cl_num_videos, cl_videos, i, and owner.
Referenced by VM_Cmd_Reset().
Definition at line 309 of file cl_video.c.
References clvideo_t::close, CLVIDEO_UNUSED, clvideo_t::framenum, host, clvideo_t::lasttime, NULL, OpenStream(), host_static_t::realtime, clvideo_t::starttime, clvideo_t::state, and clvideo_t::stream.
Referenced by CL_SetVideoState(), CL_Video_Frame(), CL_VideoStart(), and VM_cin_restart().
void CL_SetVideoState | ( | clvideo_t * | video, |
clvideostate_t | state ) |
Definition at line 298 of file cl_video.c.
References CL_RestartVideo(), CLVIDEO_FIRSTFRAME, host, clvideo_t::lasttime, host_static_t::realtime, and clvideo_t::state.
Referenced by CL_VideoStart(), and VM_cin_setstate().
|
static |
Definition at line 643 of file cl_video.c.
References CL_VideoStop().
Referenced by CL_Video_Init().
Definition at line 355 of file cl_video.c.
References clvideo_t::cachepic, cl_num_videos, CL_RestartVideo(), cl_videobmask, cl_videobytesperpixel, cl_videogmask, cl_videormask, cl_videos, CL_VideoStop(), CLTHRESHOLD, CLVIDEO_FIRSTFRAME, CLVIDEO_PAUSE, CLVIDEO_PLAY, CLVIDEO_UNUSED, clvideo_t::decodeframe, Draw_GetPicTexture(), clvideo_t::framenum, clvideo_t::framerate, host, i, clvideo_t::imagedata, int(), clvideo_t::lasttime, R_MarkDirtyTexture(), host_static_t::realtime, clvideo_t::starttime, clvideo_t::state, clvideo_t::stream, clvideo_t::suspended, SuspendVideo(), and clvideo_t::width.
Referenced by CL_Frame().
Definition at line 675 of file cl_video.c.
References b, CF_CLIENT, cl_num_videos, CL_PlayVideo_f(), CL_StopVideo_f(), cl_video_brightness, cl_video_fadein, cl_video_fadeout, cl_video_keepaspectratio, cl_video_newmap(), cl_video_scale, cl_video_scale_vpos, cl_video_shutdown(), cl_video_start(), cl_video_stipple, cl_video_subtitles, cl_video_subtitles_lines, cl_video_subtitles_textsize, cl_videobmask, cl_videobytesperpixel, cl_videogmask, cl_videormask, Cmd_AddCommand(), Cvar_RegisterVariable(), i, LibAvW_OpenLibrary(), NULL, R_RegisterModule(), and v_glslgamma_video.
Referenced by CL_Init().
Definition at line 596 of file cl_video.c.
References CL_VideoStop(), K_ENTER, K_ESCAPE, and K_SPACE.
Referenced by Key_Event().
Definition at line 713 of file cl_video.c.
References CL_CloseVideo(), cl_num_videos, cl_videos, i, and LibAvW_CloseLibrary().
Referenced by CL_Shutdown().
Definition at line 660 of file cl_video.c.
References cl_num_videos, cl_videos, cl_videotexturepool, CLVIDEO_UNUSED, i, R_FreeTexturePool(), clvideo_t::state, clvideo_t::suspended, and SuspendVideo().
Referenced by CL_Video_Init().
Definition at line 648 of file cl_video.c.
References cl_num_videos, cl_videos, cl_videotexturepool, CLVIDEO_UNUSED, i, LinkVideoTexture(), R_AllocTexturePool(), clvideo_t::state, and clvideo_t::suspended.
Referenced by CL_Video_Init().
void CL_VideoStart | ( | char * | filename, |
const char * | subtitlesfile ) |
Definition at line 578 of file cl_video.c.
References CL_CloseVideo(), cl_num_videos, CL_RestartVideo(), CL_SetVideoState(), CL_StartVideo(), cl_videoplaying, cl_videos, CLVIDEO_PLAY, CLVIDEO_UNUSED, max, OpenVideo(), and clvideo_t::state.
Referenced by CL_PlayVideo_f().
Definition at line 606 of file cl_video.c.
References CL_CloseVideo(), cl_videoplaying, and cl_videos.
Referenced by CL_ParseServerInfo(), CL_StopVideo_f(), CL_Video_Frame(), and CL_Video_KeyEvent().
Definition at line 40 of file cl_video.c.
References cl_videos, CLVIDEO_UNUSED, i, MAXCLVIDEOS, and NULL.
Referenced by CL_OpenVideo().
Definition at line 77 of file cl_video.c.
References clvideo_t::cachepic, Draw_GetPicTexture(), Draw_NewPic(), clvideo_t::height, clvideo_t::name, NULL, R_MakeTextureDynamic(), TEXF_CLAMP, TEXTYPE_BGRA, VideoUpdateCallback(), and clvideo_t::width.
Referenced by cl_video_start(), OpenVideo(), and WakeVideo().
Definition at line 128 of file cl_video.c.
References CF_CLIENT, CF_SERVER, cls, CLVIDEO_MAX_SUBTITLES, COM_ParseToken_QuakeC(), com_token, Con_DPrintf(), Con_Printf(), CON_WARN, Cvar_FindVar(), cvars_all, data, dpsnprintf(), float, FS_LoadFile(), GAME_BLOODOMNICIDE, gamemode, max, MAX_QPATH, Mem_Alloc, min, NULL, client_static_t::permanentmempool, cvar_t::string, strlen(), clvideo_t::subtitle_end, clvideo_t::subtitle_start, clvideo_t::subtitle_text, clvideo_t::subtitles, and Z_Free.
Referenced by OpenVideo().
Definition at line 49 of file cl_video.c.
References CON_ERROR, Con_Printf(), dpvsimpledecode_open(), clvideo_t::filename, jam_open(), LibAvW_OpenVideo(), and clvideo_t::stream.
Referenced by CL_RestartVideo(), OpenVideo(), and WakeVideo().
|
static |
Definition at line 215 of file cl_video.c.
References clvideo_t::cachepic, CACHEPICFLAG_NOTPERSISTENT, CACHEPICFLAG_QUIET, cl_videobytesperpixel, cls, CLVIDEO_FIRSTFRAME, CLVIDEOPREFIX, dp_strlcpy, dpsnprintf(), Draw_CachePic_Flags(), clvideo_t::filename, clvideo_t::framenum, clvideo_t::framerate, clvideo_t::getframerate, clvideo_t::getheight, clvideo_t::getwidth, clvideo_t::height, host, clvideo_t::imagedata, clvideo_t::lasttime, LinkVideoTexture(), LoadSubtitles(), Mem_Alloc, clvideo_t::name, name, NULL, OpenStream(), owner, clvideo_t::ownertag, client_static_t::permanentmempool, host_static_t::realtime, clvideo_t::state, clvideo_t::stream, clvideo_t::subtitles, and clvideo_t::width.
Referenced by CL_OpenVideo(), and CL_VideoStart().
Definition at line 92 of file cl_video.c.
References clvideo_t::close, CLVIDEO_FIRSTFRAME, NULL, clvideo_t::state, clvideo_t::stream, clvideo_t::suspended, and UnlinkVideoTexture().
Referenced by CL_Video_Frame(), and cl_video_shutdown().
Definition at line 84 of file cl_video.c.
References Draw_FreePic(), clvideo_t::imagedata, Mem_Free, and clvideo_t::name.
Referenced by CL_CloseVideo(), and SuspendVideo().
|
static |
Definition at line 71 of file cl_video.c.
References data, Draw_NewPic(), clvideo_t::height, clvideo_t::imagedata, clvideo_t::name, TEXF_CLAMP, TEXTYPE_BGRA, and clvideo_t::width.
Referenced by LinkVideoTexture().
Definition at line 107 of file cl_video.c.
References cl_videobytesperpixel, cls, CLVIDEO_FIRSTFRAME, CLVIDEO_UNUSED, clvideo_t::height, host, clvideo_t::imagedata, clvideo_t::lasttime, LinkVideoTexture(), Mem_Alloc, OpenStream(), client_static_t::permanentmempool, host_static_t::realtime, clvideo_t::starttime, clvideo_t::state, clvideo_t::suspended, and clvideo_t::width.
Referenced by CL_GetVideoBySlot().
|
static |
Definition at line 36 of file cl_video.c.
Referenced by CL_GetVideoByName(), CL_OpenVideo(), CL_PurgeOwner(), CL_Video_Frame(), CL_Video_Init(), CL_Video_Shutdown(), cl_video_shutdown(), cl_video_start(), and CL_VideoStart().
cvar_t cl_video_brightness = {CF_CLIENT | CF_ARCHIVE, "cl_video_brightness", "1", "brightness of video, 1 = fullbright, 0.75 - 3/4 etc."} |
Definition at line 12 of file cl_video.c.
Referenced by CL_DrawVideo(), and CL_Video_Init().
cvar_t cl_video_fadein = {CF_CLIENT | CF_ARCHIVE, "cl_video_fadein", "0", "fading-from-black effect once video is started, in seconds"} |
Definition at line 14 of file cl_video.c.
Referenced by CL_DrawVideo(), and CL_Video_Init().
cvar_t cl_video_fadeout = {CF_CLIENT | CF_ARCHIVE, "cl_video_fadeout", "0", "fading-to-black effect once video is ended, in seconds"} |
Definition at line 15 of file cl_video.c.
Referenced by CL_DrawVideo(), and CL_Video_Init().
cvar_t cl_video_keepaspectratio = {CF_CLIENT | CF_ARCHIVE, "cl_video_keepaspectratio", "0", "keeps aspect ratio of fullscreen videos, leaving black color on unfilled areas, a value of 2 let video to be stretched horizontally with top & bottom being sliced out"} |
Definition at line 13 of file cl_video.c.
Referenced by CL_DrawVideo(), and CL_Video_Init().
cvar_t cl_video_scale = {CF_CLIENT | CF_ARCHIVE, "cl_video_scale", "1", "scale of video, 1 = fullscreen, 0.75 - 3/4 of screen etc."} |
Definition at line 9 of file cl_video.c.
Referenced by CL_DrawVideo(), and CL_Video_Init().
cvar_t cl_video_scale_vpos = {CF_CLIENT | CF_ARCHIVE, "cl_video_scale_vpos", "0", "vertical align of scaled video, -1 is top, 1 is bottom"} |
Definition at line 10 of file cl_video.c.
Referenced by CL_DrawVideo(), and CL_Video_Init().
cvar_t cl_video_stipple = {CF_CLIENT | CF_ARCHIVE, "cl_video_stipple", "0", "draw interlacing-like effect on videos, similar to scr_stipple but static and used only with video playing."} |
Definition at line 11 of file cl_video.c.
Referenced by CL_DrawVideo(), and CL_Video_Init().
cvar_t cl_video_subtitles = {CF_CLIENT | CF_ARCHIVE, "cl_video_subtitles", "0", "show subtitles for videos (if they are present)"} |
Definition at line 6 of file cl_video.c.
Referenced by CL_DrawVideo(), and CL_Video_Init().
cvar_t cl_video_subtitles_lines = {CF_CLIENT | CF_ARCHIVE, "cl_video_subtitles_lines", "4", "how many lines to occupy for subtitles"} |
Definition at line 7 of file cl_video.c.
Referenced by CL_DrawVideo(), and CL_Video_Init().
cvar_t cl_video_subtitles_textsize = {CF_CLIENT | CF_ARCHIVE, "cl_video_subtitles_textsize", "16", "textsize for subtitles"} |
|
static |
Definition at line 32 of file cl_video.c.
Referenced by CL_Video_Frame(), and CL_Video_Init().
|
static |
Definition at line 34 of file cl_video.c.
Referenced by CL_Video_Frame(), CL_Video_Init(), OpenVideo(), and WakeVideo().
|
static |
Definition at line 33 of file cl_video.c.
Referenced by CL_Video_Frame(), and CL_Video_Init().
Definition at line 458 of file cl_video.c.
Referenced by CL_DrawVideo(), CL_VideoStart(), CL_VideoStop(), Key_Event(), R_RenderView(), and VM_CL_videoplaying().
|
static |
Definition at line 31 of file cl_video.c.
Referenced by CL_Video_Frame(), and CL_Video_Init().
|
static |
Definition at line 37 of file cl_video.c.
Referenced by CL_GetVideoByName(), CL_GetVideoBySlot(), CL_OpenVideo(), CL_PurgeOwner(), CL_Video_Frame(), CL_Video_Shutdown(), cl_video_shutdown(), cl_video_start(), CL_VideoStart(), CL_VideoStop(), and FindUnusedVid().
|
static |
Definition at line 38 of file cl_video.c.
Referenced by cl_video_shutdown(), and cl_video_start().
cvar_t v_glslgamma_video = {CF_CLIENT | CF_ARCHIVE, "v_glslgamma_video", "1", "applies GLSL gamma to played video, could be a fraction, requires r_glslgamma_2d 1."} |
Definition at line 17 of file cl_video.c.
Referenced by CL_DrawVideo(), and CL_Video_Init().