Squashed 'libtgvoip/' changes from fc13464..6e7384d

6e7384d Debug stats
a58c5fb Fixed build with TGVOIP_NO_DSP
1b699b3 p2p improvements
be5f739 Merge pull request #73 from bakatrouble/public
5efda7a Fix ARM Linux builds

git-subtree-dir: libtgvoip
git-subtree-split: 6e7384d5a8ddf01cc159392a69a49d816434282c
This commit is contained in:
infactum 2019-02-14 12:27:45 +05:00
parent c76b0a3f0c
commit 0b8cd430a2
14 changed files with 876 additions and 461 deletions

View File

@ -16,6 +16,7 @@
#include "VoIPServerConfig.h" #include "VoIPServerConfig.h"
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <math.h>
using namespace tgvoip; using namespace tgvoip;
@ -144,6 +145,7 @@ void EchoCanceller::Enable(bool enabled){
} }
void EchoCanceller::ProcessInput(int16_t* inOut, size_t numSamples, bool& hasVoice){ void EchoCanceller::ProcessInput(int16_t* inOut, size_t numSamples, bool& hasVoice){
#ifndef TGVOIP_NO_DSP
if(!isOn || (!enableAEC && !enableAGC && !enableNS)){ if(!isOn || (!enableAEC && !enableAGC && !enableNS)){
return; return;
} }
@ -165,6 +167,7 @@ void EchoCanceller::ProcessInput(int16_t* inOut, size_t numSamples, bool& hasVoi
hasVoice=hasVoice || apm->voice_detection()->stream_has_voice(); hasVoice=hasVoice || apm->voice_detection()->stream_has_voice();
} }
memcpy(inOut+480, audioFrame->data(), 480*2); memcpy(inOut+480, audioFrame->data(), 480*2);
#endif
} }
void EchoCanceller::SetAECStrength(int strength){ void EchoCanceller::SetAECStrength(int strength){
@ -182,7 +185,9 @@ void EchoCanceller::SetAECStrength(int strength){
void EchoCanceller::SetVoiceDetectionEnabled(bool enabled){ void EchoCanceller::SetVoiceDetectionEnabled(bool enabled){
enableVAD=enabled; enableVAD=enabled;
#ifndef TGVOIP_NO_DSP
apm->voice_detection()->Enable(enabled); apm->voice_detection()->Enable(enabled);
#endif
} }
using namespace tgvoip::effects; using namespace tgvoip::effects;

View File

@ -365,9 +365,7 @@ SRC += \
./webrtc_dsp/common_audio/vad/webrtc_vad.c \ ./webrtc_dsp/common_audio/vad/webrtc_vad.c \
./webrtc_dsp/common_audio/vad/vad_filterbank.c \ ./webrtc_dsp/common_audio/vad/vad_filterbank.c \
./webrtc_dsp/common_audio/vad/vad_core.c \ ./webrtc_dsp/common_audio/vad/vad_core.c \
./webrtc_dsp/common_audio/vad/vad_gmm.c \ ./webrtc_dsp/common_audio/vad/vad_gmm.c
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c
if TARGET_OS_OSX if TARGET_OS_OSX
CFLAGS += -DWEBRTC_MAC CFLAGS += -DWEBRTC_MAC
@ -395,7 +393,7 @@ endif
if TARGET_CPU_ARM if TARGET_CPU_ARM
SRC += \ SRC += \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.S \ webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.S \
webrtc_dsp/common_audio/signal_processing/spl_sqrt_floor_arm.S webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.S
if TARGET_CPU_ARMV7 if TARGET_CPU_ARMV7
CFLAGS += -mfpu=neon -mfloat-abi=hard CFLAGS += -mfpu=neon -mfloat-abi=hard
CCASFLAGS += -mfpu=neon -mfloat-abi=hard CCASFLAGS += -mfpu=neon -mfloat-abi=hard
@ -409,6 +407,10 @@ webrtc_dsp/modules/audio_processing/ns/nsx_core_neon.c \
webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.cc webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.cc
# webrtc_dsp/common_audio/signal_processing/filter_ar_fast_q12_armv7.S # webrtc_dsp/common_audio/signal_processing/filter_ar_fast_q12_armv7.S
endif endif
else
SRC += \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c
endif endif
# headers # headers

View File

@ -392,9 +392,7 @@ host_triplet = @host@
@ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/webrtc_vad.c \ @ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/webrtc_vad.c \
@ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/vad_filterbank.c \ @ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/vad_filterbank.c \
@ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/vad_core.c \ @ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/vad_core.c \
@ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/vad_gmm.c \ @ENABLE_DSP_TRUE@./webrtc_dsp/common_audio/vad/vad_gmm.c
@ENABLE_DSP_TRUE@webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c \
@ENABLE_DSP_TRUE@webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c
@ENABLE_DSP_TRUE@@TARGET_OS_OSX_TRUE@am__append_11 = -DWEBRTC_MAC @ENABLE_DSP_TRUE@@TARGET_OS_OSX_TRUE@am__append_11 = -DWEBRTC_MAC
@ENABLE_DSP_TRUE@@TARGET_OS_OSX_TRUE@am__append_12 = \ @ENABLE_DSP_TRUE@@TARGET_OS_OSX_TRUE@am__append_12 = \
@ -415,7 +413,7 @@ host_triplet = @host@
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@am__append_18 = \ @ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@am__append_18 = \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.S \ @ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.S \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@webrtc_dsp/common_audio/signal_processing/spl_sqrt_floor_arm.S @ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.S
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@am__append_19 = -mfpu=neon -mfloat-abi=hard @ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@am__append_19 = -mfpu=neon -mfloat-abi=hard
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@am__append_20 = -mfpu=neon -mfloat-abi=hard @ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@am__append_20 = -mfpu=neon -mfloat-abi=hard
@ -429,9 +427,13 @@ host_triplet = @host@
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.cc @ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.cc
# webrtc_dsp/common_audio/signal_processing/filter_ar_fast_q12_armv7.S # webrtc_dsp/common_audio/signal_processing/filter_ar_fast_q12_armv7.S
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_FALSE@am__append_22 = \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_FALSE@webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_FALSE@webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c
# headers # headers
@ENABLE_DSP_TRUE@am__append_22 = \ @ENABLE_DSP_TRUE@am__append_23 = \
@ENABLE_DSP_TRUE@webrtc_dsp/system_wrappers/include/field_trial.h \ @ENABLE_DSP_TRUE@webrtc_dsp/system_wrappers/include/field_trial.h \
@ENABLE_DSP_TRUE@webrtc_dsp/system_wrappers/include/cpu_features_wrapper.h \ @ENABLE_DSP_TRUE@webrtc_dsp/system_wrappers/include/cpu_features_wrapper.h \
@ENABLE_DSP_TRUE@webrtc_dsp/system_wrappers/include/asm_defines.h \ @ENABLE_DSP_TRUE@webrtc_dsp/system_wrappers/include/asm_defines.h \
@ -751,7 +753,7 @@ host_triplet = @host@
@ENABLE_DSP_TRUE@webrtc_dsp/common_audio/vad/vad_sp.h \ @ENABLE_DSP_TRUE@webrtc_dsp/common_audio/vad/vad_sp.h \
@ENABLE_DSP_TRUE@webrtc_dsp/common_audio/vad/vad_filterbank.h @ENABLE_DSP_TRUE@webrtc_dsp/common_audio/vad/vad_filterbank.h
@ENABLE_DSP_FALSE@am__append_23 = -DTGVOIP_NO_DSP @ENABLE_DSP_FALSE@am__append_24 = -DTGVOIP_NO_DSP
subdir = . subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@ -1076,15 +1078,13 @@ am__libtgvoip_la_SOURCES_DIST = VoIPController.cpp Buffers.cpp \
./webrtc_dsp/common_audio/vad/vad_filterbank.c \ ./webrtc_dsp/common_audio/vad/vad_filterbank.c \
./webrtc_dsp/common_audio/vad/vad_core.c \ ./webrtc_dsp/common_audio/vad/vad_core.c \
./webrtc_dsp/common_audio/vad/vad_gmm.c \ ./webrtc_dsp/common_audio/vad/vad_gmm.c \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c \
webrtc_dsp/rtc_base/logging_mac.mm \ webrtc_dsp/rtc_base/logging_mac.mm \
webrtc_dsp/rtc_base/logging_mac.h \ webrtc_dsp/rtc_base/logging_mac.h \
webrtc_dsp/modules/audio_processing/aec/aec_core_sse2.cc \ webrtc_dsp/modules/audio_processing/aec/aec_core_sse2.cc \
webrtc_dsp/modules/audio_processing/utility/ooura_fft_sse2.cc \ webrtc_dsp/modules/audio_processing/utility/ooura_fft_sse2.cc \
audio/AudioIOCallback.cpp \ audio/AudioIOCallback.cpp \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.S \ webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.S \
webrtc_dsp/common_audio/signal_processing/spl_sqrt_floor_arm.S \ webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.S \
webrtc_dsp/common_audio/signal_processing/cross_correlation_neon.c \ webrtc_dsp/common_audio/signal_processing/cross_correlation_neon.c \
webrtc_dsp/common_audio/signal_processing/downsample_fast_neon.c \ webrtc_dsp/common_audio/signal_processing/downsample_fast_neon.c \
webrtc_dsp/common_audio/signal_processing/min_max_operations_neon.c \ webrtc_dsp/common_audio/signal_processing/min_max_operations_neon.c \
@ -1092,6 +1092,8 @@ am__libtgvoip_la_SOURCES_DIST = VoIPController.cpp Buffers.cpp \
webrtc_dsp/modules/audio_processing/aecm/aecm_core_neon.cc \ webrtc_dsp/modules/audio_processing/aecm/aecm_core_neon.cc \
webrtc_dsp/modules/audio_processing/ns/nsx_core_neon.c \ webrtc_dsp/modules/audio_processing/ns/nsx_core_neon.c \
webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.cc \ webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.cc \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.c \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.c \
webrtc_dsp/system_wrappers/include/field_trial.h \ webrtc_dsp/system_wrappers/include/field_trial.h \
webrtc_dsp/system_wrappers/include/cpu_features_wrapper.h \ webrtc_dsp/system_wrappers/include/cpu_features_wrapper.h \
webrtc_dsp/system_wrappers/include/asm_defines.h \ webrtc_dsp/system_wrappers/include/asm_defines.h \
@ -1696,15 +1698,13 @@ am__dirstamp = $(am__leading_dot)dirstamp
@ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/webrtc_vad.lo \ @ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/webrtc_vad.lo \
@ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/vad_filterbank.lo \ @ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/vad_filterbank.lo \
@ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/vad_core.lo \ @ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/vad_core.lo \
@ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/vad_gmm.lo \ @ENABLE_DSP_TRUE@ ./webrtc_dsp/common_audio/vad/vad_gmm.lo
@ENABLE_DSP_TRUE@ webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.lo \
@ENABLE_DSP_TRUE@ webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.lo
@ENABLE_DSP_TRUE@@TARGET_OS_OSX_TRUE@am__objects_5 = webrtc_dsp/rtc_base/logging_mac.lo @ENABLE_DSP_TRUE@@TARGET_OS_OSX_TRUE@am__objects_5 = webrtc_dsp/rtc_base/logging_mac.lo
@ENABLE_DSP_TRUE@@TARGET_CPU_X86_TRUE@am__objects_6 = webrtc_dsp/modules/audio_processing/aec/aec_core_sse2.lo \ @ENABLE_DSP_TRUE@@TARGET_CPU_X86_TRUE@am__objects_6 = webrtc_dsp/modules/audio_processing/aec/aec_core_sse2.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_X86_TRUE@ webrtc_dsp/modules/audio_processing/utility/ooura_fft_sse2.lo @ENABLE_DSP_TRUE@@TARGET_CPU_X86_TRUE@ webrtc_dsp/modules/audio_processing/utility/ooura_fft_sse2.lo
@ENABLE_AUDIO_CALLBACK_TRUE@@ENABLE_DSP_TRUE@am__objects_7 = audio/AudioIOCallback.lo @ENABLE_AUDIO_CALLBACK_TRUE@@ENABLE_DSP_TRUE@am__objects_7 = audio/AudioIOCallback.lo
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@am__objects_8 = webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.lo \ @ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@am__objects_8 = webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/common_audio/signal_processing/spl_sqrt_floor_arm.lo @ENABLE_DSP_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.lo
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@am__objects_9 = webrtc_dsp/common_audio/signal_processing/cross_correlation_neon.lo \ @ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@am__objects_9 = webrtc_dsp/common_audio/signal_processing/cross_correlation_neon.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/common_audio/signal_processing/downsample_fast_neon.lo \ @ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/common_audio/signal_processing/downsample_fast_neon.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/common_audio/signal_processing/min_max_operations_neon.lo \ @ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/common_audio/signal_processing/min_max_operations_neon.lo \
@ -1712,8 +1712,10 @@ am__dirstamp = $(am__leading_dot)dirstamp
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/modules/audio_processing/aecm/aecm_core_neon.lo \ @ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/modules/audio_processing/aecm/aecm_core_neon.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/modules/audio_processing/ns/nsx_core_neon.lo \ @ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/modules/audio_processing/ns/nsx_core_neon.lo \
@ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.lo @ENABLE_DSP_TRUE@@TARGET_CPU_ARMV7_TRUE@@TARGET_CPU_ARM_TRUE@ webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.lo
am__objects_10 = @ENABLE_DSP_TRUE@@TARGET_CPU_ARM_FALSE@am__objects_10 = webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.lo \
am__objects_11 = VoIPController.lo Buffers.lo CongestionControl.lo \ @ENABLE_DSP_TRUE@@TARGET_CPU_ARM_FALSE@ webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.lo
am__objects_11 =
am__objects_12 = VoIPController.lo Buffers.lo CongestionControl.lo \
EchoCanceller.lo JitterBuffer.lo logging.lo MediaStreamItf.lo \ EchoCanceller.lo JitterBuffer.lo logging.lo MediaStreamItf.lo \
MessageThread.lo NetworkSocket.lo OpusDecoder.lo \ MessageThread.lo NetworkSocket.lo OpusDecoder.lo \
OpusEncoder.lo PacketReassembler.lo VoIPGroupController.lo \ OpusEncoder.lo PacketReassembler.lo VoIPGroupController.lo \
@ -1723,10 +1725,11 @@ am__objects_11 = VoIPController.lo Buffers.lo CongestionControl.lo \
video/VideoRenderer.lo json11.lo $(am__objects_1) \ video/VideoRenderer.lo json11.lo $(am__objects_1) \
$(am__objects_2) $(am__objects_3) $(am__objects_4) \ $(am__objects_2) $(am__objects_3) $(am__objects_4) \
$(am__objects_5) $(am__objects_6) $(am__objects_7) \ $(am__objects_5) $(am__objects_6) $(am__objects_7) \
$(am__objects_8) $(am__objects_9) $(am__objects_10) $(am__objects_8) $(am__objects_9) $(am__objects_10) \
am__objects_12 = $(am__objects_10) $(am__objects_10) $(am__objects_10) \ $(am__objects_11)
$(am__objects_10) am__objects_13 = $(am__objects_11) $(am__objects_11) $(am__objects_11) \
am_libtgvoip_la_OBJECTS = $(am__objects_11) $(am__objects_12) $(am__objects_11)
am_libtgvoip_la_OBJECTS = $(am__objects_12) $(am__objects_13)
libtgvoip_la_OBJECTS = $(am_libtgvoip_la_OBJECTS) libtgvoip_la_OBJECTS = $(am_libtgvoip_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@) AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@ -2043,8 +2046,8 @@ am__depfiles_remade = ./$(DEPDIR)/Buffers.Plo \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/cross_correlation_neon.Plo \ webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/cross_correlation_neon.Plo \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/downsample_fast_neon.Plo \ webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/downsample_fast_neon.Plo \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/min_max_operations_neon.Plo \ webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/min_max_operations_neon.Plo \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/spl_sqrt_floor_arm.Plo \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor.Plo \ webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor.Plo \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor_arm.Plo \
webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_neon.Plo \ webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_neon.Plo \
webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_sse2.Plo \ webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_sse2.Plo \
webrtc_dsp/modules/audio_processing/aecm/$(DEPDIR)/aecm_core_neon.Plo \ webrtc_dsp/modules/audio_processing/aecm/$(DEPDIR)/aecm_core_neon.Plo \
@ -2198,7 +2201,7 @@ CCASFLAGS = @CCASFLAGS@ $(am__append_9) $(am__append_20)
CCDEPMODE = @CCDEPMODE@ CCDEPMODE = @CCDEPMODE@
CFLAGS = -Wall -DHAVE_CONFIG_H -Wno-unknown-pragmas $(am__append_8) \ CFLAGS = -Wall -DHAVE_CONFIG_H -Wno-unknown-pragmas $(am__append_8) \
$(am__append_11) $(am__append_13) $(am__append_15) \ $(am__append_11) $(am__append_13) $(am__append_15) \
$(am__append_19) $(am__append_23) $(am__append_19) $(am__append_24)
CPP = @CPP@ CPP = @CPP@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
CXX = @CXX@ CXX = @CXX@
@ -2324,7 +2327,8 @@ SRC = VoIPController.cpp Buffers.cpp CongestionControl.cpp \
video/VideoRenderer.cpp json11.cpp $(am__append_1) \ video/VideoRenderer.cpp json11.cpp $(am__append_1) \
$(am__append_4) $(am__append_6) $(am__append_10) \ $(am__append_4) $(am__append_6) $(am__append_10) \
$(am__append_12) $(am__append_14) $(am__append_16) \ $(am__append_12) $(am__append_14) $(am__append_16) \
$(am__append_18) $(am__append_21) $(am__append_22) $(am__append_18) $(am__append_21) $(am__append_22) \
$(am__append_23)
TGVOIP_HDRS = VoIPController.h Buffers.h BlockingQueue.h \ TGVOIP_HDRS = VoIPController.h Buffers.h BlockingQueue.h \
PrivateDefines.h CongestionControl.h EchoCanceller.h \ PrivateDefines.h CongestionControl.h EchoCanceller.h \
JitterBuffer.h logging.h threading.h MediaStreamItf.h \ JitterBuffer.h logging.h threading.h MediaStreamItf.h \
@ -3434,17 +3438,6 @@ webrtc_dsp/common_audio/vad/$(DEPDIR)/$(am__dirstamp):
./webrtc_dsp/common_audio/vad/vad_gmm.lo: \ ./webrtc_dsp/common_audio/vad/vad_gmm.lo: \
webrtc_dsp/common_audio/vad/$(am__dirstamp) \ webrtc_dsp/common_audio/vad/$(am__dirstamp) \
webrtc_dsp/common_audio/vad/$(DEPDIR)/$(am__dirstamp) webrtc_dsp/common_audio/vad/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.lo: \
webrtc_dsp/common_audio/signal_processing/$(am__dirstamp) \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp):
@$(MKDIR_P) webrtc_dsp/common_audio/third_party/spl_sqrt_floor
@: > webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)
@: > webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.lo: webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp) \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/rtc_base/logging_mac.lo: \ webrtc_dsp/rtc_base/logging_mac.lo: \
webrtc_dsp/rtc_base/$(am__dirstamp) \ webrtc_dsp/rtc_base/$(am__dirstamp) \
webrtc_dsp/rtc_base/$(DEPDIR)/$(am__dirstamp) webrtc_dsp/rtc_base/$(DEPDIR)/$(am__dirstamp)
@ -3459,9 +3452,14 @@ audio/AudioIOCallback.lo: audio/$(am__dirstamp) \
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.lo: \ webrtc_dsp/common_audio/signal_processing/complex_bit_reverse_arm.lo: \
webrtc_dsp/common_audio/signal_processing/$(am__dirstamp) \ webrtc_dsp/common_audio/signal_processing/$(am__dirstamp) \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/$(am__dirstamp) webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/signal_processing/spl_sqrt_floor_arm.lo: \ webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp):
webrtc_dsp/common_audio/signal_processing/$(am__dirstamp) \ @$(MKDIR_P) webrtc_dsp/common_audio/third_party/spl_sqrt_floor
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/$(am__dirstamp) @: > webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)
@: > webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor_arm.lo: webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp) \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/signal_processing/cross_correlation_neon.lo: \ webrtc_dsp/common_audio/signal_processing/cross_correlation_neon.lo: \
webrtc_dsp/common_audio/signal_processing/$(am__dirstamp) \ webrtc_dsp/common_audio/signal_processing/$(am__dirstamp) \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/$(am__dirstamp) webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/$(am__dirstamp)
@ -3483,6 +3481,11 @@ webrtc_dsp/modules/audio_processing/ns/nsx_core_neon.lo: \
webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.lo: \ webrtc_dsp/modules/audio_processing/utility/ooura_fft_neon.lo: \
webrtc_dsp/modules/audio_processing/utility/$(am__dirstamp) \ webrtc_dsp/modules/audio_processing/utility/$(am__dirstamp) \
webrtc_dsp/modules/audio_processing/utility/$(DEPDIR)/$(am__dirstamp) webrtc_dsp/modules/audio_processing/utility/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/signal_processing/complex_bit_reverse.lo: \
webrtc_dsp/common_audio/signal_processing/$(am__dirstamp) \
webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/$(am__dirstamp)
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/spl_sqrt_floor.lo: webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(am__dirstamp) \
webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/$(am__dirstamp)
libtgvoip.la: $(libtgvoip_la_OBJECTS) $(libtgvoip_la_DEPENDENCIES) $(EXTRA_libtgvoip_la_DEPENDENCIES) libtgvoip.la: $(libtgvoip_la_OBJECTS) $(libtgvoip_la_DEPENDENCIES) $(EXTRA_libtgvoip_la_DEPENDENCIES)
$(AM_V_OBJCXXLD)$(OBJCXXLINK) -rpath $(libdir) $(libtgvoip_la_OBJECTS) $(libtgvoip_la_LIBADD) $(LIBS) $(AM_V_OBJCXXLD)$(OBJCXXLINK) -rpath $(libdir) $(libtgvoip_la_OBJECTS) $(libtgvoip_la_LIBADD) $(LIBS)
@ -3885,8 +3888,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/cross_correlation_neon.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/cross_correlation_neon.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/downsample_fast_neon.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/downsample_fast_neon.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/min_max_operations_neon.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/min_max_operations_neon.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/spl_sqrt_floor_arm.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor_arm.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_neon.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_neon.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_sse2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_sse2.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/modules/audio_processing/aecm/$(DEPDIR)/aecm_core_neon.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@webrtc_dsp/modules/audio_processing/aecm/$(DEPDIR)/aecm_core_neon.Plo@am__quote@ # am--include-marker
@ -4748,8 +4751,8 @@ distclean: distclean-am
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/cross_correlation_neon.Plo -rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/cross_correlation_neon.Plo
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/downsample_fast_neon.Plo -rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/downsample_fast_neon.Plo
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/min_max_operations_neon.Plo -rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/min_max_operations_neon.Plo
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/spl_sqrt_floor_arm.Plo
-rm -f webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor.Plo -rm -f webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor.Plo
-rm -f webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor_arm.Plo
-rm -f webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_neon.Plo -rm -f webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_neon.Plo
-rm -f webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_sse2.Plo -rm -f webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_sse2.Plo
-rm -f webrtc_dsp/modules/audio_processing/aecm/$(DEPDIR)/aecm_core_neon.Plo -rm -f webrtc_dsp/modules/audio_processing/aecm/$(DEPDIR)/aecm_core_neon.Plo
@ -5106,8 +5109,8 @@ maintainer-clean: maintainer-clean-am
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/cross_correlation_neon.Plo -rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/cross_correlation_neon.Plo
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/downsample_fast_neon.Plo -rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/downsample_fast_neon.Plo
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/min_max_operations_neon.Plo -rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/min_max_operations_neon.Plo
-rm -f webrtc_dsp/common_audio/signal_processing/$(DEPDIR)/spl_sqrt_floor_arm.Plo
-rm -f webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor.Plo -rm -f webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor.Plo
-rm -f webrtc_dsp/common_audio/third_party/spl_sqrt_floor/$(DEPDIR)/spl_sqrt_floor_arm.Plo
-rm -f webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_neon.Plo -rm -f webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_neon.Plo
-rm -f webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_sse2.Plo -rm -f webrtc_dsp/modules/audio_processing/aec/$(DEPDIR)/aec_core_sse2.Plo
-rm -f webrtc_dsp/modules/audio_processing/aecm/$(DEPDIR)/aecm_core_neon.Plo -rm -f webrtc_dsp/modules/audio_processing/aecm/$(DEPDIR)/aecm_core_neon.Plo

View File

@ -158,6 +158,15 @@ std::string IPv4Address::ToString() const{
#endif #endif
} }
bool IPv4Address::PrefixMatches(const unsigned int prefix, const NetworkAddress &other) const{
const IPv4Address* v4=dynamic_cast<const IPv4Address*>(&other);
if(v4){
uint32_t mask=0xFFFFFFFF << (32-prefix);
return (address & mask) == (v4->address & mask);
}
return false;
}
/*sockaddr &IPv4Address::ToSockAddr(uint16_t port){ /*sockaddr &IPv4Address::ToSockAddr(uint16_t port){
sockaddr_in sa; sockaddr_in sa;
sa.sin_family=AF_INET; sa.sin_family=AF_INET;
@ -198,6 +207,10 @@ std::string IPv6Address::ToString() const{
#endif #endif
} }
bool IPv6Address::PrefixMatches(const unsigned int prefix, const NetworkAddress &other) const{
return false;
}
bool IPv6Address::IsEmpty() const{ bool IPv6Address::IsEmpty() const{
const uint64_t* a=reinterpret_cast<const uint64_t*>(address); const uint64_t* a=reinterpret_cast<const uint64_t*>(address);
return a[0]==0LL && a[1]==0LL; return a[0]==0LL && a[1]==0LL;

View File

@ -31,6 +31,7 @@ namespace tgvoip {
bool operator!=(const NetworkAddress& other) const; bool operator!=(const NetworkAddress& other) const;
virtual ~NetworkAddress()=default; virtual ~NetworkAddress()=default;
virtual bool IsEmpty() const =0; virtual bool IsEmpty() const =0;
virtual bool PrefixMatches(const unsigned int prefix, const NetworkAddress& other) const =0;
}; };
class IPv4Address : public NetworkAddress{ class IPv4Address : public NetworkAddress{
@ -41,6 +42,11 @@ namespace tgvoip {
virtual std::string ToString() const override; virtual std::string ToString() const override;
uint32_t GetAddress() const; uint32_t GetAddress() const;
virtual bool IsEmpty() const override; virtual bool IsEmpty() const override;
virtual bool PrefixMatches(const unsigned int prefix, const NetworkAddress& other) const override;
static const IPv4Address Broadcast(){
return IPv4Address(0xFFFFFFFF);
}
private: private:
uint32_t address; uint32_t address;
}; };
@ -53,6 +59,7 @@ namespace tgvoip {
virtual std::string ToString() const override; virtual std::string ToString() const override;
const uint8_t* GetAddress() const; const uint8_t* GetAddress() const;
virtual bool IsEmpty() const override; virtual bool IsEmpty() const override;
virtual bool PrefixMatches(const unsigned int prefix, const NetworkAddress& other) const override;
private: private:
uint8_t address[16]; uint8_t address[16];
}; };

View File

@ -40,6 +40,9 @@ public:
void SetVadMode(bool vad); void SetVadMode(bool vad);
void AddAudioEffect(effects::AudioEffect* effect); void AddAudioEffect(effects::AudioEffect* effect);
void RemoveAudioEffect(effects::AudioEffect* effect); void RemoveAudioEffect(effects::AudioEffect* effect);
int GetComplexity(){
return complexity;
}
private: private:
static size_t Callback(unsigned char* data, size_t len, void* param); static size_t Callback(unsigned char* data, size_t len, void* param);

View File

@ -26,7 +26,7 @@
#define IS_MOBILE_NETWORK(x) (x==NET_TYPE_GPRS || x==NET_TYPE_EDGE || x==NET_TYPE_3G || x==NET_TYPE_HSPA || x==NET_TYPE_LTE || x==NET_TYPE_OTHER_MOBILE) #define IS_MOBILE_NETWORK(x) (x==NET_TYPE_GPRS || x==NET_TYPE_EDGE || x==NET_TYPE_3G || x==NET_TYPE_HSPA || x==NET_TYPE_LTE || x==NET_TYPE_OTHER_MOBILE)
#define PROTOCOL_NAME 0x50567247 // "GrVP" in little endian (reversed here) #define PROTOCOL_NAME 0x50567247 // "GrVP" in little endian (reversed here)
#define PROTOCOL_VERSION 8 #define PROTOCOL_VERSION 9
#define MIN_PROTOCOL_VERSION 3 #define MIN_PROTOCOL_VERSION 3
#define STREAM_DATA_FLAG_LEN16 0x40 #define STREAM_DATA_FLAG_LEN16 0x40

View File

@ -26,6 +26,7 @@
#include <exception> #include <exception>
#include <stdexcept> #include <stdexcept>
#include <algorithm> #include <algorithm>
#include <sstream>
#include <inttypes.h> #include <inttypes.h>
#include <float.h> #include <float.h>
@ -282,17 +283,17 @@ VoIPController::~VoIPController(){
delete echoCanceller; delete echoCanceller;
} }
delete conctl; delete conctl;
if(tgvoipLogFile){
FILE* log=tgvoipLogFile;
tgvoipLogFile=NULL;
fclose(log);
}
if(statsDump) if(statsDump)
fclose(statsDump); fclose(statsDump);
if(resolvedProxyAddress) if(resolvedProxyAddress)
delete resolvedProxyAddress; delete resolvedProxyAddress;
delete selectCanceller; delete selectCanceller;
LOGD("Left VoIPController::~VoIPController"); LOGD("Left VoIPController::~VoIPController");
if(tgvoipLogFile){
FILE* log=tgvoipLogFile;
tgvoipLogFile=NULL;
fclose(log);
}
} }
void VoIPController::Stop(){ void VoIPController::Stop(){
@ -435,6 +436,7 @@ void VoIPController::SetNetworkType(int type){
activeNetItfName=itfName; activeNetItfName=itfName;
if(isFirstChange) if(isFirstChange)
return; return;
wasNetworkHandover=true;
if(currentEndpoint){ if(currentEndpoint){
const Endpoint& _currentEndpoint=endpoints.at(currentEndpoint); const Endpoint& _currentEndpoint=endpoints.at(currentEndpoint);
const Endpoint& _preferredRelay=endpoints.at(preferredRelay); const Endpoint& _preferredRelay=endpoints.at(preferredRelay);
@ -453,8 +455,8 @@ void VoIPController::SetNetworkType(int type){
} }
}else if(endpoint.type==Endpoint::Type::TCP_RELAY && endpoint.socket){ }else if(endpoint.type==Endpoint::Type::TCP_RELAY && endpoint.socket){
endpoint.socket->Close(); endpoint.socket->Close();
delete endpoint.socket; //delete endpoint.socket;
endpoint.socket=NULL; //endpoint.socket=NULL;
} }
//if(endpoint->type==Endpoint::Type::UDP_P2P_INET){ //if(endpoint->type==Endpoint::Type::UDP_P2P_INET){
endpoint.averageRTT=0; endpoint.averageRTT=0;
@ -650,10 +652,6 @@ void VoIPController::GetStats(TrafficStats *stats){
} }
string VoIPController::GetDebugLog(){ string VoIPController::GetDebugLog(){
vector<json11::Json> lpkts;
for(DebugLoggedPacket& lpkt:debugLoggedPackets){
lpkts.push_back(json11::Json::array{lpkt.timestamp, lpkt.seq, lpkt.length});
}
map<string, json11::Json> network{ map<string, json11::Json> network{
{"type", NetworkTypeToString(networkType)} {"type", NetworkTypeToString(networkType)}
}; };
@ -665,6 +663,23 @@ string VoIPController::GetDebugLog(){
network["mcc"]=carrier.mcc; network["mcc"]=carrier.mcc;
network["mnc"]=carrier.mnc; network["mnc"]=carrier.mnc;
} }
}else if(networkType==NET_TYPE_WIFI){
#ifdef __ANDROID__
jni::DoWithJNI([&](JNIEnv* env){
jmethodID getWifiInfoMethod=env->GetStaticMethodID(jniUtilitiesClass, "getWifiInfo", "()[I");
jintArray res=static_cast<jintArray>(env->CallStaticObjectMethod(jniUtilitiesClass, getWifiInfoMethod));
if(res){
jint* wifiInfo=env->GetIntArrayElements(res, NULL);
network["rssi"]=wifiInfo[0];
network["link_speed"]=wifiInfo[1];
env->ReleaseIntArrayElements(res, wifiInfo, JNI_ABORT);
}
});
#endif
}
/*vector<json11::Json> lpkts;
for(DebugLoggedPacket& lpkt:debugLoggedPackets){
lpkts.push_back(json11::Json::array{lpkt.timestamp, lpkt.seq, lpkt.length});
} }
return json11::Json(json11::Json::object{ return json11::Json(json11::Json::object{
{"log_type", "out_packet_stats"}, {"log_type", "out_packet_stats"},
@ -677,6 +692,50 @@ string VoIPController::GetDebugLog(){
}}, }},
{"call_duration", GetCurrentTime()-connectionInitTime}, {"call_duration", GetCurrentTime()-connectionInitTime},
{"out_packet_stats", lpkts} {"out_packet_stats", lpkts}
}).dump();*/
string p2pType="none";
Endpoint& cur=endpoints[currentEndpoint];
if(cur.type==Endpoint::Type::UDP_P2P_INET)
p2pType=cur.IsIPv6Only() ? "inet6" : "inet";
else if(cur.type==Endpoint::Type::UDP_P2P_LAN)
p2pType="lan";
vector<string> problems;
if(lastError==ERROR_TIMEOUT)
problems.push_back("timeout");
if(wasReconnecting)
problems.push_back("reconnecting");
if(wasExtraEC)
problems.push_back("extra_ec");
if(wasEncoderLaggy)
problems.push_back("encoder_lag");
if(!wasEstablished)
problems.push_back("not_inited");
if(wasNetworkHandover)
problems.push_back("network_handover");
ostringstream prefRelay;
prefRelay << preferredRelay;
return json11::Json(json11::Json::object{
{"log_type", "call_stats"},
{"libtgvoip_version", LIBTGVOIP_VERSION},
{"network", network},
{"protocol_version", std::min(peerVersion, PROTOCOL_VERSION)},
{"udp_avail", udpConnectivityState==UDP_AVAILABLE},
{"tcp_used", useTCP},
{"relay_rtt", (int)(endpoints[preferredRelay].averageRTT*1000.0)},
{"p2p_type", p2pType},
{"rtt", (int)(endpoints[currentEndpoint].averageRTT*1000.0)},
{"packet_stats", json11::Json::object{
{"out", (int)seq},
{"in", (int)packetsReceived},
{"lost_out", (int)conctl->GetSendLossCount()},
{"lost_in", (int)recvLossCount}
}},
{"problems", problems},
{"pref_relay", prefRelay.str()}
}).dump(); }).dump();
} }
@ -869,7 +928,8 @@ vector<uint8_t> VoIPController::GetPersistentState(){
{"tcp", proxySupportsTCP} {"tcp", proxySupportsTCP}
}}); }});
} }
const char* jstr=Json(obj).dump().c_str(); string _jstr=Json(obj).dump();
const char* jstr=_jstr.c_str();
return vector<uint8_t>(jstr, jstr+strlen(jstr)); return vector<uint8_t>(jstr, jstr+strlen(jstr));
} }
@ -1598,6 +1658,15 @@ void VoIPController::RunRecvThread(){
} }
} }
} }
if(!srcEndpointID && packet.protocol==PROTO_UDP){
try{
Endpoint &p2p=GetEndpointByType(Endpoint::Type::UDP_P2P_INET);
if(p2p.rtts[0]==0.0 && p2p.address.PrefixMatches(24, *packet.address)){
LOGD("Packet source matches p2p endpoint partially: %s:%u", packet.address->ToString().c_str(), packet.port);
srcEndpointID=p2p.id;
}
}catch(out_of_range& ex){}
}
}else{ }else{
IPv6Address *src6=dynamic_cast<IPv6Address *>(packet.address); IPv6Address *src6=dynamic_cast<IPv6Address *>(packet.address);
if(src6){ if(src6){
@ -1668,16 +1737,20 @@ bool VoIPController::WasOutgoingPacketAcknowledged(uint32_t seq){
} }
void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcEndpoint){ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcEndpoint){
unsigned char* buffer=packet.data; unsigned char *buffer=packet.data;
size_t len=packet.length; size_t len=packet.length;
BufferInputStream in(buffer, (size_t)len); BufferInputStream in(buffer, (size_t) len);
if(memcmp(buffer, srcEndpoint.type==Endpoint::Type::UDP_RELAY || srcEndpoint.type==Endpoint::Type::TCP_RELAY ? (void*)srcEndpoint.peerTag : (void*)callID, 16)!=0){ bool hasPeerTag=false;
LOGW("Received packet has wrong peerTag"); if(peerVersion<9 || srcEndpoint.type==Endpoint::Type::UDP_RELAY || srcEndpoint.type==Endpoint::Type::TCP_RELAY){
return; if(memcmp(buffer, srcEndpoint.type==Endpoint::Type::UDP_RELAY || srcEndpoint.type==Endpoint::Type::TCP_RELAY ? (void *) srcEndpoint.peerTag : (void *) callID, 16)!=0){
LOGW("Received packet has wrong peerTag");
return;
}
in.Seek(16);
hasPeerTag=true;
} }
in.Seek(16);
if(in.Remaining()>=16 && (srcEndpoint.type==Endpoint::Type::UDP_RELAY || srcEndpoint.type==Endpoint::Type::TCP_RELAY) if(in.Remaining()>=16 && (srcEndpoint.type==Endpoint::Type::UDP_RELAY || srcEndpoint.type==Endpoint::Type::TCP_RELAY)
&& *reinterpret_cast<uint64_t*>(buffer+16)==0xFFFFFFFFFFFFFFFFLL && *reinterpret_cast<uint32_t*>(buffer+24)==0xFFFFFFFF){ && *reinterpret_cast<uint64_t *>(buffer+16)==0xFFFFFFFFFFFFFFFFLL && *reinterpret_cast<uint32_t *>(buffer+24)==0xFFFFFFFF){
// relay special request response // relay special request response
in.Seek(16+12); in.Seek(16+12);
uint32_t tlid=(uint32_t) in.ReadInt32(); uint32_t tlid=(uint32_t) in.ReadInt32();
@ -1690,7 +1763,7 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
in.ReadBytes(myIP, 16); in.ReadBytes(myIP, 16);
int32_t myPort=in.ReadInt32(); int32_t myPort=in.ReadInt32();
//udpConnectivityState=UDP_AVAILABLE; //udpConnectivityState=UDP_AVAILABLE;
LOGV("Received UDP ping reply from %s:%d: date=%d, queryID=%ld, my IP=%s, my port=%d", srcEndpoint.address.ToString().c_str(), srcEndpoint.port, date, (long int)queryID, IPv4Address(*reinterpret_cast<uint32_t*>(myIP+12)).ToString().c_str(), myPort); LOGV("Received UDP ping reply from %s:%d: date=%d, queryID=%ld, my IP=%s, my port=%d", srcEndpoint.address.ToString().c_str(), srcEndpoint.port, date, (long int) queryID, IPv4Address(*reinterpret_cast<uint32_t *>(myIP+12)).ToString().c_str(), myPort);
srcEndpoint.udpPongCount++; srcEndpoint.udpPongCount++;
if(srcEndpoint.IsIPv6Only() && !didSendIPv6Endpoint){ if(srcEndpoint.IsIPv6Only() && !didSendIPv6Endpoint){
IPv6Address realAddr(myIP); IPv6Address realAddr(myIP);
@ -1709,15 +1782,15 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
} }
} }
}else if(tlid==TLID_UDP_REFLECTOR_PEER_INFO){ }else if(tlid==TLID_UDP_REFLECTOR_PEER_INFO){
if(waitingForRelayPeerInfo && in.Remaining()>=16){ if(in.Remaining()>=16){
MutexGuard _m(endpointsMutex); MutexGuard _m(endpointsMutex);
uint32_t myAddr=(uint32_t) in.ReadInt32(); uint32_t myAddr=(uint32_t) in.ReadInt32();
uint32_t myPort=(uint32_t) in.ReadInt32(); uint32_t myPort=(uint32_t) in.ReadInt32();
uint32_t peerAddr=(uint32_t) in.ReadInt32(); uint32_t peerAddr=(uint32_t) in.ReadInt32();
uint32_t peerPort=(uint32_t) in.ReadInt32(); uint32_t peerPort=(uint32_t) in.ReadInt32();
constexpr int64_t p2pID=(int64_t)(FOURCC('P','2','P','4')) << 32; constexpr int64_t p2pID=(int64_t) (FOURCC('P', '2', 'P', '4')) << 32;
constexpr int64_t lanID=(int64_t)(FOURCC('L','A','N','4')) << 32; constexpr int64_t lanID=(int64_t) (FOURCC('L', 'A', 'N', '4')) << 32;
if(currentEndpoint==p2pID || currentEndpoint==lanID) if(currentEndpoint==p2pID || currentEndpoint==lanID)
currentEndpoint=preferredRelay; currentEndpoint=preferredRelay;
@ -1727,25 +1800,27 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
IPv4Address _peerAddr(peerAddr); IPv4Address _peerAddr(peerAddr);
IPv6Address emptyV6(string("::0")); IPv6Address emptyV6(string("::0"));
unsigned char peerTag[16]; unsigned char peerTag[16];
Endpoint p2p(p2pID, (uint16_t) peerPort, _peerAddr, emptyV6, Endpoint::Type::UDP_P2P_INET, peerTag);
endpoints[p2pID]=p2p;
LOGW("Received reflector peer info, my=%s:%u, peer=%s:%u", IPv4Address(myAddr).ToString().c_str(), myPort, IPv4Address(peerAddr).ToString().c_str(), peerPort); LOGW("Received reflector peer info, my=%s:%u, peer=%s:%u", IPv4Address(myAddr).ToString().c_str(), myPort, IPv4Address(peerAddr).ToString().c_str(), peerPort);
if(myAddr==peerAddr){ if(waitingForRelayPeerInfo){
LOGW("Detected LAN"); Endpoint p2p(p2pID, (uint16_t) peerPort, _peerAddr, emptyV6, Endpoint::Type::UDP_P2P_INET, peerTag);
IPv4Address lanAddr(0); endpoints[p2pID]=p2p;
udpSocket->GetLocalInterfaceInfo(&lanAddr, NULL); if(myAddr==peerAddr){
LOGW("Detected LAN");
IPv4Address lanAddr(0);
udpSocket->GetLocalInterfaceInfo(&lanAddr, NULL);
BufferOutputStream pkt(8); BufferOutputStream pkt(8);
pkt.WriteInt32(lanAddr.GetAddress()); pkt.WriteInt32(lanAddr.GetAddress());
pkt.WriteInt32(udpSocket->GetLocalPort()); pkt.WriteInt32(udpSocket->GetLocalPort());
if(peerVersion<6){ if(peerVersion<6){
SendPacketReliably(PKT_LAN_ENDPOINT, pkt.GetBuffer(), pkt.GetLength(), 0.5, 10); SendPacketReliably(PKT_LAN_ENDPOINT, pkt.GetBuffer(), pkt.GetLength(), 0.5, 10);
}else{ }else{
Buffer buf(move(pkt)); Buffer buf(move(pkt));
SendExtra(buf, EXTRA_TYPE_LAN_ENDPOINT); SendExtra(buf, EXTRA_TYPE_LAN_ENDPOINT);
}
} }
waitingForRelayPeerInfo=false;
} }
waitingForRelayPeerInfo=false;
} }
}else{ }else{
LOGV("Received relay response with unknown tl id: 0x%08X", tlid); LOGV("Received relay response with unknown tl id: 0x%08X", tlid);
@ -1775,7 +1850,7 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
unsigned char sha[SHA1_LENGTH]; unsigned char sha[SHA1_LENGTH];
uint32_t _len=(uint32_t) _in.ReadInt32(); uint32_t _len=(uint32_t) _in.ReadInt32();
if(_len>_in.Remaining()) if(_len>_in.Remaining())
_len=(uint32_t)_in.Remaining(); _len=(uint32_t) _in.Remaining();
crypto.sha1((uint8_t *) (aesOut), (size_t) (_len+4), sha); crypto.sha1((uint8_t *) (aesOut), (size_t) (_len+4), sha);
if(memcmp(msgHash, sha+(SHA1_LENGTH-16), 16)!=0){ if(memcmp(msgHash, sha+(SHA1_LENGTH-16), 16)!=0){
LOGW("Received packet has wrong hash after decryption"); LOGW("Received packet has wrong hash after decryption");
@ -1790,7 +1865,8 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
} }
if(useMTProto2 || retryWith2){ if(useMTProto2 || retryWith2){
in.Seek(16); // peer tag if(hasPeerTag)
in.Seek(16); // peer tag
unsigned char fingerprint[8], msgKey[16]; unsigned char fingerprint[8], msgKey[16];
if(!shortFormat){ if(!shortFormat){
@ -1833,11 +1909,11 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
innerLen=(uint32_t) (shortFormat ? in.ReadInt16() : in.ReadInt32()); innerLen=(uint32_t) (shortFormat ? in.ReadInt16() : in.ReadInt32());
if(innerLen>decryptedLen-sizeSize){ if(innerLen>decryptedLen-sizeSize){
LOGW("Received packet has wrong inner length (%d with total of %u)", (int)innerLen, (unsigned int)decryptedLen); LOGW("Received packet has wrong inner length (%d with total of %u)", (int) innerLen, (unsigned int) decryptedLen);
return; return;
} }
if(decryptedLen-innerLen<(shortFormat ? 16 : 12)){ if(decryptedLen-innerLen<(shortFormat ? 16 : 12)){
LOGW("Received packet has too little padding (%u)", (unsigned int)(decryptedLen-innerLen)); LOGW("Received packet has too little padding (%u)", (unsigned int) (decryptedLen-innerLen));
return; return;
} }
memcpy(buffer, decrypted+(shortFormat ? 2 : 4), innerLen); memcpy(buffer, decrypted+(shortFormat ? 2 : 4), innerLen);
@ -1855,6 +1931,17 @@ void VoIPController::ProcessIncomingPacket(NetworkPacket &packet, Endpoint& srcE
SetState(STATE_ESTABLISHED); SetState(STATE_ESTABLISHED);
} }
if(srcEndpoint.type==Endpoint::Type::UDP_P2P_INET && !srcEndpoint.IsIPv6Only()){
if(srcEndpoint.port!=packet.port || srcEndpoint.address!=*packet.address){
IPv4Address *v4=dynamic_cast<IPv4Address *>(packet.address);
if(v4){
LOGI("Incoming packet was decrypted successfully, changing P2P endpoint to %s:%u", packet.address->ToString().c_str(), packet.port);
srcEndpoint.address=*v4;
srcEndpoint.port=packet.port;
}
}
}
/*decryptedAudioBlock random_id:long random_bytes:string flags:# voice_call_id:flags.2?int128 in_seq_no:flags.4?int out_seq_no:flags.4?int /*decryptedAudioBlock random_id:long random_bytes:string flags:# voice_call_id:flags.2?int128 in_seq_no:flags.4?int out_seq_no:flags.4?int
* recent_received_mask:flags.5?int proto:flags.3?int extra:flags.1?string raw_data:flags.0?string = DecryptedAudioBlock * recent_received_mask:flags.5?int proto:flags.3?int extra:flags.1?string raw_data:flags.0?string = DecryptedAudioBlock
simpleAudioBlock random_id:long random_bytes:string raw_data:string = DecryptedAudioBlock; simpleAudioBlock random_id:long random_bytes:string raw_data:string = DecryptedAudioBlock;
@ -2556,6 +2643,7 @@ void VoIPController::ProcessExtraData(Buffer &data){
endpoints[lanID]=lan; endpoints[lanID]=lan;
}else if(type==EXTRA_TYPE_NETWORK_CHANGED){ }else if(type==EXTRA_TYPE_NETWORK_CHANGED){
LOGI("Peer network changed"); LOGI("Peer network changed");
wasNetworkHandover=true;
const Endpoint& _currentEndpoint=endpoints.at(currentEndpoint); const Endpoint& _currentEndpoint=endpoints.at(currentEndpoint);
if(_currentEndpoint.type!=Endpoint::Type::UDP_RELAY && _currentEndpoint.type!=Endpoint::Type::TCP_RELAY) if(_currentEndpoint.type!=Endpoint::Type::UDP_RELAY && _currentEndpoint.type!=Endpoint::Type::TCP_RELAY)
currentEndpoint=preferredRelay; currentEndpoint=preferredRelay;
@ -2695,7 +2783,7 @@ void VoIPController::SendPacket(unsigned char *data, size_t len, Endpoint& ep, P
BufferOutputStream out(len+128); BufferOutputStream out(len+128);
if(ep.type==Endpoint::Type::UDP_RELAY || ep.type==Endpoint::Type::TCP_RELAY) if(ep.type==Endpoint::Type::UDP_RELAY || ep.type==Endpoint::Type::TCP_RELAY)
out.WriteBytes((unsigned char*)ep.peerTag, 16); out.WriteBytes((unsigned char*)ep.peerTag, 16);
else else if(peerVersion<9)
out.WriteBytes(callID, 16); out.WriteBytes(callID, 16);
if(len>0){ if(len>0){
if(useMTProto2){ if(useMTProto2){
@ -3502,6 +3590,7 @@ void VoIPController::UpdateCongestion(){
LOGW("Enabling extra EC"); LOGW("Enabling extra EC");
if(needRateFlags & NEED_RATE_FLAG_SHITTY_INTERNET_MODE) if(needRateFlags & NEED_RATE_FLAG_SHITTY_INTERNET_MODE)
needRate=true; needRate=true;
wasExtraEC=true;
} }
} }
@ -3541,6 +3630,8 @@ void VoIPController::UpdateCongestion(){
encoder->SetSecondaryEncoderEnabled(false); encoder->SetSecondaryEncoderEnabled(false);
LOGW("Disabling extra EC"); LOGW("Disabling extra EC");
} }
if(!wasEncoderLaggy && encoder->GetComplexity()<10)
wasEncoderLaggy=true;
} }
} }
@ -3570,6 +3661,7 @@ void VoIPController::UpdateAudioBitrate(){
SetState(STATE_RECONNECTING); SetState(STATE_RECONNECTING);
if(needRateFlags & NEED_RATE_FLAG_RECONNECTING) if(needRateFlags & NEED_RATE_FLAG_RECONNECTING)
needRate=true; needRate=true;
wasReconnecting=true;
ResetUdpAvailability(); ResetUdpAvailability();
} }

View File

@ -751,7 +751,13 @@ namespace tgvoip{
std::vector<SentVideoFrame> sentVideoFrames; std::vector<SentVideoFrame> sentVideoFrames;
Mutex sentVideoFramesMutex; Mutex sentVideoFramesMutex;
bool videoKeyframeRequested=false; bool videoKeyframeRequested=false;
/*** debug report problems ***/
bool wasReconnecting=false;
bool wasExtraEC=false;
bool wasEncoderLaggy=false;
bool wasNetworkHandover=false;
/*** persistable state values ***/ /*** persistable state values ***/
bool proxySupportsUDP=true; bool proxySupportsUDP=true;
bool proxySupportsTCP=true; bool proxySupportsTCP=true;

119
aclocal.m4 vendored
View File

@ -22,7 +22,7 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
# #
# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Copyright (C) 1996-2001, 2003-2018 Free Software Foundation, Inc.
# Written by Gordon Matzigkeit, 1996 # Written by Gordon Matzigkeit, 1996
# #
# This file is free software; the Free Software Foundation gives # This file is free software; the Free Software Foundation gives
@ -241,8 +241,8 @@ esac
ofile=libtool ofile=libtool
can_build_shared=yes can_build_shared=yes
# All known linkers require a '.a' archive for static linking (except MSVC, # All known linkers require a '.a' archive for static linking (except MSVC and
# which needs '.lib'). # ICC, which need '.lib').
libext=a libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld with_gnu_ld=$lt_cv_prog_gnu_ld
@ -1056,8 +1056,8 @@ int forced_loaded() { return 2;}
_LT_EOF _LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
$AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
cat > conftest.c << _LT_EOF cat > conftest.c << _LT_EOF
@ -1507,9 +1507,22 @@ need_locks=$enable_libtool_lock
m4_defun([_LT_PROG_AR], m4_defun([_LT_PROG_AR],
[AC_CHECK_TOOLS(AR, [ar], false) [AC_CHECK_TOOLS(AR, [ar], false)
: ${AR=ar} : ${AR=ar}
: ${AR_FLAGS=cru}
_LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR], [1], [The archiver])
_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
# higher priority because thats what people were doing historically (setting
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
# variable obsoleted/removed.
test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
lt_ar_flags=$AR_FLAGS
_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
[Flags to create an archive])
AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
[lt_cv_ar_at_file=no [lt_cv_ar_at_file=no
@ -2221,26 +2234,35 @@ m4_defun([_LT_CMD_STRIPLIB],
striplib= striplib=
old_striplib= old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible]) AC_MSG_CHECKING([whether stripping libraries is possible])
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then if test -z "$STRIP"; then
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" AC_MSG_RESULT([no])
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
else else
# FIXME - insert some real tests, host_os isn't really good enough if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
case $host_os in old_striplib="$STRIP --strip-debug"
darwin*) striplib="$STRIP --strip-unneeded"
if test -n "$STRIP"; then AC_MSG_RESULT([yes])
else
case $host_os in
darwin*)
# FIXME - insert some real tests, host_os isn't really good enough
striplib="$STRIP -x" striplib="$STRIP -x"
old_striplib="$STRIP -S" old_striplib="$STRIP -S"
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
else ;;
freebsd*)
if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
old_striplib="$STRIP --strip-debug"
striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
;;
*)
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi ;;
;; esac
*) fi
AC_MSG_RESULT([no])
;;
esac
fi fi
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
_LT_DECL([], [striplib], [1]) _LT_DECL([], [striplib], [1])
@ -2579,8 +2601,8 @@ m4_if([$1], [],[
dynamic_linker='Win32 ld.exe' dynamic_linker='Win32 ld.exe'
;; ;;
*,cl*) *,cl* | *,icl*)
# Native MSVC # Native MSVC or ICC
libname_spec='$name' libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib' library_names_spec='$libname.dll.lib'
@ -2636,7 +2658,7 @@ m4_if([$1], [],[
;; ;;
*) *)
# Assume MSVC wrapper # Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe' dynamic_linker='Win32 ld.exe'
;; ;;
@ -4024,7 +4046,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function, # Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable. # D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++, # Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?. # which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\ lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\ " {last_section=section; section=\$ 3};"\
@ -4933,7 +4955,7 @@ m4_if([$1], [CXX], [
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else else
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi fi
;; ;;
pw32*) pw32*)
@ -4941,7 +4963,7 @@ m4_if([$1], [CXX], [
;; ;;
cygwin* | mingw* | cegcc*) cygwin* | mingw* | cegcc*)
case $cc_basename in case $cc_basename in
cl*) cl* | icl*)
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;; ;;
*) *)
@ -4998,15 +5020,15 @@ dnl Note also adjust exclude_expsyms for C++ above.
case $host_os in case $host_os in
cygwin* | mingw* | pw32* | cegcc*) cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using # When not using gcc, we currently assume that we are using
# Microsoft Visual C++. # Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then if test yes != "$GCC"; then
with_gnu_ld=no with_gnu_ld=no
fi fi
;; ;;
interix*) interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes with_gnu_ld=yes
;; ;;
openbsd* | bitrig*) openbsd* | bitrig*)
@ -5170,6 +5192,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def' emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;; ;;
interix[[3-9]]*) interix[[3-9]]*)
@ -5387,7 +5410,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else else
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi fi
aix_use_runtimelinking=no aix_use_runtimelinking=no
@ -5570,12 +5593,12 @@ _LT_EOF
cygwin* | mingw* | pw32* | cegcc*) cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using # When not using gcc, we currently assume that we are using
# Microsoft Visual C++. # Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is # hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs. # no search path for DLLs.
case $cc_basename in case $cc_basename in
cl*) cl* | icl*)
# Native MSVC # Native MSVC or ICC
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(always_export_symbols, $1)=yes
@ -5616,7 +5639,7 @@ _LT_EOF
fi' fi'
;; ;;
*) *)
# Assume MSVC wrapper # Assume MSVC and ICC wrapper
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Tell ltmain to make .lib files, not .a files. # Tell ltmain to make .lib files, not .a files.
@ -5875,6 +5898,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def' emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;; ;;
osf3*) osf3*)
@ -6641,8 +6665,8 @@ if test yes != "$_lt_caught_CXX_error"; then
cygwin* | mingw* | pw32* | cegcc*) cygwin* | mingw* | pw32* | cegcc*)
case $GXX,$cc_basename in case $GXX,$cc_basename in
,cl* | no,cl*) ,cl* | no,cl* | ,icl* | no,icl*)
# Native MSVC # Native MSVC or ICC
# hardcode_libdir_flag_spec is actually meaningless, as there is # hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs. # no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
@ -6740,6 +6764,7 @@ if test yes != "$_lt_caught_CXX_error"; then
emximp -o $lib $output_objdir/$libname.def' emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;; ;;
dgux*) dgux*)
@ -8370,7 +8395,7 @@ _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
# Helper functions for option handling. -*- Autoconf -*- # Helper functions for option handling. -*- Autoconf -*-
# #
# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Copyright (C) 2004-2005, 2007-2009, 2011-2018 Free Software
# Foundation, Inc. # Foundation, Inc.
# Written by Gary V. Vaughan, 2004 # Written by Gary V. Vaughan, 2004
# #
@ -8802,7 +8827,7 @@ LT_OPTION_DEFINE([LTDL_INIT], [convenience],
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
# #
# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Copyright (C) 2004-2005, 2007-2008, 2011-2018 Free Software
# Foundation, Inc. # Foundation, Inc.
# Written by Gary V. Vaughan, 2004 # Written by Gary V. Vaughan, 2004
# #
@ -8927,7 +8952,7 @@ m4_define([lt_dict_filter],
# ltversion.m4 -- version numbers -*- Autoconf -*- # ltversion.m4 -- version numbers -*- Autoconf -*-
# #
# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Copyright (C) 2004, 2011-2018 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004 # Written by Scott James Remnant, 2004
# #
# This file is free software; the Free Software Foundation gives # This file is free software; the Free Software Foundation gives
@ -8936,22 +8961,22 @@ m4_define([lt_dict_filter],
# @configure_input@ # @configure_input@
# serial 4179 ltversion.m4 # serial 4221 ltversion.m4
# This file is part of GNU Libtool # This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_VERSION], [2.4.6.42-b88ce])
m4_define([LT_PACKAGE_REVISION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6.42])
AC_DEFUN([LTVERSION_VERSION], AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.6' [macro_version='2.4.6.42-b88ce'
macro_revision='2.4.6' macro_revision='2.4.6.42'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0) _LT_DECL(, macro_revision, 0)
]) ])
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
# #
# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Copyright (C) 2004-2005, 2007, 2009, 2011-2018 Free Software
# Foundation, Inc. # Foundation, Inc.
# Written by Scott James Remnant, 2004. # Written by Scott James Remnant, 2004.
# #

123
configure vendored
View File

@ -3270,8 +3270,8 @@ esac
macro_version='2.4.6' macro_version='2.4.6.42-b88ce'
macro_revision='2.4.6' macro_revision='2.4.6.42'
@ -5973,13 +5973,29 @@ esac
fi fi
: ${AR=ar} : ${AR=ar}
: ${AR_FLAGS=cru}
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
# higher priority because thats what people were doing historically (setting
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
# variable obsoleted/removed.
test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
lt_ar_flags=$AR_FLAGS
# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
@ -6428,7 +6444,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function, # Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable. # D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++, # Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?. # which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK '"\ lt_cv_sys_global_symbol_pipe="$AWK '"\
" {last_section=section; section=\$ 3};"\ " {last_section=section; section=\$ 3};"\
@ -7697,8 +7713,8 @@ int forced_loaded() { return 2;}
_LT_EOF _LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
echo "$AR cru libconftest.a conftest.o" >&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5
$AR cru libconftest.a conftest.o 2>&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5
echo "$RANLIB libconftest.a" >&5 echo "$RANLIB libconftest.a" >&5
$RANLIB libconftest.a 2>&5 $RANLIB libconftest.a 2>&5
cat > conftest.c << _LT_EOF cat > conftest.c << _LT_EOF
@ -8361,8 +8377,8 @@ esac
ofile=libtool ofile=libtool
can_build_shared=yes can_build_shared=yes
# All known linkers require a '.a' archive for static linking (except MSVC, # All known linkers require a '.a' archive for static linking (except MSVC and
# which needs '.lib'). # ICC, which need '.lib').
libext=a libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld with_gnu_ld=$lt_cv_prog_gnu_ld
@ -9285,15 +9301,15 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
case $host_os in case $host_os in
cygwin* | mingw* | pw32* | cegcc*) cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using # When not using gcc, we currently assume that we are using
# Microsoft Visual C++. # Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then if test yes != "$GCC"; then
with_gnu_ld=no with_gnu_ld=no
fi fi
;; ;;
interix*) interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes with_gnu_ld=yes
;; ;;
openbsd* | bitrig*) openbsd* | bitrig*)
@ -9457,6 +9473,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def' emximp -o $lib $output_objdir/$libname.def'
old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes enable_shared_with_static_runtimes=yes
file_list_spec='@'
;; ;;
interix[3-9]*) interix[3-9]*)
@ -9674,7 +9691,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else else
export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi fi
aix_use_runtimelinking=no aix_use_runtimelinking=no
@ -9941,12 +9958,12 @@ fi
cygwin* | mingw* | pw32* | cegcc*) cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using # When not using gcc, we currently assume that we are using
# Microsoft Visual C++. # Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is # hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs. # no search path for DLLs.
case $cc_basename in case $cc_basename in
cl*) cl* | icl*)
# Native MSVC # Native MSVC or ICC
hardcode_libdir_flag_spec=' ' hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported allow_undefined_flag=unsupported
always_export_symbols=yes always_export_symbols=yes
@ -9987,7 +10004,7 @@ fi
fi' fi'
;; ;;
*) *)
# Assume MSVC wrapper # Assume MSVC and ICC wrapper
hardcode_libdir_flag_spec=' ' hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported allow_undefined_flag=unsupported
# Tell ltmain to make .lib files, not .a files. # Tell ltmain to make .lib files, not .a files.
@ -10311,6 +10328,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
emximp -o $lib $output_objdir/$libname.def' emximp -o $lib $output_objdir/$libname.def'
old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes=yes enable_shared_with_static_runtimes=yes
file_list_spec='@'
;; ;;
osf3*) osf3*)
@ -11018,8 +11036,8 @@ cygwin* | mingw* | pw32* | cegcc*)
dynamic_linker='Win32 ld.exe' dynamic_linker='Win32 ld.exe'
;; ;;
*,cl*) *,cl* | *,icl*)
# Native MSVC # Native MSVC or ICC
libname_spec='$name' libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib' library_names_spec='$libname.dll.lib'
@ -11075,7 +11093,7 @@ cygwin* | mingw* | pw32* | cegcc*)
;; ;;
*) *)
# Assume MSVC wrapper # Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe' dynamic_linker='Win32 ld.exe'
;; ;;
@ -12254,30 +12272,41 @@ striplib=
old_striplib= old_striplib=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
$as_echo_n "checking whether stripping libraries is possible... " >&6; } $as_echo_n "checking whether stripping libraries is possible... " >&6; }
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then if test -z "$STRIP"; then
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
test -z "$striplib" && striplib="$STRIP --strip-unneeded" $as_echo "no" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else else
# FIXME - insert some real tests, host_os isn't really good enough if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
case $host_os in old_striplib="$STRIP --strip-debug"
darwin*) striplib="$STRIP --strip-unneeded"
if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
case $host_os in
darwin*)
# FIXME - insert some real tests, host_os isn't really good enough
striplib="$STRIP -x" striplib="$STRIP -x"
old_striplib="$STRIP -S" old_striplib="$STRIP -S"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; } $as_echo "yes" >&6; }
else ;;
freebsd*)
if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
old_striplib="$STRIP --strip-debug"
striplib="$STRIP --strip-unneeded"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
;;
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; } $as_echo "no" >&6; }
fi ;;
;; esac
*) fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
;;
esac
fi fi
@ -13464,8 +13493,8 @@ fi
cygwin* | mingw* | pw32* | cegcc*) cygwin* | mingw* | pw32* | cegcc*)
case $GXX,$cc_basename in case $GXX,$cc_basename in
,cl* | no,cl*) ,cl* | no,cl* | ,icl* | no,icl*)
# Native MSVC # Native MSVC or ICC
# hardcode_libdir_flag_spec is actually meaningless, as there is # hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs. # no search path for DLLs.
hardcode_libdir_flag_spec_CXX=' ' hardcode_libdir_flag_spec_CXX=' '
@ -13595,6 +13624,7 @@ fi
emximp -o $lib $output_objdir/$libname.def' emximp -o $lib $output_objdir/$libname.def'
old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
enable_shared_with_static_runtimes_CXX=yes enable_shared_with_static_runtimes_CXX=yes
file_list_spec_CXX='@'
;; ;;
dgux*) dgux*)
@ -15030,7 +15060,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else else
export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi fi
;; ;;
pw32*) pw32*)
@ -15038,7 +15068,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
;; ;;
cygwin* | mingw* | cegcc*) cygwin* | mingw* | cegcc*)
case $cc_basename in case $cc_basename in
cl*) cl* | icl*)
exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;; ;;
*) *)
@ -15400,8 +15430,8 @@ cygwin* | mingw* | pw32* | cegcc*)
dynamic_linker='Win32 ld.exe' dynamic_linker='Win32 ld.exe'
;; ;;
*,cl*) *,cl* | *,icl*)
# Native MSVC # Native MSVC or ICC
libname_spec='$name' libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib' library_names_spec='$libname.dll.lib'
@ -15457,7 +15487,7 @@ cygwin* | mingw* | pw32* | cegcc*)
;; ;;
*) *)
# Assume MSVC wrapper # Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe' dynamic_linker='Win32 ld.exe'
;; ;;
@ -19370,6 +19400,7 @@ want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`'
AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
@ -19552,7 +19583,6 @@ want_nocaseglob \
DLLTOOL \ DLLTOOL \
sharedlib_from_linklib_cmd \ sharedlib_from_linklib_cmd \
AR \ AR \
AR_FLAGS \
archiver_list_spec \ archiver_list_spec \
STRIP \ STRIP \
RANLIB \ RANLIB \
@ -20561,8 +20591,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
# The archiver. # The archiver.
AR=$lt_AR AR=$lt_AR
# Flags to create an archive (by configure).
lt_ar_flags=$lt_ar_flags
# Flags to create an archive. # Flags to create an archive.
AR_FLAGS=$lt_AR_FLAGS AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"}
# How to feed a file listing to the archiver. # How to feed a file listing to the archiver.
archiver_list_spec=$lt_archiver_list_spec archiver_list_spec=$lt_archiver_list_spec

View File

@ -58,9 +58,10 @@ static void dump(NullStruct, string &out) {
static void dump(double value, string &out) { static void dump(double value, string &out) {
if (std::isfinite(value)) { if (std::isfinite(value)) {
char buf[32]; std::ostringstream stm;
snprintf(buf, sizeof buf, "%.17g", value); stm.imbue(std::locale("C"));
out += buf; stm << value;
out += stm.str();
} else { } else {
out += "null"; out += "null";
} }

770
ltmain.sh

File diff suppressed because it is too large Load Diff

View File

@ -48,6 +48,9 @@ NetworkSocketPosix::NetworkSocketPosix(NetworkProtocol protocol) : NetworkSocket
} }
NetworkSocketPosix::~NetworkSocketPosix(){ NetworkSocketPosix::~NetworkSocketPosix(){
if(fd>=0){
Close();
}
if(tcpConnectedAddress) if(tcpConnectedAddress)
delete tcpConnectedAddress; delete tcpConnectedAddress;
if(pendingOutgoingPacket) if(pendingOutgoingPacket)
@ -139,9 +142,9 @@ void NetworkSocketPosix::Send(NetworkPacket *packet){
addr.sin6_family=AF_INET6; addr.sin6_family=AF_INET6;
} }
addr.sin6_port=htons(packet->port); addr.sin6_port=htons(packet->port);
res=sendto(fd, packet->data, packet->length, 0, (const sockaddr *) &addr, sizeof(addr)); res=(int)sendto(fd, packet->data, packet->length, 0, (const sockaddr *) &addr, sizeof(addr));
}else{ }else{
res=send(fd, packet->data, packet->length, 0); res=(int)send(fd, packet->data, packet->length, 0);
} }
if(res<=0){ if(res<=0){
if(errno==EAGAIN || errno==EWOULDBLOCK){ if(errno==EAGAIN || errno==EWOULDBLOCK){
@ -220,7 +223,7 @@ void NetworkSocketPosix::Receive(NetworkPacket *packet){
packet->protocol=PROTO_UDP; packet->protocol=PROTO_UDP;
packet->port=ntohs(srcAddr.sin6_port); packet->port=ntohs(srcAddr.sin6_port);
}else if(protocol==PROTO_TCP){ }else if(protocol==PROTO_TCP){
int res=recv(fd, packet->data, packet->length, 0); int res=(int)recv(fd, packet->data, packet->length, 0);
if(res<=0){ if(res<=0){
LOGE("Error receiving from TCP socket: %d / %s", errno, strerror(errno)); LOGE("Error receiving from TCP socket: %d / %s", errno, strerror(errno));
failed=true; failed=true;
@ -341,7 +344,7 @@ void NetworkSocketPosix::Connect(const NetworkAddress *address, uint16_t port){
timeout.tv_sec=60; timeout.tv_sec=60;
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
fcntl(fd, F_SETFL, O_NONBLOCK); fcntl(fd, F_SETFL, O_NONBLOCK);
int res=connect(fd, (const sockaddr*) addr, addrLen); int res=(int)connect(fd, (const sockaddr*) addr, (socklen_t)addrLen);
if(res!=0 && errno!=EINVAL && errno!=EINPROGRESS){ if(res!=0 && errno!=EINVAL && errno!=EINPROGRESS){
LOGW("error connecting TCP socket to %s:%u: %d / %s; %d / %s", address->ToString().c_str(), port, res, strerror(res), errno, strerror(errno)); LOGW("error connecting TCP socket to %s:%u: %d / %s; %d / %s", address->ToString().c_str(), port, res, strerror(res), errno, strerror(errno));
close(fd); close(fd);