Compare commits
36 Commits
Author | SHA1 | Date | |
---|---|---|---|
c9b0a675e4 | |||
315b2222a8 | |||
bc401b3cbf | |||
92a4765a7e | |||
c76b8bf340 | |||
cdec109331 | |||
096b0eaed2 | |||
b24229cbbc | |||
55239c4ca2 | |||
a47df351ca | |||
4125ace620 | |||
aa32d179d0 | |||
9a362bd149 | |||
8366ff0ce0 | |||
ca1186946d | |||
26f4493405 | |||
e31340c243 | |||
5a5aa66ada | |||
0cc2ebeda2 | |||
6064932abf | |||
8bf9efad15 | |||
ff85c98683 | |||
57ec282d4f | |||
6e37f37c4e | |||
b8ad0dfc22 | |||
e47b68df57 | |||
e74894baeb | |||
589a744585 | |||
8ac052ad6f | |||
b34c1d5746 | |||
3f9907f93d | |||
ce1a78887a | |||
8ce8bebb7d | |||
00ae7eb234 | |||
d353e92425 | |||
6a4d14d5c0 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@
|
||||
build/
|
||||
depcomp
|
||||
install/
|
||||
subprojects/*/
|
||||
|
206
.gitlab-ci.yml
206
.gitlab-ci.yml
@ -19,8 +19,8 @@ variables:
|
||||
# CI runs, for example when adding new packages to FDO_DISTRIBUTION_PACKAGES.
|
||||
# The tag is an arbitrary string that identifies the exact container
|
||||
# contents.
|
||||
BASE_TAG: '2020-11-27.1'
|
||||
FDO_DISTRIBUTION_VERSION: '20.10'
|
||||
BASE_TAG: '2023-05-25.0'
|
||||
FDO_DISTRIBUTION_VERSION: '22.10'
|
||||
FDO_UPSTREAM_REPO: 'pulseaudio/webrtc-audio-processing'
|
||||
|
||||
include:
|
||||
@ -43,9 +43,12 @@ include:
|
||||
FDO_DISTRIBUTION_PACKAGES: >-
|
||||
g++
|
||||
gcc
|
||||
git-core
|
||||
cmake
|
||||
libabsl-dev
|
||||
meson
|
||||
ninja-build
|
||||
pkg-config
|
||||
python3-setuptools
|
||||
|
||||
# Used to extend both container and build jobs
|
||||
@ -75,24 +78,205 @@ build-container-aarch64:
|
||||
stage: container
|
||||
|
||||
# Common build template
|
||||
.build:
|
||||
.build-distro-absl:
|
||||
stage: build
|
||||
extends:
|
||||
- .fdo.distribution-image@ubuntu
|
||||
script:
|
||||
- meson build
|
||||
- cd build
|
||||
- ninja
|
||||
- meson setup --wrap-mode=nofallback builddir
|
||||
- ninja -C builddir
|
||||
artifacts:
|
||||
expire_in: '5 days'
|
||||
when: 'always'
|
||||
paths:
|
||||
- build/
|
||||
- "builddir/meson-logs/*txt"
|
||||
|
||||
build-x86_64:
|
||||
.build-vendored-absl:
|
||||
stage: build
|
||||
extends:
|
||||
- .build
|
||||
- .fdo.distribution-image@ubuntu
|
||||
script:
|
||||
- meson setup --force-fallback-for=abseil-cpp builddir
|
||||
- ninja -C builddir
|
||||
artifacts:
|
||||
expire_in: '5 days'
|
||||
when: 'always'
|
||||
paths:
|
||||
- "builddir/meson-logs/*txt"
|
||||
|
||||
build-distro-absl-x86_64:
|
||||
extends:
|
||||
- .build-distro-absl
|
||||
- .ubuntu-x86_64
|
||||
|
||||
build-aarch64:
|
||||
build-vendored-absl-x86_64:
|
||||
extends:
|
||||
- .build
|
||||
- .build-vendored-absl
|
||||
- .ubuntu-x86_64
|
||||
|
||||
build-distro-absl-aarch64:
|
||||
extends:
|
||||
- .build-distro-absl
|
||||
- .ubuntu-aarch64
|
||||
|
||||
build-vendored-absl-aarch64:
|
||||
extends:
|
||||
- .build-vendored-absl
|
||||
- .ubuntu-aarch64
|
||||
|
||||
# Update from:
|
||||
# https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/.gitlab-ci.yml
|
||||
# https://gitlab.freedesktop.org/gstreamer/orc/-/blob/main/.gitlab-ci.yml
|
||||
vs2019 amd64:
|
||||
# Update from https://gitlab.freedesktop.org/gstreamer/gstreamer/container_registry
|
||||
image: 'registry.freedesktop.org/gstreamer/gstreamer/amd64/windows:2023-04-21.0-main'
|
||||
stage: 'build'
|
||||
tags:
|
||||
- 'docker'
|
||||
- 'windows'
|
||||
- '2022'
|
||||
artifacts:
|
||||
expire_in: '5 days'
|
||||
when: 'always'
|
||||
paths:
|
||||
- "builddir/meson-logs/*txt"
|
||||
variables:
|
||||
# Make sure any failure in PowerShell scripts is fatal
|
||||
ErrorActionPreference: 'Stop'
|
||||
WarningPreference: 'Stop'
|
||||
ARCH: 'amd64'
|
||||
PLAT: 'Desktop'
|
||||
before_script:
|
||||
# Make sure meson is up to date, so we don't need to rebuild the image with each release
|
||||
- pip3 install -U meson ninja
|
||||
script:
|
||||
# Gitlab executes PowerShell in docker, but VsDevCmd.bat is a batch script.
|
||||
# Environment variables substitutions is done by PowerShell before calling
|
||||
# cmd.exe, that's why we use $env:FOO instead of %FOO%
|
||||
- cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH -app_platform=$env:PLAT &&
|
||||
meson setup builddir &&
|
||||
meson compile --verbose -C builddir"
|
||||
|
||||
# Update from:
|
||||
# https://gitlab.freedesktop.org/gstreamer/cerbero/-/blob/main/.gitlab-ci.yml
|
||||
# https://gitlab.freedesktop.org/gstreamer/orc/-/blob/main/.gitlab-ci.yml
|
||||
macos x86_64:
|
||||
stage: 'build'
|
||||
tags:
|
||||
- gst-macos-13
|
||||
artifacts:
|
||||
expire_in: '5 days'
|
||||
when: 'always'
|
||||
paths:
|
||||
- "builddir/meson-logs/*txt"
|
||||
before_script:
|
||||
- pip3 install --upgrade pip
|
||||
# Need to install certificates for python
|
||||
- pip3 install --upgrade certifi
|
||||
# Anther way to install certificates
|
||||
- open /Applications/Python\ 3.8/Install\ Certificates.command
|
||||
# Make sure meson and ninja are up to date
|
||||
- pip3 install -U meson ninja
|
||||
script:
|
||||
- CERT_PATH=$(python3 -m certifi) && export SSL_CERT_FILE=${CERT_PATH} && export REQUESTS_CA_BUNDLE=${CERT_PATH}
|
||||
- meson setup builddir
|
||||
- meson compile --verbose -C builddir
|
||||
|
||||
# Update from:
|
||||
# https://gitlab.freedesktop.org/gstreamer/cerbero/-/blob/main/.gitlab-ci.yml
|
||||
# https://gitlab.freedesktop.org/gstreamer/orc/-/blob/main/.gitlab-ci.yml
|
||||
ios arm64:
|
||||
stage: 'build'
|
||||
tags:
|
||||
- gst-ios-16
|
||||
artifacts:
|
||||
name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
|
||||
expire_in: '5 days'
|
||||
when: 'always'
|
||||
paths:
|
||||
- "builddir/meson-logs/*txt"
|
||||
before_script:
|
||||
- pip3 install --upgrade pip
|
||||
# Need to install certificates for python
|
||||
- pip3 install --upgrade certifi
|
||||
# Anther way to install certificates
|
||||
- open /Applications/Python\ 3.8/Install\ Certificates.command
|
||||
# Make sure meson and ninja are up to date
|
||||
- pip3 install -U meson ninja
|
||||
script:
|
||||
- CERT_PATH=$(python3 -m certifi) && export SSL_CERT_FILE=${CERT_PATH} && export REQUESTS_CA_BUNDLE=${CERT_PATH}
|
||||
- |
|
||||
cat > ios-cross-file.txt <<EOF
|
||||
[host_machine]
|
||||
system = 'darwin'
|
||||
cpu_family = 'aarch64'
|
||||
cpu = 'aarch64'
|
||||
endian = 'little'
|
||||
|
||||
[properties]
|
||||
c_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
|
||||
objc_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
|
||||
cpp_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
|
||||
objcpp_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
|
||||
c_link_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
|
||||
objc_link_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
|
||||
cpp_link_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
|
||||
objcpp_link_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
|
||||
|
||||
[binaries]
|
||||
ar = '$(xcrun --find --sdk iphoneos ar)'
|
||||
c = '$(xcrun --find --sdk iphoneos clang)'
|
||||
objc = '$(xcrun --find --sdk iphoneos clang)'
|
||||
cpp = '$(xcrun --find --sdk iphoneos clang++)'
|
||||
objcpp = '$(xcrun --find --sdk iphoneos clang++)'
|
||||
ranlib = '$(xcrun --find --sdk iphoneos ranlib)'
|
||||
strip = '$(xcrun --find --sdk iphoneos strip)'
|
||||
pkgconfig = 'false'
|
||||
cmake = 'false'
|
||||
EOF
|
||||
- meson setup --cross-file ios-cross-file.txt builddir
|
||||
- meson compile --verbose -C builddir
|
||||
|
||||
# Update from:
|
||||
# https://gitlab.freedesktop.org/gstreamer/cerbero/-/blob/main/.gitlab-ci.yml
|
||||
# https://gitlab.freedesktop.org/gstreamer/orc/-/blob/main/.gitlab-ci.yml
|
||||
android fedora arm64:
|
||||
# Update from https://gitlab.freedesktop.org/gstreamer/cerbero/container_registry
|
||||
image: 'registry.freedesktop.org/gstreamer/cerbero/amd64/android-fedora:2021-10-22.0-1.18'
|
||||
stage: 'build'
|
||||
artifacts:
|
||||
expire_in: '5 days'
|
||||
when: 'always'
|
||||
paths:
|
||||
- "builddir/meson-logs/*.txt"
|
||||
before_script:
|
||||
- dnf install -y python3-pip gcc ninja-build
|
||||
- pip3 install --user meson
|
||||
script:
|
||||
- export PATH="$HOME/.local/bin:$PATH"
|
||||
- |
|
||||
cat > android-cross-file.txt <<EOF
|
||||
[constants]
|
||||
ndk_path = '/android/ndk'
|
||||
toolchain = ndk_path + '/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android'
|
||||
api = '28'
|
||||
|
||||
[host_machine]
|
||||
system = 'android'
|
||||
cpu_family = 'aarch64'
|
||||
cpu = 'aarch64'
|
||||
endian = 'little'
|
||||
|
||||
[properties]
|
||||
sys_root = ndk_path + '/sysroot'
|
||||
c_link_args = ['-fuse-ld=gold']
|
||||
cpp_link_args = ['-fuse-ld=gold']
|
||||
|
||||
[binaries]
|
||||
c = toolchain + api + '-clang'
|
||||
cpp = toolchain + api + '-clang++'
|
||||
ar = toolchain + '-ar'
|
||||
strip = toolchain + '-strip'
|
||||
EOF
|
||||
- meson setup --cross-file android-cross-file.txt builddir
|
||||
- meson compile --verbose -C builddir
|
||||
|
42
README.md
42
README.md
@ -1,9 +1,9 @@
|
||||
About
|
||||
=====
|
||||
# About
|
||||
|
||||
This is meant to be a more Linux packaging friendly copy of the AudioProcessing
|
||||
module from the WebRTC[1] project. The ideal case is that we make no changes to
|
||||
the code to make tracking upstream code easy.
|
||||
module from the [ WebRTC ](https://webrtc.googlesource.com/src) project. The
|
||||
ideal case is that we make no changes to the code to make tracking upstream
|
||||
code easy.
|
||||
|
||||
This package currently only includes the AudioProcessing bits, but I am very
|
||||
open to collaborating with other projects that wish to distribute other bits of
|
||||
@ -11,25 +11,33 @@ the code and hopefully eventually have a single point of packaging all the
|
||||
WebRTC code to help people reuse the code and avoid keeping private copies in
|
||||
several different projects.
|
||||
|
||||
[1] https://webrtc.googlesource.com/src
|
||||
# Building
|
||||
|
||||
Feedback
|
||||
========
|
||||
This project uses the [Meson build system](https://mesonbuild.com/). The
|
||||
quickest way to build is:
|
||||
|
||||
Patches, suggestions welcome. You can send them to the PulseAudio mailing
|
||||
list[2] or to me at the address below.
|
||||
```sh
|
||||
# Initialise into the build/ directory, for a prefixed install into the
|
||||
# install/ directory
|
||||
meson . build -Dprefix=$PWD/install
|
||||
|
||||
-- Arun Raghavan <mail@arunraghavan.net>
|
||||
# Run the actual build
|
||||
ninja -C build
|
||||
|
||||
[2] http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
|
||||
# Install locally
|
||||
ninja -C build install
|
||||
|
||||
Notes
|
||||
====
|
||||
# The libraries, headers, and pkg-config files are now in the install/
|
||||
# directory
|
||||
```
|
||||
|
||||
1. Some files need to be patch to avoid pulling in the gtest framework. This
|
||||
should ideally be pushed upstream in some way so we're able to just pull
|
||||
in what we need without changing anything.
|
||||
# Feedback
|
||||
|
||||
2. It might be nice to try LTO on the library. We build a lot of code as part
|
||||
Patches, suggestions welcome. You can file an issue on our Gitlab
|
||||
[repository](https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/).
|
||||
|
||||
# Notes
|
||||
|
||||
1. It might be nice to try LTO on the library. We build a lot of code as part
|
||||
of the main AudioProcessing module deps, and it's possible that this could
|
||||
provide significant space savings.
|
||||
|
15
RELEASING.md
15
RELEASING.md
@ -25,16 +25,19 @@ git tag -s -m 'WebRTC AudioProcessing v<X.y>' v<X.y>
|
||||
## Make a tarball
|
||||
|
||||
```sh
|
||||
git archive --format 'tar.gz' \
|
||||
--prefix webrtc-audio-processing-X.y -9 vX.y \
|
||||
> webrtc-audio-processing-X.y.tar.gz
|
||||
# The output will be in build/meson-dist/
|
||||
meson dist -C build --formats=gztar,xztar --include-subprojects
|
||||
```
|
||||
|
||||
## Checksum the tarball
|
||||
## Do a test build
|
||||
|
||||
```sh
|
||||
sha256sum webrtc-audio-processing-X.y.tar.gz \
|
||||
> webrtc-audio-processing-X.y.tar.gz.sha256
|
||||
tar xvf webrtc-audio-processing-X.y.tar.xz
|
||||
cd webrtc-audio-processing-X.y
|
||||
meson . build -Dprefix=$PWD/install
|
||||
ninja -C build
|
||||
ninja -C build install
|
||||
cd ..
|
||||
```
|
||||
|
||||
## Publish the files
|
||||
|
87
meson.build
87
meson.build
@ -1,10 +1,10 @@
|
||||
project('webrtc-audio-processing-1', 'c', 'cpp',
|
||||
version : '1.0',
|
||||
meson_version : '>= 0.54',
|
||||
project('webrtc-audio-processing', 'c', 'cpp',
|
||||
version : '1.2',
|
||||
meson_version : '>= 0.63',
|
||||
default_options : [ 'warning_level=1',
|
||||
'buildtype=debugoptimized',
|
||||
'c_std=c11',
|
||||
'cpp_std=c++14',
|
||||
'cpp_std=c++17',
|
||||
]
|
||||
)
|
||||
|
||||
@ -27,33 +27,53 @@ ac_minor_version = minor_version
|
||||
ac_version = ac_major_version + '.' + ac_minor_version
|
||||
ac_project_name = 'webrtc-audio-coding-' + ac_major_version
|
||||
|
||||
include_subdir = meson.project_name()
|
||||
include_subdir = apm_project_name
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
cpp = meson.get_compiler('cpp')
|
||||
|
||||
host_system = host_machine.system()
|
||||
|
||||
# Don't rely on the cross file setting the system properly when targeting ios
|
||||
if host_system == 'darwin' and meson.is_cross_build()
|
||||
ios_test_code = '''#include <TargetConditionals.h>
|
||||
#if ! TARGET_OS_IPHONE
|
||||
#error "Not iOS/tvOS/watchOS/iPhoneSimulator"
|
||||
#endif'''
|
||||
if cc.compiles(ios_test_code, name : 'building for iOS')
|
||||
host_system = 'ios'
|
||||
endif
|
||||
endif
|
||||
|
||||
platform_cflags = []
|
||||
os_cflags = []
|
||||
os_deps = []
|
||||
have_posix = false
|
||||
have_win = false
|
||||
|
||||
# Let's use pkg-config if available. This will also fallback to the subproject
|
||||
# if pkg-config is not found, which is really the most reliable way of building
|
||||
# abseil due to strict C++ standard match requirements.
|
||||
absl_dep = [
|
||||
cpp.find_library('absl_base'),
|
||||
cpp.find_library('absl_bad_optional_access'),
|
||||
cpp.find_library('absl_flags_internal'),
|
||||
cpp.find_library('absl_flags_marshalling'),
|
||||
cpp.find_library('absl_flags_parse'),
|
||||
cpp.find_library('absl_flags_registry'),
|
||||
cpp.find_library('absl_flags_usage_internal'),
|
||||
cpp.find_library('absl_raw_logging_internal'),
|
||||
cpp.find_library('absl_strings'),
|
||||
cpp.find_library('absl_synchronization'),
|
||||
cpp.find_library('absl_throw_delegate'),
|
||||
dependency('absl_base', default_options: ['cpp_std=c++17']),
|
||||
dependency('absl_flags'),
|
||||
dependency('absl_strings'),
|
||||
dependency('absl_synchronization'),
|
||||
dependency('absl_bad_optional_access'),
|
||||
]
|
||||
|
||||
if absl_dep[0].type_name() == 'internal'
|
||||
absl_subproj = subproject('abseil-cpp')
|
||||
headers = [
|
||||
absl_subproj.get_variable('absl_base_headers'),
|
||||
absl_subproj.get_variable('absl_flags_headers'),
|
||||
absl_subproj.get_variable('absl_strings_headers'),
|
||||
absl_subproj.get_variable('absl_synchronization_headers'),
|
||||
absl_subproj.get_variable('absl_types_headers'),
|
||||
]
|
||||
install_headers(headers, preserve_path: true)
|
||||
endif
|
||||
|
||||
if ['darwin', 'ios'].contains(host_system)
|
||||
os_cflags = ['-DWEBRTC_MAC']
|
||||
if host_system == 'ios'
|
||||
@ -72,6 +92,12 @@ elif host_system == 'linux'
|
||||
have_posix = true
|
||||
elif host_system == 'windows'
|
||||
platform_cflags += ['-DWEBRTC_WIN', '-D_WIN32', '-U__STRICT_ANSI__']
|
||||
# this one is for MinGW to get format specifiers from inttypes.h in C++
|
||||
platform_cflags += ['-D__STDC_FORMAT_MACROS=1']
|
||||
# Avoid min/max from windows.h which breaks std::min/max
|
||||
platform_cflags += ['-DNOMINMAX']
|
||||
# Ensure M_PI etc are defined
|
||||
platform_cflags += ['-D_USE_MATH_DEFINES']
|
||||
os_deps += [cc.find_library('winmm')]
|
||||
have_win = true
|
||||
endif
|
||||
@ -88,8 +114,8 @@ have_mips = false
|
||||
have_mips64 = false
|
||||
have_x86 = false
|
||||
have_avx2 = false
|
||||
if ['arm', 'armv7'].contains(host_machine.cpu_family())
|
||||
if cc.compiles('''#ifdef __ARM_ARCH_ISA_ARM
|
||||
if host_machine.cpu_family() == 'arm'
|
||||
if cc.compiles('''#ifndef __ARM_ARCH_ISA_ARM
|
||||
#error no arm arch
|
||||
#endif''')
|
||||
have_arm = true
|
||||
@ -124,14 +150,14 @@ if ['x86', 'x86_64'].contains(host_machine.cpu_family())
|
||||
endif
|
||||
|
||||
neon_opt = get_option('neon')
|
||||
if neon_opt != 'no'
|
||||
if neon_opt != 'no' and not have_neon
|
||||
if neon_opt != 'runtime'
|
||||
if cc.compiles('#include <arm_neon.h>', args : '-mfpu=neon')
|
||||
arch_cflags += ['-mfpu=neon', '-DWEBRTC_HAS_NEON']
|
||||
have_neon = true
|
||||
endif
|
||||
else
|
||||
neon_opt += ['-DWEBRTC_DETECT_NEON', '-mfpu=neon']
|
||||
arch_cflags += ['-DWEBRTC_DETECT_NEON', '-mfpu=neon']
|
||||
have_neon = true
|
||||
endif
|
||||
endif
|
||||
@ -158,11 +184,20 @@ pkgconfig.generate(
|
||||
extra_cflags: [
|
||||
'-DWEBRTC_LIBRARY_IMPL',
|
||||
] + platform_cflags,
|
||||
libraries: libwebrtc_audio_processing,
|
||||
libraries: [
|
||||
libwebrtc_audio_processing,
|
||||
],
|
||||
requires: [
|
||||
# the audio processing header references absl's optional.h
|
||||
'absl_base',
|
||||
]
|
||||
)
|
||||
|
||||
audio_processing_dep = declare_dependency(link_with : libwebrtc_audio_processing,
|
||||
include_directories : [webrtc_inc])
|
||||
audio_processing_dep = declare_dependency(
|
||||
link_with: libwebrtc_audio_processing,
|
||||
dependencies: [absl_dep],
|
||||
include_directories: [webrtc_inc]
|
||||
)
|
||||
|
||||
meson.override_dependency(apm_project_name, audio_processing_dep)
|
||||
|
||||
@ -178,7 +213,9 @@ pkgconfig.generate(
|
||||
libraries: libwebrtc_audio_coding,
|
||||
)
|
||||
|
||||
audio_coding_dep = declare_dependency(link_with : libwebrtc_audio_coding,
|
||||
include_directories : [webrtc_inc])
|
||||
audio_coding_dep = declare_dependency(
|
||||
link_with: libwebrtc_audio_coding,
|
||||
include_directories: [webrtc_inc]
|
||||
)
|
||||
|
||||
meson.override_dependency(ac_project_name, audio_coding_dep)
|
||||
|
84
subprojects/abseil-cpp.wrap
Normal file
84
subprojects/abseil-cpp.wrap
Normal file
@ -0,0 +1,84 @@
|
||||
[wrap-file]
|
||||
directory = abseil-cpp-20230125.1
|
||||
source_url = https://github.com/abseil/abseil-cpp/archive/20230125.1.tar.gz
|
||||
source_filename = abseil-cpp-20230125.1.tar.gz
|
||||
source_hash = 81311c17599b3712069ded20cca09a62ab0bf2a89dfa16993786c8782b7ed145
|
||||
patch_filename = abseil-cpp_20230125.1-4_patch.zip
|
||||
patch_url = https://wrapdb.mesonbuild.com/v2/abseil-cpp_20230125.1-4/get_patch
|
||||
patch_hash = 112ee72052049d930396c2778fc1c6e184137905dd75d60a97dcfc386426610d
|
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/abseil-cpp_20230125.1-4/abseil-cpp-20230125.1.tar.gz
|
||||
wrapdb_version = 20230125.1-4
|
||||
|
||||
[provide]
|
||||
absl_base = absl_base_dep
|
||||
absl_container = absl_container_dep
|
||||
absl_debugging = absl_debugging_dep
|
||||
absl_log = absl_log_dep
|
||||
absl_flags = absl_flags_dep
|
||||
absl_hash = absl_hash_dep
|
||||
absl_crc = absl_crc_dep
|
||||
absl_numeric = absl_numeric_dep
|
||||
absl_profiling = absl_profiling_dep
|
||||
absl_random = absl_random_dep
|
||||
absl_status = absl_status_dep
|
||||
absl_strings = absl_strings_dep
|
||||
absl_synchronization = absl_synchronization_dep
|
||||
absl_time = absl_time_dep
|
||||
absl_types = absl_types_dep
|
||||
absl_bad_any_cast_impl = absl_types_dep
|
||||
absl_bad_optional_access = absl_types_dep
|
||||
absl_bad_variant_access = absl_types_dep
|
||||
absl_city = absl_hash_dep
|
||||
absl_civil_time = absl_time_dep
|
||||
absl_cord = absl_strings_dep
|
||||
absl_cord_internal = absl_strings_dep
|
||||
absl_cordz_functions = absl_strings_dep
|
||||
absl_cordz_handle = absl_strings_dep
|
||||
absl_cordz_info = absl_strings_dep
|
||||
absl_cordz_sample_token = absl_strings_dep
|
||||
absl_debugging_internal = absl_debugging_dep
|
||||
absl_demangle_internal = absl_debugging_dep
|
||||
absl_examine_stack = absl_debugging_dep
|
||||
absl_exponential_biased = absl_profiling_dep
|
||||
absl_failure_signal_handler = absl_debugging_dep
|
||||
absl_flags_commandlineflag = absl_flags_dep
|
||||
absl_flags_commandlineflag_internal = absl_flags_dep
|
||||
absl_flags_config = absl_flags_dep
|
||||
absl_flags_internal = absl_flags_dep
|
||||
absl_flags_marshalling = absl_flags_dep
|
||||
absl_flags_parse = absl_flags_dep
|
||||
absl_flags_private_handle_accessor = absl_flags_dep
|
||||
absl_flags_program_name = absl_flags_dep
|
||||
absl_flags_reflection = absl_flags_dep
|
||||
absl_flags_usage = absl_flags_dep
|
||||
absl_flags_usage_internal = absl_flags_dep
|
||||
absl_graphcycles_internal = absl_synchronization_dep
|
||||
absl_hashtablez_sampler = absl_container_dep
|
||||
absl_int128 = absl_numeric_dep
|
||||
absl_leak_check = absl_debugging_dep
|
||||
absl_log_severity = absl_base_dep
|
||||
absl_low_level_hash = absl_hash_dep
|
||||
absl_periodic_sampler = absl_profiling_dep
|
||||
absl_random_distributions = absl_random_dep
|
||||
absl_random_internal_distribution_test_util = absl_random_dep
|
||||
absl_random_internal_platform = absl_random_dep
|
||||
absl_random_internal_pool_urbg = absl_random_dep
|
||||
absl_random_internal_randen = absl_random_dep
|
||||
absl_random_internal_randen_hwaes = absl_random_dep
|
||||
absl_random_internal_randen_hwaes_impl = absl_random_dep
|
||||
absl_random_internal_randen_slow = absl_random_dep
|
||||
absl_random_internal_seed_material = absl_random_dep
|
||||
absl_random_seed_gen_exception = absl_random_dep
|
||||
absl_random_seed_sequences = absl_random_dep
|
||||
absl_raw_hash_set = absl_container_dep
|
||||
absl_raw_logging_internal = absl_base_dep
|
||||
absl_scoped_set_env = absl_base_dep
|
||||
absl_spinlock_wait = absl_base_dep
|
||||
absl_stacktrace = absl_debugging_dep
|
||||
absl_statusor = absl_status_dep
|
||||
absl_strerror = absl_base_dep
|
||||
absl_str_format_internal = absl_strings_dep
|
||||
absl_strings_internal = absl_strings_dep
|
||||
absl_symbolize = absl_debugging_dep
|
||||
absl_throw_delegate = absl_base_dep
|
||||
absl_time_zone = absl_time_dep
|
@ -1,3 +1,12 @@
|
||||
isac_vad_sources = [
|
||||
'codecs/isac/main/source/filter_functions.c',
|
||||
'codecs/isac/main/source/isac_vad.c',
|
||||
'codecs/isac/main/source/pitch_estimator.c',
|
||||
'codecs/isac/main/source/pitch_filter.c',
|
||||
]
|
||||
|
||||
isac_vad_dep = declare_dependency(sources: isac_vad_sources)
|
||||
|
||||
webrtc_audio_coding_sources = [
|
||||
'codecs/isac/main/source/arith_routines.c',
|
||||
'codecs/isac/main/source/arith_routines_hist.c',
|
||||
@ -12,18 +21,14 @@ webrtc_audio_coding_sources = [
|
||||
'codecs/isac/main/source/encode_lpc_swb.c',
|
||||
'codecs/isac/main/source/entropy_coding.c',
|
||||
'codecs/isac/main/source/filterbanks.c',
|
||||
'codecs/isac/main/source/filter_functions.c',
|
||||
'codecs/isac/main/source/intialize.c',
|
||||
'codecs/isac/main/source/isac.c',
|
||||
'codecs/isac/main/source/isac_vad.c',
|
||||
'codecs/isac/main/source/lattice.c',
|
||||
'codecs/isac/main/source/lpc_analysis.c',
|
||||
'codecs/isac/main/source/lpc_gain_swb_tables.c',
|
||||
'codecs/isac/main/source/lpc_shape_swb12_tables.c',
|
||||
'codecs/isac/main/source/lpc_shape_swb16_tables.c',
|
||||
'codecs/isac/main/source/lpc_tables.c',
|
||||
'codecs/isac/main/source/pitch_estimator.c',
|
||||
'codecs/isac/main/source/pitch_filter.c',
|
||||
'codecs/isac/main/source/pitch_gain_tables.c',
|
||||
'codecs/isac/main/source/pitch_lag_tables.c',
|
||||
'codecs/isac/main/source/spectrum_ar_model_tables.c',
|
||||
@ -32,7 +37,7 @@ webrtc_audio_coding_sources = [
|
||||
|
||||
libwebrtc_audio_coding = library(ac_project_name,
|
||||
webrtc_audio_coding_sources,
|
||||
dependencies: [base_dep, api_dep, common_audio_dep, system_wrappers_dep, fft_dep] + common_deps,
|
||||
dependencies: [base_dep, api_dep, common_audio_dep, system_wrappers_dep, fft_dep, isac_vad_dep] + common_deps,
|
||||
include_directories: webrtc_inc,
|
||||
c_args: common_cflags,
|
||||
cpp_args: common_cxxflags,
|
||||
@ -40,12 +45,6 @@ libwebrtc_audio_coding = library(ac_project_name,
|
||||
install: true
|
||||
)
|
||||
|
||||
webrtc_audio_coding_dep = declare_dependency(
|
||||
link_with: libwebrtc_audio_coding,
|
||||
include_directories: webrtc_inc,
|
||||
version: ac_version
|
||||
)
|
||||
|
||||
install_headers(['codecs/isac/bandwidth_info.h'],
|
||||
subdir: join_paths(include_subdir, 'modules', 'audio_coding', 'codecs', 'isac')
|
||||
)
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define MODULES_AUDIO_PROCESSING_AEC3_REVERB_FREQUENCY_RESPONSE_H_
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/types/optional.h"
|
||||
|
@ -215,19 +215,4 @@ if (rtc_include_tests) {
|
||||
deps += [ ":unittests_bundle_data" ]
|
||||
}
|
||||
}
|
||||
|
||||
rtc_executable("rnn_vad_tool") {
|
||||
testonly = true
|
||||
sources = [ "rnn_vad_tool.cc" ]
|
||||
deps = [
|
||||
":rnn_vad",
|
||||
":rnn_vad_common",
|
||||
"../../../../api:array_view",
|
||||
"../../../../common_audio",
|
||||
"../../../../rtc_base:rtc_base_approved",
|
||||
"../../../../test:test_support",
|
||||
"//third_party/abseil-cpp/absl/flags:flag",
|
||||
"//third_party/abseil-cpp/absl/flags:parse",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,120 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/flags/flag.h"
|
||||
#include "absl/flags/parse.h"
|
||||
#include "common_audio/resampler/push_sinc_resampler.h"
|
||||
#include "common_audio/wav_file.h"
|
||||
#include "modules/audio_processing/agc2/rnn_vad/common.h"
|
||||
#include "modules/audio_processing/agc2/rnn_vad/features_extraction.h"
|
||||
#include "modules/audio_processing/agc2/rnn_vad/rnn.h"
|
||||
#include "rtc_base/logging.h"
|
||||
|
||||
ABSL_FLAG(std::string, i, "", "Path to the input wav file");
|
||||
ABSL_FLAG(std::string, f, "", "Path to the output features file");
|
||||
ABSL_FLAG(std::string, o, "", "Path to the output VAD probabilities file");
|
||||
|
||||
namespace webrtc {
|
||||
namespace rnn_vad {
|
||||
namespace test {
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
absl::ParseCommandLine(argc, argv);
|
||||
rtc::LogMessage::LogToDebug(rtc::LS_INFO);
|
||||
|
||||
// Open wav input file and check properties.
|
||||
const std::string input_wav_file = absl::GetFlag(FLAGS_i);
|
||||
WavReader wav_reader(input_wav_file);
|
||||
if (wav_reader.num_channels() != 1) {
|
||||
RTC_LOG(LS_ERROR) << "Only mono wav files are supported";
|
||||
return 1;
|
||||
}
|
||||
if (wav_reader.sample_rate() % 100 != 0) {
|
||||
RTC_LOG(LS_ERROR) << "The sample rate rate must allow 10 ms frames.";
|
||||
return 1;
|
||||
}
|
||||
RTC_LOG(LS_INFO) << "Input sample rate: " << wav_reader.sample_rate();
|
||||
|
||||
// Init output files.
|
||||
const std::string output_vad_probs_file = absl::GetFlag(FLAGS_o);
|
||||
FILE* vad_probs_file = fopen(output_vad_probs_file.c_str(), "wb");
|
||||
FILE* features_file = nullptr;
|
||||
const std::string output_feature_file = absl::GetFlag(FLAGS_f);
|
||||
if (!output_feature_file.empty()) {
|
||||
features_file = fopen(output_feature_file.c_str(), "wb");
|
||||
}
|
||||
|
||||
// Initialize.
|
||||
const size_t frame_size_10ms =
|
||||
rtc::CheckedDivExact(wav_reader.sample_rate(), 100);
|
||||
std::vector<float> samples_10ms;
|
||||
samples_10ms.resize(frame_size_10ms);
|
||||
std::array<float, kFrameSize10ms24kHz> samples_10ms_24kHz;
|
||||
PushSincResampler resampler(frame_size_10ms, kFrameSize10ms24kHz);
|
||||
FeaturesExtractor features_extractor;
|
||||
std::array<float, kFeatureVectorSize> feature_vector;
|
||||
RnnBasedVad rnn_vad;
|
||||
|
||||
// Compute VAD probabilities.
|
||||
while (true) {
|
||||
// Read frame at the input sample rate.
|
||||
const auto read_samples =
|
||||
wav_reader.ReadSamples(frame_size_10ms, samples_10ms.data());
|
||||
if (read_samples < frame_size_10ms) {
|
||||
break; // EOF.
|
||||
}
|
||||
// Resample input.
|
||||
resampler.Resample(samples_10ms.data(), samples_10ms.size(),
|
||||
samples_10ms_24kHz.data(), samples_10ms_24kHz.size());
|
||||
|
||||
// Extract features and feed the RNN.
|
||||
bool is_silence = features_extractor.CheckSilenceComputeFeatures(
|
||||
samples_10ms_24kHz, feature_vector);
|
||||
float vad_probability =
|
||||
rnn_vad.ComputeVadProbability(feature_vector, is_silence);
|
||||
// Write voice probability.
|
||||
RTC_DCHECK_GE(vad_probability, 0.f);
|
||||
RTC_DCHECK_GE(1.f, vad_probability);
|
||||
fwrite(&vad_probability, sizeof(float), 1, vad_probs_file);
|
||||
// Write features.
|
||||
if (features_file) {
|
||||
const float float_is_silence = is_silence ? 1.f : 0.f;
|
||||
fwrite(&float_is_silence, sizeof(float), 1, features_file);
|
||||
if (is_silence) {
|
||||
// Do not write uninitialized values.
|
||||
feature_vector.fill(0.f);
|
||||
}
|
||||
fwrite(feature_vector.data(), sizeof(float), kFeatureVectorSize,
|
||||
features_file);
|
||||
}
|
||||
}
|
||||
|
||||
// Close output file(s).
|
||||
fclose(vad_probs_file);
|
||||
RTC_LOG(LS_INFO) << "VAD probabilities written to " << output_vad_probs_file;
|
||||
if (features_file) {
|
||||
fclose(features_file);
|
||||
RTC_LOG(LS_INFO) << "features written to " << output_feature_file;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
} // namespace rnn_vad
|
||||
} // namespace webrtc
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
return webrtc::rnn_vad::test::main(argc, argv);
|
||||
}
|
@ -88,7 +88,6 @@ webrtc_audio_processing_sources = [
|
||||
'agc2/rnn_vad/pitch_search.cc',
|
||||
'agc2/rnn_vad/pitch_search_internal.cc',
|
||||
'agc2/rnn_vad/rnn.cc',
|
||||
'agc2/rnn_vad/rnn_vad_tool.cc',
|
||||
'agc2/rnn_vad/spectral_features.cc',
|
||||
'agc2/rnn_vad/spectral_features_internal.cc',
|
||||
'agc2/saturation_protector.cc',
|
||||
@ -199,7 +198,7 @@ libwebrtc_audio_processing = library(apm_project_name,
|
||||
dependencies: [
|
||||
base_dep,
|
||||
api_dep,
|
||||
webrtc_audio_coding_dep,
|
||||
isac_vad_dep,
|
||||
system_wrappers_dep,
|
||||
common_audio_dep,
|
||||
pffft_dep,
|
||||
@ -212,9 +211,3 @@ libwebrtc_audio_processing = library(apm_project_name,
|
||||
soversion: apm_minor_version,
|
||||
install: true
|
||||
)
|
||||
|
||||
webrtc_audio_processing_dep = declare_dependency(
|
||||
link_with: libwebrtc_audio_processing,
|
||||
include_directories: webrtc_inc,
|
||||
version: apm_version
|
||||
)
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define MODULES_AUDIO_PROCESSING_TRANSIENT_FILE_UTILS_H_
|
||||
|
||||
#include <string.h>
|
||||
#include <cstdint>
|
||||
|
||||
#include "rtc_base/system/file_wrapper.h"
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
#if RTC_LOG_ENABLED()
|
||||
|
||||
#if defined(WEBRTC_WIN)
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#if _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
|
@ -51,9 +51,24 @@ foreach h : base_headers
|
||||
)
|
||||
endforeach
|
||||
|
||||
base_os_deps = []
|
||||
if host_system == 'darwin'
|
||||
base_os_deps += dependency('appleframeworks', modules: [ 'Foundation' ])
|
||||
elif host_system == 'ios'
|
||||
base_os_deps += dependency('appleframeworks',
|
||||
modules: [
|
||||
'CFNetwork',
|
||||
'Foundation',
|
||||
'Security',
|
||||
'SystemConfiguration',
|
||||
'UIKit',
|
||||
]
|
||||
)
|
||||
endif
|
||||
|
||||
libbase = static_library('libbase',
|
||||
base_sources,
|
||||
dependencies: common_deps,
|
||||
dependencies: common_deps + base_os_deps,
|
||||
include_directories: webrtc_inc,
|
||||
cpp_args : common_cxxflags
|
||||
)
|
||||
|
@ -99,11 +99,13 @@ void SetCurrentThreadName(const char* name) {
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 6320 6322)
|
||||
#ifndef __MINGW32__
|
||||
__try {
|
||||
::RaiseException(0x406D1388, 0, sizeof(threadname_info) / sizeof(ULONG_PTR),
|
||||
reinterpret_cast<ULONG_PTR*>(&threadname_info));
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) { // NOLINT
|
||||
}
|
||||
#endif
|
||||
#pragma warning(pop)
|
||||
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)
|
||||
prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name)); // NOLINT
|
||||
|
@ -11,7 +11,7 @@
|
||||
#ifndef RTC_BASE_SYNCHRONIZATION_RW_LOCK_WIN_H_
|
||||
#define RTC_BASE_SYNCHRONIZATION_RW_LOCK_WIN_H_
|
||||
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "rtc_base/synchronization/rw_lock_wrapper.h"
|
||||
|
||||
|
@ -27,6 +27,13 @@
|
||||
#define WEBRTC_ARCH_ARM_FAMILY
|
||||
#define WEBRTC_ARCH_64_BITS
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#elif defined(__riscv) || defined(__riscv__)
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#if __riscv_xlen == 64
|
||||
#define WEBRTC_ARCH_64_BITS
|
||||
#else
|
||||
#define WEBRTC_ARCH_32_BITS
|
||||
#endif
|
||||
#elif defined(_M_IX86) || defined(__i386__)
|
||||
#define WEBRTC_ARCH_X86_FAMILY
|
||||
#define WEBRTC_ARCH_X86
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <cerrno>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
@ -14,7 +14,11 @@
|
||||
namespace webrtc {
|
||||
|
||||
#if defined(WEBRTC_ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
|
||||
/* webrtc-audio-processing:
|
||||
* We don't support the Android SDK integration for this, so stub out
|
||||
void WarnThatTheCurrentThreadIsProbablyDeadlocked();
|
||||
*/
|
||||
inline void WarnThatTheCurrentThreadIsProbablyDeadlocked() {}
|
||||
#else
|
||||
inline void WarnThatTheCurrentThreadIsProbablyDeadlocked() {}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user