2013-05-04 10:40:05 +00:00
|
|
|
#include "../plugin.h"
|
|
|
|
#include "../engine.h"
|
|
|
|
|
2019-09-04 07:59:40 +00:00
|
|
|
static plugfsfuncs_t *filefuncs;
|
|
|
|
static plugaudiofuncs_t *audiofuncs;
|
|
|
|
|
2023-04-03 00:33:35 +00:00
|
|
|
#include "libavcodec/avcodec.h"
|
2013-05-11 14:02:55 +00:00
|
|
|
#include "libavformat/avformat.h"
|
|
|
|
#include "libswscale/swscale.h"
|
2016-07-12 00:40:13 +00:00
|
|
|
#include "libavutil/imgutils.h"
|
2013-05-04 10:40:05 +00:00
|
|
|
|
2017-05-10 02:57:34 +00:00
|
|
|
#define TARGET_FFMPEG (LIBAVFORMAT_VERSION_MICRO >= 100)
|
2017-09-20 11:27:13 +00:00
|
|
|
#define HAVE_DECOUPLED_API (LIBAVCODEC_VERSION_MAJOR>57 || (LIBAVCODEC_VERSION_MAJOR==57&&LIBAVCODEC_VERSION_MINOR>=36))
|
2017-05-10 02:57:34 +00:00
|
|
|
|
2013-05-04 10:40:05 +00:00
|
|
|
//between av 52.31 and 54.35, lots of constants etc got renamed to gain an extra AV_ prefix.
|
|
|
|
/*
|
|
|
|
#define AV_PIX_FMT_BGRA PIX_FMT_BGRA
|
|
|
|
#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
|
|
|
|
#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
|
|
|
|
#define AV_PIX_FMT_BGRA PIX_FMT_BGRA
|
|
|
|
#define AV_SAMPLE_FMT_U8 SAMPLE_FMT_U8
|
|
|
|
#define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16
|
|
|
|
#define AV_SAMPLE_FMT_FLT SAMPLE_FMT_FLT
|
|
|
|
#define AVIOContext ByteIOContext
|
|
|
|
#define avio_alloc_context av_alloc_put_byte
|
|
|
|
*/
|
|
|
|
|
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
|
|
|
#define DECODERNAME "ffmpeg"
|
|
|
|
|
2017-05-10 02:57:34 +00:00
|
|
|
/*should probably try threading this, though I suppose it should be the engine doing that.*/
|
2013-05-04 10:40:05 +00:00
|
|
|
/*timing is based upon the start time. this means overflow issues with rtsp etc*/
|
|
|
|
|
|
|
|
struct decctx
|
|
|
|
{
|
|
|
|
unsigned int width, height;
|
|
|
|
|
2019-09-04 07:59:40 +00:00
|
|
|
vfsfile_t *file;
|
2013-05-04 10:40:05 +00:00
|
|
|
int64_t fileofs;
|
|
|
|
int64_t filelen;
|
|
|
|
AVFormatContext *pFormatCtx;
|
|
|
|
|
|
|
|
int audioStream;
|
|
|
|
AVCodecContext *pACodecCtx;
|
|
|
|
AVFrame *pAFrame;
|
|
|
|
|
|
|
|
int videoStream;
|
|
|
|
AVCodecContext *pVCodecCtx;
|
|
|
|
AVFrame *pVFrame;
|
|
|
|
int64_t num, denum;
|
2016-07-12 00:40:13 +00:00
|
|
|
int64_t lasttime;
|
2013-05-04 10:40:05 +00:00
|
|
|
|
2016-07-12 00:40:13 +00:00
|
|
|
uint8_t *rgb_data;
|
|
|
|
int rgb_linesize;
|
2013-05-04 10:40:05 +00:00
|
|
|
struct SwsContext *pScaleCtx;
|
|
|
|
};
|
|
|
|
|
|
|
|
static qboolean AVDec_SetSize (void *vctx, int width, int height)
|
|
|
|
{
|
|
|
|
struct decctx *ctx = (struct decctx*)vctx;
|
2017-05-10 02:57:34 +00:00
|
|
|
uint8_t *rgb_data[4]; //av_image_alloc requires at least 4 entries for certain pix formats (libav (but not ffmpeg) zero-fills, so this is important).
|
|
|
|
int rgb_linesize[4];
|
2013-05-04 10:40:05 +00:00
|
|
|
|
|
|
|
//colourspace conversions will be fastest if we
|
|
|
|
// if (width > ctx->pCodecCtx->width)
|
|
|
|
width = ctx->pVCodecCtx->width;
|
|
|
|
// if (height > ctx->pCodecCtx->height)
|
|
|
|
height = ctx->pVCodecCtx->height;
|
|
|
|
|
|
|
|
//is this a no-op?
|
|
|
|
if (width == ctx->width && height == ctx->height && ctx->pScaleCtx)
|
|
|
|
return true;
|
|
|
|
|
2023-06-09 05:09:58 +00:00
|
|
|
if (av_image_alloc(rgb_data, rgb_linesize, width, height, AV_PIX_FMT_BGRA, 1) >= 0)
|
2013-05-04 10:40:05 +00:00
|
|
|
{
|
|
|
|
//update the scale context as required
|
|
|
|
//clear the old stuff out
|
2016-07-12 00:40:13 +00:00
|
|
|
av_free(ctx->rgb_data);
|
2013-05-04 10:40:05 +00:00
|
|
|
|
|
|
|
ctx->width = width;
|
|
|
|
ctx->height = height;
|
2016-07-12 00:40:13 +00:00
|
|
|
ctx->rgb_data = rgb_data[0];
|
|
|
|
ctx->rgb_linesize = rgb_linesize[0];
|
2013-05-04 10:40:05 +00:00
|
|
|
return qtrue;
|
|
|
|
}
|
|
|
|
return qfalse; //unsupported
|
|
|
|
}
|
|
|
|
|
2013-05-03 03:30:22 +00:00
|
|
|
static int AVIO_Read(void *opaque, uint8_t *buf, int buf_size)
|
|
|
|
{
|
|
|
|
struct decctx *ctx = opaque;
|
|
|
|
int ammount;
|
2019-09-04 07:59:40 +00:00
|
|
|
ammount = VFS_READ(ctx->file, buf, buf_size);
|
2013-05-03 03:30:22 +00:00
|
|
|
if (ammount > 0)
|
|
|
|
ctx->fileofs += ammount;
|
|
|
|
return ammount;
|
|
|
|
}
|
2013-05-04 10:40:05 +00:00
|
|
|
static int64_t AVIO_Seek(void *opaque, int64_t offset, int whence)
|
|
|
|
{
|
2013-05-03 03:30:22 +00:00
|
|
|
struct decctx *ctx = opaque;
|
2013-10-29 17:38:22 +00:00
|
|
|
whence &= ~AVSEEK_FORCE;
|
2013-05-03 03:30:22 +00:00
|
|
|
switch(whence)
|
|
|
|
{
|
|
|
|
default:
|
2016-07-12 00:40:13 +00:00
|
|
|
return -1;
|
|
|
|
case SEEK_SET:
|
2013-05-03 03:30:22 +00:00
|
|
|
ctx->fileofs = offset;
|
|
|
|
break;
|
|
|
|
case SEEK_CUR:
|
|
|
|
ctx->fileofs += offset;
|
|
|
|
break;
|
|
|
|
case SEEK_END:
|
|
|
|
ctx->fileofs = ctx->filelen + offset;
|
|
|
|
break;
|
|
|
|
case AVSEEK_SIZE:
|
|
|
|
return ctx->filelen;
|
|
|
|
}
|
2019-09-04 07:59:40 +00:00
|
|
|
VFS_SEEK(ctx->file, ctx->fileofs);
|
2013-10-29 17:38:22 +00:00
|
|
|
return ctx->fileofs;
|
2013-05-04 10:40:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void AVDec_Destroy(void *vctx)
|
|
|
|
{
|
|
|
|
struct decctx *ctx = (struct decctx*)vctx;
|
|
|
|
|
|
|
|
// Free the video stuff
|
2016-07-12 00:40:13 +00:00
|
|
|
av_free(ctx->rgb_data);
|
2013-10-29 17:38:22 +00:00
|
|
|
if (ctx->pVCodecCtx)
|
|
|
|
avcodec_close(ctx->pVCodecCtx);
|
2013-05-04 10:40:05 +00:00
|
|
|
av_free(ctx->pVFrame);
|
|
|
|
|
|
|
|
// Free the audio decoder
|
2013-10-29 17:38:22 +00:00
|
|
|
if (ctx->pACodecCtx)
|
|
|
|
avcodec_close(ctx->pACodecCtx);
|
2013-05-04 10:40:05 +00:00
|
|
|
av_free(ctx->pAFrame);
|
|
|
|
|
|
|
|
// Close the video file
|
|
|
|
avformat_close_input(&ctx->pFormatCtx);
|
|
|
|
|
2019-09-04 07:59:40 +00:00
|
|
|
if (ctx->file)
|
|
|
|
VFS_CLOSE(ctx->file);
|
2013-05-04 10:40:05 +00:00
|
|
|
|
|
|
|
free(ctx);
|
|
|
|
}
|
|
|
|
|
2016-07-12 00:40:13 +00:00
|
|
|
static void *AVDec_Create(const char *medianame)
|
2013-05-04 10:40:05 +00:00
|
|
|
{
|
|
|
|
struct decctx *ctx;
|
|
|
|
|
|
|
|
unsigned int i;
|
|
|
|
AVCodec *pCodec;
|
|
|
|
qboolean useioctx = false;
|
|
|
|
|
2017-05-10 02:57:34 +00:00
|
|
|
/*always respond to av: media prefixes*/
|
2019-09-04 07:59:40 +00:00
|
|
|
if (!strncmp(medianame, "av:", 3) || !strncmp(medianame, "ff:", 3))
|
2013-05-04 10:40:05 +00:00
|
|
|
{
|
|
|
|
medianame = medianame + 3;
|
|
|
|
useioctx = true;
|
|
|
|
}
|
2019-09-04 07:59:40 +00:00
|
|
|
else if (!strncmp(medianame, "avs:", 4) || !strncmp(medianame, "ffs:", 4))
|
2013-05-04 10:40:05 +00:00
|
|
|
{
|
|
|
|
medianame = medianame + 4;
|
|
|
|
//let avformat do its own avio context stuff
|
|
|
|
}
|
2019-09-04 07:59:40 +00:00
|
|
|
else if (strchr(medianame, ':')) //block other types of url/prefix.
|
2013-05-04 10:40:05 +00:00
|
|
|
return NULL;
|
2017-05-10 02:57:34 +00:00
|
|
|
else //if (!strcasecmp(extension, ".roq") || !strcasecmp(extension, ".roq"))
|
|
|
|
return NULL; //roq+cin should be played back via the engine instead.
|
2013-05-04 10:40:05 +00:00
|
|
|
|
|
|
|
ctx = malloc(sizeof(*ctx));
|
|
|
|
memset(ctx, 0, sizeof(*ctx));
|
|
|
|
|
2016-07-12 00:40:13 +00:00
|
|
|
ctx->lasttime = -1;
|
2019-09-04 07:59:40 +00:00
|
|
|
ctx->file = NULL;
|
2013-05-04 10:40:05 +00:00
|
|
|
if (useioctx)
|
|
|
|
{
|
|
|
|
// Create internal Buffer for FFmpeg:
|
|
|
|
const int iBufSize = 32 * 1024;
|
2016-07-12 00:40:13 +00:00
|
|
|
char *pBuffer = av_malloc(iBufSize);
|
2013-05-04 10:40:05 +00:00
|
|
|
AVIOContext *ioctx;
|
|
|
|
|
2019-09-04 07:59:40 +00:00
|
|
|
ctx->file = filefuncs->OpenVFS(medianame, "rb", FS_GAME);
|
|
|
|
if (!ctx->file)
|
2013-05-04 10:40:05 +00:00
|
|
|
{
|
|
|
|
Con_Printf("Unable to open %s\n", medianame);
|
|
|
|
free(ctx);
|
2016-07-12 00:40:13 +00:00
|
|
|
av_free(pBuffer);
|
2013-05-04 10:40:05 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2019-09-04 07:59:40 +00:00
|
|
|
ctx->filelen = VFS_GETLEN(ctx->file);
|
2013-05-04 10:40:05 +00:00
|
|
|
|
|
|
|
ioctx = avio_alloc_context(pBuffer, iBufSize, 0, ctx, AVIO_Read, 0, AVIO_Seek);
|
|
|
|
ctx->pFormatCtx = avformat_alloc_context();
|
|
|
|
|
|
|
|
ctx->pFormatCtx->pb = ioctx;
|
|
|
|
}
|
2013-11-21 23:02:28 +00:00
|
|
|
/*
|
|
|
|
small how-to note for if I ever try to add support for voice-and-video rtp decoding.
|
|
|
|
this stuff is presumably needed to handle ICE+stun+ports etc.
|
|
|
|
I prolly need to hack around with adding rtcp too. :s
|
|
|
|
|
2017-05-10 02:57:34 +00:00
|
|
|
rtsp: Add support for depacketizing RTP data via custom IO
|
|
|
|
|
|
|
|
To use this, set sdpflags=custom_io to the sdp demuxer. During
|
|
|
|
the avformat_open_input call, the SDP is read from the AVFormatContext
|
|
|
|
AVIOContext (ctx->pb) - after the avformat_open_input call,
|
|
|
|
during the av_read_frame() calls, the same ctx->pb is used for reading
|
|
|
|
packets (and sending back RTCP RR packets).
|
|
|
|
|
|
|
|
Normally, one would use this with a read-only AVIOContext for the
|
|
|
|
SDP during the avformat_open_input call, then close that one and
|
|
|
|
replace it with a read-write one for the packets after the
|
|
|
|
avformat_open_input call has returned.
|
|
|
|
|
|
|
|
This allows using the RTP depacketizers as "pure" demuxers, without
|
2013-11-21 23:02:28 +00:00
|
|
|
having them tied to the libavformat network IO.
|
|
|
|
*/
|
|
|
|
|
2013-05-04 10:40:05 +00:00
|
|
|
|
|
|
|
// Open video file
|
|
|
|
if(avformat_open_input(&ctx->pFormatCtx, medianame, NULL, NULL)==0)
|
|
|
|
{
|
|
|
|
// Retrieve stream information
|
|
|
|
if(avformat_find_stream_info(ctx->pFormatCtx, NULL)>=0)
|
|
|
|
{
|
|
|
|
ctx->audioStream=-1;
|
2017-09-20 11:27:13 +00:00
|
|
|
for(i=0; i<ctx->pFormatCtx->nb_streams && ctx->audioStream==-1; i++)
|
|
|
|
{
|
|
|
|
#if LIBAVFORMAT_VERSION_MAJOR >= 57
|
|
|
|
if(ctx->pFormatCtx->streams[i]->codecpar->codec_type==AVMEDIA_TYPE_AUDIO)
|
|
|
|
#else
|
2013-05-04 10:40:05 +00:00
|
|
|
if(ctx->pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO)
|
2017-09-20 11:27:13 +00:00
|
|
|
#endif
|
2013-05-04 10:40:05 +00:00
|
|
|
ctx->audioStream=i;
|
2017-09-20 11:27:13 +00:00
|
|
|
}
|
2013-05-04 10:40:05 +00:00
|
|
|
if(ctx->audioStream!=-1)
|
|
|
|
{
|
2017-09-20 11:27:13 +00:00
|
|
|
#if LIBAVFORMAT_VERSION_MAJOR >= 57
|
|
|
|
pCodec=avcodec_find_decoder(ctx->pFormatCtx->streams[ctx->audioStream]->codecpar->codec_id);
|
|
|
|
ctx->pACodecCtx = avcodec_alloc_context3(pCodec);
|
|
|
|
if (avcodec_parameters_to_context(ctx->pACodecCtx, ctx->pFormatCtx->streams[ctx->audioStream]->codecpar) < 0)
|
|
|
|
{
|
|
|
|
avcodec_free_context(&ctx->pACodecCtx);
|
|
|
|
pCodec = NULL;
|
|
|
|
}
|
|
|
|
#else
|
2013-05-04 10:40:05 +00:00
|
|
|
ctx->pACodecCtx=ctx->pFormatCtx->streams[ctx->audioStream]->codec;
|
|
|
|
pCodec=avcodec_find_decoder(ctx->pACodecCtx->codec_id);
|
2017-09-20 11:27:13 +00:00
|
|
|
#endif
|
2013-05-04 10:40:05 +00:00
|
|
|
|
2016-07-12 00:40:13 +00:00
|
|
|
ctx->pAFrame=av_frame_alloc();
|
2013-05-04 10:40:05 +00:00
|
|
|
if(pCodec!=NULL && ctx->pAFrame && avcodec_open2(ctx->pACodecCtx, pCodec, NULL) >= 0)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
ctx->audioStream = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
ctx->videoStream=-1;
|
2017-09-20 11:27:13 +00:00
|
|
|
for(i=0; i<ctx->pFormatCtx->nb_streams && ctx->videoStream==-1; i++)
|
|
|
|
{
|
|
|
|
#if LIBAVFORMAT_VERSION_MAJOR >= 57
|
|
|
|
if(ctx->pFormatCtx->streams[i]->codecpar->codec_type==AVMEDIA_TYPE_VIDEO)
|
|
|
|
#else
|
2013-05-04 10:40:05 +00:00
|
|
|
if(ctx->pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO)
|
2017-09-20 11:27:13 +00:00
|
|
|
#endif
|
2013-05-04 10:40:05 +00:00
|
|
|
ctx->videoStream=i;
|
2017-09-20 11:27:13 +00:00
|
|
|
}
|
2013-05-04 10:40:05 +00:00
|
|
|
if(ctx->videoStream!=-1)
|
|
|
|
{
|
2017-09-20 11:27:13 +00:00
|
|
|
#if LIBAVFORMAT_VERSION_MAJOR >= 57
|
|
|
|
pCodec=avcodec_find_decoder(ctx->pFormatCtx->streams[ctx->videoStream]->codecpar->codec_id);
|
|
|
|
ctx->pVCodecCtx = avcodec_alloc_context3(pCodec);
|
|
|
|
if (avcodec_parameters_to_context(ctx->pVCodecCtx, ctx->pFormatCtx->streams[ctx->videoStream]->codecpar) < 0)
|
|
|
|
{
|
|
|
|
avcodec_free_context(&ctx->pVCodecCtx);
|
|
|
|
pCodec = NULL;
|
|
|
|
}
|
|
|
|
#else
|
2013-05-04 10:40:05 +00:00
|
|
|
ctx->pVCodecCtx=ctx->pFormatCtx->streams[ctx->videoStream]->codec;
|
2017-09-20 11:27:13 +00:00
|
|
|
pCodec=avcodec_find_decoder(ctx->pVCodecCtx->codec_id);
|
|
|
|
#endif
|
2013-05-04 10:40:05 +00:00
|
|
|
ctx->num = ctx->pFormatCtx->streams[ctx->videoStream]->time_base.num;
|
|
|
|
ctx->denum = ctx->pFormatCtx->streams[ctx->videoStream]->time_base.den;
|
|
|
|
|
|
|
|
// Open codec
|
|
|
|
if(pCodec!=NULL && avcodec_open2(ctx->pVCodecCtx, pCodec, NULL) >= 0)
|
|
|
|
{
|
|
|
|
// Allocate video frame
|
2016-07-12 00:40:13 +00:00
|
|
|
ctx->pVFrame=av_frame_alloc();
|
2013-05-04 10:40:05 +00:00
|
|
|
if(ctx->pVFrame!=NULL)
|
|
|
|
{
|
|
|
|
if (AVDec_SetSize(ctx, ctx->pVCodecCtx->width, ctx->pVCodecCtx->height))
|
|
|
|
{
|
|
|
|
return ctx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
AVDec_Destroy(ctx);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2016-07-12 00:40:13 +00:00
|
|
|
static qboolean VARGS AVDec_DisplayFrame(void *vctx, qboolean nosound, qboolean forcevideo, double mediatime, void (QDECL *uploadtexture)(void *ectx, uploadfmt_t fmt, int width, int height, void *data, void *palette), void *ectx)
|
2013-05-04 10:40:05 +00:00
|
|
|
{
|
|
|
|
struct decctx *ctx = (struct decctx*)vctx;
|
|
|
|
AVPacket packet;
|
2017-09-20 11:27:13 +00:00
|
|
|
#if HAVE_DECOUPLED_API
|
|
|
|
#else
|
2013-05-04 10:40:05 +00:00
|
|
|
int frameFinished;
|
2017-09-20 11:27:13 +00:00
|
|
|
#endif
|
2013-05-04 10:40:05 +00:00
|
|
|
qboolean repainted = false;
|
2016-07-12 00:40:13 +00:00
|
|
|
int64_t curtime;
|
2013-05-04 10:40:05 +00:00
|
|
|
|
2016-07-12 00:40:13 +00:00
|
|
|
curtime = (mediatime * ctx->denum) / ctx->num;
|
2019-09-04 07:59:40 +00:00
|
|
|
|
|
|
|
nosound |= !audiofuncs;
|
2013-05-04 10:40:05 +00:00
|
|
|
|
|
|
|
while (1)
|
|
|
|
{
|
2016-07-12 00:40:13 +00:00
|
|
|
if (ctx->lasttime > curtime)
|
2013-05-04 10:40:05 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
// We're ahead of the previous frame. try and read the next.
|
|
|
|
if (av_read_frame(ctx->pFormatCtx, &packet) < 0)
|
|
|
|
{
|
2016-07-12 00:40:13 +00:00
|
|
|
if (repainted)
|
|
|
|
break;
|
|
|
|
return false;
|
2013-05-04 10:40:05 +00:00
|
|
|
}
|
|
|
|
|
2017-09-20 11:27:13 +00:00
|
|
|
#if HAVE_DECOUPLED_API
|
|
|
|
if(packet.stream_index==ctx->videoStream)
|
|
|
|
{
|
|
|
|
avcodec_send_packet(ctx->pVCodecCtx, &packet);
|
|
|
|
|
|
|
|
while(0==avcodec_receive_frame(ctx->pVCodecCtx, ctx->pVFrame))
|
|
|
|
{
|
|
|
|
//rescale+convert it to what we're rendering (no more yuv)
|
|
|
|
ctx->pScaleCtx = sws_getCachedContext(ctx->pScaleCtx, ctx->pVCodecCtx->width, ctx->pVCodecCtx->height, ctx->pVCodecCtx->pix_fmt, ctx->width, ctx->height, AV_PIX_FMT_BGRA, SWS_POINT, 0, 0, 0);
|
|
|
|
sws_scale(ctx->pScaleCtx, (void*)ctx->pVFrame->data, ctx->pVFrame->linesize, 0, ctx->pVCodecCtx->height, &ctx->rgb_data, &ctx->rgb_linesize);
|
|
|
|
|
2018-07-05 16:39:01 +00:00
|
|
|
ctx->lasttime = ctx->pVFrame->best_effort_timestamp;
|
2017-09-20 11:27:13 +00:00
|
|
|
repainted = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(packet.stream_index==ctx->audioStream && !nosound)
|
|
|
|
{
|
|
|
|
avcodec_send_packet(ctx->pACodecCtx, &packet);
|
|
|
|
while(0==avcodec_receive_frame(ctx->pACodecCtx, ctx->pAFrame))
|
|
|
|
{
|
|
|
|
int width = 2;
|
|
|
|
int channels = ctx->pACodecCtx->channels;
|
|
|
|
unsigned int auddatasize = av_samples_get_buffer_size(NULL, ctx->pACodecCtx->channels, ctx->pAFrame->nb_samples, ctx->pACodecCtx->sample_fmt, 1);
|
|
|
|
void *auddata = ctx->pAFrame->data[0];
|
|
|
|
switch(ctx->pACodecCtx->sample_fmt)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
auddatasize = 0;
|
|
|
|
break;
|
|
|
|
case AV_SAMPLE_FMT_U8P:
|
|
|
|
auddatasize /= channels;
|
|
|
|
channels = 1;
|
|
|
|
case AV_SAMPLE_FMT_U8:
|
|
|
|
width = 1;
|
|
|
|
break;
|
|
|
|
case AV_SAMPLE_FMT_S16P:
|
|
|
|
auddatasize /= channels;
|
|
|
|
channels = 1;
|
|
|
|
case AV_SAMPLE_FMT_S16:
|
|
|
|
width = 2;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AV_SAMPLE_FMT_FLTP:
|
2019-09-04 07:59:40 +00:00
|
|
|
if (channels == 2)
|
2019-08-28 02:47:00 +00:00
|
|
|
{
|
2019-09-04 07:59:40 +00:00
|
|
|
#ifdef MIXER_F32
|
|
|
|
float *l = (float*)ctx->pAFrame->data[0], *r = (float*)ctx->pAFrame->data[1], *t;
|
|
|
|
unsigned int i;
|
|
|
|
unsigned int frames = ctx->pAFrame->nb_samples;
|
|
|
|
width = sizeof(*t);
|
|
|
|
auddatasize = frames*width*channels;
|
|
|
|
t = malloc(auddatasize);
|
|
|
|
for (i = 0; i < frames; i++)
|
|
|
|
{
|
|
|
|
t[2*i+0] = l[i];
|
|
|
|
t[2*i+1] = r[i];
|
|
|
|
}
|
|
|
|
audiofuncs->RawAudio(-1, t, ctx->pACodecCtx->sample_rate, auddatasize/(channels*width), channels, width, 1);
|
|
|
|
free(t);
|
|
|
|
continue;
|
|
|
|
#else
|
|
|
|
//note that we can only reformat in place because we are NOT outputting floats.
|
2019-08-28 02:47:00 +00:00
|
|
|
float *in[2] = {(float*)ctx->pAFrame->data[0],(float*)ctx->pAFrame->data[1]};
|
|
|
|
signed short *out = (void*)auddata;
|
|
|
|
int v;
|
|
|
|
unsigned int i, c;
|
|
|
|
unsigned int frames = ctx->pAFrame->nb_samples;
|
|
|
|
for (i = 0; i < frames; i++)
|
|
|
|
{
|
2019-09-04 07:59:40 +00:00
|
|
|
for (c = 0; c < 2; c++)
|
2019-08-28 02:47:00 +00:00
|
|
|
{
|
|
|
|
v = (short)(in[c][i]*32767);
|
|
|
|
if (v < -32767)
|
|
|
|
v = -32767;
|
|
|
|
else if (v > 32767)
|
|
|
|
v = 32767;
|
|
|
|
*out++ = v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
width = sizeof(*out);
|
|
|
|
auddatasize = frames*width*channels;
|
2019-09-04 07:59:40 +00:00
|
|
|
break;
|
|
|
|
#endif
|
2019-08-28 02:47:00 +00:00
|
|
|
}
|
2019-09-04 07:59:40 +00:00
|
|
|
|
|
|
|
auddatasize /= channels;
|
|
|
|
channels = 1;
|
|
|
|
//fallthrough, using just the first channel as mono
|
2017-09-20 11:27:13 +00:00
|
|
|
case AV_SAMPLE_FMT_FLT:
|
2019-09-04 07:59:40 +00:00
|
|
|
#ifdef MIXER_F32
|
|
|
|
width = 4;
|
|
|
|
#else
|
2017-09-20 11:27:13 +00:00
|
|
|
{
|
|
|
|
float *in = (void*)auddata;
|
|
|
|
signed short *out = (void*)auddata;
|
|
|
|
int v;
|
|
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < auddatasize/sizeof(*in); i++)
|
|
|
|
{
|
|
|
|
v = (short)(in[i]*32767);
|
|
|
|
if (v < -32767)
|
|
|
|
v = -32767;
|
|
|
|
else if (v > 32767)
|
|
|
|
v = 32767;
|
|
|
|
out[i] = v;
|
|
|
|
}
|
|
|
|
auddatasize/=2;
|
|
|
|
width = 2;
|
|
|
|
}
|
2019-09-04 07:59:40 +00:00
|
|
|
#endif
|
2019-08-28 02:47:00 +00:00
|
|
|
break;
|
2017-09-20 11:27:13 +00:00
|
|
|
case AV_SAMPLE_FMT_DBLP:
|
|
|
|
auddatasize /= channels;
|
|
|
|
channels = 1;
|
|
|
|
case AV_SAMPLE_FMT_DBL:
|
|
|
|
{
|
|
|
|
double *in = (double*)auddata;
|
|
|
|
signed short *out = (void*)auddata;
|
|
|
|
int v;
|
|
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < auddatasize/sizeof(*in); i++)
|
|
|
|
{
|
|
|
|
v = (short)(in[i]*32767);
|
|
|
|
if (v < -32767)
|
|
|
|
v = -32767;
|
|
|
|
else if (v > 32767)
|
|
|
|
v = 32767;
|
|
|
|
out[i] = v;
|
|
|
|
}
|
|
|
|
auddatasize/=4;
|
|
|
|
width = 2;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2019-09-04 07:59:40 +00:00
|
|
|
audiofuncs->RawAudio(-1, auddata, ctx->pACodecCtx->sample_rate, auddatasize/(channels*width), channels, width, 1);
|
2017-09-20 11:27:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
av_packet_unref(&packet);
|
|
|
|
#else
|
|
|
|
|
2013-05-04 10:40:05 +00:00
|
|
|
// Is this a packet from the video stream?
|
|
|
|
if(packet.stream_index==ctx->videoStream)
|
|
|
|
{
|
|
|
|
// Decode video frame
|
|
|
|
avcodec_decode_video2(ctx->pVCodecCtx, ctx->pVFrame, &frameFinished, &packet);
|
|
|
|
|
|
|
|
// Did we get a video frame?
|
|
|
|
if(frameFinished)
|
|
|
|
{
|
|
|
|
ctx->pScaleCtx = sws_getCachedContext(ctx->pScaleCtx, ctx->pVCodecCtx->width, ctx->pVCodecCtx->height, ctx->pVCodecCtx->pix_fmt, ctx->width, ctx->height, AV_PIX_FMT_BGRA, SWS_POINT, 0, 0, 0);
|
|
|
|
|
|
|
|
// Convert the image from its native format to RGB
|
2016-07-12 00:40:13 +00:00
|
|
|
sws_scale(ctx->pScaleCtx, (void*)ctx->pVFrame->data, ctx->pVFrame->linesize, 0, ctx->pVCodecCtx->height, &ctx->rgb_data, &ctx->rgb_linesize);
|
2013-05-04 10:40:05 +00:00
|
|
|
|
|
|
|
repainted = true;
|
|
|
|
}
|
2017-05-10 02:57:34 +00:00
|
|
|
#if TARGET_FFMPEG
|
2016-07-12 00:40:13 +00:00
|
|
|
ctx->lasttime = av_frame_get_best_effort_timestamp(ctx->pVFrame);
|
2017-05-10 02:57:34 +00:00
|
|
|
#else
|
|
|
|
if(frameFinished)
|
|
|
|
{
|
|
|
|
if (ctx->pVFrame->pkt_pts != AV_NOPTS_VALUE)
|
|
|
|
ctx->lasttime = ctx->pVFrame->pkt_pts;
|
|
|
|
else
|
|
|
|
ctx->lasttime = ctx->pVFrame->pkt_dts;
|
|
|
|
}
|
|
|
|
#endif
|
2013-05-04 10:40:05 +00:00
|
|
|
}
|
|
|
|
else if(packet.stream_index==ctx->audioStream && !nosound)
|
|
|
|
{
|
|
|
|
int okay;
|
|
|
|
int len;
|
|
|
|
void *odata = packet.data;
|
|
|
|
while (packet.size > 0)
|
|
|
|
{
|
|
|
|
okay = false;
|
|
|
|
len = avcodec_decode_audio4(ctx->pACodecCtx, ctx->pAFrame, &okay, &packet);
|
|
|
|
if (len < 0)
|
|
|
|
break;
|
|
|
|
packet.size -= len;
|
|
|
|
packet.data += len;
|
|
|
|
if (okay)
|
|
|
|
{
|
|
|
|
int width = 2;
|
2016-07-12 00:40:13 +00:00
|
|
|
int channels = ctx->pACodecCtx->channels;
|
2013-05-04 10:40:05 +00:00
|
|
|
unsigned int auddatasize = av_samples_get_buffer_size(NULL, ctx->pACodecCtx->channels, ctx->pAFrame->nb_samples, ctx->pACodecCtx->sample_fmt, 1);
|
|
|
|
void *auddata = ctx->pAFrame->data[0];
|
|
|
|
switch(ctx->pACodecCtx->sample_fmt)
|
|
|
|
{
|
2013-05-03 03:30:22 +00:00
|
|
|
default:
|
|
|
|
auddatasize = 0;
|
2013-05-04 10:40:05 +00:00
|
|
|
break;
|
2016-07-12 00:40:13 +00:00
|
|
|
case AV_SAMPLE_FMT_U8P:
|
|
|
|
auddatasize /= channels;
|
|
|
|
channels = 1;
|
2013-05-03 03:30:22 +00:00
|
|
|
case AV_SAMPLE_FMT_U8:
|
|
|
|
width = 1;
|
|
|
|
break;
|
2016-07-12 00:40:13 +00:00
|
|
|
case AV_SAMPLE_FMT_S16P:
|
|
|
|
auddatasize /= channels;
|
|
|
|
channels = 1;
|
2013-05-03 03:30:22 +00:00
|
|
|
case AV_SAMPLE_FMT_S16:
|
|
|
|
width = 2;
|
|
|
|
break;
|
2016-07-12 00:40:13 +00:00
|
|
|
|
|
|
|
case AV_SAMPLE_FMT_FLTP:
|
|
|
|
auddatasize /= channels;
|
|
|
|
channels = 1;
|
2013-05-03 03:30:22 +00:00
|
|
|
case AV_SAMPLE_FMT_FLT:
|
2016-07-12 00:40:13 +00:00
|
|
|
//FIXME: support float audio internally.
|
2013-05-03 03:30:22 +00:00
|
|
|
{
|
|
|
|
float *in = (void*)auddata;
|
|
|
|
signed short *out = (void*)auddata;
|
2014-02-07 08:38:40 +00:00
|
|
|
int v;
|
2013-05-03 03:30:22 +00:00
|
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < auddatasize/sizeof(*in); i++)
|
|
|
|
{
|
2014-02-07 08:38:40 +00:00
|
|
|
v = (short)(in[i]*32767);
|
|
|
|
if (v < -32767)
|
|
|
|
v = -32767;
|
|
|
|
else if (v > 32767)
|
|
|
|
v = 32767;
|
|
|
|
out[i] = v;
|
2013-05-03 03:30:22 +00:00
|
|
|
}
|
|
|
|
auddatasize/=2;
|
|
|
|
width = 2;
|
|
|
|
}
|
2016-07-12 00:40:13 +00:00
|
|
|
|
|
|
|
case AV_SAMPLE_FMT_DBLP:
|
|
|
|
auddatasize /= channels;
|
|
|
|
channels = 1;
|
|
|
|
case AV_SAMPLE_FMT_DBL:
|
|
|
|
{
|
|
|
|
double *in = (double*)auddata;
|
|
|
|
signed short *out = (void*)auddata;
|
|
|
|
int v;
|
|
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < auddatasize/sizeof(*in); i++)
|
|
|
|
{
|
|
|
|
v = (short)(in[i]*32767);
|
|
|
|
if (v < -32767)
|
|
|
|
v = -32767;
|
|
|
|
else if (v > 32767)
|
|
|
|
v = 32767;
|
|
|
|
out[i] = v;
|
|
|
|
}
|
|
|
|
auddatasize/=4;
|
|
|
|
width = 2;
|
|
|
|
}
|
2013-05-04 10:40:05 +00:00
|
|
|
break;
|
|
|
|
}
|
2019-09-04 07:59:40 +00:00
|
|
|
audiofuncs->RawAudio(-1, auddata, ctx->pACodecCtx->sample_rate, auddatasize/(channels*width), channels, width, 1);
|
2013-05-04 10:40:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
packet.data = odata;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Free the packet that was allocated by av_read_frame
|
2016-07-12 00:40:13 +00:00
|
|
|
av_packet_unref(&packet);
|
2017-09-20 11:27:13 +00:00
|
|
|
#endif
|
2013-05-04 10:40:05 +00:00
|
|
|
}
|
|
|
|
|
2016-07-12 00:40:13 +00:00
|
|
|
if (forcevideo || repainted)
|
|
|
|
uploadtexture(ectx, TF_BGRA32, ctx->width, ctx->height, ctx->rgb_data, NULL);
|
|
|
|
return true;
|
2013-05-04 10:40:05 +00:00
|
|
|
}
|
|
|
|
static void AVDec_GetSize (void *vctx, int *width, int *height)
|
|
|
|
{
|
|
|
|
struct decctx *ctx = (struct decctx*)vctx;
|
|
|
|
*width = ctx->width;
|
|
|
|
*height = ctx->height;
|
|
|
|
}
|
|
|
|
|
2013-06-23 18:43:59 +00:00
|
|
|
/*static void AVDec_CursorMove (void *vctx, float posx, float posy)
|
2013-05-04 10:40:05 +00:00
|
|
|
{
|
|
|
|
//its a video, dumbass
|
|
|
|
}
|
|
|
|
static void AVDec_Key (void *vctx, int code, int unicode, int isup)
|
|
|
|
{
|
|
|
|
//its a video, dumbass
|
|
|
|
}
|
|
|
|
static void AVDec_ChangeStream(void *vctx, char *newstream)
|
|
|
|
{
|
|
|
|
}
|
2013-06-23 18:43:59 +00:00
|
|
|
*/
|
2013-05-04 10:40:05 +00:00
|
|
|
static void AVDec_Rewind(void *vctx)
|
|
|
|
{
|
|
|
|
struct decctx *ctx = (struct decctx*)vctx;
|
2017-09-20 11:27:13 +00:00
|
|
|
if (ctx->lasttime != -1)
|
2016-07-12 00:40:13 +00:00
|
|
|
{
|
2017-09-20 11:27:13 +00:00
|
|
|
av_seek_frame(ctx->pFormatCtx, -1, 0, AVSEEK_FLAG_FRAME|AVSEEK_FLAG_BACKWARD);
|
2016-07-12 00:40:13 +00:00
|
|
|
avcodec_flush_buffers(ctx->pVCodecCtx);
|
|
|
|
}
|
|
|
|
ctx->lasttime = -1;
|
2013-05-04 10:40:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
//avcodec has no way to shut down properly.
|
2019-09-04 07:59:40 +00:00
|
|
|
static qboolean AVDec_Shutdown(void)
|
2013-05-04 10:40:05 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
static media_decoder_funcs_t decoderfuncs =
|
|
|
|
{
|
2016-07-12 00:40:13 +00:00
|
|
|
sizeof(media_decoder_funcs_t),
|
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
|
|
|
DECODERNAME,
|
2013-05-04 10:40:05 +00:00
|
|
|
AVDec_Create,
|
|
|
|
AVDec_DisplayFrame,
|
|
|
|
AVDec_Destroy,
|
|
|
|
AVDec_Rewind,
|
|
|
|
|
|
|
|
NULL,//AVDec_CursorMove,
|
|
|
|
NULL,//AVDec_Key,
|
|
|
|
NULL,//AVDec_SetSize,
|
|
|
|
AVDec_GetSize,
|
|
|
|
NULL,//AVDec_ChangeStream
|
|
|
|
};
|
|
|
|
|
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
|
|
|
qboolean AVDec_Init(void)
|
2013-05-04 10:40:05 +00:00
|
|
|
{
|
2019-09-04 07:59:40 +00:00
|
|
|
filefuncs = plugfuncs->GetEngineInterface(plugfsfuncs_name, sizeof(*filefuncs));
|
|
|
|
audiofuncs = plugfuncs->GetEngineInterface(plugaudiofuncs_name, sizeof(*audiofuncs));
|
|
|
|
if (!filefuncs ||
|
|
|
|
!plugfuncs->ExportInterface("Media_VideoDecoder", &decoderfuncs, sizeof(decoderfuncs)))
|
2013-05-04 10:40:05 +00:00
|
|
|
{
|
playdemo accepts https urls now. will start playing before the file has finished downloading, to avoid unnecessary delays.
reworked network addresses to separate address family and connection type. this should make banning people more reliable, as well as simplifying a whole load of logic (no need to check for ipv4 AND ipv6).
tcpconnect will keep trying to connect even if the connection wasn't instant, instead of giving up instantly.
rewrote tcp connections quite a bit. sv_port_tcp now handles qtv+qizmo+http+ws+rtcbroker+tls equivalents.
qtv_streamport is now a legacy cvar and now acts equivalently to sv_port_tcp (but still separate).
rewrote screenshot and video capture code to use strides. this solves image-is-upside down issues with vulkan.
ignore alt key in browser port. oh no! no more red text! oh no! no more alt-being-wrongly-down-and-being-unable-to-type-anything-without-forcing-alt-released!
reworked audio decoder interface. now has clearly defined success/unavailable/end-of-file results. this should solve a whole load of issues with audio streaming.
fixed various openal audio streaming issues too. openal also got some workarounds for emscripten's poor emulation.
fixed ogg decoder to retain sync properly if seeked.
updated menu_media a bit. now reads vorbis comments/id3v1 tags to get proper track names. also saves the playlist so you don't have to manually repopulate the list so it might actually be usable now (after how many years?)
r_stains now defaults to 0, and is no longer enabled by presets. use decals if you want that sort of thing.
added fs_noreexec cvar, so configs will not be reexeced on gamedir change. this also means defaults won't be reapplied, etc.
added 'nvvk' renderer on windows, using nvidia's vulkan-inside-opengl gl extension. mostly just to see how much slower it is.
fixed up the ftp server quite a lot. more complete, more compliant, and should do ipv6 properly to-boot. file transfers also threaded.
fixed potential crash inside runclientphys.
experimental sv_antilag=3 setting. totally untested. the aim is to avoid missing due to lagged knockbacks. may be expensive for the server.
browser port's websockets support fixed. experimental support for webrtc ('works for me', requires a broker server).
updated avplug(renamed to ffmpeg so people know what it is) to use ffmpeg 3.2.4 properly, with its new encoder api. should be much more robust... also added experimental audio decoder for game music etc (currently doesn't resample, so playback rates are screwed, disabled by cvar).
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5097 fc73d0e0-1445-4013-8a0c-d673dee63da5
2017-05-10 02:08:58 +00:00
|
|
|
Con_Printf(DECODERNAME": Engine doesn't support media decoder plugins\n");
|
2013-05-04 10:40:05 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|