File: 0042.patch

package info (click to toggle)
thunderbird 1%3A143.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 4,703,968 kB
  • sloc: cpp: 7,770,492; javascript: 5,943,842; ansic: 3,918,754; python: 1,418,263; xml: 653,354; asm: 474,045; java: 183,079; sh: 111,238; makefile: 20,410; perl: 14,359; objc: 13,059; yacc: 4,583; pascal: 3,405; lex: 1,720; ruby: 999; exp: 762; sql: 715; awk: 580; php: 436; lisp: 430; sed: 69; csh: 10
file content (73 lines) | stat: -rw-r--r-- 3,370 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
From: "Byron Campen [:bwc]" <docfaraday@gmail.com>
Date: Fri, 12 Mar 2021 08:55:00 -0600
Subject: Bug 1654112 - libwebrtc modification: Surface video RTCP SR stats
 again. r=ng

libwebrtc has stopped surfacing these, and Chromium does not support
these stats at all.

Differential Revision: https://phabricator.services.mozilla.com/D108674
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/edac9d01a9ac7594f4b22708a4690753638ca32c
---
 video/rtp_video_stream_receiver2.cc | 10 ++++++++++
 video/rtp_video_stream_receiver2.h  |  6 ++++++
 video/video_receive_stream2.cc      |  8 ++++++++
 3 files changed, 24 insertions(+)

diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc
index 274423d3bb..54adbe1707 100644
--- a/video/rtp_video_stream_receiver2.cc
+++ b/video/rtp_video_stream_receiver2.cc
@@ -1174,6 +1174,16 @@ std::optional<int64_t> RtpVideoStreamReceiver2::LastReceivedKeyframePacketMs()
   return std::nullopt;
 }
 
+// Mozilla modification: VideoReceiveStream2 and friends do not surface RTCP
+// stats at all, and even on the most recent libwebrtc code there does not
+// seem to be any support for these stats right now. So, we hack this in.
+void RtpVideoStreamReceiver2::RemoteRTCPSenderInfo(
+    uint32_t* packet_count, uint32_t* octet_count,
+    int64_t* ntp_timestamp_ms) const {
+  RTC_DCHECK_RUN_ON(&worker_task_checker_);
+  rtp_rtcp_->RemoteRTCPSenderInfo(packet_count, octet_count, ntp_timestamp_ms);
+}
+
 std::optional<RtpRtcpInterface::SenderReportStats>
 RtpVideoStreamReceiver2::GetSenderReportStats() const {
   RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
diff --git a/video/rtp_video_stream_receiver2.h b/video/rtp_video_stream_receiver2.h
index bb0e8a42eb..d67c89ec1e 100644
--- a/video/rtp_video_stream_receiver2.h
+++ b/video/rtp_video_stream_receiver2.h
@@ -228,6 +228,12 @@ class RtpVideoStreamReceiver2 : public LossNotificationSender,
   std::optional<RtpRtcpInterface::SenderReportStats> GetSenderReportStats()
       const;
 
+  // Mozilla modification: VideoReceiveStream2 and friends do not surface RTCP
+  // stats at all, and even on the most recent libwebrtc code there does not
+  // seem to be any support for these stats right now. So, we hack this in.
+  void RemoteRTCPSenderInfo(uint32_t* packet_count, uint32_t* octet_count,
+                            int64_t* ntp_timestamp_ms) const;
+
  private:
   // 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 3aced70817..1c25c6083f 100644
--- a/video/video_receive_stream2.cc
+++ b/video/video_receive_stream2.cc
@@ -626,6 +626,14 @@ VideoReceiveStreamInterface::Stats VideoReceiveStream2::GetStats() const {
     stats.sender_reports_bytes_sent = rtcp_sr_stats->bytes_sent;
     stats.sender_reports_reports_count = rtcp_sr_stats->reports_count;
   }
+
+  // Mozilla modification: VideoReceiveStream2 and friends do not surface RTCP
+  // stats at all, and even on the most recent libwebrtc code there does not
+  // seem to be any support for these stats right now. So, we hack this in.
+  rtp_video_stream_receiver_.RemoteRTCPSenderInfo(
+      &stats.rtcp_sender_packets_sent, &stats.rtcp_sender_octets_sent,
+      &stats.rtcp_sender_ntp_timestamp_ms);
+
   return stats;
 }