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>
|
||||
Date: Thu, 30 Aug 2018 20:14:24 +1000
|
||||
Subject: Add Haiku platform
|
||||
Date: Sun, 10 Jun 2018 11:08:42 +1000
|
||||
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
|
||||
index 0000000..1bfbfad
|
||||
index 0000000..ce54b6e
|
||||
--- /dev/null
|
||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioInputHaiku.cpp
|
||||
@@ -0,0 +1,272 @@
|
||||
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.cpp
|
||||
@@ -0,0 +1,198 @@
|
||||
+//
|
||||
+// libtgvoip is free and unencumbered public domain software.
|
||||
+// For more information, see http://unlicense.org or the UNLICENSE file
|
||||
@@ -22,108 +181,36 @@ index 0000000..1bfbfad
|
||||
+#include <dlfcn.h>
|
||||
+#include "AudioInputHaiku.h"
|
||||
+#include "../../logging.h"
|
||||
+#include "../../audio/Resampler.h"
|
||||
+#include "../../VoIPController.h"
|
||||
+
|
||||
+#include "RingBuffer.h"
|
||||
+
|
||||
+#define BUFFER_SIZE 960
|
||||
+
|
||||
+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;
|
||||
+ 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);
|
||||
+ AudioInputHaiku *obj = (AudioInputHaiku*)cookie;
|
||||
+ if (!obj->IsRecording())
|
||||
+ 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 (audioInput->IsRecording()) {
|
||||
+ audioInput->Stop();
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+AudioInputHaiku::AudioInputHaiku()
|
||||
+AudioInputHaiku::AudioInputHaiku(std::string devID)
|
||||
+{
|
||||
+ fRecorder = NULL;
|
||||
+ fRingBuffer = NULL;
|
||||
@@ -200,7 +287,7 @@ index 0000000..1bfbfad
|
||||
+ }
|
||||
+ fRecordFormat.type = B_MEDIA_RAW_AUDIO;
|
||||
+
|
||||
+ error = fRecorder->SetHooks(RecordData, NotifyRecordData, this);
|
||||
+ error = fRecorder->SetHooks(RecordFile, NotifyRecordFile, this);
|
||||
+ if (error < B_OK) {
|
||||
+ failed=true;
|
||||
+ return;
|
||||
@@ -235,9 +322,7 @@ index 0000000..1bfbfad
|
||||
+}
|
||||
+
|
||||
+void AudioInputHaiku::Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels){
|
||||
+ tgFrameRate = sampleRate;
|
||||
+ tgChannelsCount = channels;
|
||||
+ tgBytesPerSample = bitsPerSample / 8;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+bool AudioInputHaiku::IsRecording(){
|
||||
@@ -282,12 +367,12 @@ index 0000000..1bfbfad
|
||||
+ 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
|
||||
index 0000000..2425666
|
||||
index 0000000..80573df
|
||||
--- /dev/null
|
||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioInputHaiku.h
|
||||
@@ -0,0 +1,66 @@
|
||||
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.h
|
||||
@@ -0,0 +1,57 @@
|
||||
+//
|
||||
+// libtgvoip is free and unencumbered public domain software.
|
||||
+// For more information, see http://unlicense.org or the UNLICENSE file
|
||||
@@ -312,15 +397,13 @@ index 0000000..2425666
|
||||
+
|
||||
+#include "RingBuffer.h"
|
||||
+
|
||||
+#define BUFFER_SIZE 960
|
||||
+
|
||||
+namespace tgvoip{
|
||||
+namespace audio{
|
||||
+
|
||||
+class AudioInputHaiku : public AudioInput{
|
||||
+
|
||||
+public:
|
||||
+ AudioInputHaiku();
|
||||
+ AudioInputHaiku(std::string devID);
|
||||
+ virtual ~AudioInputHaiku();
|
||||
+ virtual void Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels);
|
||||
+ virtual void Start();
|
||||
@@ -328,13 +411,6 @@ index 0000000..2425666
|
||||
+ virtual bool IsRecording();
|
||||
+
|
||||
+ RingBuffer *fRingBuffer;
|
||||
+ int16_t workBuffer[BUFFER_SIZE * 16];
|
||||
+ int16_t convertBuffer[BUFFER_SIZE * 16];
|
||||
+
|
||||
+ uint32 tgFrameRate;
|
||||
+ uint32 tgChannelsCount;
|
||||
+ uint32 tgBytesPerSample;
|
||||
+
|
||||
+private:
|
||||
+ void RunThread(void* arg);
|
||||
+
|
||||
@@ -353,13 +429,13 @@ index 0000000..2425666
|
||||
+}
|
||||
+}
|
||||
+
|
||||
+#endif //LIBTGVOIP_AUDIOINPUTHAIKU_H
|
||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.cpp
|
||||
+#endif //LIBTGVOIP_AUDIOINPUTALSA_H
|
||||
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp
|
||||
new file mode 100644
|
||||
index 0000000..533128d
|
||||
index 0000000..4454323
|
||||
--- /dev/null
|
||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.cpp
|
||||
@@ -0,0 +1,102 @@
|
||||
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp
|
||||
@@ -0,0 +1,101 @@
|
||||
+//
|
||||
+// libtgvoip is free and unencumbered public domain software.
|
||||
+// 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;
|
||||
+ isPlaying = false;
|
||||
+ isConfigured = false;
|
||||
@@ -406,7 +482,7 @@ index 0000000..533128d
|
||||
+ (uint32)channels,
|
||||
+ media_raw_audio_format::B_AUDIO_SHORT,
|
||||
+ B_MEDIA_LITTLE_ENDIAN,
|
||||
+ (uint32)BUFFER_SIZE * (bitsPerSample / 8) * channels
|
||||
+ (uint32)BUFFER_SIZE * 2 * channels
|
||||
+ };
|
||||
+
|
||||
+ switch (bitsPerSample) {
|
||||
@@ -430,7 +506,6 @@ index 0000000..533128d
|
||||
+ delete soundPlayer;
|
||||
+ soundPlayer = NULL;
|
||||
+ isPlaying = false;
|
||||
+ failed = true;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
@@ -462,11 +537,11 @@ index 0000000..533128d
|
||||
+float AudioOutputHaiku::GetLevel(){
|
||||
+ 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
|
||||
index 0000000..0ea8230
|
||||
index 0000000..6880709
|
||||
--- /dev/null
|
||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.h
|
||||
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.h
|
||||
@@ -0,0 +1,36 @@
|
||||
+//
|
||||
+// libtgvoip is free and unencumbered public domain software.
|
||||
@@ -487,7 +562,7 @@ index 0000000..0ea8230
|
||||
+
|
||||
+class AudioOutputHaiku : public AudioOutput{
|
||||
+public:
|
||||
+ AudioOutputHaiku();
|
||||
+ AudioOutputHaiku(std::string devID);
|
||||
+ virtual ~AudioOutputHaiku();
|
||||
+ virtual void Configure(uint32_t sampleRate, uint32_t bitsPerSample, uint32_t channels);
|
||||
+ virtual void Start();
|
||||
@@ -503,12 +578,12 @@ index 0000000..0ea8230
|
||||
+}
|
||||
+}
|
||||
+
|
||||
+#endif //LIBTGVOIP_AUDIOOUTPUTHAIKU_H
|
||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/RingBuffer.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/RingBuffer.cpp
|
||||
+#endif //LIBTGVOIP_AudioOutputHaiku_H
|
||||
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/RingBuffer.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/RingBuffer.cpp
|
||||
new file mode 100644
|
||||
index 0000000..43236d3
|
||||
--- /dev/null
|
||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/RingBuffer.cpp
|
||||
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/RingBuffer.cpp
|
||||
@@ -0,0 +1,130 @@
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
@@ -640,11 +715,11 @@ index 0000000..43236d3
|
||||
+{
|
||||
+ 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
|
||||
index 0000000..4715632
|
||||
--- /dev/null
|
||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/RingBuffer.h
|
||||
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/RingBuffer.h
|
||||
@@ -0,0 +1,31 @@
|
||||
+#ifndef __RING_BUFFER_H__
|
||||
+#define __RING_BUFFER_H__
|
||||
@@ -677,163 +752,38 @@ index 0000000..4715632
|
||||
+};
|
||||
+
|
||||
+#endif
|
||||
--
|
||||
2.16.4
|
||||
|
||||
|
||||
From 753b20ad62db41d0041b352dac9c9a45ecd3009b Mon Sep 17 00:00:00 2001
|
||||
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
|
||||
+ '<(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(){
|
||||
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/posix/NetworkSocketPosix.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/posix/NetworkSocketPosix.cpp
|
||||
index 05ddbb9..fcf7580 100644
|
||||
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/posix/NetworkSocketPosix.cpp
|
||||
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/posix/NetworkSocketPosix.cpp
|
||||
@@ -47,6 +47,7 @@ NetworkSocketPosix::~NetworkSocketPosix(){
|
||||
}
|
||||
int flag=0;
|
||||
int res=setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &flag, sizeof(flag));
|
||||
|
||||
void NetworkSocketPosix::SetMaxPriority(){
|
||||
+#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){
|
||||
LOGE("error enabling dual stack socket: %d / %s", errno, strerror(errno));
|
||||
+#ifndef __HAIKU__
|
||||
failed=true;
|
||||
return;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
SetMaxPriority();
|
||||
}
|
||||
|
||||
int tries=0;
|
||||
@@ -353,6 +354,8 @@ std::string NetworkSocketPosix::GetLocalInterfaceInfo(IPv4Address *v4addr, IPv6A
|
||||
SetMaxPriority();
|
||||
@@ -345,6 +349,8 @@ std::string NetworkSocketPosix::GetLocalInterfaceInfo(IPv4Address *v4addr, IPv6A
|
||||
if(didAttach){
|
||||
sharedJVM->DetachCurrentThread();
|
||||
}
|
||||
@@ -842,10 +792,10 @@ index ef8d2cb..da39a17 100644
|
||||
#else
|
||||
struct ifaddrs* interfaces;
|
||||
if(!getifaddrs(&interfaces)){
|
||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/threading.h b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/threading.h
|
||||
index 0bcf7c3..af86ef2 100644
|
||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/threading.h
|
||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/threading.h
|
||||
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/threading.h b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/threading.h
|
||||
index 0b4933c..87ea3b7 100644
|
||||
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/threading.h
|
||||
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/threading.h
|
||||
@@ -33,7 +33,7 @@ namespace tgvoip{
|
||||
};
|
||||
}
|
||||
@@ -855,17 +805,15 @@ index 0bcf7c3..af86ef2 100644
|
||||
|
||||
#include <pthread.h>
|
||||
#include <semaphore.h>
|
||||
@@ -115,6 +115,7 @@ namespace tgvoip{
|
||||
@@ -94,11 +94,13 @@ namespace tgvoip{
|
||||
static void* ActualEntryPoint(void* arg){
|
||||
Thread* self=reinterpret_cast<Thread*>(arg);
|
||||
if(self->name){
|
||||
+#ifndef __HAIKU__
|
||||
#if !defined(__APPLE__) && !defined(__gnu_hurd__)
|
||||
#ifndef __APPLE__
|
||||
pthread_setname_np(self->thread, self->name);
|
||||
#elif !defined(__gnu_hurd__)
|
||||
@@ -123,6 +124,7 @@ namespace tgvoip{
|
||||
DarwinSpecific::SetCurrentThreadPriority(DarwinSpecific::THREAD_PRIO_USER_INTERACTIVE);
|
||||
}
|
||||
#else
|
||||
pthread_setname_np(self->name);
|
||||
#endif
|
||||
+#endif //__HAKIU__
|
||||
}
|
||||
@@ -875,72 +823,230 @@ index 0bcf7c3..af86ef2 100644
|
||||
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>
|
||||
Date: Thu, 30 Aug 2018 23:52:44 +1000
|
||||
Subject: Remove GetLevel function
|
||||
Date: Sun, 10 Jun 2018 22:01:28 +1000
|
||||
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
|
||||
index 533128d..3dc052c 100644
|
||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.cpp
|
||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.cpp
|
||||
@@ -96,7 +96,3 @@ void AudioOutputHaiku::Stop(){
|
||||
bool AudioOutputHaiku::IsPlaying(){
|
||||
return isPlaying;
|
||||
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.cpp
|
||||
index ce54b6e..d7cc39a 100644
|
||||
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.cpp
|
||||
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioInputHaiku.cpp
|
||||
@@ -10,32 +10,104 @@
|
||||
#include <dlfcn.h>
|
||||
#include "AudioInputHaiku.h"
|
||||
#include "../../logging.h"
|
||||
+#include "../../audio/Resampler.h"
|
||||
#include "../../VoIPController.h"
|
||||
|
||||
#include "RingBuffer.h"
|
||||
|
||||
-#define BUFFER_SIZE 960
|
||||
-
|
||||
using namespace tgvoip::audio;
|
||||
|
||||
-void RecordFile(void* cookie, bigtime_t timestamp, void* data, size_t size, const media_format &format)
|
||||
+void RecordData(void* cookie, bigtime_t timestamp, void* data, size_t size, const media_format &format)
|
||||
{
|
||||
- AudioInputHaiku *obj = (AudioInputHaiku*)cookie;
|
||||
- if (!obj->IsRecording())
|
||||
+ 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);
|
||||
}
|
||||
-
|
||||
-float AudioOutputHaiku::GetLevel(){
|
||||
- return 0;
|
||||
-}
|
||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.h b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.h
|
||||
index 0ea8230..91f2521 100644
|
||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.h
|
||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/os/haiku/AudioOutputHaiku.h
|
||||
@@ -23,7 +23,6 @@ public:
|
||||
+
|
||||
+ 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 Stop();
|
||||
virtual bool IsPlaying() override;
|
||||
- virtual float GetLevel() override;
|
||||
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:
|
||||
bool isPlaying;
|
||||
bool isConfigured;
|
||||
--
|
||||
2.16.4
|
||||
|
||||
|
||||
From 50540bcbe0cd11cf96cf6b095d99e2ed5ab36d30 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Thu, 30 Aug 2018 23:53:16 +1000
|
||||
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
|
||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusDecoder.cpp
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <algorithm>
|
||||
-#ifdef HAVE_CONFIG_H
|
||||
+#if defined(HAVE_CONFIG_H) || defined(__HAIKU__)
|
||||
#include <opus/opus.h>
|
||||
#else
|
||||
#include "opus.h"
|
||||
diff --git a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusEncoder.cpp b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusEncoder.cpp
|
||||
index e30f814..c31aee2 100644
|
||||
--- a/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusEncoder.cpp
|
||||
+++ b/libtgvoip-bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34/OpusEncoder.cpp
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <assert.h>
|
||||
#include "logging.h"
|
||||
#include "VoIPServerConfig.h"
|
||||
-#ifdef HAVE_CONFIG_H
|
||||
+#if defined(HAVE_CONFIG_H) || defined(__HAIKU__)
|
||||
#include <opus/opus.h>
|
||||
#else
|
||||
#include "opus.h"
|
||||
void RunThread(void* arg);
|
||||
|
||||
@@ -47,11 +56,11 @@ private:
|
||||
media_format fRecordFormat;
|
||||
media_node fAudioInputNode;
|
||||
media_node fAudioMixerNode;
|
||||
-
|
||||
+
|
||||
Thread* thread;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
-#endif //LIBTGVOIP_AUDIOINPUTALSA_H
|
||||
+#endif //LIBTGVOIP_AUDIOINPUTHAIKU_H
|
||||
diff --git a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp
|
||||
index 4454323..11650da 100644
|
||||
--- a/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp
|
||||
+++ b/libtgvoip-697eea96aa90205db4fc368df4127eef56b2a5c6/os/haiku/AudioOutputHaiku.cpp
|
||||
@@ -44,7 +44,7 @@ void AudioOutputHaiku::Configure(uint32_t sampleRate, uint32_t bitsPerSample, ui
|
||||
(uint32)channels,
|
||||
media_raw_audio_format::B_AUDIO_SHORT,
|
||||
B_MEDIA_LITTLE_ENDIAN,
|
||||
- (uint32)BUFFER_SIZE * 2 * channels
|
||||
+ (uint32)BUFFER_SIZE * (bitsPerSample / 8) * channels
|
||||
};
|
||||
|
||||
switch (bitsPerSample) {
|
||||
@@ -68,6 +68,7 @@ void AudioOutputHaiku::Configure(uint32_t sampleRate, uint32_t bitsPerSample, ui
|
||||
delete soundPlayer;
|
||||
soundPlayer = NULL;
|
||||
isPlaying = false;
|
||||
+ failed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
index 0554fa1..3ea0274 100644
|
||||
index 0554fa179..3ea027406 100644
|
||||
--- a/Telegram/Resources/qrc/telegram_linux.qrc
|
||||
+++ b/Telegram/Resources/qrc/telegram_linux.qrc
|
||||
@@ -1,5 +1,4 @@
|
||||
@@ -9,10 +14,10 @@ index 0554fa1..3ea0274 100644
|
||||
</qresource>
|
||||
</RCC>
|
||||
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
|
||||
+++ b/Telegram/SourceFiles/core/launcher.cpp
|
||||
@@ -37,9 +37,10 @@ void Launcher::init() {
|
||||
@@ -39,9 +39,10 @@ void Launcher::init() {
|
||||
|
||||
QCoreApplication::setApplicationName(qsl("TelegramDesktop"));
|
||||
|
||||
@@ -25,7 +30,7 @@ index 2078858..1a70da9 100644
|
||||
|
||||
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
|
||||
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));
|
||||
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
|
||||
+++ b/Telegram/SourceFiles/platform/linux/linux_libs.h
|
||||
@@ -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
|
||||
new file mode 100644
|
||||
index 00000000..4a722b8d
|
||||
index 000000000..4a722b8d7
|
||||
--- /dev/null
|
||||
+++ b/Telegram/SourceFiles/qt_functions.cpp
|
||||
@@ -0,0 +1,94 @@
|
||||
@@ -153,7 +158,7 @@ index 00000000..4a722b8d
|
||||
+ flags |= QTextItem::StrikeOut;
|
||||
+}
|
||||
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
|
||||
+++ b/Telegram/SourceFiles/qt_static_plugins.cpp
|
||||
@@ -15,13 +15,4 @@ Q_IMPORT_PLUGIN(QWebpPlugin)
|
||||
@@ -171,7 +176,7 @@ index e29f348..122ff0f 100644
|
||||
-Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin)
|
||||
#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
|
||||
index 944f584..887c198 100644
|
||||
index 944f58479..887c1982f 100644
|
||||
--- a/Telegram/SourceFiles/ui/text/text.cpp
|
||||
+++ b/Telegram/SourceFiles/ui/text/text.cpp
|
||||
@@ -1750,11 +1750,11 @@ private:
|
||||
@@ -190,7 +195,7 @@ index 944f584..887c198 100644
|
||||
auto blockIndex = _lineStartBlock;
|
||||
auto currentBlock = _t->_blocks[blockIndex].get();
|
||||
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
|
||||
+++ b/Telegram/SourceFiles/ui/text/text_block.cpp
|
||||
@@ -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");
|
||||
}
|
||||
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
|
||||
+++ 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
|
||||
, QGuiApplication::mouseButtons() | button
|
||||
, QGuiApplication::keyboardModifiers()
|
||||
@@ -220,7 +225,7 @@ index 0f610cb..b005589 100644
|
||||
ev.setTimestamp(getms());
|
||||
QGuiApplication::sendEvent(windowHandle, &ev);
|
||||
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
|
||||
+++ b/Telegram/gyp/PrecompiledHeader.cmake
|
||||
@@ -114,7 +114,7 @@ function(add_precompiled_header _target _input)
|
||||
@@ -228,7 +233,7 @@ index a0e1e04..bd9bce0 100644
|
||||
add_custom_command(
|
||||
OUTPUT "${_output_c}"
|
||||
- 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}"
|
||||
IMPLICIT_DEPENDS C "${_pch_header}"
|
||||
COMMENT "Precompiling ${_name} for ${_target} (C)")
|
||||
@@ -237,48 +242,32 @@ index a0e1e04..bd9bce0 100644
|
||||
add_custom_command(
|
||||
OUTPUT "${_output_cxx}"
|
||||
- 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}"
|
||||
IMPLICIT_DEPENDS CXX "${_pch_header}"
|
||||
COMMENT "Precompiling header ${_name} for ${_target} (C++)")
|
||||
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
|
||||
+++ b/Telegram/gyp/Telegram.gyp
|
||||
@@ -74,14 +74,12 @@
|
||||
@@ -75,7 +75,6 @@
|
||||
'codegen.gyp:codegen_numbers',
|
||||
'codegen.gyp:codegen_style',
|
||||
'tests/tests.gyp:tests',
|
||||
- 'utils.gyp:Updater',
|
||||
'../ThirdParty/libtgvoip/libtgvoip.gyp:libtgvoip',
|
||||
'crl.gyp:crl',
|
||||
'lib_export.gyp:lib_export',
|
||||
'lib_base.gyp:lib_base',
|
||||
@@ -84,7 +83,6 @@
|
||||
],
|
||||
|
||||
'defines': [
|
||||
- 'AL_LIBTYPE_STATIC',
|
||||
'AL_ALEXT_PROTOTYPES',
|
||||
'TGVOIP_USE_CXX11_LIB',
|
||||
'<!@(python -c "for s in \'<(build_defines)\'.split(\',\'): print(s)")',
|
||||
@@ -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',
|
||||
'XXH_INLINE_ALL',
|
||||
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
|
||||
+++ b/Telegram/gyp/qt.gypi
|
||||
@@ -14,25 +14,21 @@
|
||||
@@ -408,7 +397,7 @@ index 0b783ec..3f91776 100644
|
||||
'-rdynamic',
|
||||
],
|
||||
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
|
||||
+++ b/Telegram/gyp/qt_moc.gypi
|
||||
@@ -12,7 +12,7 @@
|
||||
@@ -421,7 +410,7 @@ index 464d3c8..f350da8 100644
|
||||
# Silence "Note: No relevant classes found. No output generated."
|
||||
'--no-notes',
|
||||
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
|
||||
+++ b/Telegram/gyp/qt_rcc.gypi
|
||||
@@ -15,7 +15,7 @@
|
||||
@@ -434,7 +423,7 @@ index f5624a8..1129a95 100644
|
||||
'-no-compress',
|
||||
'<(RULE_INPUT_PATH)',
|
||||
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
|
||||
+++ b/Telegram/gyp/settings_linux.gypi
|
||||
@@ -11,7 +11,6 @@
|
||||
@@ -454,10 +443,10 @@ index 17219fa..6853b5c 100644
|
||||
],
|
||||
'cflags_c': [
|
||||
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
|
||||
+++ b/Telegram/gyp/telegram_linux.gypi
|
||||
@@ -20,10 +20,11 @@
|
||||
@@ -23,10 +23,11 @@
|
||||
'linux_path_va%': '/usr/local',
|
||||
'linux_path_vdpau%': '/usr/local',
|
||||
'linux_path_breakpad%': '/usr/local',
|
||||
@@ -470,7 +459,7 @@ index 01231c4..00a9c08 100644
|
||||
'/usr/local/include',
|
||||
'<(linux_path_ffmpeg)/include',
|
||||
'<(linux_path_openal)/include',
|
||||
@@ -32,6 +33,7 @@
|
||||
@@ -35,6 +36,7 @@
|
||||
'<(linux_path_range)/include',
|
||||
],
|
||||
'library_dirs': [
|
||||
@@ -478,7 +467,7 @@ index 01231c4..00a9c08 100644
|
||||
'/usr/local/lib',
|
||||
'<(linux_path_ffmpeg)/lib',
|
||||
'<(linux_path_openal)/lib',
|
||||
@@ -40,25 +42,15 @@
|
||||
@@ -43,25 +45,16 @@
|
||||
'<(linux_path_breakpad)/lib',
|
||||
],
|
||||
'libraries': [
|
||||
@@ -510,17 +499,11 @@ index 01231c4..00a9c08 100644
|
||||
+ 'minizip',
|
||||
+ 'opus',
|
||||
+ 'z',
|
||||
+ 'lzma',
|
||||
# '<!(pkg-config 2> /dev/null --libs <@(pkgconfig_libs))',
|
||||
],
|
||||
'cflags_cc': [
|
||||
@@ -87,16 +79,14 @@
|
||||
},
|
||||
},
|
||||
'conditions': [
|
||||
- [ '"<!(uname -p)" != "x86_64"', {
|
||||
+ [ '"<!(uname -m)" != "x86_64"', {
|
||||
'ldflags': [
|
||||
'-Wl,-wrap,__divmoddi4',
|
||||
@@ -96,10 +89,8 @@
|
||||
],
|
||||
}], ['not_need_gtk!="True"', {
|
||||
'cflags_cc': [
|
||||
@@ -534,10 +517,10 @@ index 01231c4..00a9c08 100644
|
||||
}]
|
||||
],
|
||||
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
|
||||
+++ 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.h
|
||||
|
||||
@@ -551,5 +534,5 @@ index 7a10328..397d2a2 100644
|
||||
-<(minizip_loc)/unzip.h
|
||||
+<(src_loc)/qt_functions.cpp
|
||||
|
||||
platforms: mac
|
||||
<(sp_media_key_tap_loc)/SPMediaKeyTap.m
|
||||
platforms: win
|
||||
<(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"
|
||||
REVISION="1"
|
||||
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_DIR="tdesktop-$portVersion"
|
||||
srcGitRev_2="bfa1e6ab76a467c6c6bff7eabb7c213acc7a1b34"
|
||||
srcGitRev_2="697eea96aa90205db4fc368df4127eef56b2a5c6"
|
||||
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"
|
||||
srcGitRev_3="550ac2f159ca883d360c196149b466955c77a573"
|
||||
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"
|
||||
CHECKSUM_SHA256_5="d24e6d9df2b8aa5739d3b9077c6b0ff0ef4d5ef8acc52c3a57e32893854d8d18"
|
||||
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"
|
||||
CHECKSUM_SHA256_6="d7e64fc8a2e284a5be8c0b0c6e7bfbaf951751081919829cb3bb290544c732e8"
|
||||
CHECKSUM_SHA256_6="aee42a2fe003888d0d0133cd208a1524f5d95af6af506c1cd7e07e268d0d9081"
|
||||
SOURCE_FILENAME_6="crl-$srcGitRev_6.tar.gz"
|
||||
srcGitRev_7="4b10be9cbadd7d0880437f48f875185589fd86d3"
|
||||
SOURCE_URI_7="https://github.com/ericniebler/range-v3/archive/$srcGitRev_7.tar.gz"
|
||||
CHECKSUM_SHA256_7="86f6b8a2e2d8196d62312042af1953d0b16935550130a73ae0ec69f623b0b947"
|
||||
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="
|
||||
telegram_desktop-$portVersion-systemqt.patch
|
||||
telegram_desktop-$portVersion.patchset
|
||||
@@ -107,14 +111,18 @@ PATCH()
|
||||
|
||||
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
|
||||
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 $sourceDir3/variant-$srcGitRev_3 Telegram/ThirdParty/variant
|
||||
ln -sfn $sourceDir4/GSL-$srcGitRev_4 Telegram/ThirdParty/GSL
|
||||
ln -sfn $sourceDir5/Catch2-$srcGitRev_5 Telegram/ThirdParty/Catch
|
||||
ln -sfn $sourceDir6/crl-$srcGitRev_6 Telegram/ThirdParty/crl
|
||||
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
|
||||
# multi-job takes too much memory
|
||||
Reference in New Issue
Block a user