From ee409796b05c3a498568f1f98c67247564afa249 Mon Sep 17 00:00:00 2001 From: Ystinia Zalatova <94921687+ystinia@users.noreply.github.com> Date: Wed, 24 Jul 2024 20:29:30 +0300 Subject: [PATCH] Add AudioProcessing library based on Google's implementation of WebRTC (#1500) --- general/package/Config.in | 1 + ...detection-of-cxxabi.h-and-execinfo.h.patch | 63 +++++++++++++++++++ .../webrtc-audio-processing-openipc/Config.in | 21 +++++++ .../webrtc-audio-processing-openipc.hash | 3 + .../webrtc-audio-processing-openipc.mk | 21 +++++++ 5 files changed, 109 insertions(+) create mode 100644 general/package/webrtc-audio-processing-openipc/0001-Proper-detection-of-cxxabi.h-and-execinfo.h.patch create mode 100644 general/package/webrtc-audio-processing-openipc/Config.in create mode 100644 general/package/webrtc-audio-processing-openipc/webrtc-audio-processing-openipc.hash create mode 100644 general/package/webrtc-audio-processing-openipc/webrtc-audio-processing-openipc.mk diff --git a/general/package/Config.in b/general/package/Config.in index 39096f2a..829d45b3 100644 --- a/general/package/Config.in +++ b/general/package/Config.in @@ -109,6 +109,7 @@ source "$BR2_EXTERNAL_GENERAL_PATH/package/vdec-openipc/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/venc-openipc/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/vtund-openipc/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/webui/Config.in" +source "$BR2_EXTERNAL_GENERAL_PATH/package/webrtc-audio-processing-openipc/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/wifibroadcast/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/xiongmai-opensdk-xm510/Config.in" source "$BR2_EXTERNAL_GENERAL_PATH/package/xiongmai-osdrv-xm510/Config.in" diff --git a/general/package/webrtc-audio-processing-openipc/0001-Proper-detection-of-cxxabi.h-and-execinfo.h.patch b/general/package/webrtc-audio-processing-openipc/0001-Proper-detection-of-cxxabi.h-and-execinfo.h.patch new file mode 100644 index 00000000..a0332db8 --- /dev/null +++ b/general/package/webrtc-audio-processing-openipc/0001-Proper-detection-of-cxxabi.h-and-execinfo.h.patch @@ -0,0 +1,63 @@ +From b7a166acaddc4c78afa2b653e25114d9114699f3 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 6 Aug 2016 11:24:50 +0200 +Subject: [PATCH] Proper detection of cxxabi.h and execinfo.h + +The current code in webrtc/base/checks.cc assumes that if __GLIBCXX__ is +defined and __UCLIBC__ is not defined, then both cxxabi.h and execinfo.h +will be available. + +Unfortunately, this is not correct with the musl C library: + + - It defines __GLIBCXX__ + - It does not define __UCLIBC__ (it's not uClibc after all!) + - But it also doesn't provide execinfo.h + +Therefore, in order to make things work properly, we switch to proper +autoconf checks for cxxabi.h and execinfo.h, and only use the backtrace +functionality if both are provided. + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 2 ++ + webrtc/base/checks.cc | 4 ++-- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index acbb3e2..ff4c752 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -45,6 +45,8 @@ AC_SUBST(GNUSTL_CFLAGS) + # Borrowed from gst-plugins-bad + AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IOS="no", [-]) + ++AC_CHECK_HEADERS([cxxabi.h execinfo.h]) ++ + # Based on gst-plugins-bad configure.ac and defines in + # /build/config/BUILDCONFIG.gn and + # webrtc/BUILD.gn +diff --git a/webrtc/base/checks.cc b/webrtc/base/checks.cc +index 49a31f2..05d23a6 100644 +--- a/webrtc/base/checks.cc ++++ b/webrtc/base/checks.cc +@@ -16,7 +16,7 @@ + #include + #include + +-#if defined(__GLIBCXX__) && !defined(__UCLIBC__) ++#if defined(HAVE_CXX_ABI_H) && defined(HAVE_EXECINFO_H) + #include + #include + #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(HAVE_CXX_ABI_H) && defined(HAVE_EXECINFO_H) + void* trace[100]; + int size = backtrace(trace, sizeof(trace) / sizeof(*trace)); + char** symbols = backtrace_symbols(trace, size); +-- +2.7.4 + diff --git a/general/package/webrtc-audio-processing-openipc/Config.in b/general/package/webrtc-audio-processing-openipc/Config.in new file mode 100644 index 00000000..cfe594d9 --- /dev/null +++ b/general/package/webrtc-audio-processing-openipc/Config.in @@ -0,0 +1,21 @@ +config BR2_PACKAGE_WEBRTC_AUDIO_PROCESSING_OPENIPC_ARCH_SUPPORTS + bool + default y if BR2_aarch64 || BR2_arm || BR2_i386 || BR2_x86_64 + +config BR2_PACKAGE_WEBRTC_AUDIO_PROCESSING_OPENIPC + bool "webrtc-audio-processing-openipc" + depends on BR2_PACKAGE_WEBRTC_AUDIO_PROCESSING_OPENIPC_ARCH_SUPPORTS + depends on BR2_INSTALL_LIBSTDCPP + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 + # pthread_condattr_setclock + depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL + help + AudioProcessing library based on Google's implementation of + WebRTC. + + http://freedesktop.org/software/pulseaudio/webrtc-audio-processing/ + +comment "webrtc-audio-processing-openipc needs a toolchain w/ C++, NPTL, gcc >= 4.8" + depends on BR2_PACKAGE_WEBRTC_AUDIO_PROCESSING_OPENIPC_ARCH_SUPPORTS + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS_NPTL \ + || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 diff --git a/general/package/webrtc-audio-processing-openipc/webrtc-audio-processing-openipc.hash b/general/package/webrtc-audio-processing-openipc/webrtc-audio-processing-openipc.hash new file mode 100644 index 00000000..18b8ea64 --- /dev/null +++ b/general/package/webrtc-audio-processing-openipc/webrtc-audio-processing-openipc.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 a0fdd938fd85272d67e81572c5a4d9e200a0c104753cb3c209ded175ce3c5dbf webrtc-audio-processing-0.3.1.tar.xz +sha256 9b79539028e216e813e152d45f5c1ed5fdd0554426ad50270fb03134e7082dac COPYING diff --git a/general/package/webrtc-audio-processing-openipc/webrtc-audio-processing-openipc.mk b/general/package/webrtc-audio-processing-openipc/webrtc-audio-processing-openipc.mk new file mode 100644 index 00000000..24c21c55 --- /dev/null +++ b/general/package/webrtc-audio-processing-openipc/webrtc-audio-processing-openipc.mk @@ -0,0 +1,21 @@ +################################################################################ +# +# webrtc-audio-processing-openipc +# +################################################################################ + +WEBRTC_AUDIO_PROCESSING_OPENIPC_VERSION = 0.3.1 +WEBRTC_AUDIO_PROCESSING_OPENIPC_SOURCE = webrtc-audio-processing-$(WEBRTC_AUDIO_PROCESSING_OPENIPC_VERSION).tar.xz +WEBRTC_AUDIO_PROCESSING_OPENIPC_SITE = http://freedesktop.org/software/pulseaudio/webrtc-audio-processing +WEBRTC_AUDIO_PROCESSING_OPENIPC_INSTALL_STAGING = YES +WEBRTC_AUDIO_PROCESSING_OPENIPC_LICENSE = BSD-3-Clause +WEBRTC_AUDIO_PROCESSING_OPENIPC_LICENSE_FILES = COPYING +WEBRTC_AUDIO_PROCESSING_OPENIPC_DEPENDENCIES = host-pkgconf +# 0001-Proper-detection-of-cxxabi.h-and-execinfo.h.patch +WEBRTC_AUDIO_PROCESSING_OPENIPC_AUTORECONF = YES + +ifeq ($(BR2_SOFT_FLOAT),y) +WEBRTC_AUDIO_PROCESSING_OPENIPC_CONF_OPTS += --with-ns-mode=fixed +endif + +$(eval $(autotools-package))