summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2013-12-10 21:14:13 -0600
committerTim Angus <tim@ngus.net>2016-04-07 11:50:43 +0100
commit975d4d97e4b9459c3d21b4dc3ecd807e9c330d9a (patch)
treeff58ec02fe6d22a097f71d1163c3527bc9abcea1 /Makefile
parentfae2cb94e089fabe9a69d0909a5c25e1014cb25f (diff)
Use Opus for VoIP
Server/client VoIP protocol is handled by adding new cvars cl_voipProtocol and sv_voipProtocol, sv_voip and cl_voip are used to auto set/clear them. All users need to touch are cl/sv_voip as 0 or 1 just like before. Old Speex VoIP packets in demos are skipped. New VoIP packets are skipped in demos if sv_voipProtocol doesn't match cl_voipProtocol. Notable difference between usage of speex and opus codecs, when using Speex client would be sent 80ms at a time. Using Opus, 60ms is sent at a time. This was changed because the Opus codec supports encoding up to 60ms at a time. (Simpler to send only one codec frame in a packet.)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile76
1 files changed, 11 insertions, 65 deletions
diff --git a/Makefile b/Makefile
index c1a5b29e..99c184b5 100644
--- a/Makefile
+++ b/Makefile
@@ -188,10 +188,6 @@ ifndef USE_INTERNAL_LIBS
USE_INTERNAL_LIBS=1
endif
-ifndef USE_INTERNAL_SPEEX
-USE_INTERNAL_SPEEX=$(USE_INTERNAL_LIBS)
-endif
-
ifndef USE_INTERNAL_OGG
USE_INTERNAL_OGG=$(USE_INTERNAL_LIBS)
endif
@@ -246,7 +242,6 @@ CGDIR=$(MOUNT_DIR)/cgame
NDIR=$(MOUNT_DIR)/null
UIDIR=$(MOUNT_DIR)/ui
JPDIR=$(MOUNT_DIR)/jpeg-8c
-SPEEXDIR=$(MOUNT_DIR)/libspeex
OGGDIR=$(MOUNT_DIR)/libogg-1.3.1
VORBISDIR=$(MOUNT_DIR)/libvorbis-1.3.4
OPUSDIR=$(MOUNT_DIR)/opus-1.1
@@ -962,8 +957,18 @@ ifeq ($(USE_CURL),1)
endif
endif
+ifeq ($(USE_VOIP),1)
+ CLIENT_CFLAGS += -DUSE_VOIP
+ SERVER_CFLAGS += -DUSE_VOIP
+ NEED_OPUS=1
+endif
+
ifeq ($(USE_CODEC_OPUS),1)
CLIENT_CFLAGS += -DUSE_CODEC_OPUS
+ NEED_OPUS=1
+endif
+
+ifeq ($(NEED_OPUS),1)
ifeq ($(USE_INTERNAL_OPUS),1)
OPUS_CFLAGS = -DOPUS_BUILD -DHAVE_LRINTF -DFLOATING_POINT -DUSE_ALLOCA \
-I$(OPUSDIR)/include -I$(OPUSDIR)/celt -I$(OPUSDIR)/silk \
@@ -1009,19 +1014,6 @@ ifeq ($(USE_MUMBLE),1)
CLIENT_CFLAGS += -DUSE_MUMBLE
endif
-ifeq ($(USE_VOIP),1)
- CLIENT_CFLAGS += -DUSE_VOIP
- SERVER_CFLAGS += -DUSE_VOIP
- ifeq ($(USE_INTERNAL_SPEEX),1)
- SPEEX_CFLAGS += -DFLOATING_POINT -DUSE_ALLOCA -I$(SPEEXDIR)/include
- else
- SPEEX_CFLAGS ?= $(shell pkg-config --silence-errors --cflags speex speexdsp || true)
- SPEEX_LIBS ?= $(shell pkg-config --silence-errors --libs speex speexdsp || echo -lspeex -lspeexdsp)
- endif
- CLIENT_CFLAGS += $(SPEEX_CFLAGS)
- CLIENT_LIBS += $(SPEEX_LIBS)
-endif
-
ifeq ($(USE_INTERNAL_ZLIB),1)
ZLIB_CFLAGS = -DNO_GZIP -I$(ZDIR)
else
@@ -1722,53 +1714,7 @@ ifeq ($(ARCH),x86_64)
$(B)/client/ftola.o
endif
-ifeq ($(USE_VOIP),1)
-ifeq ($(USE_INTERNAL_SPEEX),1)
-Q3OBJ += \
- $(B)/client/bits.o \
- $(B)/client/buffer.o \
- $(B)/client/cb_search.o \
- $(B)/client/exc_10_16_table.o \
- $(B)/client/exc_10_32_table.o \
- $(B)/client/exc_20_32_table.o \
- $(B)/client/exc_5_256_table.o \
- $(B)/client/exc_5_64_table.o \
- $(B)/client/exc_8_128_table.o \
- $(B)/client/fftwrap.o \
- $(B)/client/filterbank.o \
- $(B)/client/filters.o \
- $(B)/client/gain_table.o \
- $(B)/client/gain_table_lbr.o \
- $(B)/client/hexc_10_32_table.o \
- $(B)/client/hexc_table.o \
- $(B)/client/high_lsp_tables.o \
- $(B)/client/jitter.o \
- $(B)/client/kiss_fft.o \
- $(B)/client/kiss_fftr.o \
- $(B)/client/lpc.o \
- $(B)/client/lsp.o \
- $(B)/client/lsp_tables_nb.o \
- $(B)/client/ltp.o \
- $(B)/client/mdf.o \
- $(B)/client/modes.o \
- $(B)/client/modes_wb.o \
- $(B)/client/nb_celp.o \
- $(B)/client/preprocess.o \
- $(B)/client/quant_lsp.o \
- $(B)/client/resample.o \
- $(B)/client/sb_celp.o \
- $(B)/client/smallft.o \
- $(B)/client/speex.o \
- $(B)/client/speex_callbacks.o \
- $(B)/client/speex_header.o \
- $(B)/client/stereo.o \
- $(B)/client/vbr.o \
- $(B)/client/vq.o \
- $(B)/client/window.o
-endif
-endif
-
-ifeq ($(USE_CODEC_OPUS),1)
+ifeq ($(NEED_OPUS),1)
ifeq ($(USE_INTERNAL_OPUS),1)
Q3OBJ += \
$(B)/client/opus/analysis.o \