webrtc-audio-processing: update to 1.3

This commit is contained in:
cinerea0 2024-03-07 10:33:52 -05:00 committed by cinerea0
parent bb8a89a5b3
commit e9b751bf85
6 changed files with 74 additions and 163 deletions

View file

@ -1057,7 +1057,8 @@ libiptcdata.so.0 libiptcdata-1.0.4_1
libutempter.so.0 libutempter-1.1.5_1
libxatracker.so.2 libxatracker-10.0.0_2
libtumbler-1.so.0 tumbler-4.9.2_1
libwebrtc_audio_processing.so.1 webrtc-audio-processing-0.3_1
libwebrtc-audio-coding-1.so.3 webrtc-audio-processing-1.3_1
libwebrtc-audio-processing-1.so.3 webrtc-audio-processing-1.3_1
libcupsmime.so.1 libcups-1.5.3_1
libcupsppdc.so.1 libcups-1.5.3_1
libcupscgi.so.1 libcups-1.5.3_1

View file

@ -1,20 +1,20 @@
From: Than <than@redhat.com>
Date: Wed, 8 Jun 2016 19:10:08 -0400
Subject: Add generic byte order and pointer size detection
Taken from https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-Add-generic-byte-order-and-pointer-size-detection.patch?id=29cd0e622b574df6adff5704ab4e220709619767
https://bugs.gentoo.org/917493
https://sources.debian.org/src/webrtc-audio-processing/1.0-0.2/debian/patches/Add-generic-byte-order-and-pointer-size-detection.patch/
Description: Add generic byte order and pointer size detection
Author: Than <than@redhat.com>
Origin: https://bugs.freedesktop.org/show_bug.cgi?id=95738#c4
Last-Update: 2022-02-01
---
webrtc/typedefs.h | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/webrtc/typedefs.h b/webrtc/typedefs.h
index d875490..dc074f1 100644
--- a/webrtc/typedefs.h
+++ b/webrtc/typedefs.h
@@ -48,7 +48,19 @@
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/webrtc/rtc_base/system/arch.h
+++ b/webrtc/rtc_base/system/arch.h
@@ -58,7 +58,19 @@
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN
#else
-#error Please add support for your architecture in typedefs.h
-#error Please add support for your architecture in rtc_base/system/arch.h
+/* instead of failing, use typical unix defines... */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define WEBRTC_ARCH_LITTLE_ENDIAN

View file

@ -0,0 +1,15 @@
Taken from https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/webrtc-audio-processing/files/webrtc-audio-processing-1.3-x86-no-sse.patch?id=29cd0e622b574df6adff5704ab4e220709619767
https://bugs.gentoo.org/921140
https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/issues/5
--- a/webrtc/rtc_base/system/arch.h
+++ b/webrtc/rtc_base/system/arch.h
@@ -34,7 +34,7 @@
#else
#define WEBRTC_ARCH_32_BITS
#endif
-#elif defined(_M_IX86) || defined(__i386__)
+#elif defined(__SSE__) && (defined(_M_IX86) || defined(__i386__))
#define WEBRTC_ARCH_X86_FAMILY
#define WEBRTC_ARCH_X86
#define WEBRTC_ARCH_32_BITS

View file

@ -1,113 +0,0 @@
--- webrtc-audio-processing-0.3_3/configure.ac 2017-11-22 20:26:54.207009881 +0100
+++ webrtc-audio-processing-0.3_3/configure.ac 2017-11-22 20:37:57.472996521 +0100
@@ -90,10 +90,14 @@
[HAVE_NEON=1; ARCH_CFLAGS="${ARCH_CFLAGS} -DWEBRTC_HAS_NEON -DWEBRTC_ARCH_ARM64"])
AC_CHECK_DECLS([__i386__], [HAVE_X86=1])
AC_CHECK_DECLS([__x86_64__], [HAVE_X86=1])
+AC_CHECK_DECLS([__MIPSEB__], [HAVE_MIPSEB=1])
+AC_CHECK_DECLS([__MIPSEL__], [HAVE_MIPSEL=1])
AM_CONDITIONAL(HAVE_X86, [test "x${HAVE_X86}" = "x1"])
AM_CONDITIONAL(HAVE_ARM, [test "x${HAVE_ARM}" = "x1"])
AM_CONDITIONAL(HAVE_ARMV7, [test "x${HAVE_ARMV7}" = "x1"])
+AM_CONDITIONAL(HAVE_MIPSEB, [test "x${HAVE_MIPSEB}" = "x1"])
+AM_CONDITIONAL(HAVE_MIPSEL, [test "x${HAVE_MIPSEL}" = "x1"])
# Borrowed from pulseaudio's configure.ac
AC_ARG_ENABLE([neon],
--- webrtc-audio-processing-0.3_3/webrtc/typedefs.h 2015-10-15 12:48:25.000000000 +0200
+++ webrtc-audio-processing-0.3_3/webrtc/typedefs.h 2017-11-22 20:39:20.800994843 +0100
@@ -47,6 +47,10 @@
#elif defined(__pnacl__)
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN
+#elif defined(__MIPSEL__)
+#define WEBRTC_ARCH_LITTLE_ENDIAN
+#elif defined(__MIPSEB__)
+#define WEBRTC_ARCH_BIG_ENDIAN
#else
#error Please add support for your architecture in typedefs.h
#endif
--- webrtc-audio-processing-0.3/webrtc/common_audio/wav_file.cc 2015-11-19 13:41:44.000000000 +0100
+++ webrtc-audio-processing-0.3/webrtc/common_audio/wav_file.cc 2017-11-22 21:01:46.554967737 +0100
@@ -64,9 +64,6 @@
}
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<uint32_t>(num_samples),
num_samples_remaining_);
@@ -76,6 +73,12 @@
RTC_CHECK(read == num_samples || feof(file_handle_));
RTC_CHECK_LE(read, num_samples_remaining_);
num_samples_remaining_ -= rtc::checked_cast<uint32_t>(read);
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
+ for (size_t i = 0; i < read; i++) {
+ uint16_t s = static_cast<uint16_t>(samples[i]);
+ samples[i] = static_cast<int16_t>((s >> 8) | (s << 8));
+ }
+#endif
return read;
}
@@ -119,11 +122,20 @@
}
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
+#ifdef WEBRTC_ARCH_LITTLE_ENDIAN
const size_t written =
fwrite(samples, sizeof(*samples), num_samples, file_handle_);
+#else
+ size_t written = 0;
+ for (size_t i = 0; i < num_samples; i++) {
+ uint16_t s = static_cast<uint16_t>(samples[i]);
+ s = static_cast<int16_t>((s<<8) | (s>>8));
+ size_t size = fwrite(&s, sizeof(s), 1, file_handle_);
+ if (size < 1)
+ break;
+ written += size;
+ }
+#endif
RTC_CHECK_EQ(num_samples, written);
num_samples_ += static_cast<uint32_t>(written);
RTC_CHECK(written <= std::numeric_limits<uint32_t>::max() ||
--- webrtc-audio-processing-0.3/webrtc/common_audio/wav_header.cc 2015-10-15 12:48:44.000000000 +0200
+++ webrtc-audio-processing-0.3/webrtc/common_audio/wav_header.cc 2017-11-22 21:11:36.291955859 +0100
@@ -129,7 +129,30 @@
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) | (x << 8); }
+static inline void WriteLE32(uint32_t* f, uint32_t x) {
+ *f = ((x & 0xff000000) >> 24) |
+ ((x & 0x00ff0000) >> 8) |
+ ((x & 0x0000ff00) << 8) |
+ ((x & 0x000000ff) << 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 >> 8) | (x << 8); }
+static inline uint32_t ReadLE32(uint32_t x) {
+ return ((x << 24) & 0xff000000) |
+ ((x << 8) & 0x00ff0000) |
+ ((x >> 8) & 0x0000ff00) |
+ ((x >> 24) & 0x000000ff);
+}
+static inline std::string ReadFourCC(uint32_t x) {
+ uint32_t s = ReadLE32(x);
+ return std::string(reinterpret_cast<char*>(&s), 4);
+}
#endif
static inline uint32_t RiffChunkSize(uint32_t bytes_in_payload) {

View file

@ -1,20 +1,33 @@
--- a/webrtc/base/checks.cc.orig 2016-06-25 07:47:34.099515548 +0200
+++ b/webrtc/base/checks.cc 2016-06-25 07:48:28.554122463 +0200
@@ -16,7 +16,7 @@
#include <cstdio>
#include <cstdlib>
https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/37
(see also https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/38)
From de1b9c444df1ed66d72a4ab3d0e4dd2151037934 Mon Sep 17 00:00:00 2001
From: Markus Volk <f_l_k@t-online.de>
Date: Thu, 14 Sep 2023 16:12:32 +0200
Subject: [PATCH] file_wrapper.h: add missing include for musl
this fixes:
| In file included from ../webrtc-audio-processing-1.3/webrtc/rtc_base/system/file_wrapper.cc:11:
| ../webrtc-audio-processing-1.3/webrtc/rtc_base/system/file_wrapper.h:86:21: error: 'int64_t' has not been declared
if built with musl libc
Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
webrtc/rtc_base/system/file_wrapper.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/webrtc/rtc_base/system/file_wrapper.h b/webrtc/rtc_base/system/file_wrapper.h
index 42c463c..c34d366 100644
--- a/webrtc/rtc_base/system/file_wrapper.h
+++ b/webrtc/rtc_base/system/file_wrapper.h
@@ -13,6 +13,7 @@
-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
+#if defined(__GLIBC__) && defined(__GLIBCXX__)
#include <cxxabi.h>
#include <execinfo.h>
#endif
@@ -55,7 +55,7 @@ void PrintError(const char* format, ...)
// to get usable symbols on Linux. This is copied from V8. Chromium has a more
// advanced stace trace system; also more difficult to copy.
void DumpBacktrace() {
-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
+#if defined(__GLIBC__) && defined(__GLIBCXX__)
void* trace[100];
int size = backtrace(trace, sizeof(trace) / sizeof(*trace));
char** symbols = backtrace_symbols(trace, size);
#include <stddef.h>
#include <stdio.h>
+#include <cstdint>
#include <string>
--
GitLab

View file

@ -1,38 +1,33 @@
# Template file for 'webrtc-audio-processing'
pkgname=webrtc-audio-processing
version=0.3.1
version=1.3
revision=1
build_style=gnu-configure
hostmakedepends="automake libtool"
build_style=meson
hostmakedepends="pkg-config"
makedepends="abseil-cpp-devel"
short_desc="AudioProcessing library based on Google's implementation of WebRTC"
maintainer="Orphaned <orphan@voidlinux.org>"
license="BSD-3-Clause"
homepage="http://freedesktop.org/software/pulseaudio/webrtc-audio-processing"
distfiles="${homepage}/${pkgname}-${version}.tar.xz"
checksum=a0fdd938fd85272d67e81572c5a4d9e200a0c104753cb3c209ded175ce3c5dbf
homepage="https://freedesktop.org/software/pulseaudio/webrtc-audio-processing"
distfiles="${FREEDESKTOP_SITE}/pulseaudio/webrtc-audio-processing/webrtc-audio-processing-${version}.tar.gz"
checksum=95552fc17faa0202133707bbb3727e8c2cf64d4266fe31bfdb2298d769c1db75
case "$XBPS_TARGET_MACHINE" in
# Disable neon for the arm* architectures
arm*) configure_args+=" --enable-neon=no" ;;
esac
pre_configure() {
# Remove failing statement PKG_CHECK_MODULE(GNUSTL, gnustl)
sed -i configure.ac -e'/if test "x$with_gnustl" != "xno"; then/,+2d'
autoreconf -fi
}
# Upstream issue: https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/issues/5
if [ "$XBPS_MACHINE" = "i686" ]; then
CXXFLAGS="-DPFFFT_SIMD_DISABLE=1"
CFLAGS="-DPFFFT_SIMD_DISABLE=1"
fi
post_install() {
vlicense COPYING
}
webrtc-audio-processing-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
depends="${sourcepkg}>=${version}_${revision} abseil-cpp-devel"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
}
}