1
0
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:
Daniil Gentili 2020-03-29 16:55:33 +02:00
parent 18c7f84476
commit 23fafdf575
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
17 changed files with 197 additions and 193 deletions

View File

@ -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 \

View File

@ -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

View File

@ -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@

View File

@ -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;

View File

@ -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"

View File

@ -55,7 +55,7 @@ public:
return input;
}
virtual std::shared_ptr<AudioOutput> *GetOutput()
virtual std::shared_ptr<AudioOutput> GetOutput()
{
return output;
}

View File

@ -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
{

View File

@ -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
@ -73,7 +73,7 @@ class Volume : public AudioEffect
public:
Volume();
virtual ~Volume();
virtual void Process(int16_t *inOut, size_t numSamples);
virtual void Process(int16_t *inOut, size_t numSamples) override;
/**
* Level is (0.0, 2.0]
*/

View File

@ -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)

View File

@ -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;

View File

@ -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

View File

@ -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
{
@ -42,8 +42,8 @@ public:
AudioMixer();
virtual ~AudioMixer();
void SetOutput(MediaStreamItf *output);
virtual void Start();
virtual void Stop();
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);
@ -73,8 +73,8 @@ class CallbackWrapper : public MediaStreamItf
public:
CallbackWrapper(){};
virtual ~CallbackWrapper(){};
virtual void Start(){};
virtual void Stop(){};
virtual void Start() override{};
virtual void Stop() override{};
};
class AudioLevelMeter

View File

@ -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();

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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': [

View File

@ -24,7 +24,7 @@ class SocketSelectCancellerPosix : public SocketSelectCanceller
public:
SocketSelectCancellerPosix();
virtual ~SocketSelectCancellerPosix();
virtual void CancelSelect();
virtual void CancelSelect() override;
private:
int pipeRead;