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 <hta@webrtc.org>
    Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#43984}

Differential Revision: https://phabricator.services.mozilla.com/D243990
This commit is contained in:
Michael Froman
2025-03-07 16:35:44 -06:00
parent 00e01720ea
commit d30d26b5c4
6 changed files with 16 additions and 11 deletions

View File

@@ -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 # ./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 # base of lastest vendoring
4025b60bc1 d3cb43adf8

View File

@@ -264,8 +264,7 @@ int32_t AudioDeviceBuffer::SetRecordedBuffer(
if (capture_timestamp_ns) { if (capture_timestamp_ns) {
int64_t align_offsync_estimation_time = rtc::TimeMicros(); int64_t align_offsync_estimation_time = rtc::TimeMicros();
if (align_offsync_estimation_time - if (align_offsync_estimation_time - TimestampAligner::kMinFrameIntervalUs >
rtc::TimestampAligner::kMinFrameIntervalUs >
align_offsync_estimation_time_) { align_offsync_estimation_time_) {
align_offsync_estimation_time_ = align_offsync_estimation_time; align_offsync_estimation_time_ = align_offsync_estimation_time;
capture_timestamp_ns_ = capture_timestamp_ns_ =

View File

@@ -240,7 +240,7 @@ class AudioDeviceBuffer {
// Used for converting capture timestaps (received from AudioRecordThread // Used for converting capture timestaps (received from AudioRecordThread
// via AudioRecordJni::DataIsRecorded) to RTC clock. // via AudioRecordJni::DataIsRecorded) to RTC clock.
rtc::TimestampAligner timestamp_aligner_; TimestampAligner timestamp_aligner_;
// Should *never* be defined in production builds. Only used for testing. // 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. // When defined, the output signal will be replaced by a sinus tone at 440Hz.

View File

@@ -17,7 +17,7 @@
#include "rtc_base/logging.h" #include "rtc_base/logging.h"
#include "rtc_base/time_utils.h" #include "rtc_base/time_utils.h"
namespace rtc { namespace webrtc {
TimestampAligner::TimestampAligner() TimestampAligner::TimestampAligner()
: frames_seen_(0), : frames_seen_(0),
@@ -140,4 +140,4 @@ int64_t TimestampAligner::ClipTimestamp(int64_t filtered_time_us,
return time_us; return time_us;
} }
} // namespace rtc } // namespace webrtc

View File

@@ -16,7 +16,7 @@
#include "rtc_base/system/rtc_export.h" #include "rtc_base/system/rtc_export.h"
#include "rtc_base/time_utils.h" #include "rtc_base/time_utils.h"
namespace rtc { namespace webrtc {
// The TimestampAligner class helps translating timestamps of a capture system // The TimestampAligner class helps translating timestamps of a capture system
// into the same timescale as is used by rtc::TimeMicros(). Some capture systems // 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_; 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 } // namespace rtc
#endif // RTC_BASE_TIMESTAMP_ALIGNER_H_ #endif // RTC_BASE_TIMESTAMP_ALIGNER_H_

View File

@@ -19,7 +19,7 @@
#include "rtc_base/time_utils.h" #include "rtc_base/time_utils.h"
#include "test/gtest.h" #include "test/gtest.h"
namespace rtc { namespace webrtc {
namespace { namespace {
// Computes the difference x_k - mean(x), when x_k is the linear sequence x_k = // 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 interval_error_us = kIntervalUs * rel_freq_error;
int64_t system_start_us = rtc::TimeMicros(); int64_t system_start_us = rtc::TimeMicros();
webrtc::Random random(17); Random random(17);
int64_t prev_translated_time_us = system_start_us; int64_t prev_translated_time_us = system_start_us;
@@ -204,4 +204,4 @@ TEST(TimestampAlignerTest, TranslateTimestampWithoutStateUpdate) {
} }
} }
} // namespace rtc } // namespace webrtc