commit 538cafc9ee357d3cb67e424b4ca18e993f41da92 parent 42944d82c53c1556105ac1a47b993d8b332b3ca6 Author: Michael Froman <mfroman@mozilla.com> Date: Thu, 9 Oct 2025 23:09:16 -0500 Bug 1993083 - Vendor libwebrtc from 61f0f4c83c Upstream commit: https://webrtc.googlesource.com/src/+/61f0f4c83c229c20c900061b8025e976cb5d8590 Remove support for ancient MSVC (<2008) and ancient glib (<2012) Bug: None Change-Id: I13907e0aafb3a68a0d6bd33c861a3ee6d167a952 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/400240 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Philipp Hancke <phancke@meta.com> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#45201} Diffstat:
21 files changed, 73 insertions(+), 200 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-10T03:07:45.373550+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-10T04:09:03.110045+00:00. # base of lastest vendoring -33b8c034b1 +61f0f4c83c diff --git a/third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc b/third_party/libwebrtc/common_audio/third_party/ooura/fft_size_128/ooura_fft_sse2.cc @@ -20,20 +20,6 @@ namespace webrtc { #if defined(WEBRTC_ARCH_X86_FAMILY) -namespace { -// These intrinsics were unavailable before VS 2008. -// TODO(andrew): move to a common file. -#if defined(_MSC_VER) && _MSC_VER < 1500 -static __inline __m128 _mm_castsi128_ps(__m128i a) { - return *(__m128*)&a; -} -static __inline __m128i _mm_castps_si128(__m128 a) { - return *(__m128i*)&a; -} -#endif - -} // namespace - void cft1st_128_SSE2(float* a) { const __m128 mm_swap_sign = _mm_load_ps(k_swap_sign); int j, k2; diff --git a/third_party/libwebrtc/examples/peerconnection/client/linux/main.cc b/third_party/libwebrtc/examples/peerconnection/client/linux/main.cc @@ -8,7 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include <glib.h> #include <gtk/gtk.h> #include <cstdio> @@ -72,16 +71,6 @@ class CustomSocketServer : public webrtc::PhysicalSocketServer { int main(int argc, char* argv[]) { gtk_init(&argc, &argv); -// g_type_init API is deprecated (and does nothing) since glib 2.35.0, see: -// https://mail.gnome.org/archives/commits-list/2012-November/msg07809.html -#if !GLIB_CHECK_VERSION(2, 35, 0) - g_type_init(); -#endif -// g_thread_init API is deprecated since glib 2.31.0, see release note: -// http://mail.gnome.org/archives/gnome-announce-list/2011-October/msg00041.html -#if !GLIB_CHECK_VERSION(2, 31, 0) - g_thread_init(NULL); -#endif absl::ParseCommandLine(argc, argv); diff --git a/third_party/libwebrtc/modules/audio_device/BUILD.gn b/third_party/libwebrtc/modules/audio_device/BUILD.gn @@ -52,10 +52,6 @@ rtc_source_set("audio_device_api") { deps = [ "../../api/audio:audio_device" ] } -rtc_library("audio_device_config") { - sources = [ "audio_device_config.h" ] -} - rtc_library("audio_device_buffer") { if (!build_with_mozilla) { # See Bug 1820869. sources = [ @@ -262,7 +258,6 @@ if (!build_with_mozilla) { # See Bug 1820869. visibility = [ "*" ] deps = [ ":audio_device_buffer", - ":audio_device_config", ":audio_device_default", ":audio_device_dummy", ":audio_device_generic", diff --git a/third_party/libwebrtc/modules/audio_device/audio_device_config.h b/third_party/libwebrtc/modules/audio_device/audio_device_config.h @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2011 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. - */ - -#ifndef AUDIO_DEVICE_AUDIO_DEVICE_CONFIG_H_ -#define AUDIO_DEVICE_AUDIO_DEVICE_CONFIG_H_ - -// Enumerators -// -enum { GET_MIC_VOLUME_INTERVAL_MS = 1000 }; - -// Platform specifics -// -#if defined(_WIN32) -#if (_MSC_VER >= 1400) -#if !defined(WEBRTC_DUMMY_FILE_DEVICES) -// Windows Core Audio is the default audio layer in Windows. -// Only supported for VS 2005 and higher. -#define WEBRTC_WINDOWS_CORE_AUDIO_BUILD -#endif -#endif -#endif - -#endif // AUDIO_DEVICE_AUDIO_DEVICE_CONFIG_H_ diff --git a/third_party/libwebrtc/modules/audio_device/audio_device_impl.cc b/third_party/libwebrtc/modules/audio_device/audio_device_impl.cc @@ -21,16 +21,13 @@ #include "api/make_ref_counted.h" #include "api/scoped_refptr.h" #include "api/task_queue/task_queue_factory.h" -#include "modules/audio_device/audio_device_config.h" // IWYU pragma: keep #include "modules/audio_device/audio_device_generic.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" #include "system_wrappers/include/metrics.h" -#if defined(_WIN32) -#if defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD) +#if defined(WEBRTC_WIN) #include "modules/audio_device/win/audio_device_core_win.h" -#endif #elif defined(WEBRTC_LINUX) #if defined(WEBRTC_ENABLE_LINUX_ALSA) #include "modules/audio_device/linux/audio_device_alsa_linux.h" @@ -184,8 +181,8 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects( // Real (non-dummy) ADM implementations. #else AudioLayer audio_layer(PlatformAudioLayer()); -// Windows ADM implementation. -#if defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD) +#if defined(WEBRTC_WIN) + // Windows ADM implementation. if ((audio_layer == kWindowsCoreAudio) || (audio_layer == kPlatformDefaultAudio)) { RTC_LOG(LS_INFO) << "Attempting to use the Windows Core Audio APIs..."; @@ -194,7 +191,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects( RTC_LOG(LS_INFO) << "Windows Core Audio APIs will be utilized"; } } -#endif // defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD) +#endif // Linux ADM implementation. // Note that, WEBRTC_ENABLE_LINUX_ALSA is always defined by default when diff --git a/third_party/libwebrtc/modules/audio_device/mac/audio_device_mac.cc b/third_party/libwebrtc/modules/audio_device/mac/audio_device_mac.cc @@ -17,7 +17,6 @@ #include <memory> #include <vector> -#include "modules/audio_device/audio_device_config.h" #include "modules/third_party/portaudio/pa_ringbuffer.h" #include "rtc_base/checks.h" #include "rtc_base/platform_thread.h" diff --git a/third_party/libwebrtc/modules/audio_device/win/audio_device_core_win.cc b/third_party/libwebrtc/modules/audio_device/win/audio_device_core_win.cc @@ -10,19 +10,6 @@ #pragma warning(disable : 4995) // name was marked as #pragma deprecated -#if (_MSC_VER >= 1310) && (_MSC_VER < 1400) -// Reports the major and minor versions of the compiler. -// For example, 1310 for Microsoft Visual C++ .NET 2003. 1310 represents version -// 13 and a 1.0 point release. The Visual C++ 2005 compiler version is 1400. -// Type cl /? at the command line to see the major and minor versions of your -// compiler along with the build number. -#pragma message(">> INFO: Windows Core Audio is not supported in VS 2003") -#endif - -#include "modules/audio_device/audio_device_config.h" // IWYU pragma: keep - -#ifdef WEBRTC_WINDOWS_CORE_AUDIO_BUILD - // clang-format off // To get Windows includes in the right order, this must come before the Windows // includes below. @@ -4166,6 +4153,5 @@ bool AudioDeviceWindowsCore::KeyPressed() const { } return (key_down > 0); } -} // namespace webrtc -#endif // WEBRTC_WINDOWS_CORE_AUDIO_BUILD +} // namespace webrtc diff --git a/third_party/libwebrtc/modules/audio_device/win/audio_device_core_win.h b/third_party/libwebrtc/modules/audio_device/win/audio_device_core_win.h @@ -11,8 +11,6 @@ #ifndef MODULES_AUDIO_DEVICE_WIN_AUDIO_DEVICE_CORE_WIN_H_ #define MODULES_AUDIO_DEVICE_WIN_AUDIO_DEVICE_CORE_WIN_H_ -#if (_MSC_VER >= 1400) // only include for VS 2005 and higher - #include <wmcodecdsp.h> // CLSID_CWMAudioAEC //(must be before audioclient.h) @@ -292,8 +290,6 @@ class AudioDeviceWindowsCore : public AudioDeviceGeneric { uint16_t _outputDeviceIndex; }; -#endif // #if (_MSC_VER >= 1400) - } // namespace webrtc #endif // MODULES_AUDIO_DEVICE_WIN_AUDIO_DEVICE_CORE_WIN_H_ diff --git a/third_party/libwebrtc/moz-patch-stack/s0001.patch b/third_party/libwebrtc/moz-patch-stack/s0001.patch @@ -1400,10 +1400,10 @@ index fc3180f82b..8dd7e93651 100644 # Dependency on chromium's logging (in //base). deps += [ "//base" ] diff --git a/rtc_base/logging.cc b/rtc_base/logging.cc -index eee7f21bc3..4380fbb4d2 100644 +index f157205e7d..fe82a4bb4c 100644 --- a/rtc_base/logging.cc +++ b/rtc_base/logging.cc -@@ -46,6 +46,7 @@ static const int kMaxLogLineSize = 1024 - 60; +@@ -24,6 +24,7 @@ #include "absl/base/attributes.h" #include "absl/strings/string_view.h" #include "api/units/timestamp.h" @@ -1411,8 +1411,8 @@ index eee7f21bc3..4380fbb4d2 100644 #include "rtc_base/checks.h" #include "rtc_base/platform_thread_types.h" #include "rtc_base/string_encode.h" -@@ -56,6 +57,24 @@ static const int kMaxLogLineSize = 1024 - 60; - #include "rtc_base/time_utils.h" +@@ -52,6 +53,24 @@ static const int kMaxLogLineSize = 1024 - 60; + #endif // WEBRTC_MAC && !defined(WEBRTC_IOS) || WEBRTC_ANDROID namespace webrtc { + @@ -1436,7 +1436,7 @@ index eee7f21bc3..4380fbb4d2 100644 namespace { // By default, release builds don't log, debug builds at info level -@@ -116,7 +135,7 @@ std::string LogLineRef::DefaultLogLine() const { +@@ -112,7 +131,7 @@ std::string LogLineRef::DefaultLogLine() const { // LogMessage ///////////////////////////////////////////////////////////////////////////// diff --git a/third_party/libwebrtc/moz-patch-stack/s0009.patch b/third_party/libwebrtc/moz-patch-stack/s0009.patch @@ -55,10 +55,10 @@ index ba58571aca..dddaf9600b 100644 #include <endian.h> #else diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc -index 22f76416b6..79505f20b4 100644 +index 32e2eb35b2..0ce48a02f1 100644 --- a/rtc_base/cpu_info.cc +++ b/rtc_base/cpu_info.cc -@@ -66,7 +66,7 @@ uint32_t DetectNumberOfCores() { +@@ -52,7 +52,7 @@ uint32_t DetectNumberOfCores() { SYSTEM_INFO si; GetNativeSystemInfo(&si); number_of_cores = static_cast<int>(si.dwNumberOfProcessors); diff --git a/third_party/libwebrtc/moz-patch-stack/s0027.patch b/third_party/libwebrtc/moz-patch-stack/s0027.patch @@ -737,7 +737,7 @@ index bce09e0f81..12a9566a8f 100644 } diff --git a/modules/audio_device/BUILD.gn b/modules/audio_device/BUILD.gn -index 8a8235fb16..8bb0e958ee 100644 +index 66f69fca39..baecf90aa8 100644 --- a/modules/audio_device/BUILD.gn +++ b/modules/audio_device/BUILD.gn @@ -30,6 +30,7 @@ rtc_source_set("audio_device_default") { @@ -756,7 +756,7 @@ index 8a8235fb16..8bb0e958ee 100644 rtc_source_set("audio_device_api") { visibility = [ "*" ] -@@ -55,6 +57,7 @@ rtc_library("audio_device_config") { +@@ -51,6 +53,7 @@ rtc_source_set("audio_device_api") { } rtc_library("audio_device_buffer") { @@ -764,7 +764,7 @@ index 8a8235fb16..8bb0e958ee 100644 sources = [ "audio_device_buffer.cc", "audio_device_buffer.h", -@@ -81,6 +84,7 @@ rtc_library("audio_device_buffer") { +@@ -77,6 +80,7 @@ rtc_library("audio_device_buffer") { "../../system_wrappers:metrics", ] } @@ -772,7 +772,7 @@ index 8a8235fb16..8bb0e958ee 100644 rtc_library("audio_device_generic") { sources = [ -@@ -254,6 +258,7 @@ if (!build_with_chromium) { +@@ -250,6 +254,7 @@ if (!build_with_chromium) { # Contains default implementations of webrtc::AudioDeviceModule for Windows, # Linux, Mac, iOS and Android. rtc_library("audio_device_impl") { @@ -780,7 +780,7 @@ index 8a8235fb16..8bb0e958ee 100644 visibility = [ "*" ] deps = [ ":audio_device_buffer", -@@ -301,9 +306,9 @@ rtc_library("audio_device_impl") { +@@ -296,9 +301,9 @@ rtc_library("audio_device_impl") { sources = [ "include/fake_audio_device.h" ] if (build_with_mozilla) { @@ -793,7 +793,7 @@ index 8a8235fb16..8bb0e958ee 100644 ] } -@@ -406,6 +411,7 @@ rtc_library("audio_device_impl") { +@@ -401,6 +406,7 @@ rtc_library("audio_device_impl") { sources += [ "dummy/file_audio_device_factory.h" ] } } @@ -801,7 +801,7 @@ index 8a8235fb16..8bb0e958ee 100644 if (is_mac) { rtc_source_set("audio_device_impl_frameworks") { -@@ -423,6 +429,7 @@ if (is_mac) { +@@ -418,6 +424,7 @@ if (is_mac) { } } @@ -809,7 +809,7 @@ index 8a8235fb16..8bb0e958ee 100644 rtc_source_set("mock_audio_device") { visibility = [ "*" ] testonly = true -@@ -441,8 +448,10 @@ rtc_source_set("mock_audio_device") { +@@ -436,8 +443,10 @@ rtc_source_set("mock_audio_device") { "../../test:test_support", ] } diff --git a/third_party/libwebrtc/moz-patch-stack/s0055.patch b/third_party/libwebrtc/moz-patch-stack/s0055.patch @@ -26,10 +26,10 @@ index 614d251e40..bf346ec180 100644 deps += [ "logging:rtc_event_log_proto" ] } diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn -index 878aeb2dd9..2c278341c7 100644 +index 06d085e73a..2b3623e53f 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn -@@ -571,6 +571,7 @@ if (is_ios || is_mac) { +@@ -570,6 +570,7 @@ if (is_ios || is_mac) { } } @@ -37,7 +37,7 @@ index 878aeb2dd9..2c278341c7 100644 rtc_library("videosource_objc") { sources = [ "objc/api/peerconnection/RTCVideoSource+Private.h", -@@ -600,6 +601,7 @@ if (is_ios || is_mac) { +@@ -599,6 +600,7 @@ if (is_ios || is_mac) { ":used_from_extension", ] } @@ -45,7 +45,7 @@ index 878aeb2dd9..2c278341c7 100644 rtc_library("videoframebuffer_objc") { visibility = [ "*" ] -@@ -632,6 +634,7 @@ if (is_ios || is_mac) { +@@ -631,6 +633,7 @@ if (is_ios || is_mac) { ] } @@ -53,7 +53,7 @@ index 878aeb2dd9..2c278341c7 100644 rtc_library("metal_objc") { visibility = [ "*" ] allow_poison = [ -@@ -693,6 +696,7 @@ if (is_ios || is_mac) { +@@ -692,6 +695,7 @@ if (is_ios || is_mac) { ":videoframebuffer_objc", ] } @@ -61,7 +61,7 @@ index 878aeb2dd9..2c278341c7 100644 rtc_library("videocapture_objc") { visibility = [ "*" ] -@@ -721,6 +725,7 @@ if (is_ios || is_mac) { +@@ -720,6 +724,7 @@ if (is_ios || is_mac) { ] } @@ -69,7 +69,7 @@ index 878aeb2dd9..2c278341c7 100644 rtc_library("videocodec_objc") { visibility = [ "*" ] configs += [ "..:no_global_constructors" ] -@@ -1820,5 +1825,6 @@ if (is_ios || is_mac) { +@@ -1819,5 +1824,6 @@ if (is_ios || is_mac) { "VideoToolbox.framework", ] } diff --git a/third_party/libwebrtc/moz-patch-stack/s0099.patch b/third_party/libwebrtc/moz-patch-stack/s0099.patch @@ -61,10 +61,10 @@ index 0aec2d94c7..83c1b21260 100644 } } diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn -index 2c278341c7..27410af8a8 100644 +index 2b3623e53f..b3941ea94d 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn -@@ -632,6 +632,20 @@ if (is_ios || is_mac) { +@@ -631,6 +631,20 @@ if (is_ios || is_mac) { "CoreGraphics.framework", "CoreVideo.framework", ] diff --git a/third_party/libwebrtc/moz-patch-stack/s0103.patch b/third_party/libwebrtc/moz-patch-stack/s0103.patch @@ -440,7 +440,7 @@ index 82b4bbfbae..b58cb6ba9a 100644 import("../webrtc.gni") diff --git a/modules/audio_device/BUILD.gn b/modules/audio_device/BUILD.gn -index 8bb0e958ee..9da415eeda 100644 +index baecf90aa8..88b4dcd0ad 100644 --- a/modules/audio_device/BUILD.gn +++ b/modules/audio_device/BUILD.gn @@ -9,8 +9,8 @@ @@ -702,7 +702,7 @@ index 4fa98d73a2..72c01d50ab 100644 output_extension = "so" } diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn -index 27410af8a8..d0b13e2305 100644 +index b3941ea94d..eedf7ae7a5 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -9,12 +9,12 @@ @@ -731,7 +731,7 @@ index 27410af8a8..d0b13e2305 100644 } } -@@ -1281,7 +1281,7 @@ if (is_ios || is_mac) { +@@ -1280,7 +1280,7 @@ if (is_ios || is_mac) { } public_deps = [ diff --git a/third_party/libwebrtc/moz-patch-stack/s0122.patch b/third_party/libwebrtc/moz-patch-stack/s0122.patch @@ -5,35 +5,31 @@ Subject: Bug 1988042 - add BSD support to new version of libwebrtc's Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/e3b37acb8816aefb9134a68cafad8c7d5e145179 --- - rtc_base/cpu_info.cc | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) + rtc_base/cpu_info.cc | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc -index 79505f20b4..71100178f1 100644 +index 0ce48a02f1..f0bff56911 100644 --- a/rtc_base/cpu_info.cc +++ b/rtc_base/cpu_info.cc -@@ -21,8 +21,10 @@ +@@ -29,14 +29,14 @@ #include <unistd.h> #elif defined(WEBRTC_FUCHSIA) #include <zircon/syscalls.h> -#elif defined(WEBRTC_LINUX) +#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) -+#if defined(WEBRTC_LINUX) - #include <features.h> -+#endif #include <unistd.h> + #endif // WEBRTC_LINUX - #include <cstdlib> -@@ -51,7 +53,7 @@ #if defined(WEBRTC_ARCH_X86_FAMILY) && defined(_MSC_VER) #include <intrin.h> #endif -#if defined(WEBRTC_ARCH_ARM_FAMILY) && defined(WEBRTC_LINUX) +#if defined(WEBRTC_ARCH_ARM_FAMILY) && (defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)) #include <asm/hwcap.h> + #include <sys/auxv.h> #endif - -@@ -190,6 +192,9 @@ bool Supports(ISA instruction_set_architecture) { +@@ -176,6 +176,9 @@ bool Supports(ISA instruction_set_architecture) { if (instruction_set_architecture == ISA::kNeon) { #if defined(WEBRTC_ANDROID) return 0 != (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON); @@ -42,4 +38,4 @@ index 79505f20b4..71100178f1 100644 + return false; #elif defined(WEBRTC_LINUX) uint64_t hwcap = 0; - #if WEBRTC_GLIBC_PREREQ(2, 16) + hwcap = getauxval(AT_HWCAP); diff --git a/third_party/libwebrtc/moz-patch-stack/s0125.patch b/third_party/libwebrtc/moz-patch-stack/s0125.patch @@ -14,10 +14,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/eae7b6ec4f7ca191e 1 file changed, 9 insertions(+) diff --git a/rtc_base/cpu_info.cc b/rtc_base/cpu_info.cc -index 71100178f1..ae774b4543 100644 +index f0bff56911..b51c9e950e 100644 --- a/rtc_base/cpu_info.cc +++ b/rtc_base/cpu_info.cc -@@ -17,7 +17,9 @@ +@@ -25,7 +25,9 @@ #elif defined(WEBRTC_MAC) #include <sys/sysctl.h> #elif defined(WEBRTC_ANDROID) @@ -27,7 +27,7 @@ index 71100178f1..ae774b4543 100644 #include <unistd.h> #elif defined(WEBRTC_FUCHSIA) #include <zircon/syscalls.h> -@@ -191,7 +193,14 @@ bool Supports(ISA instruction_set_architecture) { +@@ -175,7 +177,14 @@ bool Supports(ISA instruction_set_architecture) { #elif defined(WEBRTC_ARCH_ARM_FAMILY) if (instruction_set_architecture == ISA::kNeon) { #if defined(WEBRTC_ANDROID) diff --git a/third_party/libwebrtc/rtc_base/cpu_info.cc b/third_party/libwebrtc/rtc_base/cpu_info.cc @@ -10,7 +10,15 @@ #include "rtc_base/cpu_info.h" +#include <cerrno> #include <cstdint> +#include <cstdlib> +#include <cstring> + +#include "rtc_base/checks.h" +#include "rtc_base/logging.h" +#include "rtc_base/system/arch.h" +#include "rtc_base/system/unused.h" // IWYU pragma: keep #if defined(WEBRTC_WIN) #include <windows.h> @@ -24,39 +32,15 @@ #elif defined(WEBRTC_FUCHSIA) #include <zircon/syscalls.h> #elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) -#if defined(WEBRTC_LINUX) -#include <features.h> -#endif #include <unistd.h> - -#include <cstdlib> -#include <cstring> // IWYU pragma: keep - -#ifdef __GLIBC_PREREQ -#define WEBRTC_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b) -#else -#define WEBRTC_GLIBC_PREREQ(a, b) 0 -#endif - -#if WEBRTC_GLIBC_PREREQ(2, 16) -#include <sys/auxv.h> // IWYU pragma: keep -#else -#include <errno.h> -#include <fcntl.h> -#include <link.h> -#endif #endif // WEBRTC_LINUX -#include "rtc_base/checks.h" -#include "rtc_base/logging.h" -#include "rtc_base/system/arch.h" -#include "rtc_base/system/unused.h" // IWYU pragma: keep - #if defined(WEBRTC_ARCH_X86_FAMILY) && defined(_MSC_VER) #include <intrin.h> #endif #if defined(WEBRTC_ARCH_ARM_FAMILY) && (defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)) #include <asm/hwcap.h> +#include <sys/auxv.h> #endif // Parts of this file derived from Chromium's base/cpu.cc. @@ -206,26 +190,7 @@ bool Supports(ISA instruction_set_architecture) { return false; #elif defined(WEBRTC_LINUX) uint64_t hwcap = 0; -#if WEBRTC_GLIBC_PREREQ(2, 16) hwcap = getauxval(AT_HWCAP); -#else - ElfW(auxv_t) auxv; - int fd = open("/proc/self/auxv", O_RDONLY); - if (fd >= 0) { - while (hwcap == 0) { - if (read(fd, &auxv, sizeof(auxv)) < (ssize_t)sizeof(auxv)) { - if (errno == EINTR) { - continue; - } - break; - } - if (AT_HWCAP == auxv.a_type) { - hwcap = auxv.a_un.a_val; - } - } - close(fd); - } -#endif // WEBRTC_GLIBC_PREREQ(2, 16) #if defined(__aarch64__) if ((hwcap & HWCAP_ASIMD) != 0) { return true; diff --git a/third_party/libwebrtc/rtc_base/logging.cc b/third_party/libwebrtc/rtc_base/logging.cc @@ -10,18 +10,34 @@ #include "rtc_base/logging.h" +#include <algorithm> #include <atomic> +#include <cinttypes> +#include <cstdarg> #include <cstdint> +#include <cstdio> #include <cstring> +#include <ctime> #include <string> +#include <vector> + +#include "absl/base/attributes.h" +#include "absl/strings/string_view.h" +#include "api/units/timestamp.h" +#include "modules/audio_processing/logging/apm_data_dumper.h" +#include "rtc_base/checks.h" +#include "rtc_base/platform_thread_types.h" +#include "rtc_base/string_encode.h" +#include "rtc_base/string_utils.h" +#include "rtc_base/strings/string_builder.h" +#include "rtc_base/synchronization/mutex.h" +#include "rtc_base/thread_annotations.h" +#include "rtc_base/time_utils.h" #if RTC_LOG_ENABLED() #if defined(WEBRTC_WIN) #include <windows.h> -#if _MSC_VER < 1900 -#define snprintf _snprintf -#endif #undef ERROR // wingdi.h #endif @@ -36,26 +52,6 @@ static const int kMaxLogLineSize = 1024 - 60; #endif // WEBRTC_MAC && !defined(WEBRTC_IOS) || WEBRTC_ANDROID -#include <algorithm> -#include <cinttypes> -#include <cstdarg> -#include <cstdio> -#include <ctime> -#include <vector> - -#include "absl/base/attributes.h" -#include "absl/strings/string_view.h" -#include "api/units/timestamp.h" -#include "modules/audio_processing/logging/apm_data_dumper.h" -#include "rtc_base/checks.h" -#include "rtc_base/platform_thread_types.h" -#include "rtc_base/string_encode.h" -#include "rtc_base/string_utils.h" -#include "rtc_base/strings/string_builder.h" -#include "rtc_base/synchronization/mutex.h" -#include "rtc_base/thread_annotations.h" -#include "rtc_base/time_utils.h" - namespace webrtc { bool LogMessage::aec_debug_ = false; diff --git a/third_party/libwebrtc/sdk/BUILD.gn b/third_party/libwebrtc/sdk/BUILD.gn @@ -335,7 +335,6 @@ if (is_ios || is_mac) { "../api/task_queue", "../api/task_queue:pending_task_safety_flag", "../modules/audio_device:audio_device_buffer", - "../modules/audio_device:audio_device_config", "../modules/audio_device:audio_device_generic", "../rtc_base:buffer", "../rtc_base:checks", diff --git a/third_party/libwebrtc/sdk/objc/native/src/audio/audio_device_module_ios.mm b/third_party/libwebrtc/sdk/objc/native/src/audio/audio_device_module_ios.mm @@ -13,7 +13,6 @@ #include <memory> #include "api/environment/environment.h" -#include "modules/audio_device/audio_device_config.h" #include "modules/audio_device/audio_device_generic.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h"