mirror of
https://github.com/danog/libtgvoip.git
synced 2024-11-26 12:14:39 +01:00
Mark more methods as override, fixes for android
This commit is contained in:
parent
18c7f84476
commit
23fafdf575
@ -1,7 +1,7 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
LOCAL_MODULE := voip
|
||||
LOCAL_CPPFLAGS := -Wall -std=c++11 -DANDROID -finline-functions -ffast-math -Os -fno-strict-aliasing -O3 -frtti -D__STDC_LIMIT_MACROS -Wno-unknown-pragmas
|
||||
LOCAL_CPPFLAGS := -Wall -std=c++17 -DANDROID -finline-functions -ffast-math -Os -fno-strict-aliasing -O3 -frtti -D__STDC_LIMIT_MACROS -Wno-unknown-pragmas
|
||||
LOCAL_CFLAGS := -O3 -DUSE_KISS_FFT -fexceptions -DWEBRTC_APM_DEBUG_DUMP=0 -DWEBRTC_POSIX -DWEBRTC_ANDROID -D__STDC_LIMIT_MACROS -DFIXED_POINT -DWEBRTC_NS_FLOAT
|
||||
LOCAL_EXPORT_LDLIBS := -llog -lOpenSLES
|
||||
|
||||
@ -23,7 +23,6 @@ LOCAL_CFLAGS += $(TGVOIP_ADDITIONAL_CFLAGS)
|
||||
LOCAL_SRC_FILES := \
|
||||
./tools/logging.cpp \
|
||||
./VoIPController.cpp \
|
||||
./VoIPGroupController.cpp \
|
||||
./tools/Buffers.cpp \
|
||||
./tools/BlockingQueue.cpp \
|
||||
./audio/AudioInput.cpp \
|
||||
|
@ -1,6 +1,6 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
CFLAGS = -Wall -DHAVE_CONFIG_H -Wno-unknown-pragmas -g
|
||||
CFLAGS = -Wall -DHAVE_CONFIG_H -Wno-unknown-pragmas -g -Wsuggest-override
|
||||
|
||||
lib_LTLIBRARIES = libtgvoip.la
|
||||
|
||||
|
@ -2274,9 +2274,10 @@ CCAS = @CCAS@
|
||||
CCASDEPMODE = @CCASDEPMODE@
|
||||
CCASFLAGS = @CCASFLAGS@ $(am__append_9) $(am__append_20)
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = -Wall -DHAVE_CONFIG_H -Wno-unknown-pragmas -g $(am__append_8) \
|
||||
$(am__append_11) $(am__append_13) $(am__append_15) \
|
||||
$(am__append_19) $(am__append_24)
|
||||
CFLAGS = -Wall -DHAVE_CONFIG_H -Wno-unknown-pragmas -g \
|
||||
-Wsuggest-override $(am__append_8) $(am__append_11) \
|
||||
$(am__append_13) $(am__append_15) $(am__append_19) \
|
||||
$(am__append_24)
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
|
@ -10,10 +10,10 @@
|
||||
#ifndef TGVOIP_USE_CUSTOM_CRYPTO
|
||||
extern "C"
|
||||
{
|
||||
#include <openssl/sha.h>
|
||||
#include <openssl/aes.h>
|
||||
#include <openssl/modes.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/sha.h>
|
||||
}
|
||||
|
||||
void tgvoip_openssl_aes_ige_encrypt(uint8_t *in, uint8_t *out, size_t length, uint8_t *key, uint8_t *iv)
|
||||
@ -198,13 +198,13 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void setOnStateUpdated(std::function<void(TgVoipState)> onStateUpdated)
|
||||
void setOnStateUpdated(std::function<void(TgVoipState)> onStateUpdated) override
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_onStateUpdated);
|
||||
onStateUpdated_ = onStateUpdated;
|
||||
}
|
||||
|
||||
void setOnSignalBarsUpdated(std::function<void(int)> onSignalBarsUpdated)
|
||||
void setOnSignalBarsUpdated(std::function<void(int)> onSignalBarsUpdated) override
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_onSignalBarsUpdated);
|
||||
onSignalBarsUpdated_ = onSignalBarsUpdated;
|
||||
|
@ -13,12 +13,6 @@
|
||||
#include "controller/protocol/VersionInfo.h"
|
||||
#include "controller/protocol/protocol/Index.h"
|
||||
|
||||
#if defined HAVE_CONFIG_H || defined TGVOIP_USE_INSTALLED_OPUS
|
||||
#include <opus/opus.h>
|
||||
#else
|
||||
#include <opus/opus.h>
|
||||
#endif
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include "controller/net/NetworkSocket.h"
|
||||
#include "os/android/AudioInputAndroid.h"
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
return input;
|
||||
}
|
||||
|
||||
virtual std::shared_ptr<AudioOutput> *GetOutput()
|
||||
virtual std::shared_ptr<AudioOutput> GetOutput()
|
||||
{
|
||||
return output;
|
||||
}
|
||||
|
@ -4,6 +4,11 @@
|
||||
#include "../protocol/packets/PacketSender.h"
|
||||
#include <deque>
|
||||
#include <list>
|
||||
#if defined HAVE_CONFIG_H || defined TGVOIP_USE_INSTALLED_OPUS
|
||||
#include <opus/opus.h>
|
||||
#else
|
||||
#include "opus.h"
|
||||
#endif
|
||||
|
||||
namespace tgvoip
|
||||
{
|
||||
|
@ -7,10 +7,10 @@
|
||||
#ifndef LIBTGVOIP_ECHOCANCELLER_H
|
||||
#define LIBTGVOIP_ECHOCANCELLER_H
|
||||
|
||||
#include "tools/threading.h"
|
||||
#include "tools/Buffers.h"
|
||||
#include "tools/BlockingQueue.h"
|
||||
#include "controller/media/MediaStreamItf.h"
|
||||
#include "tools/BlockingQueue.h"
|
||||
#include "tools/Buffers.h"
|
||||
#include "tools/threading.h"
|
||||
#include "tools/utils.h"
|
||||
|
||||
namespace webrtc
|
||||
@ -25,32 +25,32 @@ class EchoCanceller
|
||||
{
|
||||
|
||||
public:
|
||||
TGVOIP_DISALLOW_COPY_AND_ASSIGN(EchoCanceller);
|
||||
EchoCanceller(bool enableAEC, bool enableNS, bool enableAGC);
|
||||
virtual ~EchoCanceller();
|
||||
virtual void Start();
|
||||
virtual void Stop();
|
||||
void SpeakerOutCallback(unsigned char *data, size_t len);
|
||||
void Enable(bool enabled);
|
||||
void ProcessInput(int16_t *inOut, size_t numSamples, bool &hasVoice);
|
||||
void SetAECStrength(int strength);
|
||||
void SetVoiceDetectionEnabled(bool enabled);
|
||||
TGVOIP_DISALLOW_COPY_AND_ASSIGN(EchoCanceller);
|
||||
EchoCanceller(bool enableAEC, bool enableNS, bool enableAGC);
|
||||
virtual ~EchoCanceller();
|
||||
virtual void Start();
|
||||
virtual void Stop();
|
||||
void SpeakerOutCallback(unsigned char *data, size_t len);
|
||||
void Enable(bool enabled);
|
||||
void ProcessInput(int16_t *inOut, size_t numSamples, bool &hasVoice);
|
||||
void SetAECStrength(int strength);
|
||||
void SetVoiceDetectionEnabled(bool enabled);
|
||||
|
||||
private:
|
||||
bool enableAEC;
|
||||
bool enableAGC;
|
||||
bool enableNS;
|
||||
bool enableVAD = false;
|
||||
bool isOn;
|
||||
bool enableAEC;
|
||||
bool enableAGC;
|
||||
bool enableNS;
|
||||
bool enableVAD = false;
|
||||
bool isOn;
|
||||
#ifndef TGVOIP_NO_DSP
|
||||
webrtc::AudioProcessing *apm = NULL;
|
||||
webrtc::AudioFrame *audioFrame = NULL;
|
||||
void RunBufferFarendThread();
|
||||
bool didBufferFarend;
|
||||
Thread *bufferFarendThread;
|
||||
BlockingQueue<Buffer> *farendQueue;
|
||||
BufferPool<960 * 2, 10> farendBufferPool;
|
||||
bool running;
|
||||
webrtc::AudioProcessing *apm = NULL;
|
||||
webrtc::AudioFrame *audioFrame = NULL;
|
||||
void RunBufferFarendThread();
|
||||
bool didBufferFarend;
|
||||
Thread *bufferFarendThread;
|
||||
BlockingQueue<Buffer> *farendQueue;
|
||||
BufferPool<960 * 2, 10> farendBufferPool;
|
||||
bool running;
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -60,29 +60,29 @@ namespace effects
|
||||
class AudioEffect
|
||||
{
|
||||
public:
|
||||
virtual ~AudioEffect() = 0;
|
||||
virtual void Process(int16_t *inOut, size_t numSamples) = 0;
|
||||
virtual void SetPassThrough(bool passThrough);
|
||||
virtual ~AudioEffect() = 0;
|
||||
virtual void Process(int16_t *inOut, size_t numSamples) = 0;
|
||||
virtual void SetPassThrough(bool passThrough);
|
||||
|
||||
protected:
|
||||
bool passThrough = false;
|
||||
bool passThrough = false;
|
||||
};
|
||||
|
||||
class Volume : public AudioEffect
|
||||
{
|
||||
public:
|
||||
Volume();
|
||||
virtual ~Volume();
|
||||
virtual void Process(int16_t *inOut, size_t numSamples);
|
||||
/**
|
||||
Volume();
|
||||
virtual ~Volume();
|
||||
virtual void Process(int16_t *inOut, size_t numSamples) override;
|
||||
/**
|
||||
* Level is (0.0, 2.0]
|
||||
*/
|
||||
void SetLevel(float level);
|
||||
float GetLevel();
|
||||
void SetLevel(float level);
|
||||
float GetLevel();
|
||||
|
||||
private:
|
||||
float level = 1.0f;
|
||||
float multiplier = 1.0f;
|
||||
float level = 1.0f;
|
||||
float multiplier = 1.0f;
|
||||
};
|
||||
|
||||
} // namespace effects
|
||||
|
@ -11,6 +11,11 @@
|
||||
#include <math.h>
|
||||
#include <algorithm>
|
||||
|
||||
#if defined HAVE_CONFIG_H || defined TGVOIP_USE_INSTALLED_OPUS
|
||||
#include <opus/opus.h>
|
||||
#else
|
||||
#include "opus.h"
|
||||
#endif
|
||||
#include "VoIPController.h"
|
||||
|
||||
#define PACKET_SIZE (960 * 2)
|
||||
|
@ -7,17 +7,17 @@
|
||||
#ifndef LIBTGVOIP_OPUSDECODER_H
|
||||
#define LIBTGVOIP_OPUSDECODER_H
|
||||
|
||||
#include "controller/audio/EchoCanceller.h"
|
||||
#include "controller/media/MediaStreamItf.h"
|
||||
#include "tools/threading.h"
|
||||
#include "controller/net/JitterBuffer.h"
|
||||
#include "tools/BlockingQueue.h"
|
||||
#include "tools/Buffers.h"
|
||||
#include "controller/audio/EchoCanceller.h"
|
||||
#include "controller/net/JitterBuffer.h"
|
||||
#include "tools/threading.h"
|
||||
#include "tools/utils.h"
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <stdio.h>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <atomic>
|
||||
|
||||
|
||||
struct OpusDecoder;
|
||||
@ -27,56 +27,56 @@ namespace tgvoip
|
||||
class OpusDecoder
|
||||
{
|
||||
public:
|
||||
TGVOIP_DISALLOW_COPY_AND_ASSIGN(OpusDecoder);
|
||||
virtual void Start();
|
||||
TGVOIP_DISALLOW_COPY_AND_ASSIGN(OpusDecoder);
|
||||
virtual void Start();
|
||||
|
||||
virtual void Stop();
|
||||
virtual void Stop();
|
||||
|
||||
OpusDecoder(const std::shared_ptr<MediaStreamItf> &dst, bool isAsync, bool needEC);
|
||||
OpusDecoder(const std::unique_ptr<MediaStreamItf> &dst, bool isAsync, bool needEC);
|
||||
virtual ~OpusDecoder();
|
||||
size_t HandleCallback(unsigned char *data, size_t len);
|
||||
void SetEchoCanceller(const std::shared_ptr<EchoCanceller> &canceller);
|
||||
void SetFrameDuration(uint32_t duration);
|
||||
void SetJitterBuffer(const std::shared_ptr<JitterBuffer> &jitterBuffer);
|
||||
void SetDTX(bool enable);
|
||||
void SetLevelMeter(const std::shared_ptr<AudioLevelMeter> &levelMeter);
|
||||
void AddAudioEffect(const std::shared_ptr<effects::AudioEffect> &effect);
|
||||
void RemoveAudioEffect(const std::shared_ptr<effects::AudioEffect> &effect);
|
||||
OpusDecoder(const std::shared_ptr<MediaStreamItf> &dst, bool isAsync, bool needEC);
|
||||
OpusDecoder(const std::unique_ptr<MediaStreamItf> &dst, bool isAsync, bool needEC);
|
||||
virtual ~OpusDecoder();
|
||||
size_t HandleCallback(unsigned char *data, size_t len);
|
||||
void SetEchoCanceller(const std::shared_ptr<EchoCanceller> &canceller);
|
||||
void SetFrameDuration(uint32_t duration);
|
||||
void SetJitterBuffer(const std::shared_ptr<JitterBuffer> &jitterBuffer);
|
||||
void SetDTX(bool enable);
|
||||
void SetLevelMeter(const std::shared_ptr<AudioLevelMeter> &levelMeter);
|
||||
void AddAudioEffect(const std::shared_ptr<effects::AudioEffect> &effect);
|
||||
void RemoveAudioEffect(const std::shared_ptr<effects::AudioEffect> &effect);
|
||||
|
||||
private:
|
||||
void Initialize(bool isAsync, bool needEC);
|
||||
static size_t Callback(unsigned char *data, size_t len, void *param);
|
||||
void RunThread();
|
||||
int DecodeNextFrame();
|
||||
::OpusDecoder *dec;
|
||||
::OpusDecoder *ecDec;
|
||||
BlockingQueue<Buffer> *decodedQueue;
|
||||
BufferPool<960 * 2, 32> bufferPool;
|
||||
unsigned char *buffer;
|
||||
unsigned char *lastDecoded;
|
||||
unsigned char *processedBuffer;
|
||||
size_t outputBufferSize;
|
||||
std::atomic<bool> running;
|
||||
Thread *thread;
|
||||
Semaphore *semaphore;
|
||||
uint32_t frameDuration;
|
||||
std::shared_ptr<EchoCanceller> echoCanceller;
|
||||
std::shared_ptr<JitterBuffer> jitterBuffer;
|
||||
std::shared_ptr<AudioLevelMeter> levelMeter;
|
||||
int consecutiveLostPackets;
|
||||
bool enableDTX;
|
||||
size_t silentPacketCount;
|
||||
std::vector<std::shared_ptr<effects::AudioEffect>> postProcEffects;
|
||||
//bool async;
|
||||
std::atomic<bool> async;
|
||||
alignas(2) unsigned char nextBuffer[8192];
|
||||
alignas(2) unsigned char decodeBuffer[8192];
|
||||
size_t nextLen;
|
||||
unsigned int packetsPerFrame;
|
||||
ptrdiff_t remainingDataLen;
|
||||
bool prevWasEC;
|
||||
int16_t prevLastSample;
|
||||
void Initialize(bool isAsync, bool needEC);
|
||||
static size_t Callback(unsigned char *data, size_t len, void *param);
|
||||
void RunThread();
|
||||
int DecodeNextFrame();
|
||||
::OpusDecoder *dec;
|
||||
::OpusDecoder *ecDec;
|
||||
BlockingQueue<Buffer> *decodedQueue;
|
||||
BufferPool<960 * 2, 32> bufferPool;
|
||||
unsigned char *buffer;
|
||||
unsigned char *lastDecoded;
|
||||
unsigned char *processedBuffer;
|
||||
size_t outputBufferSize;
|
||||
std::atomic<bool> running;
|
||||
Thread *thread;
|
||||
Semaphore *semaphore;
|
||||
uint32_t frameDuration;
|
||||
std::shared_ptr<EchoCanceller> echoCanceller;
|
||||
std::shared_ptr<JitterBuffer> jitterBuffer;
|
||||
std::shared_ptr<AudioLevelMeter> levelMeter;
|
||||
int consecutiveLostPackets;
|
||||
bool enableDTX;
|
||||
size_t silentPacketCount;
|
||||
std::vector<std::shared_ptr<effects::AudioEffect>> postProcEffects;
|
||||
//bool async;
|
||||
std::atomic<bool> async;
|
||||
alignas(2) unsigned char nextBuffer[8192];
|
||||
alignas(2) unsigned char decodeBuffer[8192];
|
||||
size_t nextLen;
|
||||
unsigned int packetsPerFrame;
|
||||
ptrdiff_t remainingDataLen;
|
||||
bool prevWasEC;
|
||||
int16_t prevLastSample;
|
||||
};
|
||||
} // namespace tgvoip
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#if defined HAVE_CONFIG_H || defined TGVOIP_USE_INSTALLED_OPUS
|
||||
#include <opus/opus.h>
|
||||
#else
|
||||
#include <opus/opus.h>
|
||||
#include "opus.h"
|
||||
#endif
|
||||
|
||||
namespace
|
||||
|
@ -7,13 +7,13 @@
|
||||
#ifndef LIBTGVOIP_MEDIASTREAMINPUT_H
|
||||
#define LIBTGVOIP_MEDIASTREAMINPUT_H
|
||||
|
||||
#include <string.h>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <stdint.h>
|
||||
#include "tools/threading.h"
|
||||
#include "tools/BlockingQueue.h"
|
||||
#include "tools/Buffers.h"
|
||||
#include "tools/threading.h"
|
||||
#include <memory>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <vector>
|
||||
|
||||
namespace tgvoip
|
||||
{
|
||||
@ -23,72 +23,72 @@ class EchoCanceller;
|
||||
class MediaStreamItf
|
||||
{
|
||||
public:
|
||||
virtual void Start() = 0;
|
||||
virtual void Stop() = 0;
|
||||
void SetCallback(size_t (*f)(unsigned char *, size_t, void *), void *param);
|
||||
virtual void Start() = 0;
|
||||
virtual void Stop() = 0;
|
||||
void SetCallback(size_t (*f)(unsigned char *, size_t, void *), void *param);
|
||||
|
||||
//protected:
|
||||
size_t InvokeCallback(unsigned char *data, size_t length);
|
||||
//protected:
|
||||
size_t InvokeCallback(unsigned char *data, size_t length);
|
||||
|
||||
private:
|
||||
size_t (*callback)(unsigned char *, size_t, void *) = NULL;
|
||||
void *callbackParam;
|
||||
Mutex callbackMutex;
|
||||
size_t (*callback)(unsigned char *, size_t, void *) = NULL;
|
||||
void *callbackParam;
|
||||
Mutex callbackMutex;
|
||||
};
|
||||
|
||||
class AudioMixer : public MediaStreamItf
|
||||
{
|
||||
public:
|
||||
AudioMixer();
|
||||
virtual ~AudioMixer();
|
||||
void SetOutput(MediaStreamItf *output);
|
||||
virtual void Start();
|
||||
virtual void Stop();
|
||||
void AddInput(std::shared_ptr<MediaStreamItf> input);
|
||||
void RemoveInput(std::shared_ptr<MediaStreamItf> input);
|
||||
void SetInputVolume(std::shared_ptr<MediaStreamItf> input, float volumeDB);
|
||||
void SetEchoCanceller(EchoCanceller *aec);
|
||||
AudioMixer();
|
||||
virtual ~AudioMixer();
|
||||
void SetOutput(MediaStreamItf *output);
|
||||
virtual void Start() override;
|
||||
virtual void Stop() override;
|
||||
void AddInput(std::shared_ptr<MediaStreamItf> input);
|
||||
void RemoveInput(std::shared_ptr<MediaStreamItf> input);
|
||||
void SetInputVolume(std::shared_ptr<MediaStreamItf> input, float volumeDB);
|
||||
void SetEchoCanceller(EchoCanceller *aec);
|
||||
|
||||
private:
|
||||
void RunThread();
|
||||
struct MixerInput
|
||||
{
|
||||
std::shared_ptr<MediaStreamItf> source;
|
||||
float multiplier;
|
||||
};
|
||||
Mutex inputsMutex;
|
||||
void DoCallback(unsigned char *data, size_t length);
|
||||
static size_t OutputCallback(unsigned char *data, size_t length, void *arg);
|
||||
std::vector<MixerInput> inputs;
|
||||
Thread *thread;
|
||||
BufferPool<960 * 2, 16> bufferPool;
|
||||
BlockingQueue<Buffer> processedQueue;
|
||||
Semaphore semaphore;
|
||||
EchoCanceller *echoCanceller;
|
||||
bool running;
|
||||
void RunThread();
|
||||
struct MixerInput
|
||||
{
|
||||
std::shared_ptr<MediaStreamItf> source;
|
||||
float multiplier;
|
||||
};
|
||||
Mutex inputsMutex;
|
||||
void DoCallback(unsigned char *data, size_t length);
|
||||
static size_t OutputCallback(unsigned char *data, size_t length, void *arg);
|
||||
std::vector<MixerInput> inputs;
|
||||
Thread *thread;
|
||||
BufferPool<960 * 2, 16> bufferPool;
|
||||
BlockingQueue<Buffer> processedQueue;
|
||||
Semaphore semaphore;
|
||||
EchoCanceller *echoCanceller;
|
||||
bool running;
|
||||
};
|
||||
|
||||
class CallbackWrapper : public MediaStreamItf
|
||||
{
|
||||
public:
|
||||
CallbackWrapper(){};
|
||||
virtual ~CallbackWrapper(){};
|
||||
virtual void Start(){};
|
||||
virtual void Stop(){};
|
||||
CallbackWrapper(){};
|
||||
virtual ~CallbackWrapper(){};
|
||||
virtual void Start() override{};
|
||||
virtual void Stop() override{};
|
||||
};
|
||||
|
||||
class AudioLevelMeter
|
||||
{
|
||||
public:
|
||||
AudioLevelMeter();
|
||||
float GetLevel();
|
||||
void Update(int16_t *samples, size_t count);
|
||||
AudioLevelMeter();
|
||||
float GetLevel();
|
||||
void Update(int16_t *samples, size_t count);
|
||||
|
||||
private:
|
||||
int16_t absMax;
|
||||
int16_t count;
|
||||
int8_t currentLevel;
|
||||
int16_t currentLevelFullRange;
|
||||
int16_t absMax;
|
||||
int16_t count;
|
||||
int8_t currentLevel;
|
||||
int16_t currentLevelFullRange;
|
||||
};
|
||||
}; // namespace tgvoip
|
||||
|
||||
|
@ -169,17 +169,17 @@ class NetworkSocketTCPObfuscated : public NetworkSocketWrapper
|
||||
public:
|
||||
NetworkSocketTCPObfuscated(const std::shared_ptr<NetworkSocket> &wrapped);
|
||||
virtual ~NetworkSocketTCPObfuscated();
|
||||
virtual std::shared_ptr<NetworkSocket> GetWrapped();
|
||||
virtual void InitConnection();
|
||||
virtual std::shared_ptr<NetworkSocket> GetWrapped() override;
|
||||
virtual void InitConnection() override;
|
||||
virtual void Send(NetworkPacket &&packet) override;
|
||||
virtual NetworkPacket Receive(size_t maxLen) override;
|
||||
virtual void Open();
|
||||
virtual void Close();
|
||||
virtual void Connect(const NetworkAddress address, uint16_t port);
|
||||
virtual bool OnReadyToSend();
|
||||
virtual void Open() override;
|
||||
virtual void Close() override;
|
||||
virtual void Connect(const NetworkAddress address, uint16_t port) override;
|
||||
virtual bool OnReadyToSend() override;
|
||||
|
||||
virtual bool IsFailed();
|
||||
virtual bool IsReadyToSend()
|
||||
virtual bool IsFailed() override;
|
||||
virtual bool IsReadyToSend() override
|
||||
{
|
||||
return readyToSend && wrapped->IsReadyToSend();
|
||||
};
|
||||
@ -199,15 +199,15 @@ public:
|
||||
virtual void Send(NetworkPacket &&packet) override;
|
||||
virtual NetworkPacket Receive(size_t maxLen) override;
|
||||
virtual void Open() override;
|
||||
virtual void Close();
|
||||
virtual void Connect(const NetworkAddress address, uint16_t port);
|
||||
virtual std::shared_ptr<NetworkSocket> GetWrapped();
|
||||
virtual void InitConnection();
|
||||
virtual bool IsFailed();
|
||||
virtual NetworkAddress GetConnectedAddress();
|
||||
virtual uint16_t GetConnectedPort();
|
||||
virtual bool OnReadyToSend();
|
||||
virtual bool OnReadyToReceive();
|
||||
virtual void Close() override;
|
||||
virtual void Connect(const NetworkAddress address, uint16_t port) override;
|
||||
virtual std::shared_ptr<NetworkSocket> GetWrapped() override;
|
||||
virtual void InitConnection() override;
|
||||
virtual bool IsFailed() override;
|
||||
virtual NetworkAddress GetConnectedAddress() override;
|
||||
virtual uint16_t GetConnectedPort() override;
|
||||
virtual bool OnReadyToSend() override;
|
||||
virtual bool OnReadyToReceive() override;
|
||||
|
||||
bool NeedSelectForSending();
|
||||
|
||||
|
@ -120,7 +120,7 @@ public:
|
||||
uint8_t streamId;
|
||||
uint8_t flags = 0;
|
||||
|
||||
uint8_t getID() const
|
||||
uint8_t getID() const override
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
@ -150,7 +150,7 @@ public:
|
||||
|
||||
Array<Wrapped<Bytes>> data;
|
||||
|
||||
uint8_t getID() const
|
||||
uint8_t getID() const override
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
@ -175,7 +175,7 @@ struct ExtraNetworkChanged : public Extra
|
||||
|
||||
uint8_t flags = 0;
|
||||
|
||||
uint8_t getID() const
|
||||
uint8_t getID() const override
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
@ -197,7 +197,7 @@ public:
|
||||
NetworkAddress address;
|
||||
uint16_t port = 0;
|
||||
|
||||
uint8_t getID() const
|
||||
uint8_t getID() const override
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
@ -218,7 +218,7 @@ struct ExtraIpv6Endpoint : public Extra
|
||||
NetworkAddress address;
|
||||
uint16_t port = 0;
|
||||
|
||||
uint8_t getID() const
|
||||
uint8_t getID() const override
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
@ -240,7 +240,7 @@ struct ExtraGroupCallKey : public Extra
|
||||
|
||||
Buffer key;
|
||||
|
||||
uint8_t getID() const
|
||||
uint8_t getID() const override
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
@ -258,7 +258,7 @@ struct ExtraGroupCallUpgrade : public Extra
|
||||
bool parse(const BufferInputStream &in, const VersionInfo &ver) override { return true; };
|
||||
void serialize(BufferOutputStream &out, const VersionInfo &ver) const override{};
|
||||
|
||||
uint8_t getID() const
|
||||
uint8_t getID() const override
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
@ -293,7 +293,7 @@ struct ExtraInit : public Extra
|
||||
Array<UInt32> decoders;
|
||||
uint8_t maxResolution;
|
||||
|
||||
uint8_t getID() const
|
||||
uint8_t getID() const override
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
@ -320,7 +320,7 @@ struct ExtraInitAck : public Extra
|
||||
|
||||
Array<ExtraStreamInfo> streams;
|
||||
|
||||
uint8_t getID() const
|
||||
uint8_t getID() const override
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
@ -344,7 +344,7 @@ struct ExtraPing : public Extra
|
||||
bool parse(const BufferInputStream &in, const VersionInfo &ver) override { return true; };
|
||||
void serialize(BufferOutputStream &out, const VersionInfo &ver) const override{};
|
||||
|
||||
uint8_t getID() const
|
||||
uint8_t getID() const override
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
@ -363,7 +363,7 @@ struct ExtraPong : public Extra
|
||||
|
||||
uint32_t seq = 0;
|
||||
|
||||
uint8_t getID() const
|
||||
uint8_t getID() const override
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ struct Bytes : public Serializable,
|
||||
virtual ~Bytes() = default;
|
||||
Bytes() = default;
|
||||
|
||||
bool parse(const BufferInputStream &in, const VersionInfo &ver)
|
||||
bool parse(const BufferInputStream &in, const VersionInfo &ver) override
|
||||
{
|
||||
setData(std::make_unique<Buffer>(in.GetLength()));
|
||||
return in.TryRead(*getData());
|
||||
@ -368,16 +368,16 @@ struct OutputBytes : public Bytes
|
||||
OutputBytes() = default;
|
||||
OutputBytes(Buffer &&_data) : data(std::make_unique<Buffer>(std::move(_data))){};
|
||||
|
||||
virtual Buffer *getData()
|
||||
virtual Buffer *getData() override
|
||||
{
|
||||
return data.get();
|
||||
}
|
||||
virtual const Buffer *getData() const
|
||||
virtual const Buffer *getData() const override
|
||||
{
|
||||
return data.get();
|
||||
}
|
||||
|
||||
virtual void setData(std::unique_ptr<Buffer> &&buf)
|
||||
virtual void setData(std::unique_ptr<Buffer> &&buf) override
|
||||
{
|
||||
data = std::move(buf);
|
||||
}
|
||||
@ -390,15 +390,15 @@ struct InputBytes : public Bytes
|
||||
InputBytes() = default;
|
||||
InputBytes(std::shared_ptr<Buffer> _data) : data(_data){};
|
||||
|
||||
virtual Buffer *getData()
|
||||
virtual Buffer *getData() override
|
||||
{
|
||||
return data.get();
|
||||
}
|
||||
virtual const Buffer *getData() const
|
||||
virtual const Buffer *getData() const override
|
||||
{
|
||||
return data.get();
|
||||
}
|
||||
virtual void setData(std::unique_ptr<Buffer> &&buf)
|
||||
virtual void setData(std::unique_ptr<Buffer> &&buf) override
|
||||
{
|
||||
data = std::move(buf);
|
||||
}
|
||||
@ -416,7 +416,7 @@ struct UInt32 : public Serializable,
|
||||
{
|
||||
return data;
|
||||
}
|
||||
bool parse(const BufferInputStream &in, const VersionInfo &ver)
|
||||
bool parse(const BufferInputStream &in, const VersionInfo &ver) override
|
||||
{
|
||||
return in.TryRead(data);
|
||||
}
|
||||
|
@ -756,7 +756,7 @@
|
||||
[
|
||||
'"<(OS)" == "mac"', {
|
||||
'xcode_settings': {
|
||||
'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
|
||||
'CLANG_CXX_LANGUAGE_STANDARD': 'c++17',
|
||||
'ALWAYS_SEARCH_USER_PATHS': 'NO',
|
||||
},
|
||||
'defines': [
|
||||
|
@ -24,7 +24,7 @@ class SocketSelectCancellerPosix : public SocketSelectCanceller
|
||||
public:
|
||||
SocketSelectCancellerPosix();
|
||||
virtual ~SocketSelectCancellerPosix();
|
||||
virtual void CancelSelect();
|
||||
virtual void CancelSelect() override;
|
||||
|
||||
private:
|
||||
int pipeRead;
|
||||
|
Loading…
Reference in New Issue
Block a user