mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-06 06:58:57 +02:00
Telegram: bump version
This commit is contained in:
@@ -1,15 +1,174 @@
|
|||||||
From 957b6bc19b971d44f878a458c441301bd3215185 Mon Sep 17 00:00:00 2001
|
From 15130ecca47fcbfd3e15c9ace71b00a669042202 Mon Sep 17 00:00:00 2001
|
||||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||||
Date: Thu, 30 Aug 2018 20:14:24 +1000
|
Date: Sun, 10 Jun 2018 11:08:42 +1000
|
||||||
Subject: Add Haiku platform
|
Subject: Fix for using external opus lib
|
||||||
|
|
||||||
|
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioInputHaiku.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioInputHaiku.cpp
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/OpusDecoder.h b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/OpusDecoder.h
|
||||||
|
index 6425c97..848b930 100644
|
||||||
|
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/OpusDecoder.h
|
||||||
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/OpusDecoder.h
|
||||||
|
@@ -9,7 +9,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
#include "MediaStreamItf.h"
|
||||||
|
-#include "opus.h"
|
||||||
|
+#include <opus/opus.h>
|
||||||
|
#include "threading.h"
|
||||||
|
#include "BlockingQueue.h"
|
||||||
|
#include "Buffers.h"
|
||||||
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/OpusEncoder.h b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/OpusEncoder.h
|
||||||
|
index 4726f6b..92d8c33 100644
|
||||||
|
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/OpusEncoder.h
|
||||||
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/OpusEncoder.h
|
||||||
|
@@ -9,7 +9,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
#include "MediaStreamItf.h"
|
||||||
|
-#include "opus.h"
|
||||||
|
+#include <opus/opus.h>
|
||||||
|
#include "threading.h"
|
||||||
|
#include "BlockingQueue.h"
|
||||||
|
#include "Buffers.h"
|
||||||
|
--
|
||||||
|
2.16.4
|
||||||
|
|
||||||
|
|
||||||
|
From b4be4f2018dcc71fee9682e1f20f2a75799d9902 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||||
|
Date: Sun, 10 Jun 2018 11:10:12 +1000
|
||||||
|
Subject: Add haiku modules
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/VoIPController.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/VoIPController.cpp
|
||||||
|
index 6d266a5..d08296a 100644
|
||||||
|
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/VoIPController.cpp
|
||||||
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/VoIPController.cpp
|
||||||
|
@@ -8,6 +8,9 @@
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
+#ifdef __HAIKU__
|
||||||
|
+#include <OS.h>
|
||||||
|
+#endif
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
@@ -2404,6 +2407,10 @@ double VoIPController::GetCurrentTime(){
|
||||||
|
struct timespec ts;
|
||||||
|
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||||
|
return ts.tv_sec+(double)ts.tv_nsec/1000000000.0;
|
||||||
|
+#elif defined(__HAIKU__)
|
||||||
|
+ struct timeval tm;
|
||||||
|
+ gettimeofday(&tm, NULL);
|
||||||
|
+ return tm.tv_sec+(double)tm.tv_usec/1000000.0;
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
static pthread_once_t token = PTHREAD_ONCE_INIT;
|
||||||
|
pthread_once(&token, &initMachTimestart);
|
||||||
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/audio/AudioInput.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/audio/AudioInput.cpp
|
||||||
|
index 062ca06..887889e 100644
|
||||||
|
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/audio/AudioInput.cpp
|
||||||
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/audio/AudioInput.cpp
|
||||||
|
@@ -22,6 +22,8 @@
|
||||||
|
#elif defined(__linux__)
|
||||||
|
#include "../os/linux/AudioInputALSA.h"
|
||||||
|
#include "../os/linux/AudioInputPulse.h"
|
||||||
|
+#elif defined(__HAIKU__)
|
||||||
|
+#include "../os/haiku/AudioInputHaiku.h"
|
||||||
|
#else
|
||||||
|
#error "Unsupported operating system"
|
||||||
|
#endif
|
||||||
|
@@ -64,6 +66,8 @@ AudioInput *AudioInput::Create(std::string deviceID, void* platformSpecific){
|
||||||
|
LOGW("in: PulseAudio available but not working; trying ALSA");
|
||||||
|
}
|
||||||
|
return new AudioInputALSA(deviceID);
|
||||||
|
+#elif defined(__HAIKU__)
|
||||||
|
+ return new AudioInputHaiku(deviceID);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/audio/AudioOutput.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/audio/AudioOutput.cpp
|
||||||
|
index 109d24d..c3cc014 100644
|
||||||
|
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/audio/AudioOutput.cpp
|
||||||
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/audio/AudioOutput.cpp
|
||||||
|
@@ -25,6 +25,8 @@
|
||||||
|
#elif defined(__linux__)
|
||||||
|
#include "../os/linux/AudioOutputALSA.h"
|
||||||
|
#include "../os/linux/AudioOutputPulse.h"
|
||||||
|
+#elif defined(__HAIKU__)
|
||||||
|
+#include "../os/haiku/AudioOutputHaiku.h"
|
||||||
|
#else
|
||||||
|
#error "Unsupported operating system"
|
||||||
|
#endif
|
||||||
|
@@ -59,6 +61,9 @@ std::unique_ptr<AudioOutput> AudioOutput::Create(std::string deviceID, void* pla
|
||||||
|
LOGW("out: PulseAudio available but not working; trying ALSA");
|
||||||
|
}
|
||||||
|
return std::unique_ptr<AudioOutput>(new AudioOutputALSA(deviceID));
|
||||||
|
+#elif defined(__HAIKU__)
|
||||||
|
+ LOGW("out: MediaKitAudio enabled");
|
||||||
|
+ return std::unique_ptr<AudioOutput>(new AudioOutputHaiku(deviceID));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/libtgvoip.gyp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/libtgvoip.gyp
|
||||||
|
index f236987..24f017b 100644
|
||||||
|
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/libtgvoip.gyp
|
||||||
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/libtgvoip.gyp
|
||||||
|
@@ -100,6 +100,14 @@
|
||||||
|
'<(tgvoip_src_loc)/os/linux/PulseAudioLoader.cpp',
|
||||||
|
'<(tgvoip_src_loc)/os/linux/PulseAudioLoader.h',
|
||||||
|
|
||||||
|
+ # Haiku
|
||||||
|
+ '<(tgvoip_src_loc)/os/haiku/AudioInputHaiku.cpp',
|
||||||
|
+ '<(tgvoip_src_loc)/os/haiku/AudioInputHaiku.h',
|
||||||
|
+ '<(tgvoip_src_loc)/os/haiku/AudioOutputHaiku.cpp',
|
||||||
|
+ '<(tgvoip_src_loc)/os/haiku/AudioOutputHaiku.h',
|
||||||
|
+ '<(tgvoip_src_loc)/os/haiku/RingBuffer.cpp',
|
||||||
|
+ '<(tgvoip_src_loc)/os/haiku/RingBuffer.h',
|
||||||
|
+
|
||||||
|
# POSIX
|
||||||
|
'<(tgvoip_src_loc)/os/posix/NetworkSocketPosix.cpp',
|
||||||
|
'<(tgvoip_src_loc)/os/posix/NetworkSocketPosix.h',
|
||||||
|
@@ -253,6 +261,11 @@
|
||||||
|
'sources/': [['exclude', '<(tgvoip_src_loc)/os/posix/']],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
+ [
|
||||||
|
+ '"<(OS)" != "haiku"', {
|
||||||
|
+ 'sources/': [['exclude', '<(tgvoip_src_loc)/os/haiku/']],
|
||||||
|
+ },
|
||||||
|
+ ],
|
||||||
|
[
|
||||||
|
'"<(OS)" != "mac"', {
|
||||||
|
'sources/': [['exclude', '<(tgvoip_src_loc)/os/darwin/']],
|
||||||
|
@@ -378,6 +391,21 @@
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
+ '"<(OS)" == "haiku"', {
|
||||||
|
+ 'defines': [
|
||||||
|
+ 'WEBRTC_POSIX',
|
||||||
|
+ ],
|
||||||
|
+ 'cflags_cc': [
|
||||||
|
+ '-msse2',
|
||||||
|
+ '-std=gnu++14',
|
||||||
|
+ ],
|
||||||
|
+ 'direct_dependent_settings': {
|
||||||
|
+ 'libraries': [
|
||||||
|
+
|
||||||
|
+ ],
|
||||||
|
+ },
|
||||||
|
+ },
|
||||||
|
+ ], [
|
||||||
|
'"<(OS)" == "linux"', {
|
||||||
|
'defines': [
|
||||||
|
'WEBRTC_POSIX',
|
||||||
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.cpp
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..1bfbfad
|
index 0000000..ce54b6e
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioInputHaiku.cpp
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.cpp
|
||||||
@@ -0,0 +1,272 @@
|
@@ -0,0 +1,198 @@
|
||||||
+//
|
+//
|
||||||
+// libtgvoip is free and unencumbered public domain software.
|
+// libtgvoip is free and unencumbered public domain software.
|
||||||
+// For more information, see http://unlicense.org or the UNLICENSE file
|
+// For more information, see http://unlicense.org or the UNLICENSE file
|
||||||
@@ -22,108 +181,36 @@ index 0000000..1bfbfad
|
|||||||
+#include <dlfcn.h>
|
+#include <dlfcn.h>
|
||||||
+#include "AudioInputHaiku.h"
|
+#include "AudioInputHaiku.h"
|
||||||
+#include "../../logging.h"
|
+#include "../../logging.h"
|
||||||
+#include "../../audio/Resampler.h"
|
|
||||||
+#include "../../VoIPController.h"
|
+#include "../../VoIPController.h"
|
||||||
+
|
+
|
||||||
+#include "RingBuffer.h"
|
+#include "RingBuffer.h"
|
||||||
+
|
+
|
||||||
|
+#define BUFFER_SIZE 960
|
||||||
|
+
|
||||||
+using namespace tgvoip::audio;
|
+using namespace tgvoip::audio;
|
||||||
+
|
+
|
||||||
+void RecordData(void* cookie, bigtime_t timestamp, void* data, size_t size, const media_format &format)
|
+void RecordFile(void* cookie, bigtime_t timestamp, void* data, size_t size, const media_format &format)
|
||||||
+{
|
+{
|
||||||
+ AudioInputHaiku *audioInput = (AudioInputHaiku*)cookie;
|
+ AudioInputHaiku *obj = (AudioInputHaiku*)cookie;
|
||||||
+ if (!audioInput->IsRecording())
|
+ if (!obj->IsRecording())
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ if (format.u.raw_audio.format == media_raw_audio_format::B_AUDIO_SHORT &&
|
|
||||||
+ format.u.raw_audio.channel_count == 1) {
|
|
||||||
+ audioInput->fRingBuffer->Write((unsigned char*)data, size);
|
|
||||||
+ return;
|
+ return;
|
||||||
|
+ if (format.u.raw_audio.channel_count == 1) {
|
||||||
|
+ obj->fRingBuffer->Write((unsigned char*)data, size);
|
||||||
|
+ } else if (format.u.raw_audio.channel_count == 2) {
|
||||||
|
+ unsigned char *s = (unsigned char*)data;
|
||||||
|
+ for (int i=0; i<size/4; i++, s+=4)
|
||||||
|
+ obj->fRingBuffer->Write(s, 2);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ uint32 bytesPerSample = 2;
|
|
||||||
+ switch (format.u.raw_audio.format) {
|
|
||||||
+ case media_raw_audio_format::B_AUDIO_CHAR:
|
|
||||||
+ bytesPerSample = 1;
|
|
||||||
+ break;
|
|
||||||
+ case media_raw_audio_format::B_AUDIO_SHORT:
|
|
||||||
+ bytesPerSample = 2;
|
|
||||||
+ break;
|
|
||||||
+ case media_raw_audio_format::B_AUDIO_INT:
|
|
||||||
+ bytesPerSample = 4;
|
|
||||||
+ break;
|
|
||||||
+ case media_raw_audio_format::B_AUDIO_FLOAT:
|
|
||||||
+ bytesPerSample = 4;
|
|
||||||
+ break;
|
|
||||||
+ default:
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ int frames = size / (format.u.raw_audio.channel_count * bytesPerSample);
|
|
||||||
+ int16_t *dst = audioInput->workBuffer;
|
|
||||||
+
|
|
||||||
+ if (format.u.raw_audio.format == media_raw_audio_format::B_AUDIO_CHAR) {
|
|
||||||
+ unsigned char* src=reinterpret_cast<unsigned char*>(data);
|
|
||||||
+ for (int n=0; n < frames; n++) {
|
|
||||||
+ int32_t value = 0;
|
|
||||||
+ for (int j=0; j < format.u.raw_audio.channel_count; j++, src++) {
|
|
||||||
+ value += ((int32_t)(*src) - INT8_MAX) * UINT8_MAX;
|
|
||||||
+ }
|
|
||||||
+ value /= format.u.raw_audio.channel_count;
|
|
||||||
+ dst[n] = (int16_t)value;
|
|
||||||
+ }
|
|
||||||
+ } else if (format.u.raw_audio.format == media_raw_audio_format::B_AUDIO_SHORT) {
|
|
||||||
+ int16_t* src=reinterpret_cast<int16_t*>(data);
|
|
||||||
+ for (int n=0; n < frames; n++) {
|
|
||||||
+ int32_t value = 0;
|
|
||||||
+ for (int j=0; j < format.u.raw_audio.channel_count; j++, src++) {
|
|
||||||
+ value += *src;
|
|
||||||
+ }
|
|
||||||
+ value /= format.u.raw_audio.channel_count;
|
|
||||||
+ dst[n] = (int16_t)value;
|
|
||||||
+ }
|
|
||||||
+ } else if (format.u.raw_audio.format == media_raw_audio_format::B_AUDIO_INT) {
|
|
||||||
+ int32_t* src=reinterpret_cast<int32_t*>(data);
|
|
||||||
+ for (int n=0; n < frames; n++) {
|
|
||||||
+ int64_t value = 0;
|
|
||||||
+ for (int j=0; j < format.u.raw_audio.channel_count; j++, src++) {
|
|
||||||
+ value += (int64_t)(*src);
|
|
||||||
+ }
|
|
||||||
+ value /= format.u.raw_audio.channel_count;
|
|
||||||
+ dst[n] = (int16_t)(value / (UINT16_MAX + 1));
|
|
||||||
+ }
|
|
||||||
+ } else if (format.u.raw_audio.format == media_raw_audio_format::B_AUDIO_FLOAT) {
|
|
||||||
+ float* src=reinterpret_cast<float*>(data);
|
|
||||||
+ for (int n=0; n < frames; n++) {
|
|
||||||
+ float value = 0;
|
|
||||||
+ for (int j=0; j < format.u.raw_audio.channel_count; j++, src++) {
|
|
||||||
+ value += *src;
|
|
||||||
+ }
|
|
||||||
+ value /= format.u.raw_audio.channel_count;
|
|
||||||
+ dst[n] = (int16_t)(value*INT16_MAX);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if(format.u.raw_audio.frame_rate != audioInput->tgFrameRate) {
|
|
||||||
+ size_t len = tgvoip::audio::Resampler::Convert(dst, audioInput->convertBuffer,
|
|
||||||
+ frames, frames, audioInput->tgFrameRate, format.u.raw_audio.frame_rate) * audioInput->tgBytesPerSample;
|
|
||||||
+ audioInput->fRingBuffer->Write((unsigned char*)audioInput->convertBuffer, len);
|
|
||||||
+ } else {
|
|
||||||
+ audioInput->fRingBuffer->Write((unsigned char*)dst, frames * audioInput->tgBytesPerSample);
|
|
||||||
+ }
|
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+void NotifyRecordData(void * cookie, BMediaRecorder::notification code, ...)
|
+void NotifyRecordFile(void * cookie, BMediaRecorder::notification code, ...)
|
||||||
+{
|
+{
|
||||||
+ AudioInputHaiku *audioInput = (AudioInputHaiku*)cookie;
|
|
||||||
+ if (code == BMediaRecorder::B_WILL_STOP) {
|
+ if (code == BMediaRecorder::B_WILL_STOP) {
|
||||||
+ if (audioInput->IsRecording()) {
|
|
||||||
+ audioInput->Stop();
|
|
||||||
+ }
|
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+AudioInputHaiku::AudioInputHaiku()
|
+AudioInputHaiku::AudioInputHaiku(std::string devID)
|
||||||
+{
|
+{
|
||||||
+ fRecorder = NULL;
|
+ fRecorder = NULL;
|
||||||
+ fRingBuffer = NULL;
|
+ fRingBuffer = NULL;
|
||||||
@@ -200,7 +287,7 @@ index 0000000..1bfbfad
|
|||||||
+ }
|
+ }
|
||||||
+ fRecordFormat.type = B_MEDIA_RAW_AUDIO;
|
+ fRecordFormat.type = B_MEDIA_RAW_AUDIO;
|
||||||
+
|
+
|
||||||
+ error = fRecorder->SetHooks(RecordData, NotifyRecordData, this);
|
+ error = fRecorder->SetHooks(RecordFile, NotifyRecordFile, this);
|
||||||
+ if (error < B_OK) {
|
+ if (error < B_OK) {
|
||||||
+ failed=true;
|
+ failed=true;
|
||||||
+ return;
|
+ return;
|
||||||
@@ -235,9 +322,7 @@ index 0000000..1bfbfad
|
|||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+void AudioInputHaiku::Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels){
|
+void AudioInputHaiku::Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels){
|
||||||
+ tgFrameRate = sampleRate;
|
+
|
||||||
+ tgChannelsCount = channels;
|
|
||||||
+ tgBytesPerSample = bitsPerSample / 8;
|
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+bool AudioInputHaiku::IsRecording(){
|
+bool AudioInputHaiku::IsRecording(){
|
||||||
@@ -282,12 +367,12 @@ index 0000000..1bfbfad
|
|||||||
+ snooze(100);
|
+ snooze(100);
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioInputHaiku.h b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioInputHaiku.h
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.h b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.h
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..2425666
|
index 0000000..80573df
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioInputHaiku.h
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.h
|
||||||
@@ -0,0 +1,66 @@
|
@@ -0,0 +1,57 @@
|
||||||
+//
|
+//
|
||||||
+// libtgvoip is free and unencumbered public domain software.
|
+// libtgvoip is free and unencumbered public domain software.
|
||||||
+// For more information, see http://unlicense.org or the UNLICENSE file
|
+// For more information, see http://unlicense.org or the UNLICENSE file
|
||||||
@@ -312,29 +397,20 @@ index 0000000..2425666
|
|||||||
+
|
+
|
||||||
+#include "RingBuffer.h"
|
+#include "RingBuffer.h"
|
||||||
+
|
+
|
||||||
+#define BUFFER_SIZE 960
|
|
||||||
+
|
|
||||||
+namespace tgvoip{
|
+namespace tgvoip{
|
||||||
+namespace audio{
|
+namespace audio{
|
||||||
+
|
+
|
||||||
+class AudioInputHaiku : public AudioInput{
|
+class AudioInputHaiku : public AudioInput{
|
||||||
+
|
+
|
||||||
+public:
|
+public:
|
||||||
+ AudioInputHaiku();
|
+ AudioInputHaiku(std::string devID);
|
||||||
+ virtual ~AudioInputHaiku();
|
+ virtual ~AudioInputHaiku();
|
||||||
+ virtual void Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels);
|
+ virtual void Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels);
|
||||||
+ virtual void Start();
|
+ virtual void Start();
|
||||||
+ virtual void Stop();
|
+ virtual void Stop();
|
||||||
+ virtual bool IsRecording();
|
+ virtual bool IsRecording();
|
||||||
+
|
+
|
||||||
+ RingBuffer *fRingBuffer;
|
+ RingBuffer *fRingBuffer;
|
||||||
+ int16_t workBuffer[BUFFER_SIZE * 16];
|
|
||||||
+ int16_t convertBuffer[BUFFER_SIZE * 16];
|
|
||||||
+
|
|
||||||
+ uint32 tgFrameRate;
|
|
||||||
+ uint32 tgChannelsCount;
|
|
||||||
+ uint32 tgBytesPerSample;
|
|
||||||
+
|
|
||||||
+private:
|
+private:
|
||||||
+ void RunThread(void* arg);
|
+ void RunThread(void* arg);
|
||||||
+
|
+
|
||||||
@@ -346,20 +422,20 @@ index 0000000..2425666
|
|||||||
+ media_format fRecordFormat;
|
+ media_format fRecordFormat;
|
||||||
+ media_node fAudioInputNode;
|
+ media_node fAudioInputNode;
|
||||||
+ media_node fAudioMixerNode;
|
+ media_node fAudioMixerNode;
|
||||||
+
|
+
|
||||||
+ Thread* thread;
|
+ Thread* thread;
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+}
|
+}
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+#endif //LIBTGVOIP_AUDIOINPUTHAIKU_H
|
+#endif //LIBTGVOIP_AUDIOINPUTALSA_H
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.cpp
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..533128d
|
index 0000000..4454323
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.cpp
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp
|
||||||
@@ -0,0 +1,102 @@
|
@@ -0,0 +1,101 @@
|
||||||
+//
|
+//
|
||||||
+// libtgvoip is free and unencumbered public domain software.
|
+// libtgvoip is free and unencumbered public domain software.
|
||||||
+// For more information, see http://unlicense.org or the UNLICENSE file
|
+// For more information, see http://unlicense.org or the UNLICENSE file
|
||||||
@@ -384,7 +460,7 @@ index 0000000..533128d
|
|||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+
|
+
|
||||||
+AudioOutputHaiku::AudioOutputHaiku(){
|
+AudioOutputHaiku::AudioOutputHaiku(std::string devID){
|
||||||
+ soundPlayer = NULL;
|
+ soundPlayer = NULL;
|
||||||
+ isPlaying = false;
|
+ isPlaying = false;
|
||||||
+ isConfigured = false;
|
+ isConfigured = false;
|
||||||
@@ -406,7 +482,7 @@ index 0000000..533128d
|
|||||||
+ (uint32)channels,
|
+ (uint32)channels,
|
||||||
+ media_raw_audio_format::B_AUDIO_SHORT,
|
+ media_raw_audio_format::B_AUDIO_SHORT,
|
||||||
+ B_MEDIA_LITTLE_ENDIAN,
|
+ B_MEDIA_LITTLE_ENDIAN,
|
||||||
+ (uint32)BUFFER_SIZE * (bitsPerSample / 8) * channels
|
+ (uint32)BUFFER_SIZE * 2 * channels
|
||||||
+ };
|
+ };
|
||||||
+
|
+
|
||||||
+ switch (bitsPerSample) {
|
+ switch (bitsPerSample) {
|
||||||
@@ -430,7 +506,6 @@ index 0000000..533128d
|
|||||||
+ delete soundPlayer;
|
+ delete soundPlayer;
|
||||||
+ soundPlayer = NULL;
|
+ soundPlayer = NULL;
|
||||||
+ isPlaying = false;
|
+ isPlaying = false;
|
||||||
+ failed = true;
|
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
@@ -462,11 +537,11 @@ index 0000000..533128d
|
|||||||
+float AudioOutputHaiku::GetLevel(){
|
+float AudioOutputHaiku::GetLevel(){
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+}
|
+}
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.h b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.h
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.h b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.h
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..0ea8230
|
index 0000000..6880709
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.h
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.h
|
||||||
@@ -0,0 +1,36 @@
|
@@ -0,0 +1,36 @@
|
||||||
+//
|
+//
|
||||||
+// libtgvoip is free and unencumbered public domain software.
|
+// libtgvoip is free and unencumbered public domain software.
|
||||||
@@ -487,7 +562,7 @@ index 0000000..0ea8230
|
|||||||
+
|
+
|
||||||
+class AudioOutputHaiku : public AudioOutput{
|
+class AudioOutputHaiku : public AudioOutput{
|
||||||
+public:
|
+public:
|
||||||
+ AudioOutputHaiku();
|
+ AudioOutputHaiku(std::string devID);
|
||||||
+ virtual ~AudioOutputHaiku();
|
+ virtual ~AudioOutputHaiku();
|
||||||
+ virtual void Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels);
|
+ virtual void Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels);
|
||||||
+ virtual void Start();
|
+ virtual void Start();
|
||||||
@@ -503,12 +578,12 @@ index 0000000..0ea8230
|
|||||||
+}
|
+}
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+#endif //LIBTGVOIP_AUDIOOUTPUTHAIKU_H
|
+#endif //LIBTGVOIP_AudioOutputHaiku_H
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/RingBuffer.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/RingBuffer.cpp
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/RingBuffer.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/RingBuffer.cpp
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..43236d3
|
index 0000000..43236d3
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/RingBuffer.cpp
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/RingBuffer.cpp
|
||||||
@@ -0,0 +1,130 @@
|
@@ -0,0 +1,130 @@
|
||||||
+#include <stdio.h>
|
+#include <stdio.h>
|
||||||
+#include <stdlib.h>
|
+#include <stdlib.h>
|
||||||
@@ -640,11 +715,11 @@ index 0000000..43236d3
|
|||||||
+{
|
+{
|
||||||
+ return initialized?B_OK:B_ERROR;
|
+ return initialized?B_OK:B_ERROR;
|
||||||
+}
|
+}
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/RingBuffer.h b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/RingBuffer.h
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/RingBuffer.h b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/RingBuffer.h
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..4715632
|
index 0000000..4715632
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/RingBuffer.h
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/RingBuffer.h
|
||||||
@@ -0,0 +1,31 @@
|
@@ -0,0 +1,31 @@
|
||||||
+#ifndef __RING_BUFFER_H__
|
+#ifndef __RING_BUFFER_H__
|
||||||
+#define __RING_BUFFER_H__
|
+#define __RING_BUFFER_H__
|
||||||
@@ -677,163 +752,38 @@ index 0000000..4715632
|
|||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+#endif
|
+#endif
|
||||||
--
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/posix/NetworkSocketPosix.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/posix/NetworkSocketPosix.cpp
|
||||||
2.16.4
|
index 05ddbb9..fcf7580 100644
|
||||||
|
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/posix/NetworkSocketPosix.cpp
|
||||||
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/posix/NetworkSocketPosix.cpp
|
||||||
From 753b20ad62db41d0041b352dac9c9a45ecd3009b Mon Sep 17 00:00:00 2001
|
@@ -47,6 +47,7 @@ NetworkSocketPosix::~NetworkSocketPosix(){
|
||||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
}
|
||||||
Date: Thu, 30 Aug 2018 20:15:02 +1000
|
|
||||||
Subject: Fix Haiku build
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/VoIPController.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/VoIPController.cpp
|
|
||||||
index b82899e..700b0cd 100644
|
|
||||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/VoIPController.cpp
|
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/VoIPController.cpp
|
|
||||||
@@ -8,6 +8,9 @@
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#endif
|
|
||||||
+#ifdef __HAIKU__
|
|
||||||
+#include <OS.h>
|
|
||||||
+#endif
|
|
||||||
#include <errno.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <wchar.h>
|
|
||||||
@@ -2052,6 +2055,10 @@ double VoIPController::GetCurrentTime(){
|
|
||||||
struct timespec ts;
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
|
||||||
return ts.tv_sec+(double)ts.tv_nsec/1000000000.0;
|
|
||||||
+#elif defined(__HAIKU__)
|
|
||||||
+ struct timeval tm;
|
|
||||||
+ gettimeofday(&tm, NULL);
|
|
||||||
+ return tm.tv_sec+(double)tm.tv_usec/1000000.0;
|
|
||||||
#elif defined(__APPLE__)
|
|
||||||
static pthread_once_t token = PTHREAD_ONCE_INIT;
|
|
||||||
pthread_once(&token, &initMachTimestart);
|
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/audio/AudioIO.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/audio/AudioIO.cpp
|
|
||||||
index 06beea7..bae4d64 100644
|
|
||||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/audio/AudioIO.cpp
|
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/audio/AudioIO.cpp
|
|
||||||
@@ -37,6 +37,9 @@
|
|
||||||
#ifndef WITHOUT_PULSE
|
|
||||||
#include "../os/linux/AudioPulse.h"
|
|
||||||
#endif
|
|
||||||
+#elif defined(__HAIKU__)
|
|
||||||
+#include "../os/haiku/AudioInputHaiku.h"
|
|
||||||
+#include "../os/haiku/AudioOutputHaiku.h"
|
|
||||||
#else
|
|
||||||
#error "Unsupported operating system"
|
|
||||||
#endif
|
|
||||||
@@ -62,6 +65,8 @@ shared_ptr<AudioIO> AudioIO::Create(){
|
|
||||||
return std::make_shared<ContextlessAudioIO<AudioInputWave, AudioOutputWave>>(inputDevice, outputDevice);
|
|
||||||
#endif
|
|
||||||
return std::make_shared<ContextlessAudioIO<AudioInputWASAPI, AudioOutputWASAPI>>(inputDevice, outputDevice);
|
|
||||||
+#elif defined(__HAIKU__)
|
|
||||||
+ return std::make_shared<ContextlessAudioIO<AudioInputHaiku, AudioOutputHaiku>>();
|
|
||||||
#elif defined(__linux__)
|
|
||||||
#ifndef WITHOUT_ALSA
|
|
||||||
#ifndef WITHOUT_PULSE
|
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/audio/AudioInput.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/audio/AudioInput.cpp
|
|
||||||
index 3e3ccb9..a3e4c06 100644
|
|
||||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/audio/AudioInput.cpp
|
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/audio/AudioInput.cpp
|
|
||||||
@@ -31,6 +31,8 @@
|
|
||||||
#ifndef WITHOUT_PULSE
|
|
||||||
#include "../os/linux/AudioPulse.h"
|
|
||||||
#endif
|
|
||||||
+#elif defined(__HAIKU__)
|
|
||||||
+#include "../os/haiku/AudioInputHaiku.h"
|
|
||||||
#else
|
|
||||||
#error "Unsupported operating system"
|
|
||||||
#endif
|
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/audio/AudioOutput.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/audio/AudioOutput.cpp
|
|
||||||
index 938c1aa..36900a8 100644
|
|
||||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/audio/AudioOutput.cpp
|
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/audio/AudioOutput.cpp
|
|
||||||
@@ -35,6 +35,8 @@
|
|
||||||
#include "../os/linux/AudioOutputPulse.h"
|
|
||||||
#include "../os/linux/AudioPulse.h"
|
|
||||||
#endif
|
|
||||||
+#elif defined(__HAIKU__)
|
|
||||||
+#include "../os/haiku/AudioOutputHaiku.h"
|
|
||||||
#else
|
|
||||||
#error "Unsupported operating system"
|
|
||||||
#endif
|
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/libtgvoip.gyp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/libtgvoip.gyp
|
|
||||||
index 0cf04ea..4f21d1e 100644
|
|
||||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/libtgvoip.gyp
|
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/libtgvoip.gyp
|
|
||||||
@@ -104,6 +104,14 @@
|
|
||||||
'<(tgvoip_src_loc)/os/linux/AudioPulse.cpp',
|
|
||||||
'<(tgvoip_src_loc)/os/linux/AudioPulse.h',
|
|
||||||
|
|
||||||
+ # Haiku
|
void NetworkSocketPosix::SetMaxPriority(){
|
||||||
+ '<(tgvoip_src_loc)/os/haiku/AudioInputHaiku.cpp',
|
|
||||||
+ '<(tgvoip_src_loc)/os/haiku/AudioInputHaiku.h',
|
|
||||||
+ '<(tgvoip_src_loc)/os/haiku/AudioOutputHaiku.cpp',
|
|
||||||
+ '<(tgvoip_src_loc)/os/haiku/AudioOutputHaiku.h',
|
|
||||||
+ '<(tgvoip_src_loc)/os/haiku/RingBuffer.cpp',
|
|
||||||
+ '<(tgvoip_src_loc)/os/haiku/RingBuffer.h',
|
|
||||||
+
|
|
||||||
# POSIX
|
|
||||||
'<(tgvoip_src_loc)/os/posix/NetworkSocketPosix.cpp',
|
|
||||||
'<(tgvoip_src_loc)/os/posix/NetworkSocketPosix.h',
|
|
||||||
@@ -257,6 +265,11 @@
|
|
||||||
'sources/': [['exclude', '<(tgvoip_src_loc)/os/posix/']],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
+ [
|
|
||||||
+ '"<(OS)" != "haiku"', {
|
|
||||||
+ 'sources/': [['exclude', '<(tgvoip_src_loc)/os/haiku/']],
|
|
||||||
+ },
|
|
||||||
+ ],
|
|
||||||
[
|
|
||||||
'"<(OS)" != "mac"', {
|
|
||||||
'sources/': [['exclude', '<(tgvoip_src_loc)/os/darwin/']],
|
|
||||||
@@ -382,6 +395,21 @@
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
+ '"<(OS)" == "haiku"', {
|
|
||||||
+ 'defines': [
|
|
||||||
+ 'WEBRTC_POSIX',
|
|
||||||
+ ],
|
|
||||||
+ 'cflags_cc': [
|
|
||||||
+ '-msse2',
|
|
||||||
+ '-std=gnu++14',
|
|
||||||
+ ],
|
|
||||||
+ 'direct_dependent_settings': {
|
|
||||||
+ 'libraries': [
|
|
||||||
+
|
|
||||||
+ ],
|
|
||||||
+ },
|
|
||||||
+ },
|
|
||||||
+ ], [
|
|
||||||
'"<(OS)" == "linux"', {
|
|
||||||
'defines': [
|
|
||||||
'WEBRTC_POSIX',
|
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/posix/NetworkSocketPosix.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/posix/NetworkSocketPosix.cpp
|
|
||||||
index ef8d2cb..da39a17 100644
|
|
||||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/posix/NetworkSocketPosix.cpp
|
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/posix/NetworkSocketPosix.cpp
|
|
||||||
@@ -202,12 +202,13 @@ void NetworkSocketPosix::Open(){
|
|
||||||
}
|
|
||||||
int flag=0;
|
|
||||||
int res=setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &flag, sizeof(flag));
|
|
||||||
+#ifndef __HAIKU__
|
+#ifndef __HAIKU__
|
||||||
|
#ifdef __APPLE__
|
||||||
|
int prio=NET_SERVICE_TYPE_VO;
|
||||||
|
int res=setsockopt(fd, SOL_SOCKET, SO_NET_SERVICE_TYPE, &prio, sizeof(prio));
|
||||||
|
@@ -65,6 +66,7 @@ void NetworkSocketPosix::SetMaxPriority(){
|
||||||
|
LOGE("error setting ip tos: %d / %s", errno, strerror(errno));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
+#endif //__HAIKU__
|
||||||
|
}
|
||||||
|
|
||||||
|
void NetworkSocketPosix::Send(NetworkPacket *packet){
|
||||||
|
@@ -196,8 +198,10 @@ void NetworkSocketPosix::Open(){
|
||||||
|
int res=setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &flag, sizeof(flag));
|
||||||
if(res<0){
|
if(res<0){
|
||||||
LOGE("error enabling dual stack socket: %d / %s", errno, strerror(errno));
|
LOGE("error enabling dual stack socket: %d / %s", errno, strerror(errno));
|
||||||
|
+#ifndef __HAIKU__
|
||||||
failed=true;
|
failed=true;
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
-
|
|
||||||
+#endif
|
+#endif
|
||||||
SetMaxPriority();
|
}
|
||||||
|
|
||||||
int tries=0;
|
SetMaxPriority();
|
||||||
@@ -353,6 +354,8 @@ std::string NetworkSocketPosix::GetLocalInterfaceInfo(IPv4Address *v4addr, IPv6A
|
@@ -345,6 +349,8 @@ std::string NetworkSocketPosix::GetLocalInterfaceInfo(IPv4Address *v4addr, IPv6A
|
||||||
if(didAttach){
|
if(didAttach){
|
||||||
sharedJVM->DetachCurrentThread();
|
sharedJVM->DetachCurrentThread();
|
||||||
}
|
}
|
||||||
@@ -842,10 +792,10 @@ index ef8d2cb..da39a17 100644
|
|||||||
#else
|
#else
|
||||||
struct ifaddrs* interfaces;
|
struct ifaddrs* interfaces;
|
||||||
if(!getifaddrs(&interfaces)){
|
if(!getifaddrs(&interfaces)){
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/threading.h b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/threading.h
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/threading.h b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/threading.h
|
||||||
index 0bcf7c3..af86ef2 100644
|
index 0b4933c..87ea3b7 100644
|
||||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/threading.h
|
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/threading.h
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/threading.h
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/threading.h
|
||||||
@@ -33,7 +33,7 @@ namespace tgvoip{
|
@@ -33,7 +33,7 @@ namespace tgvoip{
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -855,17 +805,15 @@ index 0bcf7c3..af86ef2 100644
|
|||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <semaphore.h>
|
#include <semaphore.h>
|
||||||
@@ -115,6 +115,7 @@ namespace tgvoip{
|
@@ -94,11 +94,13 @@ namespace tgvoip{
|
||||||
static void* ActualEntryPoint(void* arg){
|
static void* ActualEntryPoint(void* arg){
|
||||||
Thread* self=reinterpret_cast<Thread*>(arg);
|
Thread* self=reinterpret_cast<Thread*>(arg);
|
||||||
if(self->name){
|
if(self->name){
|
||||||
+#ifndef __HAIKU__
|
+#ifndef __HAIKU__
|
||||||
#if !defined(__APPLE__) && !defined(__gnu_hurd__)
|
#ifndef __APPLE__
|
||||||
pthread_setname_np(self->thread, self->name);
|
pthread_setname_np(self->thread, self->name);
|
||||||
#elif !defined(__gnu_hurd__)
|
#else
|
||||||
@@ -123,6 +124,7 @@ namespace tgvoip{
|
pthread_setname_np(self->name);
|
||||||
DarwinSpecific::SetCurrentThreadPriority(DarwinSpecific::THREAD_PRIO_USER_INTERACTIVE);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
+#endif //__HAKIU__
|
+#endif //__HAKIU__
|
||||||
}
|
}
|
||||||
@@ -875,72 +823,230 @@ index 0bcf7c3..af86ef2 100644
|
|||||||
2.16.4
|
2.16.4
|
||||||
|
|
||||||
|
|
||||||
From 1bf1510ada4edb23b04da953284b5d1decca9bd0 Mon Sep 17 00:00:00 2001
|
From 4dbfc02248dde7ae10d29d81f25575942f204c89 Mon Sep 17 00:00:00 2001
|
||||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||||
Date: Thu, 30 Aug 2018 23:52:44 +1000
|
Date: Sun, 10 Jun 2018 22:01:28 +1000
|
||||||
Subject: Remove GetLevel function
|
Subject: Add mix and resample for haiku audio input
|
||||||
|
|
||||||
|
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.cpp
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.cpp
|
||||||
index 533128d..3dc052c 100644
|
index ce54b6e..d7cc39a 100644
|
||||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.cpp
|
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.cpp
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.cpp
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.cpp
|
||||||
@@ -96,7 +96,3 @@ void AudioOutputHaiku::Stop(){
|
@@ -10,32 +10,104 @@
|
||||||
bool AudioOutputHaiku::IsPlaying(){
|
#include <dlfcn.h>
|
||||||
return isPlaying;
|
#include "AudioInputHaiku.h"
|
||||||
}
|
#include "../../logging.h"
|
||||||
|
+#include "../../audio/Resampler.h"
|
||||||
|
#include "../../VoIPController.h"
|
||||||
|
|
||||||
|
#include "RingBuffer.h"
|
||||||
|
|
||||||
|
-#define BUFFER_SIZE 960
|
||||||
-
|
-
|
||||||
-float AudioOutputHaiku::GetLevel(){
|
using namespace tgvoip::audio;
|
||||||
- return 0;
|
|
||||||
-}
|
-void RecordFile(void* cookie, bigtime_t timestamp, void* data, size_t size, const media_format &format)
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.h b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.h
|
+void RecordData(void* cookie, bigtime_t timestamp, void* data, size_t size, const media_format &format)
|
||||||
index 0ea8230..91f2521 100644
|
{
|
||||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.h
|
- AudioInputHaiku *obj = (AudioInputHaiku*)cookie;
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.h
|
- if (!obj->IsRecording())
|
||||||
@@ -23,7 +23,6 @@ public:
|
+ AudioInputHaiku *audioInput = (AudioInputHaiku*)cookie;
|
||||||
|
+ if (!audioInput->IsRecording())
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ if (format.u.raw_audio.format == media_raw_audio_format::B_AUDIO_SHORT &&
|
||||||
|
+ format.u.raw_audio.channel_count == 1) {
|
||||||
|
+ audioInput->fRingBuffer->Write((unsigned char*)data, size);
|
||||||
|
return;
|
||||||
|
- if (format.u.raw_audio.channel_count == 1) {
|
||||||
|
- obj->fRingBuffer->Write((unsigned char*)data, size);
|
||||||
|
- } else if (format.u.raw_audio.channel_count == 2) {
|
||||||
|
- unsigned char *s = (unsigned char*)data;
|
||||||
|
- for (int i=0; i<size/4; i++, s+=4)
|
||||||
|
- obj->fRingBuffer->Write(s, 2);
|
||||||
|
}
|
||||||
|
-
|
||||||
|
+
|
||||||
|
+ uint32 bytesPerSample = 2;
|
||||||
|
+ switch (format.u.raw_audio.format) {
|
||||||
|
+ case media_raw_audio_format::B_AUDIO_CHAR:
|
||||||
|
+ bytesPerSample = 1;
|
||||||
|
+ break;
|
||||||
|
+ case media_raw_audio_format::B_AUDIO_SHORT:
|
||||||
|
+ bytesPerSample = 2;
|
||||||
|
+ break;
|
||||||
|
+ case media_raw_audio_format::B_AUDIO_INT:
|
||||||
|
+ bytesPerSample = 4;
|
||||||
|
+ break;
|
||||||
|
+ case media_raw_audio_format::B_AUDIO_FLOAT:
|
||||||
|
+ bytesPerSample = 4;
|
||||||
|
+ break;
|
||||||
|
+ default:
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ int frames = size / (format.u.raw_audio.channel_count * bytesPerSample);
|
||||||
|
+ int16_t *dst = audioInput->workBuffer;
|
||||||
|
+
|
||||||
|
+ if (format.u.raw_audio.format == media_raw_audio_format::B_AUDIO_CHAR) {
|
||||||
|
+ unsigned char* src=reinterpret_cast<unsigned char*>(data);
|
||||||
|
+ for (int n=0; n < frames; n++) {
|
||||||
|
+ int32_t value = 0;
|
||||||
|
+ for (int j=0; j < format.u.raw_audio.channel_count; j++, src++) {
|
||||||
|
+ value += ((int32_t)(*src) - INT8_MAX) * UINT8_MAX;
|
||||||
|
+ }
|
||||||
|
+ value /= format.u.raw_audio.channel_count;
|
||||||
|
+ dst[n] = (int16_t)value;
|
||||||
|
+ }
|
||||||
|
+ } else if (format.u.raw_audio.format == media_raw_audio_format::B_AUDIO_SHORT) {
|
||||||
|
+ int16_t* src=reinterpret_cast<int16_t*>(data);
|
||||||
|
+ for (int n=0; n < frames; n++) {
|
||||||
|
+ int32_t value = 0;
|
||||||
|
+ for (int j=0; j < format.u.raw_audio.channel_count; j++, src++) {
|
||||||
|
+ value += *src;
|
||||||
|
+ }
|
||||||
|
+ value /= format.u.raw_audio.channel_count;
|
||||||
|
+ dst[n] = (int16_t)value;
|
||||||
|
+ }
|
||||||
|
+ } else if (format.u.raw_audio.format == media_raw_audio_format::B_AUDIO_INT) {
|
||||||
|
+ int32_t* src=reinterpret_cast<int32_t*>(data);
|
||||||
|
+ for (int n=0; n < frames; n++) {
|
||||||
|
+ int64_t value = 0;
|
||||||
|
+ for (int j=0; j < format.u.raw_audio.channel_count; j++, src++) {
|
||||||
|
+ value += (int64_t)(*src);
|
||||||
|
+ }
|
||||||
|
+ value /= format.u.raw_audio.channel_count;
|
||||||
|
+ dst[n] = (int16_t)(value / (UINT16_MAX + 1));
|
||||||
|
+ }
|
||||||
|
+ } else if (format.u.raw_audio.format == media_raw_audio_format::B_AUDIO_FLOAT) {
|
||||||
|
+ float* src=reinterpret_cast<float*>(data);
|
||||||
|
+ for (int n=0; n < frames; n++) {
|
||||||
|
+ float value = 0;
|
||||||
|
+ for (int j=0; j < format.u.raw_audio.channel_count; j++, src++) {
|
||||||
|
+ value += *src;
|
||||||
|
+ }
|
||||||
|
+ value /= format.u.raw_audio.channel_count;
|
||||||
|
+ dst[n] = (int16_t)(value*INT16_MAX);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if(format.u.raw_audio.frame_rate != audioInput->tgFrameRate) {
|
||||||
|
+ size_t len = tgvoip::audio::Resampler::Convert(dst, audioInput->convertBuffer,
|
||||||
|
+ frames, frames, audioInput->tgFrameRate, format.u.raw_audio.frame_rate) * audioInput->tgBytesPerSample;
|
||||||
|
+ audioInput->fRingBuffer->Write((unsigned char*)audioInput->convertBuffer, len);
|
||||||
|
+ } else {
|
||||||
|
+ audioInput->fRingBuffer->Write((unsigned char*)dst, frames * audioInput->tgBytesPerSample);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
-void NotifyRecordFile(void * cookie, BMediaRecorder::notification code, ...)
|
||||||
|
+void NotifyRecordData(void * cookie, BMediaRecorder::notification code, ...)
|
||||||
|
{
|
||||||
|
+ AudioInputHaiku *audioInput = (AudioInputHaiku*)cookie;
|
||||||
|
if (code == BMediaRecorder::B_WILL_STOP) {
|
||||||
|
+ if (audioInput->IsRecording()) {
|
||||||
|
+ audioInput->Stop();
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -116,7 +188,7 @@ AudioInputHaiku::AudioInputHaiku(std::string devID)
|
||||||
|
}
|
||||||
|
fRecordFormat.type = B_MEDIA_RAW_AUDIO;
|
||||||
|
|
||||||
|
- error = fRecorder->SetHooks(RecordFile, NotifyRecordFile, this);
|
||||||
|
+ error = fRecorder->SetHooks(RecordData, NotifyRecordData, this);
|
||||||
|
if (error < B_OK) {
|
||||||
|
failed=true;
|
||||||
|
return;
|
||||||
|
@@ -151,7 +223,9 @@ AudioInputHaiku::~AudioInputHaiku(){
|
||||||
|
}
|
||||||
|
|
||||||
|
void AudioInputHaiku::Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels){
|
||||||
|
-
|
||||||
|
+ tgFrameRate = sampleRate;
|
||||||
|
+ tgChannelsCount = channels;
|
||||||
|
+ tgBytesPerSample = bitsPerSample / 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AudioInputHaiku::IsRecording(){
|
||||||
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.h b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.h
|
||||||
|
index 80573df..746d7df 100644
|
||||||
|
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.h
|
||||||
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.h
|
||||||
|
@@ -22,6 +22,8 @@
|
||||||
|
|
||||||
|
#include "RingBuffer.h"
|
||||||
|
|
||||||
|
+#define BUFFER_SIZE 960
|
||||||
|
+
|
||||||
|
namespace tgvoip{
|
||||||
|
namespace audio{
|
||||||
|
|
||||||
|
@@ -34,8 +36,15 @@ public:
|
||||||
virtual void Start();
|
virtual void Start();
|
||||||
virtual void Stop();
|
virtual void Stop();
|
||||||
virtual bool IsPlaying() override;
|
virtual bool IsRecording();
|
||||||
- virtual float GetLevel() override;
|
-
|
||||||
|
- RingBuffer *fRingBuffer;
|
||||||
|
+
|
||||||
|
+ RingBuffer *fRingBuffer;
|
||||||
|
+ int16_t workBuffer[BUFFER_SIZE * 16];
|
||||||
|
+ int16_t convertBuffer[BUFFER_SIZE * 16];
|
||||||
|
+
|
||||||
|
+ uint32 tgFrameRate;
|
||||||
|
+ uint32 tgChannelsCount;
|
||||||
|
+ uint32 tgBytesPerSample;
|
||||||
|
+
|
||||||
private:
|
private:
|
||||||
bool isPlaying;
|
void RunThread(void* arg);
|
||||||
bool isConfigured;
|
|
||||||
--
|
@@ -47,11 +56,11 @@ private:
|
||||||
2.16.4
|
media_format fRecordFormat;
|
||||||
|
media_node fAudioInputNode;
|
||||||
|
media_node fAudioMixerNode;
|
||||||
From 50540bcbe0cd11cf96cf6b095d99e2ed5ab36d30 Mon Sep 17 00:00:00 2001
|
-
|
||||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
+
|
||||||
Date: Thu, 30 Aug 2018 23:53:16 +1000
|
Thread* thread;
|
||||||
Subject: Fix opus includes
|
};
|
||||||
|
|
||||||
|
}
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusDecoder.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusDecoder.cpp
|
}
|
||||||
index 87a48eb..545113a 100644
|
|
||||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusDecoder.cpp
|
-#endif //LIBTGVOIP_AUDIOINPUTALSA_H
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusDecoder.cpp
|
+#endif //LIBTGVOIP_AUDIOINPUTHAIKU_H
|
||||||
@@ -10,7 +10,7 @@
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp
|
||||||
#include <assert.h>
|
index 4454323..11650da 100644
|
||||||
#include <math.h>
|
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp
|
||||||
#include <algorithm>
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp
|
||||||
-#ifdef HAVE_CONFIG_H
|
@@ -44,7 +44,7 @@ void AudioOutputHaiku::Configure(uint32_t sampleRate, uint32_t bitsPerSample, ui
|
||||||
+#if defined(HAVE_CONFIG_H) || defined(__HAIKU__)
|
(uint32)channels,
|
||||||
#include <opus/opus.h>
|
media_raw_audio_format::B_AUDIO_SHORT,
|
||||||
#else
|
B_MEDIA_LITTLE_ENDIAN,
|
||||||
#include "opus.h"
|
- (uint32)BUFFER_SIZE * 2 * channels
|
||||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusEncoder.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusEncoder.cpp
|
+ (uint32)BUFFER_SIZE * (bitsPerSample / 8) * channels
|
||||||
index e30f814..c31aee2 100644
|
};
|
||||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusEncoder.cpp
|
|
||||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusEncoder.cpp
|
switch (bitsPerSample) {
|
||||||
@@ -8,7 +8,7 @@
|
@@ -68,6 +68,7 @@ void AudioOutputHaiku::Configure(uint32_t sampleRate, uint32_t bitsPerSample, ui
|
||||||
#include <assert.h>
|
delete soundPlayer;
|
||||||
#include "logging.h"
|
soundPlayer = NULL;
|
||||||
#include "VoIPServerConfig.h"
|
isPlaying = false;
|
||||||
-#ifdef HAVE_CONFIG_H
|
+ failed = true;
|
||||||
+#if defined(HAVE_CONFIG_H) || defined(__HAIKU__)
|
return;
|
||||||
#include <opus/opus.h>
|
}
|
||||||
#else
|
|
||||||
#include "opus.h"
|
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.h b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.h
|
||||||
|
index 6880709..6a463fa 100644
|
||||||
|
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.h
|
||||||
|
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.h
|
||||||
|
@@ -33,4 +33,4 @@ private:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-#endif //LIBTGVOIP_AudioOutputHaiku_H
|
||||||
|
+#endif //LIBTGVOIP_AUDIOOUTPUTHAIKU_H
|
||||||
--
|
--
|
||||||
2.16.4
|
2.16.4
|
||||||
|
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
|
From: Giovanni Santini <giovannisantini93@yahoo.it>
|
||||||
|
Date: Sun, 02 Sep 2018 11:28:00 +0200
|
||||||
|
Subject: [PATCH] Linux "clean" build
|
||||||
|
This patch is a refreshed version of the patch usually applied
|
||||||
|
during ArchLinux builds of Telegram Desktop.
|
||||||
diff --git a/Telegram/Resources/qrc/telegram_linux.qrc b/Telegram/Resources/qrc/telegram_linux.qrc
|
diff --git a/Telegram/Resources/qrc/telegram_linux.qrc b/Telegram/Resources/qrc/telegram_linux.qrc
|
||||||
index 0554fa1..3ea0274 100644
|
index 0554fa179..3ea027406 100644
|
||||||
--- a/Telegram/Resources/qrc/telegram_linux.qrc
|
--- a/Telegram/Resources/qrc/telegram_linux.qrc
|
||||||
+++ b/Telegram/Resources/qrc/telegram_linux.qrc
|
+++ b/Telegram/Resources/qrc/telegram_linux.qrc
|
||||||
@@ -1,5 +1,4 @@
|
@@ -1,5 +1,4 @@
|
||||||
@@ -9,10 +14,10 @@ index 0554fa1..3ea0274 100644
|
|||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp
|
diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp
|
||||||
index 2078858..1a70da9 100644
|
index d4bdadc17..8a420c74b 100644
|
||||||
--- a/Telegram/SourceFiles/core/launcher.cpp
|
--- a/Telegram/SourceFiles/core/launcher.cpp
|
||||||
+++ b/Telegram/SourceFiles/core/launcher.cpp
|
+++ b/Telegram/SourceFiles/core/launcher.cpp
|
||||||
@@ -37,9 +37,10 @@ void Launcher::init() {
|
@@ -39,9 +39,10 @@ void Launcher::init() {
|
||||||
|
|
||||||
QCoreApplication::setApplicationName(qsl("TelegramDesktop"));
|
QCoreApplication::setApplicationName(qsl("TelegramDesktop"));
|
||||||
|
|
||||||
@@ -25,7 +30,7 @@ index 2078858..1a70da9 100644
|
|||||||
|
|
||||||
initHook();
|
initHook();
|
||||||
}
|
}
|
||||||
@@ -57,6 +58,13 @@ int Launcher::exec() {
|
@@ -59,6 +60,13 @@ int Launcher::exec() {
|
||||||
Logs::start(this); // must be started before Platform is started
|
Logs::start(this); // must be started before Platform is started
|
||||||
Platform::start(); // must be started before QApplication is created
|
Platform::start(); // must be started before QApplication is created
|
||||||
|
|
||||||
@@ -40,7 +45,7 @@ index 2078858..1a70da9 100644
|
|||||||
|
|
||||||
DEBUG_LOG(("Telegram finished, result: %1").arg(result));
|
DEBUG_LOG(("Telegram finished, result: %1").arg(result));
|
||||||
diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.h b/Telegram/SourceFiles/platform/linux/linux_libs.h
|
diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.h b/Telegram/SourceFiles/platform/linux/linux_libs.h
|
||||||
index 6f93d69..df185d5 100644
|
index 6f93d69cd..df185d5a2 100644
|
||||||
--- a/Telegram/SourceFiles/platform/linux/linux_libs.h
|
--- a/Telegram/SourceFiles/platform/linux/linux_libs.h
|
||||||
+++ b/Telegram/SourceFiles/platform/linux/linux_libs.h
|
+++ b/Telegram/SourceFiles/platform/linux/linux_libs.h
|
||||||
@@ -17,7 +17,7 @@ extern "C" {
|
@@ -17,7 +17,7 @@ extern "C" {
|
||||||
@@ -54,7 +59,7 @@ index 6f93d69..df185d5 100644
|
|||||||
|
|
||||||
diff --git a/Telegram/SourceFiles/qt_functions.cpp b/Telegram/SourceFiles/qt_functions.cpp
|
diff --git a/Telegram/SourceFiles/qt_functions.cpp b/Telegram/SourceFiles/qt_functions.cpp
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 00000000..4a722b8d
|
index 000000000..4a722b8d7
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/Telegram/SourceFiles/qt_functions.cpp
|
+++ b/Telegram/SourceFiles/qt_functions.cpp
|
||||||
@@ -0,0 +1,94 @@
|
@@ -0,0 +1,94 @@
|
||||||
@@ -153,7 +158,7 @@ index 00000000..4a722b8d
|
|||||||
+ flags |= QTextItem::StrikeOut;
|
+ flags |= QTextItem::StrikeOut;
|
||||||
+}
|
+}
|
||||||
diff --git a/Telegram/SourceFiles/qt_static_plugins.cpp b/Telegram/SourceFiles/qt_static_plugins.cpp
|
diff --git a/Telegram/SourceFiles/qt_static_plugins.cpp b/Telegram/SourceFiles/qt_static_plugins.cpp
|
||||||
index e29f348..122ff0f 100644
|
index e29f348c8..122ff0f5d 100644
|
||||||
--- a/Telegram/SourceFiles/qt_static_plugins.cpp
|
--- a/Telegram/SourceFiles/qt_static_plugins.cpp
|
||||||
+++ b/Telegram/SourceFiles/qt_static_plugins.cpp
|
+++ b/Telegram/SourceFiles/qt_static_plugins.cpp
|
||||||
@@ -15,13 +15,4 @@ Q_IMPORT_PLUGIN(QWebpPlugin)
|
@@ -15,13 +15,4 @@ Q_IMPORT_PLUGIN(QWebpPlugin)
|
||||||
@@ -171,7 +176,7 @@ index e29f348..122ff0f 100644
|
|||||||
-Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin)
|
-Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin)
|
||||||
#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX
|
#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX
|
||||||
diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp
|
diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp
|
||||||
index 944f584..887c198 100644
|
index 944f58479..887c1982f 100644
|
||||||
--- a/Telegram/SourceFiles/ui/text/text.cpp
|
--- a/Telegram/SourceFiles/ui/text/text.cpp
|
||||||
+++ b/Telegram/SourceFiles/ui/text/text.cpp
|
+++ b/Telegram/SourceFiles/ui/text/text.cpp
|
||||||
@@ -1750,11 +1750,11 @@ private:
|
@@ -1750,11 +1750,11 @@ private:
|
||||||
@@ -190,7 +195,7 @@ index 944f584..887c198 100644
|
|||||||
auto blockIndex = _lineStartBlock;
|
auto blockIndex = _lineStartBlock;
|
||||||
auto currentBlock = _t->_blocks[blockIndex].get();
|
auto currentBlock = _t->_blocks[blockIndex].get();
|
||||||
diff --git a/Telegram/SourceFiles/ui/text/text_block.cpp b/Telegram/SourceFiles/ui/text/text_block.cpp
|
diff --git a/Telegram/SourceFiles/ui/text/text_block.cpp b/Telegram/SourceFiles/ui/text/text_block.cpp
|
||||||
index 2959cec..04ad006 100644
|
index 2959cec77..04ad00645 100644
|
||||||
--- a/Telegram/SourceFiles/ui/text/text_block.cpp
|
--- a/Telegram/SourceFiles/ui/text/text_block.cpp
|
||||||
+++ b/Telegram/SourceFiles/ui/text/text_block.cpp
|
+++ b/Telegram/SourceFiles/ui/text/text_block.cpp
|
||||||
@@ -332,6 +332,9 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi
|
@@ -332,6 +332,9 @@ TextBlock::TextBlock(const style::font &font, const QString &str, QFixed minResi
|
||||||
@@ -204,10 +209,10 @@ index 2959cec..04ad006 100644
|
|||||||
CrashReports::ClearAnnotationRef("CrashString");
|
CrashReports::ClearAnnotationRef("CrashString");
|
||||||
}
|
}
|
||||||
diff --git a/Telegram/SourceFiles/ui/twidget.cpp b/Telegram/SourceFiles/ui/twidget.cpp
|
diff --git a/Telegram/SourceFiles/ui/twidget.cpp b/Telegram/SourceFiles/ui/twidget.cpp
|
||||||
index 0f610cb..b005589 100644
|
index 71f318229..461f52278 100644
|
||||||
--- a/Telegram/SourceFiles/ui/twidget.cpp
|
--- a/Telegram/SourceFiles/ui/twidget.cpp
|
||||||
+++ b/Telegram/SourceFiles/ui/twidget.cpp
|
+++ b/Telegram/SourceFiles/ui/twidget.cpp
|
||||||
@@ -227,9 +227,9 @@ void sendSynteticMouseEvent(QWidget *widget, QEvent::Type type, Qt::MouseButton
|
@@ -233,9 +233,9 @@ void sendSynteticMouseEvent(QWidget *widget, QEvent::Type type, Qt::MouseButton
|
||||||
, button
|
, button
|
||||||
, QGuiApplication::mouseButtons() | button
|
, QGuiApplication::mouseButtons() | button
|
||||||
, QGuiApplication::keyboardModifiers()
|
, QGuiApplication::keyboardModifiers()
|
||||||
@@ -220,7 +225,7 @@ index 0f610cb..b005589 100644
|
|||||||
ev.setTimestamp(getms());
|
ev.setTimestamp(getms());
|
||||||
QGuiApplication::sendEvent(windowHandle, &ev);
|
QGuiApplication::sendEvent(windowHandle, &ev);
|
||||||
diff --git a/Telegram/gyp/PrecompiledHeader.cmake b/Telegram/gyp/PrecompiledHeader.cmake
|
diff --git a/Telegram/gyp/PrecompiledHeader.cmake b/Telegram/gyp/PrecompiledHeader.cmake
|
||||||
index a0e1e04..bd9bce0 100644
|
index a0e1e0489..223113081 100644
|
||||||
--- a/Telegram/gyp/PrecompiledHeader.cmake
|
--- a/Telegram/gyp/PrecompiledHeader.cmake
|
||||||
+++ b/Telegram/gyp/PrecompiledHeader.cmake
|
+++ b/Telegram/gyp/PrecompiledHeader.cmake
|
||||||
@@ -114,7 +114,7 @@ function(add_precompiled_header _target _input)
|
@@ -114,7 +114,7 @@ function(add_precompiled_header _target _input)
|
||||||
@@ -228,7 +233,7 @@ index a0e1e04..bd9bce0 100644
|
|||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${_output_c}"
|
OUTPUT "${_output_c}"
|
||||||
- COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} -x c-header -o "${_output_c}" -c "${_pchfile}"
|
- COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} -x c-header -o "${_output_c}" -c "${_pchfile}"
|
||||||
+ COMMAND "${CMAKE_C_COMPILER}" "$(C_DEFINES)" "$(C_INCLUDES)" "$(C_FLAGS)" -x c-header -o "${_output_c}" -c "${_pchfile}"
|
+ COMMAND "${CMAKE_C_COMPILER}" ${_compiler_FLAGS} "$(C_DEFINES)" "$(C_INCLUDES)" "$(C_FLAGS)" -x c-header -o "${_output_c}" -c "${_pchfile}"
|
||||||
DEPENDS "${_pchfile}" "${_pch_c_flags_file}"
|
DEPENDS "${_pchfile}" "${_pch_c_flags_file}"
|
||||||
IMPLICIT_DEPENDS C "${_pch_header}"
|
IMPLICIT_DEPENDS C "${_pch_header}"
|
||||||
COMMENT "Precompiling ${_name} for ${_target} (C)")
|
COMMENT "Precompiling ${_name} for ${_target} (C)")
|
||||||
@@ -237,48 +242,32 @@ index a0e1e04..bd9bce0 100644
|
|||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${_output_cxx}"
|
OUTPUT "${_output_cxx}"
|
||||||
- COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} -x c++-header -o "${_output_cxx}" -c "${_pchfile}"
|
- COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} -x c++-header -o "${_output_cxx}" -c "${_pchfile}"
|
||||||
+ COMMAND "${CMAKE_CXX_COMPILER}" "$(CXX_DEFINES)" "$(CXX_INCLUDES)" "$(CXX_FLAGS)" -x c++-header -o "${_output_cxx}" -c "${_pchfile}"
|
+ COMMAND "${CMAKE_CXX_COMPILER}" ${_compiler_FLAGS} "$(CXX_DEFINES)" "$(CXX_INCLUDES)" "$(CXX_FLAGS)" -x c++-header -o "${_output_cxx}" -c "${_pchfile}"
|
||||||
DEPENDS "${_pchfile}" "${_pch_cpp_flags_file}"
|
DEPENDS "${_pchfile}" "${_pch_cpp_flags_file}"
|
||||||
IMPLICIT_DEPENDS CXX "${_pch_header}"
|
IMPLICIT_DEPENDS CXX "${_pch_header}"
|
||||||
COMMENT "Precompiling header ${_name} for ${_target} (C++)")
|
COMMENT "Precompiling header ${_name} for ${_target} (C++)")
|
||||||
diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp
|
diff --git a/Telegram/gyp/Telegram.gyp b/Telegram/gyp/Telegram.gyp
|
||||||
index 65917d9..d91e55c 100644
|
index 1cab5ae29..2c6ef58cb 100644
|
||||||
--- a/Telegram/gyp/Telegram.gyp
|
--- a/Telegram/gyp/Telegram.gyp
|
||||||
+++ b/Telegram/gyp/Telegram.gyp
|
+++ b/Telegram/gyp/Telegram.gyp
|
||||||
@@ -74,14 +74,12 @@
|
@@ -75,7 +75,6 @@
|
||||||
'codegen.gyp:codegen_numbers',
|
'codegen.gyp:codegen_numbers',
|
||||||
'codegen.gyp:codegen_style',
|
'codegen.gyp:codegen_style',
|
||||||
'tests/tests.gyp:tests',
|
'tests/tests.gyp:tests',
|
||||||
- 'utils.gyp:Updater',
|
- 'utils.gyp:Updater',
|
||||||
'../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip',
|
'../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip',
|
||||||
'crl.gyp:crl',
|
'crl.gyp:crl',
|
||||||
'lib_export.gyp:lib_export',
|
'lib_base.gyp:lib_base',
|
||||||
|
@@ -84,7 +83,6 @@
|
||||||
],
|
],
|
||||||
|
|
||||||
'defines': [
|
'defines': [
|
||||||
- 'AL_LIBTYPE_STATIC',
|
- 'AL_LIBTYPE_STATIC',
|
||||||
'AL_ALEXT_PROTOTYPES',
|
'AL_ALEXT_PROTOTYPES',
|
||||||
'TGVOIP_USE_CXX11_LIB',
|
'TGVOIP_USE_CXX11_LIB',
|
||||||
'<!@(python -c "for s in \'<(build_defines)\'.split(\',\'): print(s)")',
|
'XXH_INLINE_ALL',
|
||||||
@@ -90,15 +88,7 @@
|
|
||||||
'include_dirs': [
|
|
||||||
'<(src_loc)',
|
|
||||||
'<(SHARED_INTERMEDIATE_DIR)',
|
|
||||||
- '<(libs_loc)/breakpad/src',
|
|
||||||
- '<(libs_loc)/lzma/C',
|
|
||||||
- '<(libs_loc)/zlib',
|
|
||||||
- '<(libs_loc)/ffmpeg',
|
|
||||||
- '<(libs_loc)/openal-soft/include',
|
|
||||||
- '<(libs_loc)/opus/include',
|
|
||||||
- '<(libs_loc)/range-v3/include',
|
|
||||||
- '<(minizip_loc)',
|
|
||||||
- '<(sp_media_key_tap_loc)',
|
|
||||||
+ '/usr/include/minizip',
|
|
||||||
'<(emoji_suggestions_loc)',
|
|
||||||
'<(submodules_loc)/GSL/include',
|
|
||||||
'<(submodules_loc)/variant/include',
|
|
||||||
diff --git a/Telegram/gyp/qt.gypi b/Telegram/gyp/qt.gypi
|
diff --git a/Telegram/gyp/qt.gypi b/Telegram/gyp/qt.gypi
|
||||||
index 0b783ec..3f91776 100644
|
index 0b783ec21..3f917765a 100644
|
||||||
--- a/Telegram/gyp/qt.gypi
|
--- a/Telegram/gyp/qt.gypi
|
||||||
+++ b/Telegram/gyp/qt.gypi
|
+++ b/Telegram/gyp/qt.gypi
|
||||||
@@ -14,25 +14,21 @@
|
@@ -14,25 +14,21 @@
|
||||||
@@ -408,7 +397,7 @@ index 0b783ec..3f91776 100644
|
|||||||
'-rdynamic',
|
'-rdynamic',
|
||||||
],
|
],
|
||||||
diff --git a/Telegram/gyp/qt_moc.gypi b/Telegram/gyp/qt_moc.gypi
|
diff --git a/Telegram/gyp/qt_moc.gypi b/Telegram/gyp/qt_moc.gypi
|
||||||
index 464d3c8..f350da8 100644
|
index 464d3c818..f350da8f3 100644
|
||||||
--- a/Telegram/gyp/qt_moc.gypi
|
--- a/Telegram/gyp/qt_moc.gypi
|
||||||
+++ b/Telegram/gyp/qt_moc.gypi
|
+++ b/Telegram/gyp/qt_moc.gypi
|
||||||
@@ -12,7 +12,7 @@
|
@@ -12,7 +12,7 @@
|
||||||
@@ -421,7 +410,7 @@ index 464d3c8..f350da8 100644
|
|||||||
# Silence "Note: No relevant classes found. No output generated."
|
# Silence "Note: No relevant classes found. No output generated."
|
||||||
'--no-notes',
|
'--no-notes',
|
||||||
diff --git a/Telegram/gyp/qt_rcc.gypi b/Telegram/gyp/qt_rcc.gypi
|
diff --git a/Telegram/gyp/qt_rcc.gypi b/Telegram/gyp/qt_rcc.gypi
|
||||||
index f5624a8..1129a95 100644
|
index f5624a82b..1129a95c5 100644
|
||||||
--- a/Telegram/gyp/qt_rcc.gypi
|
--- a/Telegram/gyp/qt_rcc.gypi
|
||||||
+++ b/Telegram/gyp/qt_rcc.gypi
|
+++ b/Telegram/gyp/qt_rcc.gypi
|
||||||
@@ -15,7 +15,7 @@
|
@@ -15,7 +15,7 @@
|
||||||
@@ -434,7 +423,7 @@ index f5624a8..1129a95 100644
|
|||||||
'-no-compress',
|
'-no-compress',
|
||||||
'<(RULE_INPUT_PATH)',
|
'<(RULE_INPUT_PATH)',
|
||||||
diff --git a/Telegram/gyp/settings_linux.gypi b/Telegram/gyp/settings_linux.gypi
|
diff --git a/Telegram/gyp/settings_linux.gypi b/Telegram/gyp/settings_linux.gypi
|
||||||
index 17219fa..6853b5c 100644
|
index 17219fa2c..6853b5c3e 100644
|
||||||
--- a/Telegram/gyp/settings_linux.gypi
|
--- a/Telegram/gyp/settings_linux.gypi
|
||||||
+++ b/Telegram/gyp/settings_linux.gypi
|
+++ b/Telegram/gyp/settings_linux.gypi
|
||||||
@@ -11,7 +11,6 @@
|
@@ -11,7 +11,6 @@
|
||||||
@@ -454,10 +443,10 @@ index 17219fa..6853b5c 100644
|
|||||||
],
|
],
|
||||||
'cflags_c': [
|
'cflags_c': [
|
||||||
diff --git a/Telegram/gyp/telegram_linux.gypi b/Telegram/gyp/telegram_linux.gypi
|
diff --git a/Telegram/gyp/telegram_linux.gypi b/Telegram/gyp/telegram_linux.gypi
|
||||||
index 01231c4..00a9c08 100644
|
index 80259c687..b5e3c18a2 100644
|
||||||
--- a/Telegram/gyp/telegram_linux.gypi
|
--- a/Telegram/gyp/telegram_linux.gypi
|
||||||
+++ b/Telegram/gyp/telegram_linux.gypi
|
+++ b/Telegram/gyp/telegram_linux.gypi
|
||||||
@@ -20,10 +20,11 @@
|
@@ -23,10 +23,11 @@
|
||||||
'linux_path_va%': '/usr/local',
|
'linux_path_va%': '/usr/local',
|
||||||
'linux_path_vdpau%': '/usr/local',
|
'linux_path_vdpau%': '/usr/local',
|
||||||
'linux_path_breakpad%': '/usr/local',
|
'linux_path_breakpad%': '/usr/local',
|
||||||
@@ -470,7 +459,7 @@ index 01231c4..00a9c08 100644
|
|||||||
'/usr/local/include',
|
'/usr/local/include',
|
||||||
'<(linux_path_ffmpeg)/include',
|
'<(linux_path_ffmpeg)/include',
|
||||||
'<(linux_path_openal)/include',
|
'<(linux_path_openal)/include',
|
||||||
@@ -32,6 +33,7 @@
|
@@ -35,6 +36,7 @@
|
||||||
'<(linux_path_range)/include',
|
'<(linux_path_range)/include',
|
||||||
],
|
],
|
||||||
'library_dirs': [
|
'library_dirs': [
|
||||||
@@ -478,7 +467,7 @@ index 01231c4..00a9c08 100644
|
|||||||
'/usr/local/lib',
|
'/usr/local/lib',
|
||||||
'<(linux_path_ffmpeg)/lib',
|
'<(linux_path_ffmpeg)/lib',
|
||||||
'<(linux_path_openal)/lib',
|
'<(linux_path_openal)/lib',
|
||||||
@@ -40,25 +42,15 @@
|
@@ -43,25 +45,16 @@
|
||||||
'<(linux_path_breakpad)/lib',
|
'<(linux_path_breakpad)/lib',
|
||||||
],
|
],
|
||||||
'libraries': [
|
'libraries': [
|
||||||
@@ -510,17 +499,11 @@ index 01231c4..00a9c08 100644
|
|||||||
+ 'minizip',
|
+ 'minizip',
|
||||||
+ 'opus',
|
+ 'opus',
|
||||||
+ 'z',
|
+ 'z',
|
||||||
|
+ 'lzma',
|
||||||
# '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
|
# '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
|
||||||
],
|
],
|
||||||
'cflags_cc': [
|
'cflags_cc': [
|
||||||
@@ -87,16 +79,14 @@
|
@@ -96,10 +89,8 @@
|
||||||
},
|
|
||||||
},
|
|
||||||
'conditions': [
|
|
||||||
- [ '"<!(uname -p)" != "x86_64"', {
|
|
||||||
+ [ '"<!(uname -m)" != "x86_64"', {
|
|
||||||
'ldflags': [
|
|
||||||
'-Wl,-wrap,__divmoddi4',
|
|
||||||
],
|
],
|
||||||
}], ['not_need_gtk!="True"', {
|
}], ['not_need_gtk!="True"', {
|
||||||
'cflags_cc': [
|
'cflags_cc': [
|
||||||
@@ -534,10 +517,10 @@ index 01231c4..00a9c08 100644
|
|||||||
}]
|
}]
|
||||||
],
|
],
|
||||||
diff --git a/Telegram/gyp/telegram_sources.txt b/Telegram/gyp/telegram_sources.txt
|
diff --git a/Telegram/gyp/telegram_sources.txt b/Telegram/gyp/telegram_sources.txt
|
||||||
index 7a10328..397d2a2 100644
|
index dd4f848db..22cf8866c 100644
|
||||||
--- a/Telegram/gyp/telegram_sources.txt
|
--- a/Telegram/gyp/telegram_sources.txt
|
||||||
+++ b/Telegram/gyp/telegram_sources.txt
|
+++ b/Telegram/gyp/telegram_sources.txt
|
||||||
@@ -797,14 +797,7 @@
|
@@ -765,14 +765,7 @@
|
||||||
<(emoji_suggestions_loc)/emoji_suggestions.cpp
|
<(emoji_suggestions_loc)/emoji_suggestions.cpp
|
||||||
<(emoji_suggestions_loc)/emoji_suggestions.h
|
<(emoji_suggestions_loc)/emoji_suggestions.h
|
||||||
|
|
||||||
@@ -551,5 +534,5 @@ index 7a10328..397d2a2 100644
|
|||||||
-<(minizip_loc)/unzip.h
|
-<(minizip_loc)/unzip.h
|
||||||
+<(src_loc)/qt_functions.cpp
|
+<(src_loc)/qt_functions.cpp
|
||||||
|
|
||||||
platforms: mac
|
platforms: win
|
||||||
<(sp_media_key_tap_loc)/SPMediaKeyTap.m
|
<(res_loc)/winrc/Telegram.rc
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -5,12 +5,12 @@ COPYRIGHT="2013-2018 Telegram"
|
|||||||
LICENSE="GNU GPL v3"
|
LICENSE="GNU GPL v3"
|
||||||
REVISION="1"
|
REVISION="1"
|
||||||
SOURCE_URI="https://github.com/telegramdesktop/tdesktop/archive/v$portVersion.tar.gz"
|
SOURCE_URI="https://github.com/telegramdesktop/tdesktop/archive/v$portVersion.tar.gz"
|
||||||
CHECKSUM_SHA256="83daeded641f79bd370b5e83be88242ab57520e7754f1371a9e5c1f3d9863f2a"
|
CHECKSUM_SHA256="0ebb775dc6535eb3fef290d292b528073e02b4777068425c31f735091902d966"
|
||||||
SOURCE_FILENAME="tdesktop-$portVersion.tar.gz"
|
SOURCE_FILENAME="tdesktop-$portVersion.tar.gz"
|
||||||
SOURCE_DIR="tdesktop-$portVersion"
|
SOURCE_DIR="tdesktop-$portVersion"
|
||||||
srcGitRev_2="bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34"
|
srcGitRev_2="697eea96aa90205db4fc368df4127eef56b2a5c6"
|
||||||
SOURCE_URI_2="https://github.com/telegramdesktop/libtgvoip/archive/$srcGitRev_2.tar.gz"
|
SOURCE_URI_2="https://github.com/telegramdesktop/libtgvoip/archive/$srcGitRev_2.tar.gz"
|
||||||
CHECKSUM_SHA256_2="74cf9046687e88ab6074e8f8946da53d95b11abb34a51db1f042ab0ae14f1b91"
|
CHECKSUM_SHA256_2="1a7c7b7b3757a6eaec6ab283a0203426690775b2564b2ab5f5a26ab0518fe579"
|
||||||
SOURCE_FILENAME_2="libtgvoip-$srcGitRev_2.tar.gz"
|
SOURCE_FILENAME_2="libtgvoip-$srcGitRev_2.tar.gz"
|
||||||
srcGitRev_3="550ac2f159ca883d360c196149b466955c77a573"
|
srcGitRev_3="550ac2f159ca883d360c196149b466955c77a573"
|
||||||
SOURCE_URI_3="https://github.com/mapbox/variant/archive/$srcGitRev_3.tar.gz"
|
SOURCE_URI_3="https://github.com/mapbox/variant/archive/$srcGitRev_3.tar.gz"
|
||||||
@@ -24,14 +24,18 @@ srcGitRev_5="5ca44b68721833ae3731802ed99af67c6f38a53a"
|
|||||||
SOURCE_URI_5="https://github.com/philsquared/Catch/archive/$srcGitRev_5.tar.gz"
|
SOURCE_URI_5="https://github.com/philsquared/Catch/archive/$srcGitRev_5.tar.gz"
|
||||||
CHECKSUM_SHA256_5="d24e6d9df2b8aa5739d3b9077c6b0ff0ef4d5ef8acc52c3a57e32893854d8d18"
|
CHECKSUM_SHA256_5="d24e6d9df2b8aa5739d3b9077c6b0ff0ef4d5ef8acc52c3a57e32893854d8d18"
|
||||||
SOURCE_FILENAME_5="Catch-$srcGitRev_5.tar.gz"
|
SOURCE_FILENAME_5="Catch-$srcGitRev_5.tar.gz"
|
||||||
srcGitRev_6="527ad273b683d52c5adf5b45b73c6466aa0d0cf0"
|
srcGitRev_6="4291015efab76bda5886a56b5007f4531be17d46"
|
||||||
SOURCE_URI_6="https://github.com/telegramdesktop/crl/archive/$srcGitRev_6.tar.gz"
|
SOURCE_URI_6="https://github.com/telegramdesktop/crl/archive/$srcGitRev_6.tar.gz"
|
||||||
CHECKSUM_SHA256_6="d7e64fc8a2e284a5be8c0b0c6e7bfbaf951751081919829cb3bb290544c732e8"
|
CHECKSUM_SHA256_6="aee42a2fe003888d0d0133cd208a1524f5d95af6af506c1cd7e07e268d0d9081"
|
||||||
SOURCE_FILENAME_6="crl-$srcGitRev_6.tar.gz"
|
SOURCE_FILENAME_6="crl-$srcGitRev_6.tar.gz"
|
||||||
srcGitRev_7="4b10be9cbadd7d0880437f48f875185589fd86d3"
|
srcGitRev_7="4b10be9cbadd7d0880437f48f875185589fd86d3"
|
||||||
SOURCE_URI_7="https://github.com/ericniebler/range-v3/archive/$srcGitRev_7.tar.gz"
|
SOURCE_URI_7="https://github.com/ericniebler/range-v3/archive/$srcGitRev_7.tar.gz"
|
||||||
CHECKSUM_SHA256_7="86f6b8a2e2d8196d62312042af1953d0b16935550130a73ae0ec69f623b0b947"
|
CHECKSUM_SHA256_7="86f6b8a2e2d8196d62312042af1953d0b16935550130a73ae0ec69f623b0b947"
|
||||||
SOURCE_FILENAME_7="range-$srcGitRev_7.tar.gz"
|
SOURCE_FILENAME_7="range-$srcGitRev_7.tar.gz"
|
||||||
|
srcGitRev_8="7cc9639699f64b750c0b82333dced9ea77e8436e"
|
||||||
|
SOURCE_URI_8="https://github.com/Cyan4973/xxHash/archive/$srcGitRev_8.tar.gz"
|
||||||
|
CHECKSUM_SHA256_8="0d1e2b4ae15f98acc49084e23ba94853dba2b0f654865ecedb1072b3959421bf"
|
||||||
|
SOURCE_FILENAME_8="xxHash-$srcGitRev_8.tar.gz"
|
||||||
PATCHES="
|
PATCHES="
|
||||||
telegram_desktop-$portVersion-systemqt.patch
|
telegram_desktop-$portVersion-systemqt.patch
|
||||||
telegram_desktop-$portVersion.patchset
|
telegram_desktop-$portVersion.patchset
|
||||||
@@ -107,14 +111,18 @@ PATCH()
|
|||||||
|
|
||||||
BUILD()
|
BUILD()
|
||||||
{
|
{
|
||||||
|
# sed -i "s|@HAIKU_HEADERS@|/system/$relativeIncludeDir|" Telegram/gyp/telegram_haiku.gypi
|
||||||
|
# sed -i "s|@HAIKU_HEADERS@|/system/$relativeIncludeDir|" Telegram/gyp/qt.gypi
|
||||||
|
# sed -i "s|@HAIKU_LIBS@|/system/$relativeLibDir|" Telegram/gyp/telegram_haiku.gypi
|
||||||
# link submodules
|
# link submodules
|
||||||
rm -rf Telegram/ThirdParty/{libtgvoip,variant,GSL,Catch,crl,range}
|
rm -rf Telegram/ThirdParty/{libtgvoip,variant,GSL,Catch,crl,range,xxHash}
|
||||||
ln -sfn $sourceDir2/libtgvoip-$srcGitRev_2 Telegram/ThirdParty/libtgvoip
|
ln -sfn $sourceDir2/libtgvoip-$srcGitRev_2 Telegram/ThirdParty/libtgvoip
|
||||||
ln -sfn $sourceDir3/variant-$srcGitRev_3 Telegram/ThirdParty/variant
|
ln -sfn $sourceDir3/variant-$srcGitRev_3 Telegram/ThirdParty/variant
|
||||||
ln -sfn $sourceDir4/GSL-$srcGitRev_4 Telegram/ThirdParty/GSL
|
ln -sfn $sourceDir4/GSL-$srcGitRev_4 Telegram/ThirdParty/GSL
|
||||||
ln -sfn $sourceDir5/Catch2-$srcGitRev_5 Telegram/ThirdParty/Catch
|
ln -sfn $sourceDir5/Catch2-$srcGitRev_5 Telegram/ThirdParty/Catch
|
||||||
ln -sfn $sourceDir6/crl-$srcGitRev_6 Telegram/ThirdParty/crl
|
ln -sfn $sourceDir6/crl-$srcGitRev_6 Telegram/ThirdParty/crl
|
||||||
ln -sfn $sourceDir7/range-v3-$srcGitRev_7 Telegram/ThirdParty/range
|
ln -sfn $sourceDir7/range-v3-$srcGitRev_7 Telegram/ThirdParty/range
|
||||||
|
ln -sfn $sourceDir8/xxHash-$srcGitRev_8 Telegram/ThirdParty/xxHash
|
||||||
|
|
||||||
Telegram/gyp/refresh.sh ; cd out/Release
|
Telegram/gyp/refresh.sh ; cd out/Release
|
||||||
# multi-job takes too much memory
|
# multi-job takes too much memory
|
||||||
Reference in New Issue
Block a user