mirror of
https://github.com/danog/libtgvoip.git
synced 2024-11-26 20:24:38 +01:00
Merge pull request #58 from telegramdesktop/tdesktop
Fix build for Linux.
This commit is contained in:
commit
296187a443
@ -34,7 +34,7 @@ AudioOutput* AudioIOCallback::GetOutput(){
|
||||
#pragma mark - Input
|
||||
|
||||
AudioInputCallback::AudioInputCallback(){
|
||||
thread=new Thread(new MethodPointer<AudioInputCallback>(&AudioInputCallback::RunThread, this), NULL);
|
||||
thread=new Thread(std::bind(&AudioInputCallback::RunThread, this));
|
||||
thread->SetName("AudioInputCallback");
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ void AudioInputCallback::SetDataCallback(std::function<void(int16_t*, size_t)> c
|
||||
dataCallback=c;
|
||||
}
|
||||
|
||||
void AudioInputCallback::RunThread(void*){
|
||||
void AudioInputCallback::RunThread(){
|
||||
int16_t buf[960];
|
||||
while(running){
|
||||
double t=VoIPController::GetCurrentTime();
|
||||
@ -76,7 +76,7 @@ void AudioInputCallback::RunThread(void*){
|
||||
#pragma mark - Output
|
||||
|
||||
AudioOutputCallback::AudioOutputCallback(){
|
||||
thread=new Thread(new MethodPointer<AudioOutputCallback>(&AudioOutputCallback::RunThread, this), NULL);
|
||||
thread=new Thread(std::bind(&AudioOutputCallback::RunThread, this));
|
||||
thread->SetName("AudioOutputCallback");
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ void AudioOutputCallback::SetDataCallback(std::function<void(int16_t*, size_t)>
|
||||
dataCallback=c;
|
||||
}
|
||||
|
||||
void AudioOutputCallback::RunThread(void*){
|
||||
void AudioOutputCallback::RunThread(){
|
||||
int16_t buf[960];
|
||||
while(running){
|
||||
double t=VoIPController::GetCurrentTime();
|
||||
|
@ -22,7 +22,7 @@ namespace tgvoip{
|
||||
virtual void Stop() override;
|
||||
void SetDataCallback(std::function<void(int16_t*, size_t)> c);
|
||||
private:
|
||||
void RunThread(void*);
|
||||
void RunThread();
|
||||
bool running=false;
|
||||
bool recording=false;
|
||||
Thread* thread;
|
||||
@ -38,7 +38,7 @@ namespace tgvoip{
|
||||
virtual bool IsPlaying() override;
|
||||
void SetDataCallback(std::function<void(int16_t*, size_t)> c);
|
||||
private:
|
||||
void RunThread(void*);
|
||||
void RunThread();
|
||||
bool running=false;
|
||||
bool playing=false;
|
||||
Thread* thread;
|
||||
|
@ -54,7 +54,7 @@ void AudioInputALSA::Start(){
|
||||
return;
|
||||
|
||||
isRecording=true;
|
||||
thread=new Thread(new MethodPointer<AudioInputALSA>(&AudioInputALSA::RunThread, this), NULL);
|
||||
thread=new Thread(std::bind(&AudioInputALSA::RunThread, this));
|
||||
thread->SetName("AudioInputALSA");
|
||||
thread->Start();
|
||||
}
|
||||
@ -69,7 +69,7 @@ void AudioInputALSA::Stop(){
|
||||
thread=NULL;
|
||||
}
|
||||
|
||||
void AudioInputALSA::RunThread(void* arg){
|
||||
void AudioInputALSA::RunThread(){
|
||||
unsigned char buffer[BUFFER_SIZE*2];
|
||||
snd_pcm_sframes_t frames;
|
||||
while(isRecording){
|
||||
@ -172,4 +172,4 @@ void AudioInputALSA::EnumerateDevices(std::vector<AudioInputDevice>& devs){
|
||||
}
|
||||
|
||||
dlclose(lib);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
static void EnumerateDevices(std::vector<AudioInputDevice>& devs);
|
||||
|
||||
private:
|
||||
void RunThread(void* arg);
|
||||
void RunThread();
|
||||
|
||||
int (*_snd_pcm_open)(snd_pcm_t** pcm, const char* name, snd_pcm_stream_t stream, int mode);
|
||||
int (*_snd_pcm_set_params)(snd_pcm_t* pcm, snd_pcm_format_t format, snd_pcm_access_t access, unsigned int channels, unsigned int rate, int soft_resample, unsigned int latency);
|
||||
|
@ -53,7 +53,7 @@ void AudioOutputALSA::Start(){
|
||||
return;
|
||||
|
||||
isPlaying=true;
|
||||
thread=new Thread(new MethodPointer<AudioOutputALSA>(&AudioOutputALSA::RunThread, this), NULL);
|
||||
thread=new Thread(std::bind(&AudioOutputALSA::RunThread, this));
|
||||
thread->SetName("AudioOutputALSA");
|
||||
thread->Start();
|
||||
}
|
||||
@ -71,7 +71,7 @@ void AudioOutputALSA::Stop(){
|
||||
bool AudioOutputALSA::IsPlaying(){
|
||||
return isPlaying;
|
||||
}
|
||||
void AudioOutputALSA::RunThread(void* arg){
|
||||
void AudioOutputALSA::RunThread(){
|
||||
unsigned char buffer[BUFFER_SIZE*2];
|
||||
snd_pcm_sframes_t frames;
|
||||
while(isPlaying){
|
||||
@ -174,4 +174,4 @@ void AudioOutputALSA::EnumerateDevices(std::vector<AudioOutputDevice>& devs){
|
||||
}
|
||||
|
||||
dlclose(lib);
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
static void EnumerateDevices(std::vector<AudioOutputDevice>& devs);
|
||||
|
||||
private:
|
||||
void RunThread(void* arg);
|
||||
void RunThread();
|
||||
|
||||
int (*_snd_pcm_open)(snd_pcm_t** pcm, const char* name, snd_pcm_stream_t stream, int mode);
|
||||
int (*_snd_pcm_set_params)(snd_pcm_t* pcm, snd_pcm_format_t format, snd_pcm_access_t access, unsigned int channels, unsigned int rate, int soft_resample, unsigned int latency);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <netdb.h>
|
||||
#include <net/if.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include "../../logging.h"
|
||||
|
Loading…
Reference in New Issue
Block a user