commit 1370263e8eab83fd21d3ccd5f76880e636084f81 parent 6074156970456679cb592e382e2f70cc507b6684 Author: Dan Baker <dbaker@mozilla.com> Date: Thu, 23 Oct 2025 17:33:02 -0600 Bug 1995393 - Vendor libwebrtc from 2d3c3291d1 Upstream commit: https://webrtc.googlesource.com/src/+/2d3c3291d14af665709dbf842f409abef2392746 Use injected clock in encoder_bitrate_adjuster Stops using the global clock methods from time_utils. This CL was uploaded by an experimental version of git cl split (https://crbug.com/389069356). Bug: webrtc:42223992 Change-Id: If9e08fdf63ef553b7ff67c9817b02b71046eaec5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/404964 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Evan Shrubsole <eshr@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Auto-Submit: Evan Shrubsole <eshr@webrtc.org> Cr-Commit-Position: refs/heads/main@{#45381} Diffstat:
3 files changed, 11 insertions(+), 6 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 /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-23T23:30:32.398138+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-23T23:32:50.070321+00:00. # base of lastest vendoring -431721137a +2d3c3291d1 diff --git a/third_party/libwebrtc/video/encoder_bitrate_adjuster.cc b/third_party/libwebrtc/video/encoder_bitrate_adjuster.cc @@ -31,7 +31,6 @@ #include "rtc_base/checks.h" #include "rtc_base/experiments/rate_control_settings.h" #include "rtc_base/logging.h" -#include "rtc_base/time_utils.h" #include "system_wrappers/include/clock.h" #include "video/encoder_overshoot_detector.h" #include "video/rate_utilization_tracker.h" @@ -386,7 +385,12 @@ void EncoderBitrateAdjuster::OnEncodedFrame(DataSize size, // Detectors may not exist, for instance if ScreenshareLayers is used. auto& detector = overshoot_detectors_[stream_index][temporal_index]; if (detector) { - detector->OnEncodedFrame(size.bytes(), TimeMillis()); + // Due to http://bugs.webrtc.org/439515766, and sensitivity of some + // bandwidth estimation algorithms, this must round down to maintain + // behavior with TimeMillis. This may be removed either by migrating the + // whole algorithm to use Timestamp/TimeDelta, or when TimeMillis has been + // removed. + detector->OnEncodedFrame(size.bytes(), clock_.TimeInMicroseconds() / 1000); } if (media_rate_trackers_[stream_index]) { media_rate_trackers_[stream_index]->OnDataProduced(size, diff --git a/third_party/libwebrtc/video/encoder_bitrate_adjuster_unittest.cc b/third_party/libwebrtc/video/encoder_bitrate_adjuster_unittest.cc @@ -130,8 +130,9 @@ class EncoderBitrateAdjusterTest : public Test, RTC_DCHECK_EQ(media_utilization_factors.size(), network_utilization_factors.size()); - const int64_t start_us = TimeMicros(); - while (TimeMicros() < start_us + (duration_ms * kNumMicrosecsPerMillisec)) { + const int64_t start_us = time_controller_.GetClock()->TimeInMicroseconds(); + while (time_controller_.GetClock()->TimeInMicroseconds() < + start_us + (duration_ms * kNumMicrosecsPerMillisec)) { time_controller_.AdvanceTime(TimeDelta::Seconds(1) / target_framerate_fps_); for (size_t si = 0; si < NumSpatialLayers(); ++si) {