From d30d26b5c4015160943f548bc77a037a3fcaba2e Mon Sep 17 00:00:00 2001 From: Michael Froman Date: Fri, 7 Mar 2025 16:35:44 -0600 Subject: [PATCH] Bug 1952339 - Vendor libwebrtc from d3cb43adf8 Upstream commit: https://webrtc.googlesource.com/src/+/d3cb43adf8a474152748f7ab910562c38cfe6188 Move timestamp_aligner.h to webrtc namespace Bug: webrtc:42232595 Change-Id: Iefe0f228f16ef44dd8e45e0074b60f7ccf14f1e1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/378825 Reviewed-by: Harald Alvestrand Commit-Queue: Evan Shrubsole Cr-Commit-Position: refs/heads/main@{#43984} Differential Revision: https://phabricator.services.mozilla.com/D243990 --- third_party/libwebrtc/README.mozilla.last-vendor | 4 ++-- .../libwebrtc/modules/audio_device/audio_device_buffer.cc | 3 +-- .../libwebrtc/modules/audio_device/audio_device_buffer.h | 2 +- third_party/libwebrtc/rtc_base/timestamp_aligner.cc | 4 ++-- third_party/libwebrtc/rtc_base/timestamp_aligner.h | 8 +++++++- .../libwebrtc/rtc_base/timestamp_aligner_unittest.cc | 6 +++--- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor index ca96c499f14a..64f3c8f999d2 100644 --- 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-03-07T22:34:45.489930+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-03-07T22:35:34.289187+00:00. # base of lastest vendoring -4025b60bc1 +d3cb43adf8 diff --git a/third_party/libwebrtc/modules/audio_device/audio_device_buffer.cc b/third_party/libwebrtc/modules/audio_device/audio_device_buffer.cc index 95096da8e620..c82f807a6e89 100644 --- a/third_party/libwebrtc/modules/audio_device/audio_device_buffer.cc +++ b/third_party/libwebrtc/modules/audio_device/audio_device_buffer.cc @@ -264,8 +264,7 @@ int32_t AudioDeviceBuffer::SetRecordedBuffer( if (capture_timestamp_ns) { int64_t align_offsync_estimation_time = rtc::TimeMicros(); - if (align_offsync_estimation_time - - rtc::TimestampAligner::kMinFrameIntervalUs > + if (align_offsync_estimation_time - TimestampAligner::kMinFrameIntervalUs > align_offsync_estimation_time_) { align_offsync_estimation_time_ = align_offsync_estimation_time; capture_timestamp_ns_ = diff --git a/third_party/libwebrtc/modules/audio_device/audio_device_buffer.h b/third_party/libwebrtc/modules/audio_device/audio_device_buffer.h index 99a4cb7d1a36..7dcc8756c07f 100644 --- a/third_party/libwebrtc/modules/audio_device/audio_device_buffer.h +++ b/third_party/libwebrtc/modules/audio_device/audio_device_buffer.h @@ -240,7 +240,7 @@ class AudioDeviceBuffer { // Used for converting capture timestaps (received from AudioRecordThread // via AudioRecordJni::DataIsRecorded) to RTC clock. - rtc::TimestampAligner timestamp_aligner_; + TimestampAligner timestamp_aligner_; // Should *never* be defined in production builds. Only used for testing. // When defined, the output signal will be replaced by a sinus tone at 440Hz. diff --git a/third_party/libwebrtc/rtc_base/timestamp_aligner.cc b/third_party/libwebrtc/rtc_base/timestamp_aligner.cc index 6c7ac1f839cf..d3ce44a32307 100644 --- a/third_party/libwebrtc/rtc_base/timestamp_aligner.cc +++ b/third_party/libwebrtc/rtc_base/timestamp_aligner.cc @@ -17,7 +17,7 @@ #include "rtc_base/logging.h" #include "rtc_base/time_utils.h" -namespace rtc { +namespace webrtc { TimestampAligner::TimestampAligner() : frames_seen_(0), @@ -140,4 +140,4 @@ int64_t TimestampAligner::ClipTimestamp(int64_t filtered_time_us, return time_us; } -} // namespace rtc +} // namespace webrtc diff --git a/third_party/libwebrtc/rtc_base/timestamp_aligner.h b/third_party/libwebrtc/rtc_base/timestamp_aligner.h index 636afcd65919..49268196d4ed 100644 --- a/third_party/libwebrtc/rtc_base/timestamp_aligner.h +++ b/third_party/libwebrtc/rtc_base/timestamp_aligner.h @@ -16,7 +16,7 @@ #include "rtc_base/system/rtc_export.h" #include "rtc_base/time_utils.h" -namespace rtc { +namespace webrtc { // The TimestampAligner class helps translating timestamps of a capture system // into the same timescale as is used by rtc::TimeMicros(). Some capture systems @@ -88,6 +88,12 @@ class RTC_EXPORT TimestampAligner { int64_t prev_time_offset_us_; }; +} // namespace webrtc + +// Re-export symbols from the webrtc namespace for backwards compatibility. +// TODO(bugs.webrtc.org/4222596): Remove once all references are updated. +namespace rtc { +using ::webrtc::TimestampAligner; } // namespace rtc #endif // RTC_BASE_TIMESTAMP_ALIGNER_H_ diff --git a/third_party/libwebrtc/rtc_base/timestamp_aligner_unittest.cc b/third_party/libwebrtc/rtc_base/timestamp_aligner_unittest.cc index ca91b62625f1..3eded73cf39a 100644 --- a/third_party/libwebrtc/rtc_base/timestamp_aligner_unittest.cc +++ b/third_party/libwebrtc/rtc_base/timestamp_aligner_unittest.cc @@ -19,7 +19,7 @@ #include "rtc_base/time_utils.h" #include "test/gtest.h" -namespace rtc { +namespace webrtc { namespace { // Computes the difference x_k - mean(x), when x_k is the linear sequence x_k = @@ -60,7 +60,7 @@ void TestTimestampFilter(double rel_freq_error) { int64_t interval_error_us = kIntervalUs * rel_freq_error; int64_t system_start_us = rtc::TimeMicros(); - webrtc::Random random(17); + Random random(17); int64_t prev_translated_time_us = system_start_us; @@ -204,4 +204,4 @@ TEST(TimestampAlignerTest, TranslateTimestampWithoutStateUpdate) { } } -} // namespace rtc +} // namespace webrtc