49 Commits

Author SHA1 Message Date
Alper Nebi Yasak
73aed233b2 meson: Use neon_opt to control building neon files
Using the have_neon boolean to enable NEON code means we have to either
fully enable it or fully disable it. When using -Dneon=runtime, ideally
only the parts that support runtime checks would be built for NEON, and
those that don't would be built without NEON. Though, there are no
longer any runtime checks for NEON anywhere, so it's equivalent to 'no'
with a warning.

In general, we should use have_* variables to indicate compiler support,
and *_opt options to choose if and how we want to utilize that. Use
neon_opt to control NEON compilation and avoid modifying have_neon which
now would fully refer to compiler support.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-12-30 14:18:44 -05:00
Alper Nebi Yasak
2493b6e659 meson: Raise error for setting 'neon' when unsupported
We can set -Dneon=yes on x86, which will fail during build because the
x86 compiler doesn't understand the resulting `-mfpu=neon` flag. Make the
'neon' build option cause an error in the setup stage if we didn't
detect hardware support for NEON.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-12-30 14:18:00 -05:00
Alper Nebi Yasak
fc5a4946af meson: Set 'auto' as the default neon option value
The default for the neon build option is 'no', which disabled NEON code
for 32-bit ARM but enabled it for ARM64. Now that 'no' can disable NEON
code for ARM64, the default should be 'auto' which would enable it where
possible. Handle the 'auto' value, and set it as the default.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-12-30 14:17:32 -05:00
Alper Nebi Yasak
b7a194f824 meson: Check arm neon support before parsing neon option
The main if statment for the NEON option has been quite convoluted. The
previous commits reduced what it does to a simple case: check NEON
support and set have_neon on 32-bit ARM CPUs. Do that near the
architecture definitions.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-12-30 14:16:43 -05:00
Alper Nebi Yasak
6c914be933 meson: Make -Dneon=no disable neon-specific code
When the neon build option is set to 'no', we should disable optimized
implementations that use NEON. Change have_neon to false in that case,
so that we skip the flags and skip building NEON-specific files.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-12-30 14:16:43 -05:00
Alper Nebi Yasak
8b0255991e meson: Set WEBRTC_HAS_NEON macro after handling neon build option
The WEBRTC_HAS_NEON macro that enables using NEON implementations is
unconditionally set for arm64 and the 'neon' build option is ignored,
assuming we always want to use the NEON-specific implementations instead
of generic ones. This is an OK assumption to make because arm64 CPUs
always support NEON.

But the code handling the build option ended up quite convoluted. As
part of cleaning up, set the relevant cflags after we handle the build
option. This also means that we can make 'runtime' fall back to 'no',
and disable NEON-specific code with -Dneon=no.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-12-30 14:16:43 -05:00
Alper Nebi Yasak
b22ce018c8 meson: Drop obsolete WEBRTC_DETECT_NEON macro
Upstream has dropped runtime checks for NEON instructions around 2016,
and the WEBRTC_DETECT_NEON macro is removed along with it. Disable NEON
when building with -Dneon=runtime and omit a warning instead.

Link: https://webrtc.googlesource.com/src/+/e305d956c0717a28ca88cd8547e5b310dfa74594
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-12-30 14:16:43 -05:00
Arun Raghavan
6119c05d7d meson: Drop WEBRTC_THREAD_RR
The define was dropped upstream a while back and is unused.
2024-12-30 12:20:27 -05:00
Jan Beich
2a318149f8 Add support for BSD systems
webrtc/rtc_base/checks.cc:158:28: error: use of undeclared identifier 'LAST_SYSTEM_ERROR'
  158 |                file, line, LAST_SYSTEM_ERROR, message);
      |                            ^
webrtc/rtc_base/checks.cc:220:16: error: use of undeclared identifier 'LAST_SYSTEM_ERROR'
  220 |                LAST_SYSTEM_ERROR);
      |                ^
In file included from webrtc/rtc_base/platform_thread_types.cc:11:
webrtc/rtc_base/platform_thread_types.h:47:1: error: unknown type name 'PlatformThreadId'
   47 | PlatformThreadId CurrentThreadId();
      | ^
webrtc/rtc_base/platform_thread_types.h:52:1: error: unknown type name 'PlatformThreadRef'
   52 | PlatformThreadRef CurrentThreadRef();
      | ^
webrtc/rtc_base/platform_thread_types.h:55:29: error: unknown type name 'PlatformThreadRef'
   55 | bool IsThreadRefEqual(const PlatformThreadRef& a, const PlatformThreadRef& b);
      |                             ^
webrtc/rtc_base/platform_thread_types.h:55:57: error: unknown type name 'PlatformThreadRef'
   55 | bool IsThreadRefEqual(const PlatformThreadRef& a, const PlatformThreadRef& b);
      |                                                         ^
webrtc/rtc_base/platform_thread_types.cc:37:1: error: unknown type name 'PlatformThreadId'
   37 | PlatformThreadId CurrentThreadId() {
      | ^
webrtc/rtc_base/platform_thread_types.cc:58:1: error: unknown type name 'PlatformThreadRef'
   58 | PlatformThreadRef CurrentThreadRef() {
      | ^
webrtc/rtc_base/platform_thread_types.cc:68:29: error: unknown type name 'PlatformThreadRef'
   68 | bool IsThreadRefEqual(const PlatformThreadRef& a, const PlatformThreadRef& b) {
      |                             ^
webrtc/rtc_base/platform_thread_types.cc:68:57: error: unknown type name 'PlatformThreadRef'
   68 | bool IsThreadRefEqual(const PlatformThreadRef& a, const PlatformThreadRef& b) {
      |                                                         ^
In file included from webrtc/rtc_base/event_tracer.cc:30:
In file included from webrtc/api/sequence_checker.h:15:
In file included from webrtc/rtc_base/synchronization/sequence_checker_internal.h:18:
webrtc/rtc_base/synchronization/mutex.h:28:2: error: Unsupported platform.
   28 | #error Unsupported platform.
      |  ^
webrtc/rtc_base/synchronization/mutex.h:52:3: error: unknown type name 'MutexImpl'
   52 |   MutexImpl impl_;
      |   ^
2024-12-30 17:18:54 +00:00
Alper Nebi Yasak
85556fd38b meson: Drop malformed WEBRTC_ARCH_MIPS_FAMILY cflags argument
The top-level meson.build file adds WEBRTC_ARCH_MIPS_FAMILY to
arch_cflags for mips architectures, which causes the following error:

  [1/306] Compiling C++ object webrtc/rtc_base/liblibbase.a.p/synchronization_yield.cc.o
  FAILED: webrtc/rtc_base/liblibbase.a.p/synchronization_yield.cc.o
  c++ [...] -DWEBRTC_THREAD_RR WEBRTC_ARCH_MIPS_FAMILY -MD [...] ../webrtc/rtc_base/synchronization/yield.cc
  c++: warning: WEBRTC_ARCH_MIPS_FAMILY: linker input file unused because linking not done
  c++: error: WEBRTC_ARCH_MIPS_FAMILY: linker input file not found: No such file or directory

It is supposed to be "-DWEBRTC_ARCH_MIPS_FAMILY". But, that macro is
already defined in arch.h when building for mips:

  [30/306] Compiling C++ object webrtc/system_wrappers/libsystem_wrappers.a.p/source_cpu_features.cc.o
  In file included from ../webrtc/system_wrappers/source/cpu_features.cc:13:
  ../webrtc/rtc_base/system/arch.h:47:9: warning: "WEBRTC_ARCH_MIPS_FAMILY" redefined
     47 | #define WEBRTC_ARCH_MIPS_FAMILY
        |         ^~~~~~~~~~~~~~~~~~~~~~~
  <command-line>: note: this is the location of the previous definition

Drop the broken, unnecessary argument from cflags.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-12-30 12:06:49 -05:00
Arun Raghavan
fed81a77c9 Allow disabling inline SSE
Should make building on i686 without SSE feasible.

Fixes: https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/issues/5
2024-12-26 17:35:08 -05:00
Arun Raghavan
0d4c5f27b5 build: Bump version to 2.0 2024-12-26 12:55:16 -05:00
Arun Raghavan
b5c48b97f6 Bump to WebRTC M131 release
Ongoing fixes and improvements, transient suppressor is gone. Also,
dropping isac because it doesn't seem to be useful, and is just build
system deadweight now.

Upstream references:

  Version: 131.0.6778.200
  WebRTC: 79aff54b0fa9238ce3518dd9eaf9610cd6f22e82
  Chromium: 2a19506ad24af755f2a215a4c61f775393e0db42
2024-12-26 12:55:16 -05:00
Arun Raghavan
8bdb53d91c meson: Update abseil wrap to 20240722
We need something recent enough with the stringify API for the M131 bump.
2024-12-26 12:55:12 -05:00
Arun Raghavan
867e2d875b Add a trivial example to run AEC offline
Just allows for some sanity testing for now, will improve for
configurability and add some sample data in the future.
2024-12-24 18:57:37 -05:00
Arun Raghavan
06157f1659 build: Use Visual Studio-specific flags for AVX
Needed for now, but unstable-simd is likely a better fix for all our
SIMD building.
2024-12-24 12:02:19 -05:00
Arun Raghavan
c6abf6cd3f Bump to WebRTC M120 release
Some API deprecation -- ExperimentalAgc and ExperimentalNs are gone.
We're continuing to carry iSAC even though it's gone upstream, but maybe
we'll want to drop that soon.
2024-12-24 11:05:39 -05:00
L. E. Segovia
a949f1de2d build: Appease MSYS2 UCRT64 GCC 13
Undefining this macro makes GCC in standards C++ mode very unhappy:

In file included from D:/msys64/ucrt64/include/c++/13.2.0/bits/requires_hosted.h:31,
                 from D:/msys64/ucrt64/include/c++/13.2.0/string:38,
                 from ..\subprojects\webrtc-audio-processing\webrtc/rtc_base/system/file_wrapper.h:17,
                 from ../subprojects/webrtc-audio-processing/webrtc/rtc_base/system/file_wrapper.cc:11:
D:/msys64/ucrt64/include/c++/13.2.0/x86_64-w64-mingw32/bits/c++config.h:666:2: warning: #warning "__STRICT_ANSI__ seems to have been undefined; this is not supported" [-Wcpp]
  666 | #warning "__STRICT_ANSI__ seems to have been undefined; this is not supported"
      |  ^~~~~~~

See: https://github.com/fmtlib/fmt/issues/2059#issue-761209068

See: #32
2024-03-23 16:34:50 -03:00
Arun Raghavan
8e258a1933 build: Bump version to 1.3 2023-09-05 11:19:47 -04:00
Nirbheek Chauhan
0691ae20d8 meson: Fix generation of pkgconfig files
Too much information was specified manually. All this is deduced
automatically if you specify the library as the first positional
argument.

Only absl_base needs to be in Requires: because absl_optional's header
file is needed at build time.

Also add a check in the CI for the pc files being usable.
2023-09-05 01:50:51 +05:30
Arun Raghavan
c9b0a675e4 build: Bump version to 1.2 2023-09-01 11:05:31 -04:00
Arun Raghavan
315b2222a8 meson: Update minimum version based on what abseil wrap needs 2023-08-13 17:42:29 -04:00
Arun Raghavan
bc401b3cbf build: Expose absl as a dependency of webrtc-audio-processing
This is needed because the audio processing header references
abseil's optional.h. Clean up the declared dependencies while we're at
it.

Fixes: https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/merge_requests/34
2023-08-13 17:42:29 -04:00
Nirbheek Chauhan
92a4765a7e meson: Update to latest wrap, install required absl headers 2023-06-01 17:46:28 +05:30
Nirbheek Chauhan
096b0eaed2 meson: Fixes for MSVC build
winsock2.h must be included before windows.h or alternative
definitions of `struct sockaddr` are defined.

```
FAILED: webrtc/rtc_base/liblibbase.a.p/logging.cc.obj
"cl" "-Iwebrtc\rtc_base\liblibbase.a.p" "-Iwebrtc\rtc_base" "-I..\webrtc\rtc_base" "-Iwebrtc" "-I..\webrtc" "-Isubprojects\abseil-cpp-20230125.1" "-I..\subprojects\abseil-cpp-20230125.1" "/MD" "/nologo" "/showIncludes" "/utf-8" "/Zc:__cplusplus" "/W2" "/EHsc" "/std:c++17" "/permissive-" "/O2" "/Zi" "-DWEBRTC_LIBRARY_
IMPL" "-DWEBRTC_ENABLE_SYMBOL_EXPORT" "-DNDEBUG" "-DWEBRTC_WIN" "-D_WIN32" "-U__STRICT_ANSI__" "-D__STDC_FORMAT_MACROS=1" "-DNOMINMAX" "-DWEBRTC_ENABLE_AVX2" "/Fdwebrtc\rtc_base\liblibbase.a.p\logging.cc.pdb" /Fowebrtc/rtc_base/liblibbase.a.p/logging.cc.obj "/c" ../webrtc/rtc_base/logging.cc
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(103): warning C4005: 'AF_IPX': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winsock.h(457): note: see previous definition of 'AF_IPX'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(147): warning C4005: 'AF_MAX': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winsock.h(476): note: see previous definition of 'AF_MAX'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(187): warning C4005: 'SO_DONTLINGER': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winsock.h(399): note: see previous definition of 'SO_DONTLINGER'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(240): error C2011: 'sockaddr': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winsock.h(482): note: see declaration of 'sockaddr'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(442): error C2143: syntax error: missing '}' before 'constant'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(442): error C2059: syntax error: 'constant'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(496): error C2143: syntax error: missing ';' before '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(496): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(496): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...
```
2023-05-26 03:17:31 +05:30
Nirbheek Chauhan
b24229cbbc meson: Ensure that abseil is built with c++17 too
subprojects do not inherit $lang_std default values from the project.
2023-05-26 03:17:31 +05:30
Nirbheek Chauhan
4125ace620 meson: Fix compatibility with Fedora's abseil-cpp package
1. Fedora abseil-cpp package is built with C++17:
   https://src.fedoraproject.org/rpms/abseil-cpp/blob/rawhide/f/abseil-cpp.spec
2. There is no `absl_types` pkgconfig file, and it's only needed on iOS
2023-05-26 03:16:38 +05:30
Nirbheek Chauhan
9a362bd149 meson: Don't require cross files to set host_system = ios
It's not specified as a host_system by meson, so people will often not
set it.
2023-05-26 00:45:29 +05:30
Nirbheek Chauhan
8366ff0ce0 meson: Get rid of cmake and manual library searching
Simplify fallback, and prefer it. `[provide]` section requires meson
0.55, so require that.

pkg-config lookup is only provided for distros, since they dislike
static linking / vendoring.
2023-05-26 00:45:00 +05:30
Jan Palus
ca1186946d
build: don't detect neon again when building on aarch64
it will try to add -mfpu=neon to cflags not available on aarch64 since
neon is mandatory there
2022-05-21 14:10:48 +02:00
Jan Palus
26f4493405
build: fix -Dneon=runtime 2022-05-21 14:08:15 +02:00
Arun Raghavan
5a5aa66ada Add an abseil subproject and correctly specify fallback deps 2021-10-20 11:16:18 -04:00
Arun Raghavan
0cc2ebeda2 Add missing absl library for bad_optional_access 2021-10-20 11:15:57 -04:00
Arun Raghavan
8bf9efad15 Use pkg-config for abseil-cpp detection if available
This should make things a bit easier.
2021-10-19 18:06:37 -04:00
Arun Raghavan
ff85c98683 Some fixes for MinGW
* Rename Windows.h uses to windows.h
  * Comment out structured exception handling usage

Makes MinGW happier. Mostly the same as previous work by
Nicolas Dufresne <nicolas.dufresne@collabora.com>, with the exception
that we now don't try to invoke RaiseException which would fail in MinGW
as it raises a Windows structured exception.
2021-10-19 16:09:07 -04:00
Arun Raghavan
e74894baeb build: Add library-based absl detection as a fallback
This should help for cases where users can make abseil-cpp available but
wiring up the CMake-build isn't that easy (for example, while
cross-compiling).
2021-06-05 18:37:23 -04:00
Arun Raghavan
b34c1d5746 build: Fix ARM ISA detection
armv7 isn't a real cpu_family in meson, so drop that. The detection for
__ARM_ARCH_ISA_ARM was also inverted.

Fixes: https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/issues/6
2020-12-11 08:16:04 -05:00
Arun Raghavan
3f9907f93d build: Use cmake to look up abseil dependency
This should be much more robust than looking up the library directly.

Fixes: https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/issues/4
2020-12-10 19:20:09 -05:00
Arun Raghavan
ce1a78887a build: Revert top-level project name to not have a prefix
Should make meson dist easier to work with.
2020-12-10 18:24:05 -05:00
Arun Raghavan
8ce8bebb7d build: Bump project version to 1.1 2020-12-10 18:24:05 -05:00
Guillaume Desmottes
d938d2cf52 meson: override dependency
Will allow us to build the libs as part of gst-build as subprojects.
2020-10-28 16:03:08 +01:00
Arun Raghavan
21d78a4267 build: Make packages versioned
Since we cannot rely on the API to be stable upstream, let's start
making the pkg-config, library, and include dir have a version suffix.
This will allow different downstream projects depending on us to
independently switch versions without packagers having to jump through
hoops.
2020-10-23 13:30:23 -04:00
Arun Raghavan
bcec8b0b21 Update to current webrtc library
This is from the upstream library commit id
3326535126e435f1ba647885ce43a8f0f3d317eb, corresponding to Chromium
88.0.4290.1.
2020-10-23 13:30:23 -04:00
Guillaume Desmottes
34efc689c2 add webrtc-audio-coding public library
This new lib contains the bare minimum to implement an iSAC encoder and
decoder.

The webrtc files have been copied from the revision as the existing
imported files (c8b569e0a7ad0b369e15f0197b3a558699ec8efa).
2020-03-27 14:52:22 +01:00
Guillaume Desmottes
f2003f80d1 meson: fix pkgconfig generation
The bug preventing us to pass the library object to
pkgconfig.generate() has been fixed in meson 0.52.

By doing so the generated pc file has the right -L linker flag, making
it easier to test the lib from non standard location.
We also no longer have to pass libraries_private, it will handle it
automatically.
2020-03-24 15:00:53 +01:00
Matthew Waters
27e93ee86b build/meson: fix compilation on arm64
The assembly files used don't use the right comments for arm64
2018-11-08 20:56:52 +11:00
Arun Raghavan
682857751b build: Factor out common POSIX flag setting in meson build 2018-10-28 14:57:00 +00:00
Arun Raghavan
b47c302cef build: Fix project() invocation in meson build 2018-10-28 14:56:54 +00:00
Matthew Waters
eb398328ab Initial meson build files 2018-10-28 23:25:18 +11:00