commit 27556f41d962dd2084a35f71d0aea88256828f31
Author: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Sat Jan 12 14:20:15 2019 +0100
Updated to 2.4.2 (regular release).
.gitignore | 1 +
libtgvoip-build-fixes.patch | 192 +++++---------------------------------------
libtgvoip-sse2.patch | 43 ----------
libtgvoip.spec | 10 ++-
sources | 2 +-
5 files changed, 31 insertions(+), 217 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 234dcb3..252aff7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@
/libtgvoip-2.2.3.tar.gz
/libtgvoip-2.2.4.tar.gz
/libtgvoip-2.4.tar.gz
+/libtgvoip-2.4.2.tar.gz
diff --git a/libtgvoip-build-fixes.patch b/libtgvoip-build-fixes.patch
index 62e6c38..a09cbce 100644
--- a/libtgvoip-build-fixes.patch
+++ b/libtgvoip-build-fixes.patch
@@ -1,18 +1,14 @@
-From a68fc701c8110245f898100228fef2905ef6731e Mon Sep 17 00:00:00 2001
+From e94437a0f3444da9f42022090ba797725998928a Mon Sep 17 00:00:00 2001
From: Vitaly Zaitsev <vitaly(a)easycoding.org>
Date: Thu, 6 Jul 2017 17:27:01 +0200
Subject: [PATCH] Fixed build of libtgvoip under Fedora as shared library.
---
- libtgvoip.gyp | 7 +++---
- webrtc_dsp/common_audio/wav_file.cc | 20 ++++++++++++----
- webrtc_dsp/common_audio/wav_header.cc | 34 ++++++++++++++++++++++++++-
- webrtc_dsp/rtc_base/system/arch.h | 24 ++++++++++++++++++-
- webrtc_dsp/typedefs.h | 24 ++++++++++++++++++-
- 5 files changed, 98 insertions(+), 11 deletions(-)
+ libtgvoip.gyp | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/libtgvoip.gyp b/libtgvoip.gyp
-index 8c62b56..c362667 100644
+index 8c62b56..8fe9c5b 100644
--- a/libtgvoip.gyp
+++ b/libtgvoip.gyp
@@ -4,7 +4,8 @@
@@ -39,170 +35,26 @@ index 8c62b56..c362667 100644
],
'direct_dependent_settings': {
'include_dirs': [
-diff --git a/webrtc_dsp/common_audio/wav_file.cc b/webrtc_dsp/common_audio/wav_file.cc
-index 1b8bcbd..9ebf635 100644
---- a/webrtc_dsp/common_audio/wav_file.cc
-+++ b/webrtc_dsp/common_audio/wav_file.cc
-@@ -93,9 +93,6 @@ size_t WavReader::num_samples() const {
- }
+@@ -70,8 +71,6 @@
+ '<(tgvoip_src_loc)/video/VideoSource.h',
+ '<(tgvoip_src_loc)/video/VideoRenderer.cpp',
+ '<(tgvoip_src_loc)/video/VideoRenderer.h',
+- '<(tgvoip_src_loc)/json11.cpp',
+- '<(tgvoip_src_loc)/json11.hpp',
- size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
--#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to big-endian when reading from WAV file"
--#endif
- // There could be metadata after the audio; ensure we don't read it.
- num_samples = std::min(num_samples, num_samples_remaining_);
- const size_t read =
-@@ -104,6 +101,12 @@ size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples)
{
- RTC_CHECK(read == num_samples || feof(file_handle_));
- RTC_CHECK_LE(read, num_samples_remaining_);
- num_samples_remaining_ -= read;
-+#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-+ //convert to big-endian
-+ for(size_t idx = 0; idx < num_samples; idx++) {
-+ samples[idx] = (samples[idx]<<8) | (samples[idx]>>8);
-+ }
-+#endif
- return read;
- }
+ # Windows
+ '<(tgvoip_src_loc)/os/windows/NetworkSocketWinsock.cpp',
+@@ -722,7 +721,9 @@
-@@ -178,10 +181,17 @@ size_t WavWriter::num_samples() const {
- void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
- #ifndef WEBRTC_ARCH_LITTLE_ENDIAN
--#error "Need to convert samples to little-endian when writing to WAV file"
--#endif
-+ int16_t * le_samples = new int16_t[num_samples];
-+ for(size_t idx = 0; idx < num_samples; idx++) {
-+ le_samples[idx] = (samples[idx]<<8) | (samples[idx]>>8);
-+ }
-+ const size_t written =
-+ fwrite(le_samples, sizeof(*le_samples), num_samples, file_handle_);
-+ delete []le_samples;
-+#else
- const size_t written =
- fwrite(samples, sizeof(*samples), num_samples, file_handle_);
-+#endif
- RTC_CHECK_EQ(num_samples, written);
- num_samples_ += written;
- RTC_CHECK(num_samples_ >= written); // detect size_t overflow
-diff --git a/webrtc_dsp/common_audio/wav_header.cc
b/webrtc_dsp/common_audio/wav_header.cc
-index e49b748..68a2620 100644
---- a/webrtc_dsp/common_audio/wav_header.cc
-+++ b/webrtc_dsp/common_audio/wav_header.cc
-@@ -86,7 +86,39 @@ static inline std::string ReadFourCC(uint32_t x) {
- return std::string(reinterpret_cast<char*>(&x), 4);
- }
- #else
--#error "Write be-to-le conversion functions"
-+static inline void WriteLE16(uint16_t* f, uint16_t x) {
-+ *f = ((x << 8) & 0xff00) | ( ( x >> 8) & 0x00ff);
-+}
-+
-+static inline void WriteLE32(uint32_t* f, uint32_t x) {
-+ *f = ( (x & 0x000000ff) << 24 )
-+ | ((x & 0x0000ff00) << 8)
-+ | ((x & 0x00ff0000) >> 8)
-+ | ((x & 0xff000000) >> 24 );
-+}
-+
-+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
-+ *f = (static_cast<uint32_t>(a) << 24 )
-+ | (static_cast<uint32_t>(b) << 16)
-+ | (static_cast<uint32_t>(c) << 8)
-+ | (static_cast<uint32_t>(d) );
-+}
-+
-+static inline uint16_t ReadLE16(uint16_t x) {
-+ return (( x & 0x00ff) << 8 )| ((x & 0xff00)>>8);
-+}
-+
-+static inline uint32_t ReadLE32(uint32_t x) {
-+ return ( (x & 0x000000ff) << 24 )
-+ | ( (x & 0x0000ff00) << 8 )
-+ | ( (x & 0x00ff0000) >> 8)
-+ | ( (x & 0xff000000) >> 24 );
-+}
-+
-+static inline std::string ReadFourCC(uint32_t x) {
-+ x = ReadLE32(x);
-+ return std::string(reinterpret_cast<char*>(&x), 4);
-+}
- #endif
-
- static inline uint32_t RiffChunkSize(size_t bytes_in_payload) {
-diff --git a/webrtc_dsp/rtc_base/system/arch.h b/webrtc_dsp/rtc_base/system/arch.h
-index 326b83e..ef27c17 100644
---- a/webrtc_dsp/rtc_base/system/arch.h
-+++ b/webrtc_dsp/rtc_base/system/arch.h
-@@ -47,8 +47,30 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__powerpc64__)
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#else
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#endif
-+#define WEBRTC_ARCH_64_BITS
-+#elif defined(__powerpc__)
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#define WEBRTC_ARCH_32_BITS
-+#else
-+/* instead of failing, use typical unix defines... */
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
-+#define WEBRTC_ARCH_BIG_ENDIAN
- #else
--#error Please add support for your architecture in typedefs.h
-+#error __BYTE_ORDER__ is not defined
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #endif
-
- #if !(defined(WEBRTC_ARCH_LITTLE_ENDIAN) ^ defined(WEBRTC_ARCH_BIG_ENDIAN))
-diff --git a/webrtc_dsp/typedefs.h b/webrtc_dsp/typedefs.h
-index c960d95..d6ce35e 100644
---- a/webrtc_dsp/typedefs.h
-+++ b/webrtc_dsp/typedefs.h
-@@ -47,8 +47,30 @@
- #elif defined(__pnacl__)
- #define WEBRTC_ARCH_32_BITS
- #define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif defined(__powerpc64__)
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#else
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#endif
-+#define WEBRTC_ARCH_64_BITS
-+#elif defined(__powerpc__)
-+#define WEBRTC_ARCH_BIG_ENDIAN
-+#define WEBRTC_ARCH_32_BITS
-+#else
-+/* instead of failing, use typical unix defines... */
-+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-+#define WEBRTC_ARCH_LITTLE_ENDIAN
-+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
-+#define WEBRTC_ARCH_BIG_ENDIAN
- #else
--#error Please add support for your architecture in typedefs.h
-+#error __BYTE_ORDER__ is not defined
-+#endif
-+#if defined(__LP64__)
-+#define WEBRTC_ARCH_64_BITS
-+#else
-+#define WEBRTC_ARCH_32_BITS
-+#endif
- #endif
-
- #if !(defined(WEBRTC_ARCH_LITTLE_ENDIAN) ^ defined(WEBRTC_ARCH_BIG_ENDIAN))
+ ],
+- 'libraries': [],
++ 'libraries': [
++ 'json11',
++ ],
+ 'configurations': {
+ 'Debug': {},
+ 'Release': {},
--
-2.19.2
+2.20.1
diff --git a/libtgvoip.spec b/libtgvoip.spec
index d63a250..fec2c92 100644
--- a/libtgvoip.spec
+++ b/libtgvoip.spec
@@ -1,6 +1,6 @@
Name: libtgvoip
-Version: 2.4
-Release: 2%{?dist}
+Version: 2.4.2
+Release: 1%{?dist}
Summary: VoIP library for Telegram clients
# Libtgvoip shared library - Public Domain.
@@ -10,13 +10,13 @@ URL:
https://github.com/grishka/%{name}
Source0: %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: %{name}-build-fixes.patch
-Patch100: %{name}-sse2.patch
Provides: bundled(webrtc-audio-processing) = 0.3
BuildRequires: pulseaudio-libs-devel
BuildRequires: alsa-lib-devel
BuildRequires: openssl-devel
+BuildRequires: json11-devel
BuildRequires: opus-devel
BuildRequires: gcc-c++
BuildRequires: cmake
@@ -49,6 +49,7 @@ popd
# Installing shared library...
mkdir -p "%{buildroot}%{_libdir}"
install -m 0755 -p out/Release/lib.target/%{name}.so.%{version}
"%{buildroot}%{_libdir}/%{name}.so.%{version}"
+ln -s %{name}.so.%{version} "%{buildroot}%{_libdir}/%{name}.so.2.4"
ln -s %{name}.so.%{version} "%{buildroot}%{_libdir}/%{name}.so.2"
ln -s %{name}.so.%{version} "%{buildroot}%{_libdir}/%{name}.so"
@@ -69,6 +70,9 @@ find video -maxdepth 1 -type f -name "*.h" -exec install -m
0644 -p '{}' %{build
%{_libdir}/%{name}.so
%changelog
+* Sat Jan 12 2019 Vitaly Zaitsev <vitaly(a)easycoding.org> - 2.4.2-1
+- Updated to 2.4.2 (regular release).
+
* Tue Dec 11 2018 Vitaly Zaitsev <vitaly(a)easycoding.org> - 2.4-2
- Backported upstream patch with crash and build fixes.
diff --git a/sources b/sources
index 2d4950e..9b36e00 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-d0a9f1b6fa82e9681346525aa06f9b4e libtgvoip-2.4.tar.gz
+34ef6e2ce1679615bf30048c7c323610 libtgvoip-2.4.2.tar.gz