tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 36cef7033ee3582fe756214410a9a951ffb6b8c1
parent 2f4c3cbb4c186760648167fd22dacb99c1b03efc
Author: Michael Froman <mfroman@mozilla.com>
Date:   Thu,  9 Oct 2025 13:33:38 -0500

Bug 1993083 - Vendor libwebrtc from 094a2c3b1c

Upstream commit: https://webrtc.googlesource.com/src/+/094a2c3b1ca5b59fc47dd869fc4ad9bb7c49e950
    Use Timestamp type to represent VideoFrameMetaData::render_time

    Bug: webrtc:42223979
    Change-Id: I059948e3d5a17654d6283db51168875eb5fa155e
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/400180
    Reviewed-by: Philip Eliasson <philipel@webrtc.org>
    Commit-Queue: Philip Eliasson <philipel@webrtc.org>
    Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45142}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0037.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0042.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0057.patch | 8++++----
Mthird_party/libwebrtc/moz-patch-stack/s0058.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0059.patch | 10+++++-----
Mthird_party/libwebrtc/video/receive_statistics_proxy.cc | 13++++++-------
Mthird_party/libwebrtc/video/receive_statistics_proxy.h | 2+-
Mthird_party/libwebrtc/video/video_receive_stream2.cc | 2+-
Mthird_party/libwebrtc/video/video_receive_stream2.h | 9++-------
10 files changed, 25 insertions(+), 31 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-09T18:32:23.046684+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T18:33:28.869732+00:00. # base of lastest vendoring -90f2e1f705 +094a2c3b1c diff --git a/third_party/libwebrtc/moz-patch-stack/s0037.patch b/third_party/libwebrtc/moz-patch-stack/s0037.patch @@ -53,7 +53,7 @@ index 18ee7ffa46..7e358c3c13 100644 // Implements RtpVideoFrameReceiver. void ManageFrame(std::unique_ptr<RtpFrameObject> frame) override; diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc -index 4660da8265..f8b2adcd88 100644 +index b5902e5a91..ec23e47fa4 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -627,6 +627,14 @@ VideoReceiveStreamInterface::Stats VideoReceiveStream2::GetStats() const { diff --git a/third_party/libwebrtc/moz-patch-stack/s0042.patch b/third_party/libwebrtc/moz-patch-stack/s0042.patch @@ -190,7 +190,7 @@ index 7e358c3c13..05498bd640 100644 private: // Implements RtpVideoFrameReceiver. diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc -index f8b2adcd88..7030a702a1 100644 +index ec23e47fa4..42c4077475 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -633,7 +633,8 @@ VideoReceiveStreamInterface::Stats VideoReceiveStream2::GetStats() const { diff --git a/third_party/libwebrtc/moz-patch-stack/s0057.patch b/third_party/libwebrtc/moz-patch-stack/s0057.patch @@ -186,10 +186,10 @@ index f17b00efb1..e205032fa6 100644 void ForceSpsPpsIdrIsH264Keyframe(); diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc -index b89ae42538..e35f8babb1 100644 +index 012716ad8d..f4905632fd 100644 --- a/video/receive_statistics_proxy.cc +++ b/video/receive_statistics_proxy.cc -@@ -818,6 +818,11 @@ void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) { +@@ -817,6 +817,11 @@ void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) { })); } @@ -202,7 +202,7 @@ index b89ae42538..e35f8babb1 100644 RTC_DCHECK_RUN_ON(&main_thread_); last_codec_type_ = codec_type; diff --git a/video/receive_statistics_proxy.h b/video/receive_statistics_proxy.h -index 2fb819ae94..4702332dc5 100644 +index fb03196198..5e126e5915 100644 --- a/video/receive_statistics_proxy.h +++ b/video/receive_statistics_proxy.h @@ -105,6 +105,7 @@ class ReceiveStatisticsProxy : public VideoStreamBufferControllerStatsObserver, @@ -272,7 +272,7 @@ index 05498bd640..e35711dc8b 100644 RTC_GUARDED_BY(packet_sequence_checker_); // h26x_packet_buffer_ is applicable to H.264 and H.265. For H.265 it is diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc -index 7030a702a1..ea87ba1309 100644 +index 42c4077475..ff4d634b33 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -257,6 +257,7 @@ VideoReceiveStream2::VideoReceiveStream2( diff --git a/third_party/libwebrtc/moz-patch-stack/s0058.patch b/third_party/libwebrtc/moz-patch-stack/s0058.patch @@ -10,10 +10,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/56fbf0469e25fa0d5 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc -index e35f8babb1..7bb737f239 100644 +index f4905632fd..ab5825d8c3 100644 --- a/video/receive_statistics_proxy.cc +++ b/video/receive_statistics_proxy.cc -@@ -819,8 +819,13 @@ void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) { +@@ -818,8 +818,13 @@ void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) { } void ReceiveStatisticsProxy::OnDiscardedPackets(uint32_t packets_discarded) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0059.patch b/third_party/libwebrtc/moz-patch-stack/s0059.patch @@ -116,7 +116,7 @@ index 251b464f37..90fbb7780f 100644 num_discarded_packets_ += num_discarded_packets; } diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc -index 7bb737f239..5c97607c6d 100644 +index ab5825d8c3..56203f11f2 100644 --- a/video/receive_statistics_proxy.cc +++ b/video/receive_statistics_proxy.cc @@ -39,6 +39,7 @@ @@ -127,7 +127,7 @@ index 7bb737f239..5c97607c6d 100644 #include "system_wrappers/include/clock.h" #include "system_wrappers/include/metrics.h" #include "video/stats_counter.h" -@@ -786,6 +787,9 @@ void ReceiveStatisticsProxy::OnCompleteFrame(bool is_keyframe, +@@ -785,6 +786,9 @@ void ReceiveStatisticsProxy::OnCompleteFrame(bool is_keyframe, VideoContentType content_type) { RTC_DCHECK_RUN_ON(&main_thread_); @@ -137,7 +137,7 @@ index 7bb737f239..5c97607c6d 100644 // Content type extension is set only for keyframes and should be propagated // for all the following delta frames. Here we may receive frames out of order // and miscategorise some delta frames near the layer switch. -@@ -811,6 +815,8 @@ void ReceiveStatisticsProxy::OnCompleteFrame(bool is_keyframe, +@@ -810,6 +814,8 @@ void ReceiveStatisticsProxy::OnCompleteFrame(bool is_keyframe, void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) { // Can be called on either the decode queue or the worker thread // See FrameBuffer2 for more details. @@ -146,7 +146,7 @@ index 7bb737f239..5c97607c6d 100644 worker_thread_->PostTask( SafeTask(task_safety_.flag(), [frames_dropped, this]() { RTC_DCHECK_RUN_ON(&main_thread_); -@@ -821,6 +827,9 @@ void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) { +@@ -820,6 +826,9 @@ void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) { void ReceiveStatisticsProxy::OnDiscardedPackets(uint32_t packets_discarded) { // Can be called on either the decode queue or the worker thread // See FrameBuffer2 for more details. @@ -156,7 +156,7 @@ index 7bb737f239..5c97607c6d 100644 worker_thread_->PostTask( SafeTask(task_safety_.flag(), [packets_discarded, this]() { RTC_DCHECK_RUN_ON(&main_thread_); -@@ -849,6 +858,8 @@ void ReceiveStatisticsProxy::OnStreamInactive() { +@@ -848,6 +857,8 @@ void ReceiveStatisticsProxy::OnStreamInactive() { void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms) { RTC_DCHECK_RUN_ON(&main_thread_); diff --git a/third_party/libwebrtc/video/receive_statistics_proxy.cc b/third_party/libwebrtc/video/receive_statistics_proxy.cc @@ -104,7 +104,6 @@ ReceiveStatisticsProxy::ReceiveStatisticsProxy(uint32_t remote_ssrc, last_content_type_(VideoContentType::UNSPECIFIED), last_codec_type_(kVideoCodecVP8), num_delayed_frames_rendered_(0), - sum_missed_render_deadline_ms_(0), timing_frame_info_counter_(kMovingMaxWindowMs), worker_thread_(worker_thread) { RTC_DCHECK(worker_thread); @@ -172,8 +171,8 @@ void ReceiveStatisticsProxy::UpdateHistograms( if (num_delayed_frames_rendered_ > 0) { RTC_HISTOGRAM_COUNTS_1000( "WebRTC.Video.DelayedFramesToRenderer_AvgDelayInMs", - static_cast<int>(sum_missed_render_deadline_ms_ / - num_delayed_frames_rendered_)); + (sum_missed_render_deadline_ / num_delayed_frames_rendered_) + .ms()); } } } @@ -746,10 +745,10 @@ void ReceiveStatisticsProxy::OnRenderedFrame( content_specific_stats->received_height.Add(frame_meta.height); // Consider taking stats_.render_delay_ms into account. - const int64_t time_until_rendering_ms = - frame_meta.render_time_ms() - frame_meta.decode_timestamp.ms(); - if (time_until_rendering_ms < 0) { - sum_missed_render_deadline_ms_ += -time_until_rendering_ms; + const TimeDelta time_until_rendering = + frame_meta.render_time - frame_meta.decode_timestamp; + if (time_until_rendering < TimeDelta::Zero()) { + sum_missed_render_deadline_ += -time_until_rendering; ++num_delayed_frames_rendered_; } diff --git a/third_party/libwebrtc/video/receive_statistics_proxy.h b/third_party/libwebrtc/video/receive_statistics_proxy.h @@ -204,7 +204,7 @@ class ReceiveStatisticsProxy : public VideoStreamBufferControllerStatsObserver, std::optional<int64_t> last_decoded_frame_time_ms_ RTC_GUARDED_BY(main_thread_); size_t num_delayed_frames_rendered_ RTC_GUARDED_BY(main_thread_); - int64_t sum_missed_render_deadline_ms_ RTC_GUARDED_BY(main_thread_); + TimeDelta sum_missed_render_deadline_ RTC_GUARDED_BY(main_thread_); // Mutable because calling Max() on MovingMaxCounter is not const. Yet it is // called from const GetStats(). mutable MovingMaxCounter<TimingFrameInfo> timing_frame_info_counter_ diff --git a/third_party/libwebrtc/video/video_receive_stream2.cc b/third_party/libwebrtc/video/video_receive_stream2.cc @@ -714,7 +714,7 @@ void VideoReceiveStream2::OnFrame(const VideoFrame& video_frame) { int64_t sync_offset_ms; double estimated_freq_khz; if (rtp_stream_sync_.GetStreamSyncOffsetInMs( - frame_meta.rtp_timestamp, frame_meta.render_time_ms(), + frame_meta.rtp_timestamp, frame_meta.render_time.ms(), &video_playout_ntp_ms, &sync_offset_ms, &estimated_freq_khz)) { stats_proxy_.OnSyncOffsetUpdated(video_playout_ntp_ms, sync_offset_ms, estimated_freq_khz); diff --git a/third_party/libwebrtc/video/video_receive_stream2.h b/third_party/libwebrtc/video/video_receive_stream2.h @@ -50,7 +50,6 @@ #include "rtc_base/synchronization/mutex.h" #include "rtc_base/system/no_unique_address.h" #include "rtc_base/thread_annotations.h" -#include "rtc_base/time_utils.h" #include "video/corruption_detection/frame_instrumentation_evaluation.h" #include "video/decode_synchronizer.h" #include "video/receive_statistics_proxy.h" @@ -82,18 +81,14 @@ class CallStats; struct VideoFrameMetaData { VideoFrameMetaData(const webrtc::VideoFrame& frame, Timestamp now) : rtp_timestamp(frame.rtp_timestamp()), - timestamp_us(frame.timestamp_us()), + render_time(Timestamp::Micros(frame.timestamp_us())), ntp_time_ms(frame.ntp_time_ms()), width(frame.width()), height(frame.height()), decode_timestamp(now) {} - int64_t render_time_ms() const { - return timestamp_us / kNumMicrosecsPerMillisec; - } - const uint32_t rtp_timestamp; - const int64_t timestamp_us; + const Timestamp render_time; const int64_t ntp_time_ms; const int width; const int height;