1
0
mirror of https://github.com/danog/libtgvoip.git synced 2024-11-29 20:29:01 +01:00

Finish moving around

This commit is contained in:
Daniil Gentili 2020-01-25 18:36:49 +01:00
parent f3afe0612f
commit b58ce4a2ab
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
26 changed files with 177 additions and 165 deletions

View File

@ -11,13 +11,13 @@ controller/net/CongestionControl.cpp \
controller/audio/EchoCanceller.cpp \
controller/net/JitterBuffer.cpp \
tools/logging.cpp \
controller/MediaStreamItf.cpp \
controller/media/MediaStreamItf.cpp \
tools/MessageThread.cpp \
controller/net/NetworkSocket.cpp \
controller/net/Endpoint.cpp \
controller/audio/OpusDecoder.cpp \
controller/audio/OpusEncoder.cpp \
controller/PacketReassembler.cpp \
controller/net/PacketReassembler.cpp \
VoIPGroupController.cpp \
VoIPServerConfig.cpp \
audio/AudioIO.cpp \
@ -44,12 +44,12 @@ controller/audio/EchoCanceller.h \
controller/net/JitterBuffer.h \
tools/logging.h \
tools/threading.h \
controller/MediaStreamItf.h \
controller/media/MediaStreamItf.h \
tools/MessageThread.h \
controller/net/NetworkSocket.h \
controller/audio/OpusDecoder.h \
controller/audio/OpusEncoder.h \
controller/PacketReassembler.h \
controller/net/PacketReassembler.h \
VoIPServerConfig.h \
audio/AudioIO.h \
audio/AudioInput.h \

View File

@ -812,11 +812,11 @@ am__libtgvoip_la_SOURCES_DIST = TgVoip.cpp VoIPController.cpp \
tools/Buffers.cpp controller/net/CongestionControl.cpp \
controller/audio/EchoCanceller.cpp \
controller/net/JitterBuffer.cpp tools/logging.cpp \
controller/MediaStreamItf.cpp tools/MessageThread.cpp \
controller/media/MediaStreamItf.cpp tools/MessageThread.cpp \
controller/net/NetworkSocket.cpp controller/net/Endpoint.cpp \
controller/audio/OpusDecoder.cpp \
controller/audio/OpusEncoder.cpp \
controller/PacketReassembler.cpp VoIPGroupController.cpp \
controller/net/PacketReassembler.cpp VoIPGroupController.cpp \
VoIPServerConfig.cpp audio/AudioIO.cpp audio/AudioInput.cpp \
audio/AudioOutput.cpp audio/Resampler.cpp \
audio/AudioInputTester.cpp os/posix/NetworkSocketPosix.cpp \
@ -1432,10 +1432,11 @@ am__libtgvoip_la_SOURCES_DIST = TgVoip.cpp VoIPController.cpp \
VoIPController.h tools/Buffers.h tools/BlockingQueue.h \
controller/PrivateDefines.h controller/net/CongestionControl.h \
controller/audio/EchoCanceller.h controller/net/JitterBuffer.h \
tools/logging.h tools/threading.h controller/MediaStreamItf.h \
tools/MessageThread.h controller/net/NetworkSocket.h \
controller/audio/OpusDecoder.h controller/audio/OpusEncoder.h \
controller/PacketReassembler.h VoIPServerConfig.h \
tools/logging.h tools/threading.h \
controller/media/MediaStreamItf.h tools/MessageThread.h \
controller/net/NetworkSocket.h controller/audio/OpusDecoder.h \
controller/audio/OpusEncoder.h \
controller/net/PacketReassembler.h VoIPServerConfig.h \
audio/AudioIO.h audio/AudioInput.h audio/AudioOutput.h \
audio/Resampler.h os/posix/NetworkSocketPosix.h \
video/VideoSource.h video/VideoPacketSender.h video/VideoFEC.h \
@ -1750,11 +1751,11 @@ am__objects_12 = TgVoip.lo VoIPController.lo tools/Buffers.lo \
controller/net/CongestionControl.lo \
controller/audio/EchoCanceller.lo \
controller/net/JitterBuffer.lo tools/logging.lo \
controller/MediaStreamItf.lo tools/MessageThread.lo \
controller/media/MediaStreamItf.lo tools/MessageThread.lo \
controller/net/NetworkSocket.lo controller/net/Endpoint.lo \
controller/audio/OpusDecoder.lo \
controller/audio/OpusEncoder.lo \
controller/PacketReassembler.lo VoIPGroupController.lo \
controller/net/PacketReassembler.lo VoIPGroupController.lo \
VoIPServerConfig.lo audio/AudioIO.lo audio/AudioInput.lo \
audio/AudioOutput.lo audio/Resampler.lo \
audio/AudioInputTester.lo os/posix/NetworkSocketPosix.lo \
@ -2060,15 +2061,15 @@ am__depfiles_remade = ./$(DEPDIR)/TgVoip.Plo \
audio/$(DEPDIR)/AudioInput.Plo \
audio/$(DEPDIR)/AudioInputTester.Plo \
audio/$(DEPDIR)/AudioOutput.Plo audio/$(DEPDIR)/Resampler.Plo \
controller/$(DEPDIR)/MediaStreamItf.Plo \
controller/$(DEPDIR)/PacketReassembler.Plo \
controller/audio/$(DEPDIR)/EchoCanceller.Plo \
controller/audio/$(DEPDIR)/OpusDecoder.Plo \
controller/audio/$(DEPDIR)/OpusEncoder.Plo \
controller/media/$(DEPDIR)/MediaStreamItf.Plo \
controller/net/$(DEPDIR)/CongestionControl.Plo \
controller/net/$(DEPDIR)/Endpoint.Plo \
controller/net/$(DEPDIR)/JitterBuffer.Plo \
controller/net/$(DEPDIR)/NetworkSocket.Plo \
controller/net/$(DEPDIR)/PacketReassembler.Plo \
os/darwin/$(DEPDIR)/AudioInputAudioUnit.Plo \
os/darwin/$(DEPDIR)/AudioInputAudioUnitOSX.Plo \
os/darwin/$(DEPDIR)/AudioOutputAudioUnit.Plo \
@ -2182,10 +2183,11 @@ am__nobase_tgvoipinclude_HEADERS_DIST = TgVoip.h VoIPController.h \
tools/Buffers.h tools/BlockingQueue.h \
controller/PrivateDefines.h controller/net/CongestionControl.h \
controller/audio/EchoCanceller.h controller/net/JitterBuffer.h \
tools/logging.h tools/threading.h controller/MediaStreamItf.h \
tools/MessageThread.h controller/net/NetworkSocket.h \
controller/audio/OpusDecoder.h controller/audio/OpusEncoder.h \
controller/PacketReassembler.h VoIPServerConfig.h \
tools/logging.h tools/threading.h \
controller/media/MediaStreamItf.h tools/MessageThread.h \
controller/net/NetworkSocket.h controller/audio/OpusDecoder.h \
controller/audio/OpusEncoder.h \
controller/net/PacketReassembler.h VoIPServerConfig.h \
audio/AudioIO.h audio/AudioInput.h audio/AudioOutput.h \
audio/Resampler.h os/posix/NetworkSocketPosix.h \
video/VideoSource.h video/VideoPacketSender.h video/VideoFEC.h \
@ -2379,11 +2381,11 @@ SRC = TgVoip.cpp VoIPController.cpp tools/Buffers.cpp \
controller/net/CongestionControl.cpp \
controller/audio/EchoCanceller.cpp \
controller/net/JitterBuffer.cpp tools/logging.cpp \
controller/MediaStreamItf.cpp tools/MessageThread.cpp \
controller/media/MediaStreamItf.cpp tools/MessageThread.cpp \
controller/net/NetworkSocket.cpp controller/net/Endpoint.cpp \
controller/audio/OpusDecoder.cpp \
controller/audio/OpusEncoder.cpp \
controller/PacketReassembler.cpp VoIPGroupController.cpp \
controller/net/PacketReassembler.cpp VoIPGroupController.cpp \
VoIPServerConfig.cpp audio/AudioIO.cpp audio/AudioInput.cpp \
audio/AudioOutput.cpp audio/Resampler.cpp \
audio/AudioInputTester.cpp os/posix/NetworkSocketPosix.cpp \
@ -2398,10 +2400,11 @@ TGVOIP_HDRS = TgVoip.h VoIPController.h tools/Buffers.h \
tools/BlockingQueue.h controller/PrivateDefines.h \
controller/net/CongestionControl.h \
controller/audio/EchoCanceller.h controller/net/JitterBuffer.h \
tools/logging.h tools/threading.h controller/MediaStreamItf.h \
tools/MessageThread.h controller/net/NetworkSocket.h \
controller/audio/OpusDecoder.h controller/audio/OpusEncoder.h \
controller/PacketReassembler.h VoIPServerConfig.h \
tools/logging.h tools/threading.h \
controller/media/MediaStreamItf.h tools/MessageThread.h \
controller/net/NetworkSocket.h controller/audio/OpusDecoder.h \
controller/audio/OpusEncoder.h \
controller/net/PacketReassembler.h VoIPServerConfig.h \
audio/AudioIO.h audio/AudioInput.h audio/AudioOutput.h \
audio/Resampler.h os/posix/NetworkSocketPosix.h \
video/VideoSource.h video/VideoPacketSender.h video/VideoFEC.h \
@ -2528,14 +2531,14 @@ controller/net/JitterBuffer.lo: controller/net/$(am__dirstamp) \
controller/net/$(DEPDIR)/$(am__dirstamp)
tools/logging.lo: tools/$(am__dirstamp) \
tools/$(DEPDIR)/$(am__dirstamp)
controller/$(am__dirstamp):
@$(MKDIR_P) controller
@: > controller/$(am__dirstamp)
controller/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) controller/$(DEPDIR)
@: > controller/$(DEPDIR)/$(am__dirstamp)
controller/MediaStreamItf.lo: controller/$(am__dirstamp) \
controller/$(DEPDIR)/$(am__dirstamp)
controller/media/$(am__dirstamp):
@$(MKDIR_P) controller/media
@: > controller/media/$(am__dirstamp)
controller/media/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) controller/media/$(DEPDIR)
@: > controller/media/$(DEPDIR)/$(am__dirstamp)
controller/media/MediaStreamItf.lo: controller/media/$(am__dirstamp) \
controller/media/$(DEPDIR)/$(am__dirstamp)
tools/MessageThread.lo: tools/$(am__dirstamp) \
tools/$(DEPDIR)/$(am__dirstamp)
controller/net/NetworkSocket.lo: controller/net/$(am__dirstamp) \
@ -2546,8 +2549,8 @@ controller/audio/OpusDecoder.lo: controller/audio/$(am__dirstamp) \
controller/audio/$(DEPDIR)/$(am__dirstamp)
controller/audio/OpusEncoder.lo: controller/audio/$(am__dirstamp) \
controller/audio/$(DEPDIR)/$(am__dirstamp)
controller/PacketReassembler.lo: controller/$(am__dirstamp) \
controller/$(DEPDIR)/$(am__dirstamp)
controller/net/PacketReassembler.lo: controller/net/$(am__dirstamp) \
controller/net/$(DEPDIR)/$(am__dirstamp)
audio/$(am__dirstamp):
@$(MKDIR_P) audio
@: > audio/$(am__dirstamp)
@ -3696,10 +3699,10 @@ mostlyclean-compile:
-rm -f ./webrtc_dsp/third_party/rnnoise/src/*.lo
-rm -f audio/*.$(OBJEXT)
-rm -f audio/*.lo
-rm -f controller/*.$(OBJEXT)
-rm -f controller/*.lo
-rm -f controller/audio/*.$(OBJEXT)
-rm -f controller/audio/*.lo
-rm -f controller/media/*.$(OBJEXT)
-rm -f controller/media/*.lo
-rm -f controller/net/*.$(OBJEXT)
-rm -f controller/net/*.lo
-rm -f os/darwin/*.$(OBJEXT)
@ -4003,15 +4006,15 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@audio/$(DEPDIR)/AudioInputTester.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@audio/$(DEPDIR)/AudioOutput.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@audio/$(DEPDIR)/Resampler.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@controller/$(DEPDIR)/MediaStreamItf.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@controller/$(DEPDIR)/PacketReassembler.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@controller/audio/$(DEPDIR)/EchoCanceller.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@controller/audio/$(DEPDIR)/OpusDecoder.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@controller/audio/$(DEPDIR)/OpusEncoder.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@controller/media/$(DEPDIR)/MediaStreamItf.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@controller/net/$(DEPDIR)/CongestionControl.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@controller/net/$(DEPDIR)/Endpoint.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@controller/net/$(DEPDIR)/JitterBuffer.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@controller/net/$(DEPDIR)/NetworkSocket.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@controller/net/$(DEPDIR)/PacketReassembler.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@os/darwin/$(DEPDIR)/AudioInputAudioUnit.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@os/darwin/$(DEPDIR)/AudioInputAudioUnitOSX.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@os/darwin/$(DEPDIR)/AudioOutputAudioUnit.Plo@am__quote@ # am--include-marker
@ -4217,8 +4220,8 @@ clean-libtool:
-rm -rf ./webrtc_dsp/system_wrappers/source/.libs ./webrtc_dsp/system_wrappers/source/_libs
-rm -rf ./webrtc_dsp/third_party/rnnoise/src/.libs ./webrtc_dsp/third_party/rnnoise/src/_libs
-rm -rf audio/.libs audio/_libs
-rm -rf controller/.libs controller/_libs
-rm -rf controller/audio/.libs controller/audio/_libs
-rm -rf controller/media/.libs controller/media/_libs
-rm -rf controller/net/.libs controller/net/_libs
-rm -rf os/darwin/.libs os/darwin/_libs
-rm -rf os/linux/.libs os/linux/_libs
@ -4520,10 +4523,10 @@ distclean-generic:
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f audio/$(DEPDIR)/$(am__dirstamp)
-rm -f audio/$(am__dirstamp)
-rm -f controller/$(DEPDIR)/$(am__dirstamp)
-rm -f controller/$(am__dirstamp)
-rm -f controller/audio/$(DEPDIR)/$(am__dirstamp)
-rm -f controller/audio/$(am__dirstamp)
-rm -f controller/media/$(DEPDIR)/$(am__dirstamp)
-rm -f controller/media/$(am__dirstamp)
-rm -f controller/net/$(DEPDIR)/$(am__dirstamp)
-rm -f controller/net/$(am__dirstamp)
-rm -f os/darwin/$(DEPDIR)/$(am__dirstamp)
@ -4888,15 +4891,15 @@ distclean: distclean-am
-rm -f audio/$(DEPDIR)/AudioInputTester.Plo
-rm -f audio/$(DEPDIR)/AudioOutput.Plo
-rm -f audio/$(DEPDIR)/Resampler.Plo
-rm -f controller/$(DEPDIR)/MediaStreamItf.Plo
-rm -f controller/$(DEPDIR)/PacketReassembler.Plo
-rm -f controller/audio/$(DEPDIR)/EchoCanceller.Plo
-rm -f controller/audio/$(DEPDIR)/OpusDecoder.Plo
-rm -f controller/audio/$(DEPDIR)/OpusEncoder.Plo
-rm -f controller/media/$(DEPDIR)/MediaStreamItf.Plo
-rm -f controller/net/$(DEPDIR)/CongestionControl.Plo
-rm -f controller/net/$(DEPDIR)/Endpoint.Plo
-rm -f controller/net/$(DEPDIR)/JitterBuffer.Plo
-rm -f controller/net/$(DEPDIR)/NetworkSocket.Plo
-rm -f controller/net/$(DEPDIR)/PacketReassembler.Plo
-rm -f os/darwin/$(DEPDIR)/AudioInputAudioUnit.Plo
-rm -f os/darwin/$(DEPDIR)/AudioInputAudioUnitOSX.Plo
-rm -f os/darwin/$(DEPDIR)/AudioOutputAudioUnit.Plo
@ -5256,15 +5259,15 @@ maintainer-clean: maintainer-clean-am
-rm -f audio/$(DEPDIR)/AudioInputTester.Plo
-rm -f audio/$(DEPDIR)/AudioOutput.Plo
-rm -f audio/$(DEPDIR)/Resampler.Plo
-rm -f controller/$(DEPDIR)/MediaStreamItf.Plo
-rm -f controller/$(DEPDIR)/PacketReassembler.Plo
-rm -f controller/audio/$(DEPDIR)/EchoCanceller.Plo
-rm -f controller/audio/$(DEPDIR)/OpusDecoder.Plo
-rm -f controller/audio/$(DEPDIR)/OpusEncoder.Plo
-rm -f controller/media/$(DEPDIR)/MediaStreamItf.Plo
-rm -f controller/net/$(DEPDIR)/CongestionControl.Plo
-rm -f controller/net/$(DEPDIR)/Endpoint.Plo
-rm -f controller/net/$(DEPDIR)/JitterBuffer.Plo
-rm -f controller/net/$(DEPDIR)/NetworkSocket.Plo
-rm -f controller/net/$(DEPDIR)/PacketReassembler.Plo
-rm -f os/darwin/$(DEPDIR)/AudioInputAudioUnit.Plo
-rm -f os/darwin/$(DEPDIR)/AudioInputAudioUnitOSX.Plo
-rm -f os/darwin/$(DEPDIR)/AudioOutputAudioUnit.Plo

View File

@ -4,97 +4,14 @@
// you should have received with this source code distribution.
//
#ifndef _WIN32
#include <unistd.h>
#include <sys/time.h>
#endif
#include <errno.h>
#include <string.h>
#include <wchar.h>
#include "VoIPController.h"
#include "tools/logging.h"
#include "tools/threading.h"
#include "tools/Buffers.h"
#include "controller/audio/OpusEncoder.h"
#include "controller/audio/OpusDecoder.h"
#include "VoIPServerConfig.h"
#include "controller/PrivateDefines.h"
#include "controller/net/Endpoint.h"
#include "tools/json11.hpp"
#include "controller/PacketSender.h"
#include "video/VideoPacketSender.h"
#include <assert.h>
#include <time.h>
#include <math.h>
#include <exception>
#include <stdexcept>
#include <algorithm>
#include <sstream>
#include <inttypes.h>
#include <float.h>
inline int pad4(int x)
{
int r = PAD4(x);
if (r == 4)
return 0;
return r;
}
using namespace tgvoip;
using namespace std;
#ifdef __APPLE__
#include "os/darwin/AudioUnitIO.h"
#include <mach/mach_time.h>
double VoIPController::machTimebase = 0;
uint64_t VoIPController::machTimestart = 0;
#endif
#ifdef _WIN32
int64_t VoIPController::win32TimeScale = 0;
bool VoIPController::didInitWin32TimeScale = false;
#endif
#ifdef __ANDROID__
#include "os/android/JNIUtilities.h"
#include "os/android/AudioInputAndroid.h"
#include "controller/net/NetworkSocket.h"
extern jclass jniUtilitiesClass;
#endif
#if defined(TGVOIP_USE_CALLBACK_AUDIO_IO)
#include "audio/AudioIOCallback.h"
#endif
#include "controller/voip/PublicAPI.cpp"
#include "controller/voip/Init.cpp"
#pragma mark - Miscellaneous
void VoIPController::SetState(int state)
{
this->state = state;
LOGV("Call state changed to %d", state);
stateChangeTime = GetCurrentTime();
messageThread.Post([this, state] {
if (callbacks.connectionStateChanged)
callbacks.connectionStateChanged(this, state);
});
if (state == STATE_ESTABLISHED)
{
SetMicMute(micMuted);
if (!wasEstablished)
{
wasEstablished = true;
messageThread.Post(std::bind(&VoIPController::UpdateRTT, this), 0.1, 0.5);
messageThread.Post(std::bind(&VoIPController::UpdateAudioBitrate, this), 0.0, 0.3);
messageThread.Post(std::bind(&VoIPController::UpdateCongestion, this), 0.0, 1.0);
messageThread.Post(std::bind(&VoIPController::UpdateSignalBars, this), 1.0, 1.0);
messageThread.Post(std::bind(&VoIPController::TickJitterBufferAndCongestionControl, this), 0.0, 0.1);
}
}
}
#include "controller/controller/PublicAPI.cpp"
#include "controller/controller/Init.cpp"
#include "controller/controller/Crypto.cpp"
#include "controller/controller/Time.cpp"
#include "controller/media/Audio.cpp"
#include "controller/media/Video.cpp"
#include "controller/protocol/Bandwidth.cpp"
#include "controller/protocol/Endpoints.cpp"
#include "controller/protocol/Loop.cpp"
#include "controller/protocol/NetworkAPI.cpp"
#include "controller/protocol/Tick.cpp"

View File

@ -40,7 +40,7 @@
#include "controller/net/CongestionControl.h"
#include "controller/net/NetworkSocket.h"
#include "tools/Buffers.h"
#include "controller/PacketReassembler.h"
#include "controller/net/PacketReassembler.h"
#include "tools/MessageThread.h"
#include "tools/utils.h"
#include "controller/PrivateDefines.h"
@ -581,7 +581,7 @@ private:
void SendNopPacket();
void TickJitterBufferAndCongestionControl();
void ResetUdpAvailability();
static std::string VoIPController::NetworkTypeToString(int type)
static std::string NetworkTypeToString(int type)
{
switch (type)
{
@ -612,7 +612,7 @@ private:
}
}
static std::string VoIPController::GetPacketTypeString(unsigned char type)
static std::string GetPacketTypeString(unsigned char type)
{
switch (type)
{

View File

@ -10,7 +10,7 @@
#include <stdint.h>
#include <vector>
#include <string>
#include "../controller/MediaStreamItf.h"
#include "../controller/media/MediaStreamItf.h"
namespace tgvoip
{

View File

@ -11,7 +11,7 @@
#include <string>
#include <vector>
#include <memory>
#include "../controller/MediaStreamItf.h"
#include "../controller/media/MediaStreamItf.h"
namespace tgvoip
{

View File

@ -0,0 +1,66 @@
#pragma once
#ifndef _WIN32
#include <unistd.h>
#include <sys/time.h>
#endif
#include <errno.h>
#include <string.h>
#include <wchar.h>
#include "../VoIPController.h"
#include "../tools/logging.h"
#include "../tools/threading.h"
#include "../tools/Buffers.h"
#include "../controller/audio/OpusEncoder.h"
#include "../controller/audio/OpusDecoder.h"
#include "../VoIPServerConfig.h"
#include "../controller/PrivateDefines.h"
#include "../controller/net/Endpoint.h"
#include "../tools/json11.hpp"
#include "../controller/net/PacketSender.h"
#include "../video/VideoPacketSender.h"
#include <assert.h>
#include <time.h>
#include <math.h>
#include <exception>
#include <stdexcept>
#include <algorithm>
#include <sstream>
#include <inttypes.h>
#include <float.h>
inline int pad4(int x)
{
int r = PAD4(x);
if (r == 4)
return 0;
return r;
}
using namespace tgvoip;
using namespace std;
#ifdef __APPLE__
#include "os/darwin/AudioUnitIO.h"
#include <mach/mach_time.h>
double VoIPController::machTimebase = 0;
uint64_t VoIPController::machTimestart = 0;
#endif
#ifdef _WIN32
int64_t VoIPController::win32TimeScale = 0;
bool VoIPController::didInitWin32TimeScale = false;
#endif
#ifdef __ANDROID__
#include "os/android/JNIUtilities.h"
#include "os/android/AudioInputAndroid.h"
#include "controller/net/NetworkSocket.h"
extern jclass jniUtilitiesClass;
#endif
#if defined(TGVOIP_USE_CALLBACK_AUDIO_IO)
#include "audio/AudioIOCallback.h"
#endif

View File

@ -10,7 +10,7 @@
#include "tools/threading.h"
#include "tools/Buffers.h"
#include "tools/BlockingQueue.h"
#include "controller/MediaStreamItf.h"
#include "controller/media/MediaStreamItf.h"
#include "tools/utils.h"
namespace webrtc

View File

@ -7,7 +7,7 @@
#ifndef LIBTGVOIP_OPUSDECODER_H
#define LIBTGVOIP_OPUSDECODER_H
#include "controller/MediaStreamItf.h"
#include "controller/media/MediaStreamItf.h"
#include "tools/threading.h"
#include "tools/BlockingQueue.h"
#include "tools/Buffers.h"

View File

@ -7,7 +7,7 @@
#ifndef LIBTGVOIP_OPUSENCODER_H
#define LIBTGVOIP_OPUSENCODER_H
#include "controller/MediaStreamItf.h"
#include "controller/media/MediaStreamItf.h"
#include "tools/threading.h"
#include "tools/BlockingQueue.h"
#include "tools/Buffers.h"

View File

@ -1,4 +1,4 @@
#include "../../VoIPController.h"
#include "../PrivateDefines.cpp"
using namespace tgvoip;
using namespace std;

View File

@ -1,4 +1,4 @@
#include "../../VoIPController.h"
#include "../PrivateDefines.cpp"
using namespace tgvoip;
using namespace std;

View File

@ -1,4 +1,4 @@
#include "../../VoIPController.h"
#include "../PrivateDefines.cpp"
using namespace tgvoip;
@ -734,4 +734,31 @@ CellularCarrierInfo VoIPController::GetCarrierInfo()
#else
return CellularCarrierInfo();
#endif
}
}
#pragma mark - Miscellaneous
void VoIPController::SetState(int state)
{
this->state = state;
LOGV("Call state changed to %d", state);
stateChangeTime = GetCurrentTime();
messageThread.Post([this, state] {
if (callbacks.connectionStateChanged)
callbacks.connectionStateChanged(this, state);
});
if (state == STATE_ESTABLISHED)
{
SetMicMute(micMuted);
if (!wasEstablished)
{
wasEstablished = true;
messageThread.Post(std::bind(&VoIPController::UpdateRTT, this), 0.1, 0.5);
messageThread.Post(std::bind(&VoIPController::UpdateAudioBitrate, this), 0.0, 0.3);
messageThread.Post(std::bind(&VoIPController::UpdateCongestion, this), 0.0, 1.0);
messageThread.Post(std::bind(&VoIPController::UpdateSignalBars, this), 1.0, 1.0);
messageThread.Post(std::bind(&VoIPController::TickJitterBufferAndCongestionControl, this), 0.0, 0.1);
}
}
}

View File

@ -1,4 +1,4 @@
#include "../../VoIPController.h"
#include "../PrivateDefines.cpp"
using namespace tgvoip;
using namespace std;

View File

@ -1,5 +1,5 @@
#include "../../VoIPController.h"
#include "../PrivateDefines.cpp"
using namespace tgvoip;
using namespace std;

View File

@ -5,7 +5,7 @@
//
#include "tools/logging.h"
#include "controller/MediaStreamItf.h"
#include "controller/media/MediaStreamItf.h"
#include "controller/audio/EchoCanceller.h"
#include <stdint.h>
#include <algorithm>

View File

@ -1,4 +1,4 @@
#include "../../VoIPController.h"
#include "../PrivateDefines.cpp"
using namespace tgvoip;
using namespace std;

View File

@ -10,7 +10,7 @@
#include <stdlib.h>
#include <vector>
#include <stdio.h>
#include "controller/MediaStreamItf.h"
#include "controller/media/MediaStreamItf.h"
#include "tools/BlockingQueue.h"
#include "tools/Buffers.h"
#include "tools/threading.h"

View File

@ -2,7 +2,7 @@
// Created by Grishka on 19.03.2018.
//
#include "controller/PacketReassembler.h"
#include "PacketReassembler.h"
#include "tools/logging.h"
#include "controller/PrivateDefines.h"
#include "video/VideoFEC.h"

View File

@ -1,4 +1,4 @@
#include "../../VoIPController.h"
#include "../PrivateDefines.cpp"
using namespace tgvoip;
using namespace std;

View File

@ -1,4 +1,4 @@
#include "../../VoIPController.h"
#include "../PrivateDefines.cpp"
using namespace tgvoip;
using namespace std;

View File

@ -1,4 +1,4 @@
#include "../../VoIPController.h"
#include "../PrivateDefines.cpp"
using namespace tgvoip;
using namespace std;

View File

@ -1,4 +1,4 @@
#include "../../VoIPController.h"
#include "../PrivateDefines.cpp"
using namespace tgvoip;
using namespace std;

View File

@ -1,5 +1,4 @@
#include "../../VoIPController.h"
#include "../PrivateDefines.cpp"
using namespace tgvoip;
using namespace std;

View File

@ -40,7 +40,7 @@
'<(tgvoip_src_loc)/tools/logging.cpp',
'<(tgvoip_src_loc)/tools/logging.h',
'<(tgvoip_src_loc)/controller/MediaStreamItf.cpp',
'<(tgvoip_src_loc)/controller/MediaStreamItf.h',
'<(tgvoip_src_loc)/controller/media/MediaStreamItf.h',
'<(tgvoip_src_loc)/controller/audio/OpusDecoder.cpp',
'<(tgvoip_src_loc)/controller/audio/OpusDecoder.h',
'<(tgvoip_src_loc)/controller/audio/OpusEncoder.cpp',

View File

@ -5,7 +5,7 @@
#ifndef LIBTGVOIP_VIDEOPACKETSENDER_H
#define LIBTGVOIP_VIDEOPACKETSENDER_H
#include "../controller/PacketSender.h"
#include "../controller/net/PacketSender.h"
#include "../tools/Buffers.h"
#include "../tools/threading.h"
#include <memory>