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 <[email protected]>
    Commit-Queue: Evan Shrubsole <[email protected]>
    Reviewed-by: Danil Chapovalov <[email protected]>
    Auto-Submit: Evan Shrubsole <[email protected]>
    Cr-Commit-Position: refs/heads/main@{#45381}
This commit is contained in:
Dan Baker authored and [email protected] committed 2025-11-13 01:09:40 +00:00
1 parent 6074156970
commit 1370263e8e
3 files changed
+11 -6

No files matched your search

+2 -2
View File
@@ -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
+6 -2
View File
@@ -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,
@@ -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) {