1
0
mirror of https://github.com/danog/libtgvoip.git synced 2024-12-11 16:49:52 +01:00
libtgvoip/EchoCanceller.h

54 lines
1.4 KiB
C
Raw Normal View History

2017-02-02 17:24:40 +01:00
//
// libtgvoip is free and unencumbered public domain software.
// For more information, see http://unlicense.org or the UNLICENSE file
// you should have received with this source code distribution.
//
#ifndef LIBTGVOIP_ECHOCANCELLER_H
#define LIBTGVOIP_ECHOCANCELLER_H
#include "threading.h"
#include "BufferPool.h"
#include "BlockingQueue.h"
namespace tgvoip{
class EchoCanceller{
2017-02-02 17:24:40 +01:00
public:
EchoCanceller(bool enableAEC, bool enableNS, bool enableAGC);
virtual ~EchoCanceller();
2017-02-02 17:24:40 +01:00
virtual void Start();
virtual void Stop();
void SpeakerOutCallback(unsigned char* data, size_t len);
void Enable(bool enabled);
void ProcessInput(unsigned char* data, unsigned char* out, size_t len);
private:
2017-03-30 16:06:59 +02:00
bool enableAEC;
bool enableAGC;
bool enableNS;
#ifndef TGVOIP_NO_DSP
2017-02-02 17:24:40 +01:00
static void* StartBufferFarendThread(void* arg);
void RunBufferFarendThread();
bool didBufferFarend;
2017-03-30 16:06:59 +02:00
tgvoip_mutex_t aecMutex;
void* aec;
void* splittingFilter; // webrtc::SplittingFilter
void* splittingFilterIn; // webrtc::IFChannelBuffer
void* splittingFilterOut; // webrtc::IFChannelBuffer
void* splittingFilterFarend; // webrtc::SplittingFilter
void* splittingFilterFarendIn; // webrtc::IFChannelBuffer
void* splittingFilterFarendOut; // webrtc::IFChannelBuffer
2017-02-02 17:24:40 +01:00
tgvoip_thread_t bufferFarendThread;
BlockingQueue<int16_t*>* farendQueue;
BufferPool* farendBufferPool;
2017-02-02 17:24:40 +01:00
bool running;
void* ns; // NsxHandle
2017-03-30 16:06:59 +02:00
void* agc;
int32_t agcMicLevel;
2017-02-02 17:24:40 +01:00
#endif
};
}
2017-02-02 17:24:40 +01:00
#endif //LIBTGVOIP_ECHOCANCELLER_H