From d47a474aa66caf349764b9064c9d60bce8751eaa39ad224b8a811cb510f7557f Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Sat, 25 Jun 2016 16:50:49 +0000 Subject: [PATCH] Accepting request 404777 from home:oholecek:branches:multimedia:libs - Remove webrtc-aarch64.patch, no longer needed - Adapt the rest of webrtc- patches to new arch naming - Remove unneeded explicit version dependency for automake - Update to 0.3 * build: enforce linking with --no-undefined, add explicit -lpthread * build: Make sure files with SSE2 code are compiled with -msse2 - Remove no-undefined.patch - Remove webrtc-audio-processing-0.2-x86_msse2.patch - Add no-undefined.patch patch https://cgit.freedesktop.org/pulseaudio/webrtc-audio-processing/patch/?id=d58164e4d87854233564b59e76259b72e21507f6 - Add big_endian_support_2.patch https://bugs.freedesktop.org/show_bug.cgi?id=95738 - Adapt webrtc-audio-processing-0.2-x86_msse2.patch to new version - Adapt big_endian_support.patch to new version - Add webrtc-audio-processing-0.2-x86_msse2.patch patch fixing 386 build https://lists.freedesktop.org/archives/pulseaudio-discuss/2016-May/026294.html - Add big_endian_support.patch https://bugs.freedesktop.org/show_bug.cgi?id=95738 - New automake version dependency >= 1.5 - Update to 0.2: Contains API breaking changes. Upstream changes include: * Rewritten AGC and voice activity detection * Intelligibility enhancer * Extended AEC filter * Beamformer * Transient suppressor * ARM, NEON and MIPS optimisations (MIPS optimisations are not hooked up) API changes: * We no longer include a top-level audio_processing.h. The webrtc tree format is used, so use webrtc/modules/audio_processing/include/audio_processing.h * The top-level module_common_types.h has also been moved to webrtc/modules/interface/module_common_types.h * C++11 support is now required while compiling client code * AudioProcessing::Create() does not take any arguments any more * AudioProcessing::Destroy() is gone, use standard C++ "delete" instead * Stream parameters are now configured via StreamConfig and ProcessingConfig rather than set_sample_rate(), set_num_channels(), etc. * AudioFrame field names have changed * Use config API for newer audio processing options * Use ProcessReverseStream() instead of AnalyzeReverseStream(), particularly when using the intelligibility enhancer * GainControl::set_analog_level_limits() is broken. The AGC implementation hard codes 0-255 as the volume range Other notes: * The new audio processing parameters are not all tested, and a few are not enabled upstream (in Chromium) either * The rewritten AGC appears to be less sensitive, and it might make sense to initialise the capture volume to something reasonable (33% or 50%, for example) to make sure there is sufficient energy in the stream to trigger the AGC mechanism - Adapted all 3 arch patches OBS-URL: https://build.opensuse.org/request/show/404777 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/webrtc-audio-processing?expand=0&rev=11 --- big_endian_support.patch | 90 ++++++++++++++++++++++++++++++ big_endian_support_2.patch | 24 ++++++++ webrtc-aarch64.patch | 12 ---- webrtc-audio-processing-0.1.tar.xz | 3 - webrtc-audio-processing-0.3.tar.xz | 3 + webrtc-audio-processing.changes | 77 +++++++++++++++++++++++++ webrtc-audio-processing.spec | 41 +++++++------- webrtc-ppc64.patch | 18 +++--- webrtc-s390x.patch | 16 +++--- 9 files changed, 232 insertions(+), 52 deletions(-) create mode 100644 big_endian_support.patch create mode 100644 big_endian_support_2.patch delete mode 100644 webrtc-aarch64.patch delete mode 100644 webrtc-audio-processing-0.1.tar.xz create mode 100644 webrtc-audio-processing-0.3.tar.xz diff --git a/big_endian_support.patch b/big_endian_support.patch new file mode 100644 index 0000000..26850f7 --- /dev/null +++ b/big_endian_support.patch @@ -0,0 +1,90 @@ +diff -up webrtc-audio-processing-0.2/webrtc/common_audio/wav_file.cc.than webrtc-audio-processing-0.2/webrtc/common_audio/wav_file.cc +--- webrtc-audio-processing-0.2/webrtc/common_audio/wav_file.cc.than 2016-05-24 08:28:45.749940095 -0400 ++++ webrtc-audio-processing-0.2/webrtc/common_audio/wav_file.cc 2016-05-24 08:50:30.361020010 -0400 +@@ -64,9 +64,6 @@ WavReader::~WavReader() { + } + + 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(rtc::checked_cast(num_samples), + num_samples_remaining_); +@@ -76,6 +73,12 @@ size_t WavReader::ReadSamples(size_t num + RTC_CHECK(read == num_samples || feof(file_handle_)); + RTC_CHECK_LE(read, num_samples_remaining_); + num_samples_remaining_ -= rtc::checked_cast(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; + } + +@@ -120,10 +123,17 @@ WavWriter::~WavWriter() { + + 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_ += static_cast(written); + RTC_CHECK(written <= std::numeric_limits::max() || +diff -up webrtc-audio-processing-0.2/webrtc/common_audio/wav_header.cc.than webrtc-audio-processing-0.2/webrtc/common_audio/wav_header.cc +--- webrtc-audio-processing-0.2/webrtc/common_audio/wav_header.cc.than 2016-05-24 08:50:52.591379263 -0400 ++++ webrtc-audio-processing-0.2/webrtc/common_audio/wav_header.cc 2016-05-24 08:52:08.552606848 -0400 +@@ -129,7 +129,39 @@ static inline std::string ReadFourCC(uin + return std::string(reinterpret_cast(&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(a) << 24 ) ++ | (static_cast(b) << 16) ++ | (static_cast(c) << 8) ++ | (static_cast(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(&x), 4); ++} + #endif + + static inline uint32_t RiffChunkSize(uint32_t bytes_in_payload) { diff --git a/big_endian_support_2.patch b/big_endian_support_2.patch new file mode 100644 index 0000000..f38262a --- /dev/null +++ b/big_endian_support_2.patch @@ -0,0 +1,24 @@ +diff -up webrtc-audio-processing-0.2/webrtc/typedefs.h.typedef webrtc-audio-processing-0.2/webrtc/typedefs.h +--- webrtc-audio-processing-0.2/webrtc/typedefs.h.typedef 2016-05-12 09:08:53.885000410 -0500 ++++ webrtc-audio-processing-0.2/webrtc/typedefs.h 2016-05-12 09:12:38.006851953 -0500 +@@ -48,7 +48,19 @@ + #define WEBRTC_ARCH_32_BITS + #define WEBRTC_ARCH_LITTLE_ENDIAN + #else +-#error Please add support for your architecture in typedefs.h ++/* 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 __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-aarch64.patch b/webrtc-aarch64.patch deleted file mode 100644 index bbb001c..0000000 --- a/webrtc-aarch64.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- src/typedefs.h -+++ src/typedefs.h -@@ -82,6 +82,9 @@ - #elif defined(__s390__) - #define WEBRTC_BIG_ENDIAN - #define WEBRTC_ARCH_32_BITS -+#elif defined(__aarch64__) -+#define WEBRTC_LITTLE_ENDIAN -+#define WEBRTC_ARCH_64_BITS - #else - #error Please add support for your architecture in typedefs.h - #endif diff --git a/webrtc-audio-processing-0.1.tar.xz b/webrtc-audio-processing-0.1.tar.xz deleted file mode 100644 index 9ef9b74..0000000 --- a/webrtc-audio-processing-0.1.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ed4b52f9c2688b97628035a5565377d74704d7c04de4254a768df3342c7afedc -size 392540 diff --git a/webrtc-audio-processing-0.3.tar.xz b/webrtc-audio-processing-0.3.tar.xz new file mode 100644 index 0000000..1b1d882 --- /dev/null +++ b/webrtc-audio-processing-0.3.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:756e291d4f557d88cd50c4fe3b8454ec238362d22cedb3e6173240d90f0a80fa +size 688096 diff --git a/webrtc-audio-processing.changes b/webrtc-audio-processing.changes index db178e9..9430f54 100644 --- a/webrtc-audio-processing.changes +++ b/webrtc-audio-processing.changes @@ -1,3 +1,80 @@ +------------------------------------------------------------------- +Sat Jun 25 10:39:08 UTC 2016 - oholecek@suse.com + +- Remove webrtc-aarch64.patch, no longer needed +- Adapt the rest of webrtc- patches to new arch naming + +------------------------------------------------------------------- +Thu Jun 23 13:31:14 UTC 2016 - oholecek@suse.com + +- Remove unneeded explicit version dependency for automake + +------------------------------------------------------------------- +Wed Jun 22 11:55:11 UTC 2016 - oholecek@suse.com + +- Update to 0.3 + * build: enforce linking with --no-undefined, add explicit -lpthread + * build: Make sure files with SSE2 code are compiled with -msse2 +- Remove no-undefined.patch +- Remove webrtc-audio-processing-0.2-x86_msse2.patch +------------------------------------------------------------------- +Mon Jun 20 13:02:06 UTC 2016 - oholecek@suse.com + +- Add no-undefined.patch patch + https://cgit.freedesktop.org/pulseaudio/webrtc-audio-processing/patch/?id=d58164e4d87854233564b59e76259b72e21507f6 +- Add big_endian_support_2.patch https://bugs.freedesktop.org/show_bug.cgi?id=95738 +- Adapt webrtc-audio-processing-0.2-x86_msse2.patch to new version +- Adapt big_endian_support.patch to new version + +------------------------------------------------------------------- +Mon May 30 09:00:51 UTC 2016 - oholecek@suse.com + +- Add webrtc-audio-processing-0.2-x86_msse2.patch patch fixing 386 build + https://lists.freedesktop.org/archives/pulseaudio-discuss/2016-May/026294.html +- Add big_endian_support.patch + https://bugs.freedesktop.org/show_bug.cgi?id=95738 +- New automake version dependency >= 1.5 + +------------------------------------------------------------------- +Thu May 26 21:19:28 UTC 2016 - oholecek@suse.com + +- Update to 0.2: + Contains API breaking changes. + + Upstream changes include: + * Rewritten AGC and voice activity detection + * Intelligibility enhancer + * Extended AEC filter + * Beamformer + * Transient suppressor + * ARM, NEON and MIPS optimisations (MIPS optimisations are not hooked up) + + API changes: + * We no longer include a top-level audio_processing.h. The webrtc tree format + is used, so use webrtc/modules/audio_processing/include/audio_processing.h + * The top-level module_common_types.h has also been moved to + webrtc/modules/interface/module_common_types.h + * C++11 support is now required while compiling client code + * AudioProcessing::Create() does not take any arguments any more + * AudioProcessing::Destroy() is gone, use standard C++ "delete" instead + * Stream parameters are now configured via StreamConfig and ProcessingConfig + rather than set_sample_rate(), set_num_channels(), etc. + * AudioFrame field names have changed + * Use config API for newer audio processing options + * Use ProcessReverseStream() instead of AnalyzeReverseStream(), particularly + when using the intelligibility enhancer + * GainControl::set_analog_level_limits() is broken. The AGC implementation + hard codes 0-255 as the volume range + + Other notes: + * The new audio processing parameters are not all tested, and a few are not + enabled upstream (in Chromium) either + * The rewritten AGC appears to be less sensitive, and it might make sense to + initialise the capture volume to something reasonable (33% or 50%, for + example) to make sure there is sufficient energy in the stream to trigger + the AGC mechanism +- Adapted all 3 arch patches + ------------------------------------------------------------------- Thu Mar 7 13:51:31 UTC 2013 - idonmez@suse.com diff --git a/webrtc-audio-processing.spec b/webrtc-audio-processing.spec index 434394e..540a61a 100644 --- a/webrtc-audio-processing.spec +++ b/webrtc-audio-processing.spec @@ -2,7 +2,7 @@ # # spec file for package webrtc-audio-processing # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2012 Pascal Bleser # # All modifications and additions to the file contributed by third parties @@ -18,18 +18,23 @@ # +%define soname 1 # Please submit bugfixes or comments via http://bugs.opensuse.org/ - Name: webrtc-audio-processing -%define soname 0 -Version: 0.1 +Version: 0.3 Release: 0 Summary: Real-Time Communication Library for Web Browsers License: BSD-3-Clause Group: System/Libraries -Source: http://freedesktop.org/software/pulseaudio/webrtc-audio-processing/webrtc-audio-processing-%{version}.tar.xz Url: http://www.freedesktop.org/software/pulseaudio/webrtc-audio-processing/ -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Source: http://freedesktop.org/software/pulseaudio/webrtc-audio-processing/webrtc-audio-processing-%{version}.tar.xz +# PATCH-FIX-UPSTREAN big_endian_support.patch https://bugs.freedesktop.org/show_bug.cgi?id=95738 +Patch1: big_endian_support.patch +# PATCH-FIX-UPSTREAN big_endian_support.patch https://bugs.freedesktop.org/show_bug.cgi?id=95738 +Patch2: big_endian_support_2.patch +# PATCH-FIX-OPENSUSE webrtc-(ppc64|s390x|aarch64).patch +Patch100: webrtc-ppc64.patch +Patch101: webrtc-s390x.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ @@ -38,9 +43,7 @@ BuildRequires: libtool BuildRequires: make BuildRequires: pkgconfig BuildRequires: xz -Patch0: webrtc-ppc64.patch -Patch1: webrtc-s390x.patch -Patch2: webrtc-aarch64.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description WebRTC is an open source project that enables web browsers with Real-Time @@ -86,31 +89,29 @@ WebRTC implements the W3C's proposal for video conferencing on the web. %prep %setup -q -T -c "%{name}-%{version}" -xz --decompress --stdout "%{SOURCE0}" | %__tar xf - --strip-components=1 -%__sed -i 's/\r$//' AUTHORS -%patch0 -p1 -%patch1 -%patch2 +xz --decompress --stdout "%{SOURCE0}" | tar xf - --strip-components=1 +sed -i 's/\r$//' AUTHORS +%patch1 -p1 +%patch2 -p1 +%patch100 +%patch101 %build %configure -%__make %{?_smp_mflags} V=1 +make %{?_smp_mflags} V=1 %install %makeinstall -%__rm -f "%{buildroot}%{_libdir}"/*.la +rm -f "%{buildroot}%{_libdir}"/*.la %post -n libwebrtc_audio_processing%{soname} -p /sbin/ldconfig %postun -n libwebrtc_audio_processing%{soname} -p /sbin/ldconfig -%clean -%{?buildroot:%__rm -rf "%{buildroot}"} - %files -n libwebrtc_audio_processing%{soname} %defattr(-,root,root) -%doc AUTHORS COPYING NEWS PATENTS README +%doc AUTHORS COPYING NEWS README.md UPDATING.md %{_libdir}/libwebrtc_audio_processing.so.%{soname} %{_libdir}/libwebrtc_audio_processing.so.%{soname}.*.* diff --git a/webrtc-ppc64.patch b/webrtc-ppc64.patch index aa73651..28dad72 100644 --- a/webrtc-ppc64.patch +++ b/webrtc-ppc64.patch @@ -1,17 +1,17 @@ -Index: webrtc-audio-processing-0.1/src/typedefs.h +Index: webrtc/typedefs.h =================================================================== ---- webrtc-audio-processing-0.1.orig/src/typedefs.h -+++ webrtc-audio-processing-0.1/src/typedefs.h -@@ -76,6 +76,12 @@ - //#define WEBRTC_ARCH_ARMEL +--- webrtc/typedefs.h.org ++++ webrtc/typedefs.h +@@ -47,6 +47,12 @@ + #elif defined(__pnacl__) #define WEBRTC_ARCH_32_BITS #define WEBRTC_ARCH_LITTLE_ENDIAN +#elif defined(__powerpc64__) -+#define WEBRTC_BIG_ENDIAN ++#define WEBRTC_ARCH_BIG_ENDIAN +#define WEBRTC_ARCH_64_BITS +#elif defined(__powerpc__) -+#define WEBRTC_BIG_ENDIAN ++#define WEBRTC_ARCH_BIG_ENDIAN +#define WEBRTC_ARCH_32_BITS #else - #error Please add support for your architecture in typedefs.h - #endif + /* instead of failing, use typical unix defines... */ + #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ diff --git a/webrtc-s390x.patch b/webrtc-s390x.patch index 3c7f8dc..1ae3523 100644 --- a/webrtc-s390x.patch +++ b/webrtc-s390x.patch @@ -1,15 +1,15 @@ ---- src/typedefs.h -+++ src/typedefs.h -@@ -82,6 +82,12 @@ +--- webrtc/typedefs.h ++++ webrtc/typedefs.h +@@ -53,6 +53,12 @@ #elif defined(__powerpc__) - #define WEBRTC_BIG_ENDIAN + #define WEBRTC_ARCH_BIG_ENDIAN #define WEBRTC_ARCH_32_BITS +#elif defined(__s390x__) -+#define WEBRTC_BIG_ENDIAN ++#define WEBRTC_ARCH_BIG_ENDIAN +#define WEBRTC_ARCH_64_BITS +#elif defined(__s390__) -+#define WEBRTC_BIG_ENDIAN ++#define WEBRTC_ARCH_BIG_ENDIAN +#define WEBRTC_ARCH_32_BITS #else - #error Please add support for your architecture in typedefs.h - #endif + /* instead of failing, use typical unix defines... */ + #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__