summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0060.patch
blob: 81458c04dfe5fb4a6ff072effacd0d6b709258a4 (plain)
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
From: Michael Froman <mjfroman@mac.com>
Date: Mon, 4 Apr 2022 12:25:26 -0500
Subject: Bug 1766646 - (fix) breakout Call::Stats and SharedModuleThread into
 seperate files

---
 call/BUILD.gn             |  6 ++++++
 call/call.cc              | 13 -------------
 call/call.h               | 13 ++-----------
 call/call_basic_stats.cc  | 20 ++++++++++++++++++++
 call/call_basic_stats.h   | 21 +++++++++++++++++++++
 video/video_send_stream.h |  1 -
 6 files changed, 49 insertions(+), 25 deletions(-)
 create mode 100644 call/call_basic_stats.cc
 create mode 100644 call/call_basic_stats.h

diff --git a/call/BUILD.gn b/call/BUILD.gn
index 0e52e8fb3f..26618aee80 100644
--- a/call/BUILD.gn
+++ b/call/BUILD.gn
@@ -33,6 +33,12 @@ rtc_library("call_interfaces") {
     "syncable.cc",
     "syncable.h",
   ]
+  if (build_with_mozilla) {
+    sources += [
+      "call_basic_stats.cc",
+      "call_basic_stats.h",
+    ]
+  }
 
   deps = [
     ":audio_sender_interface",
diff --git a/call/call.cc b/call/call.cc
index a63087f5c1..4c3f4b63fc 100644
--- a/call/call.cc
+++ b/call/call.cc
@@ -472,19 +472,6 @@ class Call final : public webrtc::Call,
 };
 }  // namespace internal
 
-std::string Call::Stats::ToString(int64_t time_ms) const {
-  char buf[1024];
-  rtc::SimpleStringBuilder ss(buf);
-  ss << "Call stats: " << time_ms << ", {";
-  ss << "send_bw_bps: " << send_bandwidth_bps << ", ";
-  ss << "recv_bw_bps: " << recv_bandwidth_bps << ", ";
-  ss << "max_pad_bps: " << max_padding_bitrate_bps << ", ";
-  ss << "pacer_delay_ms: " << pacer_delay_ms << ", ";
-  ss << "rtt_ms: " << rtt_ms;
-  ss << '}';
-  return ss.str();
-}
-
 /* Mozilla: Avoid this since it could use GetRealTimeClock().
 Call* Call::Create(const Call::Config& config) {
   Clock* clock = Clock::GetRealTimeClock();
diff --git a/call/call.h b/call/call.h
index 366978392e..42daa95a6c 100644
--- a/call/call.h
+++ b/call/call.h
@@ -21,6 +21,7 @@
 #include "api/task_queue/task_queue_base.h"
 #include "call/audio_receive_stream.h"
 #include "call/audio_send_stream.h"
+#include "call/call_basic_stats.h"
 #include "call/call_config.h"
 #include "call/flexfec_receive_stream.h"
 #include "call/packet_receiver.h"
@@ -30,7 +31,6 @@
 #include "rtc_base/copy_on_write_buffer.h"
 #include "rtc_base/network/sent_packet.h"
 #include "rtc_base/network_route.h"
-#include "rtc_base/ref_count.h"
 
 namespace webrtc {
 
@@ -47,16 +47,7 @@ namespace webrtc {
 class Call {
  public:
   using Config = CallConfig;
-
-  struct Stats {
-    std::string ToString(int64_t time_ms) const;
-
-    int send_bandwidth_bps = 0;       // Estimated available send bandwidth.
-    int max_padding_bitrate_bps = 0;  // Cumulative configured max padding.
-    int recv_bandwidth_bps = 0;       // Estimated available receive bandwidth.
-    int64_t pacer_delay_ms = 0;
-    int64_t rtt_ms = -1;
-  };
+  using Stats = CallBasicStats;
 
   static Call* Create(const Call::Config& config);
   static Call* Create(const Call::Config& config,
diff --git a/call/call_basic_stats.cc b/call/call_basic_stats.cc
new file mode 100644
index 0000000000..74333a663b
--- /dev/null
+++ b/call/call_basic_stats.cc
@@ -0,0 +1,20 @@
+#include "call/call_basic_stats.h"
+
+#include "rtc_base/strings/string_builder.h"
+
+namespace webrtc {
+
+std::string CallBasicStats::ToString(int64_t time_ms) const {
+  char buf[1024];
+  rtc::SimpleStringBuilder ss(buf);
+  ss << "Call stats: " << time_ms << ", {";
+  ss << "send_bw_bps: " << send_bandwidth_bps << ", ";
+  ss << "recv_bw_bps: " << recv_bandwidth_bps << ", ";
+  ss << "max_pad_bps: " << max_padding_bitrate_bps << ", ";
+  ss << "pacer_delay_ms: " << pacer_delay_ms << ", ";
+  ss << "rtt_ms: " << rtt_ms;
+  ss << '}';
+  return ss.str();
+}
+
+}  // namespace webrtc
diff --git a/call/call_basic_stats.h b/call/call_basic_stats.h
new file mode 100644
index 0000000000..98febe9405
--- /dev/null
+++ b/call/call_basic_stats.h
@@ -0,0 +1,21 @@
+#ifndef CALL_CALL_BASIC_STATS_H_
+#define CALL_CALL_BASIC_STATS_H_
+
+#include <string>
+
+namespace webrtc {
+
+// named to avoid conflicts with video/call_stats.h
+struct CallBasicStats {
+  std::string ToString(int64_t time_ms) const;
+
+  int send_bandwidth_bps = 0;       // Estimated available send bandwidth.
+  int max_padding_bitrate_bps = 0;  // Cumulative configured max padding.
+  int recv_bandwidth_bps = 0;       // Estimated available receive bandwidth.
+  int64_t pacer_delay_ms = 0;
+  int64_t rtt_ms = -1;
+};
+
+}  // namespace webrtc
+
+#endif  // CALL_CALL_BASIC_STATS_H_
diff --git a/video/video_send_stream.h b/video/video_send_stream.h
index a7ce112b21..404873fd39 100644
--- a/video/video_send_stream.h
+++ b/video/video_send_stream.h
@@ -37,7 +37,6 @@ namespace test {
 class VideoSendStreamPeer;
 }  // namespace test
 
-class CallStats;
 class IvfFileWriter;
 class RateLimiter;
 class RtpRtcp;
-- 
2.34.1