File: s0029.patch

package info (click to toggle)
firefox 147.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,484 kB
  • sloc: cpp: 7,607,246; javascript: 6,533,185; ansic: 3,775,227; python: 1,415,393; xml: 634,561; asm: 438,951; java: 186,241; sh: 62,752; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (131 lines) | stat: -rw-r--r-- 5,216 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
From: Andreas Pehrson <apehrson@mozilla.com>
Date: Mon, 18 Jan 2021 11:04:00 +0100
Subject: Bug 1654112 - Include RtcpPacketTypeCounter in audio send stats, to
 not regress nackCount. r=ng

This is similar to how it's already included for video send.

Differential Revision: https://phabricator.services.mozilla.com/D102273
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/d380a43d59f4f7cbc001f4eab9b63ee993b32cd8
---
 audio/audio_send_stream.cc |  1 +
 audio/channel_send.cc      | 32 ++++++++++++++++++++++++++++++++
 audio/channel_send.h       |  1 +
 call/audio_send_stream.h   |  2 ++
 4 files changed, 36 insertions(+)

diff --git a/audio/audio_send_stream.cc b/audio/audio_send_stream.cc
index 4710362715..a56b45d405 100644
--- a/audio/audio_send_stream.cc
+++ b/audio/audio_send_stream.cc
@@ -437,6 +437,7 @@ webrtc::AudioSendStream::Stats AudioSendStream::GetStats(
 
   webrtc::ChannelSendStatistics channel_stats =
       channel_send_->GetRTCPStatistics();
+  stats.rtcp_packet_type_counts = channel_stats.rtcp_packet_type_counts;
   stats.payload_bytes_sent = channel_stats.payload_bytes_sent;
   stats.header_and_padding_bytes_sent =
       channel_stats.header_and_padding_bytes_sent;
diff --git a/audio/channel_send.cc b/audio/channel_send.cc
index fbda6e852e..7536645e4e 100644
--- a/audio/channel_send.cc
+++ b/audio/channel_send.cc
@@ -81,6 +81,32 @@ constexpr TimeDelta kMinRetransmissionWindow = TimeDelta::Millis(30);
 class RtpPacketSenderProxy;
 class TransportSequenceNumberProxy;
 
+class RtcpCounterObserver : public RtcpPacketTypeCounterObserver {
+ public:
+  explicit RtcpCounterObserver(uint32_t ssrc) : ssrc_(ssrc) {}
+
+  void RtcpPacketTypesCounterUpdated(
+      uint32_t ssrc,
+      const RtcpPacketTypeCounter& packet_counter) override {
+    if (ssrc_ != ssrc) {
+      return;
+    }
+
+    MutexLock lock(&mutex_);
+    packet_counter_ = packet_counter;
+  }
+
+  RtcpPacketTypeCounter GetCounts() {
+    MutexLock lock(&mutex_);
+    return packet_counter_;
+  }
+
+ private:
+  Mutex mutex_;
+  const uint32_t ssrc_;
+  RtcpPacketTypeCounter packet_counter_;
+};
+
 class AudioBitrateAccountant {
  public:
   void RegisterPacketOverhead(int packet_byte_overhead) {
@@ -288,6 +314,8 @@ class ChannelSend : public ChannelSendInterface,
   bool input_mute_ RTC_GUARDED_BY(volume_settings_mutex_) = false;
   bool previous_frame_muted_ RTC_GUARDED_BY(encoder_queue_checker_) = false;
 
+  const std::unique_ptr<RtcpCounterObserver> rtcp_counter_observer_;
+
   PacketRouter* packet_router_ RTC_GUARDED_BY(&worker_thread_checker_) =
       nullptr;
   const std::unique_ptr<RtpPacketSenderProxy> rtp_packet_pacer_proxy_;
@@ -500,6 +528,7 @@ ChannelSend::ChannelSend(
     RtpTransportControllerSendInterface* transport_controller)
     : env_(env),
       ssrc_(ssrc),
+      rtcp_counter_observer_(new RtcpCounterObserver(ssrc)),
       rtp_packet_pacer_proxy_(new RtpPacketSenderProxy()),
       retransmission_rate_limiter_(
           new RateLimiter(&env_.clock(), kMaxRetransmissionWindow.ms())),
@@ -521,6 +550,8 @@ ChannelSend::ChannelSend(
 
   configuration.paced_sender = rtp_packet_pacer_proxy_.get();
   configuration.rtt_stats = rtcp_rtt_stats;
+  configuration.rtcp_packet_type_counter_observer =
+      rtcp_counter_observer_.get();
   if (env_.field_trials().IsDisabled("WebRTC-DisableRtxRateLimiter")) {
     configuration.retransmission_rate_limiter =
         retransmission_rate_limiter_.get();
@@ -804,6 +835,7 @@ ChannelSendStatistics ChannelSend::GetRTCPStatistics() const {
   RTC_DCHECK_RUN_ON(&worker_thread_checker_);
   ChannelSendStatistics stats = {
       .round_trip_time = rtp_rtcp_->LastRtt().value_or(TimeDelta::Zero())};
+  stats.rtcp_packet_type_counts = rtcp_counter_observer_->GetCounts();
 
   StreamDataCounters rtp_stats;
   StreamDataCounters rtx_stats;
diff --git a/audio/channel_send.h b/audio/channel_send.h
index 185f3e9975..5a2c547673 100644
--- a/audio/channel_send.h
+++ b/audio/channel_send.h
@@ -52,6 +52,7 @@ struct ChannelSendStatistics {
   TimeDelta total_packet_send_delay = TimeDelta::Zero();
   // https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-retransmittedpacketssent
   uint64_t retransmitted_packets_sent;
+  RtcpPacketTypeCounter rtcp_packet_type_counts;
   // A snapshot of Report Blocks with additional data of interest to statistics.
   // Within this list, the sender-source SSRC pair is unique and per-pair the
   // ReportBlockData represents the latest Report Block that was received for
diff --git a/call/audio_send_stream.h b/call/audio_send_stream.h
index 2ae1742f91..21ae21b66f 100644
--- a/call/audio_send_stream.h
+++ b/call/audio_send_stream.h
@@ -32,6 +32,7 @@
 #include "api/units/time_delta.h"
 #include "call/audio_sender.h"
 #include "modules/rtp_rtcp/include/report_block_data.h"
+#include "modules/rtp_rtcp/include/rtcp_statistics.h"
 
 namespace webrtc {
 
@@ -68,6 +69,7 @@ class AudioSendStream : public AudioSender {
 
     ANAStats ana_statistics;
     AudioProcessingStats apm_statistics;
+    RtcpPacketTypeCounter rtcp_packet_type_counts;
 
     int64_t target_bitrate_bps = 0;
     // A snapshot of Report Blocks with additional data of interest to