blob: f97e23fb04c66838b35a5d16262cf8001b3c920b [file] [log] [blame]
hbosd565b732016-08-30 14:04:35 -07001/*
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "api/stats/rtcstats_objects.h"
hbosd565b732016-08-30 14:04:35 -070012
Yves Gerey3e707812018-11-28 16:47:49 +010013#include <utility>
14
15#include "rtc_base/checks.h"
16
Jakob Ivarsson758d9462019-03-19 15:38:49 +010017#include "api/stats/rtc_stats.h"
18
hbosd565b732016-08-30 14:04:35 -070019namespace webrtc {
20
agrieve26622d32017-08-08 10:48:15 -070021const char* const RTCDataChannelState::kConnecting = "connecting";
22const char* const RTCDataChannelState::kOpen = "open";
23const char* const RTCDataChannelState::kClosing = "closing";
24const char* const RTCDataChannelState::kClosed = "closed";
hboscc555c52016-10-18 12:48:31 -070025
agrieve26622d32017-08-08 10:48:15 -070026const char* const RTCStatsIceCandidatePairState::kFrozen = "frozen";
27const char* const RTCStatsIceCandidatePairState::kWaiting = "waiting";
28const char* const RTCStatsIceCandidatePairState::kInProgress = "in-progress";
29const char* const RTCStatsIceCandidatePairState::kFailed = "failed";
30const char* const RTCStatsIceCandidatePairState::kSucceeded = "succeeded";
hbosc47a0c32016-10-11 14:54:49 -070031
32// Strings defined in https://tools.ietf.org/html/rfc5245.
agrieve26622d32017-08-08 10:48:15 -070033const char* const RTCIceCandidateType::kHost = "host";
34const char* const RTCIceCandidateType::kSrflx = "srflx";
35const char* const RTCIceCandidateType::kPrflx = "prflx";
36const char* const RTCIceCandidateType::kRelay = "relay";
hbosab9f6e42016-10-07 02:18:47 -070037
agrieve26622d32017-08-08 10:48:15 -070038const char* const RTCDtlsTransportState::kNew = "new";
39const char* const RTCDtlsTransportState::kConnecting = "connecting";
40const char* const RTCDtlsTransportState::kConnected = "connected";
41const char* const RTCDtlsTransportState::kClosed = "closed";
42const char* const RTCDtlsTransportState::kFailed = "failed";
hbos7064d592017-01-16 07:38:02 -080043
agrieve26622d32017-08-08 10:48:15 -070044const char* const RTCMediaStreamTrackKind::kAudio = "audio";
45const char* const RTCMediaStreamTrackKind::kVideo = "video";
hbos160e4a72017-01-17 02:53:23 -080046
Gary Liu37e489c2017-11-21 10:49:36 -080047// https://w3c.github.io/webrtc-stats/#dom-rtcnetworktype
48const char* const RTCNetworkType::kBluetooth = "bluetooth";
49const char* const RTCNetworkType::kCellular = "cellular";
50const char* const RTCNetworkType::kEthernet = "ethernet";
51const char* const RTCNetworkType::kWifi = "wifi";
52const char* const RTCNetworkType::kWimax = "wimax";
53const char* const RTCNetworkType::kVpn = "vpn";
54const char* const RTCNetworkType::kUnknown = "unknown";
55
Henrik Boström2e069262019-04-09 13:59:31 +020056// https://webrtc.org/experiments/rtp-hdrext/video-content-type/
57const char* const RTCContentType::kUnspecified = "unspecified";
58const char* const RTCContentType::kScreenshare = "screenshare";
59
Steve Antond6a5cbd2017-08-18 09:40:25 -070060// clang-format off
hbos2fa7c672016-10-24 04:00:05 -070061WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate",
62 &fingerprint,
63 &fingerprint_algorithm,
64 &base64_certificate,
Nico Weber22f99252019-02-20 10:13:16 -050065 &issuer_certificate_id)
Steve Antond6a5cbd2017-08-18 09:40:25 -070066// clang-format on
hbos2fa7c672016-10-24 04:00:05 -070067
Yves Gerey665174f2018-06-19 15:03:05 +020068RTCCertificateStats::RTCCertificateStats(const std::string& id,
69 int64_t timestamp_us)
70 : RTCCertificateStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -070071
Yves Gerey665174f2018-06-19 15:03:05 +020072RTCCertificateStats::RTCCertificateStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -070073 : RTCStats(std::move(id), timestamp_us),
74 fingerprint("fingerprint"),
75 fingerprint_algorithm("fingerprintAlgorithm"),
76 base64_certificate("base64Certificate"),
Yves Gerey665174f2018-06-19 15:03:05 +020077 issuer_certificate_id("issuerCertificateId") {}
hbos2fa7c672016-10-24 04:00:05 -070078
Yves Gerey665174f2018-06-19 15:03:05 +020079RTCCertificateStats::RTCCertificateStats(const RTCCertificateStats& other)
hbos2fa7c672016-10-24 04:00:05 -070080 : RTCStats(other.id(), other.timestamp_us()),
81 fingerprint(other.fingerprint),
82 fingerprint_algorithm(other.fingerprint_algorithm),
83 base64_certificate(other.base64_certificate),
Yves Gerey665174f2018-06-19 15:03:05 +020084 issuer_certificate_id(other.issuer_certificate_id) {}
hbos2fa7c672016-10-24 04:00:05 -070085
Yves Gerey665174f2018-06-19 15:03:05 +020086RTCCertificateStats::~RTCCertificateStats() {}
hbos2fa7c672016-10-24 04:00:05 -070087
Steve Antond6a5cbd2017-08-18 09:40:25 -070088// clang-format off
hbos0adb8282016-11-23 02:32:06 -080089WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec",
90 &payload_type,
hbos13f54b22017-02-28 06:56:04 -080091 &mime_type,
hbos0adb8282016-11-23 02:32:06 -080092 &clock_rate,
93 &channels,
hbos13f54b22017-02-28 06:56:04 -080094 &sdp_fmtp_line,
Nico Weber22f99252019-02-20 10:13:16 -050095 &implementation)
Steve Antond6a5cbd2017-08-18 09:40:25 -070096// clang-format on
hbos0adb8282016-11-23 02:32:06 -080097
Yves Gerey665174f2018-06-19 15:03:05 +020098RTCCodecStats::RTCCodecStats(const std::string& id, int64_t timestamp_us)
99 : RTCCodecStats(std::string(id), timestamp_us) {}
hbos0adb8282016-11-23 02:32:06 -0800100
Yves Gerey665174f2018-06-19 15:03:05 +0200101RTCCodecStats::RTCCodecStats(std::string&& id, int64_t timestamp_us)
hbos0adb8282016-11-23 02:32:06 -0800102 : RTCStats(std::move(id), timestamp_us),
103 payload_type("payloadType"),
hbos13f54b22017-02-28 06:56:04 -0800104 mime_type("mimeType"),
hbos0adb8282016-11-23 02:32:06 -0800105 clock_rate("clockRate"),
106 channels("channels"),
hbos13f54b22017-02-28 06:56:04 -0800107 sdp_fmtp_line("sdpFmtpLine"),
Yves Gerey665174f2018-06-19 15:03:05 +0200108 implementation("implementation") {}
hbos0adb8282016-11-23 02:32:06 -0800109
Yves Gerey665174f2018-06-19 15:03:05 +0200110RTCCodecStats::RTCCodecStats(const RTCCodecStats& other)
hbos0adb8282016-11-23 02:32:06 -0800111 : RTCStats(other.id(), other.timestamp_us()),
112 payload_type(other.payload_type),
hbos13f54b22017-02-28 06:56:04 -0800113 mime_type(other.mime_type),
hbos0adb8282016-11-23 02:32:06 -0800114 clock_rate(other.clock_rate),
115 channels(other.channels),
hbos13f54b22017-02-28 06:56:04 -0800116 sdp_fmtp_line(other.sdp_fmtp_line),
Yves Gerey665174f2018-06-19 15:03:05 +0200117 implementation(other.implementation) {}
hbos0adb8282016-11-23 02:32:06 -0800118
Yves Gerey665174f2018-06-19 15:03:05 +0200119RTCCodecStats::~RTCCodecStats() {}
hbos0adb8282016-11-23 02:32:06 -0800120
Steve Antond6a5cbd2017-08-18 09:40:25 -0700121// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700122WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel",
123 &label,
124 &protocol,
125 &datachannelid,
126 &state,
127 &messages_sent,
128 &bytes_sent,
129 &messages_received,
Nico Weber22f99252019-02-20 10:13:16 -0500130 &bytes_received)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700131// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700132
Yves Gerey665174f2018-06-19 15:03:05 +0200133RTCDataChannelStats::RTCDataChannelStats(const std::string& id,
134 int64_t timestamp_us)
135 : RTCDataChannelStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -0700136
Yves Gerey665174f2018-06-19 15:03:05 +0200137RTCDataChannelStats::RTCDataChannelStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -0700138 : RTCStats(std::move(id), timestamp_us),
139 label("label"),
140 protocol("protocol"),
141 datachannelid("datachannelid"),
142 state("state"),
143 messages_sent("messagesSent"),
144 bytes_sent("bytesSent"),
145 messages_received("messagesReceived"),
Yves Gerey665174f2018-06-19 15:03:05 +0200146 bytes_received("bytesReceived") {}
hbos2fa7c672016-10-24 04:00:05 -0700147
Yves Gerey665174f2018-06-19 15:03:05 +0200148RTCDataChannelStats::RTCDataChannelStats(const RTCDataChannelStats& other)
hbos2fa7c672016-10-24 04:00:05 -0700149 : RTCStats(other.id(), other.timestamp_us()),
150 label(other.label),
151 protocol(other.protocol),
152 datachannelid(other.datachannelid),
153 state(other.state),
154 messages_sent(other.messages_sent),
155 bytes_sent(other.bytes_sent),
156 messages_received(other.messages_received),
Yves Gerey665174f2018-06-19 15:03:05 +0200157 bytes_received(other.bytes_received) {}
hbos2fa7c672016-10-24 04:00:05 -0700158
Yves Gerey665174f2018-06-19 15:03:05 +0200159RTCDataChannelStats::~RTCDataChannelStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700160
Steve Antond6a5cbd2017-08-18 09:40:25 -0700161// clang-format off
hbosc47a0c32016-10-11 14:54:49 -0700162WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair",
163 &transport_id,
164 &local_candidate_id,
165 &remote_candidate_id,
166 &state,
167 &priority,
168 &nominated,
169 &writable,
170 &readable,
171 &bytes_sent,
172 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800173 &total_round_trip_time,
174 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700175 &available_outgoing_bitrate,
176 &available_incoming_bitrate,
177 &requests_received,
178 &requests_sent,
179 &responses_received,
180 &responses_sent,
181 &retransmissions_received,
182 &retransmissions_sent,
183 &consent_requests_received,
184 &consent_requests_sent,
185 &consent_responses_received,
Nico Weber22f99252019-02-20 10:13:16 -0500186 &consent_responses_sent)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700187// clang-format on
hbosc47a0c32016-10-11 14:54:49 -0700188
Yves Gerey665174f2018-06-19 15:03:05 +0200189RTCIceCandidatePairStats::RTCIceCandidatePairStats(const std::string& id,
190 int64_t timestamp_us)
191 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {}
hbosc47a0c32016-10-11 14:54:49 -0700192
Yves Gerey665174f2018-06-19 15:03:05 +0200193RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string&& id,
194 int64_t timestamp_us)
hbosc47a0c32016-10-11 14:54:49 -0700195 : RTCStats(std::move(id), timestamp_us),
196 transport_id("transportId"),
197 local_candidate_id("localCandidateId"),
198 remote_candidate_id("remoteCandidateId"),
199 state("state"),
200 priority("priority"),
201 nominated("nominated"),
202 writable("writable"),
203 readable("readable"),
204 bytes_sent("bytesSent"),
205 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800206 total_round_trip_time("totalRoundTripTime"),
207 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700208 available_outgoing_bitrate("availableOutgoingBitrate"),
209 available_incoming_bitrate("availableIncomingBitrate"),
210 requests_received("requestsReceived"),
211 requests_sent("requestsSent"),
212 responses_received("responsesReceived"),
213 responses_sent("responsesSent"),
214 retransmissions_received("retransmissionsReceived"),
215 retransmissions_sent("retransmissionsSent"),
216 consent_requests_received("consentRequestsReceived"),
217 consent_requests_sent("consentRequestsSent"),
218 consent_responses_received("consentResponsesReceived"),
Yves Gerey665174f2018-06-19 15:03:05 +0200219 consent_responses_sent("consentResponsesSent") {}
hbosc47a0c32016-10-11 14:54:49 -0700220
221RTCIceCandidatePairStats::RTCIceCandidatePairStats(
222 const RTCIceCandidatePairStats& other)
223 : RTCStats(other.id(), other.timestamp_us()),
224 transport_id(other.transport_id),
225 local_candidate_id(other.local_candidate_id),
226 remote_candidate_id(other.remote_candidate_id),
227 state(other.state),
228 priority(other.priority),
229 nominated(other.nominated),
230 writable(other.writable),
231 readable(other.readable),
232 bytes_sent(other.bytes_sent),
233 bytes_received(other.bytes_received),
hbos3168c7a2016-12-15 06:17:08 -0800234 total_round_trip_time(other.total_round_trip_time),
235 current_round_trip_time(other.current_round_trip_time),
hbosc47a0c32016-10-11 14:54:49 -0700236 available_outgoing_bitrate(other.available_outgoing_bitrate),
237 available_incoming_bitrate(other.available_incoming_bitrate),
238 requests_received(other.requests_received),
239 requests_sent(other.requests_sent),
240 responses_received(other.responses_received),
241 responses_sent(other.responses_sent),
242 retransmissions_received(other.retransmissions_received),
243 retransmissions_sent(other.retransmissions_sent),
244 consent_requests_received(other.consent_requests_received),
245 consent_requests_sent(other.consent_requests_sent),
246 consent_responses_received(other.consent_responses_received),
Yves Gerey665174f2018-06-19 15:03:05 +0200247 consent_responses_sent(other.consent_responses_sent) {}
hbosc47a0c32016-10-11 14:54:49 -0700248
Yves Gerey665174f2018-06-19 15:03:05 +0200249RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {}
hbosc47a0c32016-10-11 14:54:49 -0700250
Steve Antond6a5cbd2017-08-18 09:40:25 -0700251// clang-format off
Henrik Boström1df1bf82018-03-20 13:24:20 +0100252WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800253 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800254 &is_remote,
Gary Liu37e489c2017-11-21 10:49:36 -0800255 &network_type,
hbosab9f6e42016-10-07 02:18:47 -0700256 &ip,
257 &port,
258 &protocol,
Philipp Hancke95513752018-09-27 14:40:08 +0200259 &relay_protocol,
hbosab9f6e42016-10-07 02:18:47 -0700260 &candidate_type,
261 &priority,
hbosd17a5a72017-01-02 08:09:59 -0800262 &url,
Nico Weber22f99252019-02-20 10:13:16 -0500263 &deleted)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700264// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700265
Yves Gerey665174f2018-06-19 15:03:05 +0200266RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id,
267 int64_t timestamp_us,
268 bool is_remote)
269 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {}
hbosab9f6e42016-10-07 02:18:47 -0700270
Gary Liu37e489c2017-11-21 10:49:36 -0800271RTCIceCandidateStats::RTCIceCandidateStats(std::string&& id,
272 int64_t timestamp_us,
273 bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700274 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800275 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800276 is_remote("isRemote", is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800277 network_type("networkType"),
hbosab9f6e42016-10-07 02:18:47 -0700278 ip("ip"),
279 port("port"),
280 protocol("protocol"),
Philipp Hancke95513752018-09-27 14:40:08 +0200281 relay_protocol("relayProtocol"),
hbosab9f6e42016-10-07 02:18:47 -0700282 candidate_type("candidateType"),
283 priority("priority"),
hbosd17a5a72017-01-02 08:09:59 -0800284 url("url"),
Gary Liu37e489c2017-11-21 10:49:36 -0800285 deleted("deleted", false) {}
hbosab9f6e42016-10-07 02:18:47 -0700286
287RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
288 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800289 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800290 is_remote(other.is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800291 network_type(other.network_type),
hbosab9f6e42016-10-07 02:18:47 -0700292 ip(other.ip),
293 port(other.port),
294 protocol(other.protocol),
Philipp Hancke95513752018-09-27 14:40:08 +0200295 relay_protocol(other.relay_protocol),
hbosab9f6e42016-10-07 02:18:47 -0700296 candidate_type(other.candidate_type),
297 priority(other.priority),
hbosd17a5a72017-01-02 08:09:59 -0800298 url(other.url),
Gary Liu37e489c2017-11-21 10:49:36 -0800299 deleted(other.deleted) {}
hbosab9f6e42016-10-07 02:18:47 -0700300
Yves Gerey665174f2018-06-19 15:03:05 +0200301RTCIceCandidateStats::~RTCIceCandidateStats() {}
hbosab9f6e42016-10-07 02:18:47 -0700302
303const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
304
Yves Gerey665174f2018-06-19 15:03:05 +0200305RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(const std::string& id,
306 int64_t timestamp_us)
307 : RTCIceCandidateStats(id, timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700308
Yves Gerey665174f2018-06-19 15:03:05 +0200309RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string&& id,
310 int64_t timestamp_us)
311 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700312
Henrik Boström1df1bf82018-03-20 13:24:20 +0100313std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const {
314 return std::unique_ptr<RTCStats>(new RTCLocalIceCandidateStats(*this));
315}
316
hbosab9f6e42016-10-07 02:18:47 -0700317const char* RTCLocalIceCandidateStats::type() const {
318 return kType;
319}
320
321const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
322
Yves Gerey665174f2018-06-19 15:03:05 +0200323RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(const std::string& id,
324 int64_t timestamp_us)
325 : RTCIceCandidateStats(id, timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700326
Yves Gerey665174f2018-06-19 15:03:05 +0200327RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string&& id,
328 int64_t timestamp_us)
329 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700330
Henrik Boström1df1bf82018-03-20 13:24:20 +0100331std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const {
332 return std::unique_ptr<RTCStats>(new RTCRemoteIceCandidateStats(*this));
333}
334
hbosab9f6e42016-10-07 02:18:47 -0700335const char* RTCRemoteIceCandidateStats::type() const {
336 return kType;
337}
338
Steve Antond6a5cbd2017-08-18 09:40:25 -0700339// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800340WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
341 &stream_identifier,
Nico Weber22f99252019-02-20 10:13:16 -0500342 &track_ids)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700343// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800344
Yves Gerey665174f2018-06-19 15:03:05 +0200345RTCMediaStreamStats::RTCMediaStreamStats(const std::string& id,
346 int64_t timestamp_us)
347 : RTCMediaStreamStats(std::string(id), timestamp_us) {}
hbos09bc1282016-11-08 06:29:22 -0800348
Yves Gerey665174f2018-06-19 15:03:05 +0200349RTCMediaStreamStats::RTCMediaStreamStats(std::string&& id, int64_t timestamp_us)
hbos09bc1282016-11-08 06:29:22 -0800350 : RTCStats(std::move(id), timestamp_us),
351 stream_identifier("streamIdentifier"),
Yves Gerey665174f2018-06-19 15:03:05 +0200352 track_ids("trackIds") {}
hbos09bc1282016-11-08 06:29:22 -0800353
Yves Gerey665174f2018-06-19 15:03:05 +0200354RTCMediaStreamStats::RTCMediaStreamStats(const RTCMediaStreamStats& other)
hbos09bc1282016-11-08 06:29:22 -0800355 : RTCStats(other.id(), other.timestamp_us()),
356 stream_identifier(other.stream_identifier),
Yves Gerey665174f2018-06-19 15:03:05 +0200357 track_ids(other.track_ids) {}
hbos09bc1282016-11-08 06:29:22 -0800358
Yves Gerey665174f2018-06-19 15:03:05 +0200359RTCMediaStreamStats::~RTCMediaStreamStats() {}
hbos09bc1282016-11-08 06:29:22 -0800360
Steve Antond6a5cbd2017-08-18 09:40:25 -0700361// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800362WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
zsteine76bd3a2017-07-14 12:17:49 -0700363 &track_identifier,
Henrik Boström646fda02019-05-22 15:49:42 +0200364 &media_source_id,
zsteine76bd3a2017-07-14 12:17:49 -0700365 &remote_source,
366 &ended,
367 &detached,
368 &kind,
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200369 &jitter_buffer_delay,
Chen Xing0acffb52019-01-15 15:46:29 +0100370 &jitter_buffer_emitted_count,
zsteine76bd3a2017-07-14 12:17:49 -0700371 &frame_width,
372 &frame_height,
373 &frames_per_second,
374 &frames_sent,
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100375 &huge_frames_sent,
zsteine76bd3a2017-07-14 12:17:49 -0700376 &frames_received,
377 &frames_decoded,
378 &frames_dropped,
379 &frames_corrupted,
380 &partial_frames_lost,
381 &full_frames_lost,
382 &audio_level,
383 &total_audio_energy,
zsteine76bd3a2017-07-14 12:17:49 -0700384 &echo_return_loss,
Steve Anton2dbc69f2017-08-24 17:15:13 -0700385 &echo_return_loss_enhancement,
386 &total_samples_received,
387 &total_samples_duration,
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200388 &concealed_samples,
Ruslan Burakov8af88962018-11-22 17:21:10 +0100389 &concealment_events,
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100390 &jitter_buffer_flushes,
Sergey Silkin02371062019-01-31 16:45:42 +0100391 &delayed_packet_outage_samples,
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100392 &relative_packet_arrival_delay,
Henrik Lundin44125fa2019-04-29 17:00:46 +0200393 &interruption_count,
394 &total_interruption_duration,
Sergey Silkin02371062019-01-31 16:45:42 +0100395 &freeze_count,
396 &pause_count,
397 &total_freezes_duration,
398 &total_pauses_duration,
399 &total_frames_duration,
Nico Weber22f99252019-02-20 10:13:16 -0500400 &sum_squared_frame_durations)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700401// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800402
Yves Gerey665174f2018-06-19 15:03:05 +0200403RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(const std::string& id,
404 int64_t timestamp_us,
405 const char* kind)
406 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {}
hbos09bc1282016-11-08 06:29:22 -0800407
zsteine76bd3a2017-07-14 12:17:49 -0700408RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(std::string&& id,
409 int64_t timestamp_us,
410 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800411 : RTCStats(std::move(id), timestamp_us),
412 track_identifier("trackIdentifier"),
Henrik Boström646fda02019-05-22 15:49:42 +0200413 media_source_id("mediaSourceId"),
hbos09bc1282016-11-08 06:29:22 -0800414 remote_source("remoteSource"),
415 ended("ended"),
416 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800417 kind("kind", kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200418 jitter_buffer_delay("jitterBufferDelay"),
Chen Xing0acffb52019-01-15 15:46:29 +0100419 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
hbos09bc1282016-11-08 06:29:22 -0800420 frame_width("frameWidth"),
421 frame_height("frameHeight"),
422 frames_per_second("framesPerSecond"),
423 frames_sent("framesSent"),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100424 huge_frames_sent("hugeFramesSent"),
hbos09bc1282016-11-08 06:29:22 -0800425 frames_received("framesReceived"),
426 frames_decoded("framesDecoded"),
427 frames_dropped("framesDropped"),
428 frames_corrupted("framesCorrupted"),
429 partial_frames_lost("partialFramesLost"),
430 full_frames_lost("fullFramesLost"),
431 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700432 total_audio_energy("totalAudioEnergy"),
hbos09bc1282016-11-08 06:29:22 -0800433 echo_return_loss("echoReturnLoss"),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700434 echo_return_loss_enhancement("echoReturnLossEnhancement"),
435 total_samples_received("totalSamplesReceived"),
436 total_samples_duration("totalSamplesDuration"),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200437 concealed_samples("concealedSamples"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200438 silent_concealed_samples("silentConcealedSamples"),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100439 concealment_events("concealmentEvents"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200440 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
441 removed_samples_for_acceleration("removedSamplesForAcceleration"),
Jakob Ivarsson758d9462019-03-19 15:38:49 +0100442 jitter_buffer_flushes(
443 "jitterBufferFlushes",
444 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
445 delayed_packet_outage_samples(
446 "delayedPacketOutageSamples",
447 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
448 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
449 relative_packet_arrival_delay(
450 "relativePacketArrivalDelay",
451 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200452 interruption_count("interruptionCount"),
453 total_interruption_duration("totalInterruptionDuration"),
Sergey Silkin02371062019-01-31 16:45:42 +0100454 freeze_count("freezeCount"),
455 pause_count("pauseCount"),
456 total_freezes_duration("totalFreezesDuration"),
457 total_pauses_duration("totalPausesDuration"),
458 total_frames_duration("totalFramesDuration"),
459 sum_squared_frame_durations("sumOfSquaredFramesDuration") {
hbos160e4a72017-01-17 02:53:23 -0800460 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
461 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800462}
463
464RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
465 const RTCMediaStreamTrackStats& other)
466 : RTCStats(other.id(), other.timestamp_us()),
467 track_identifier(other.track_identifier),
Henrik Boström646fda02019-05-22 15:49:42 +0200468 media_source_id(other.media_source_id),
hbos09bc1282016-11-08 06:29:22 -0800469 remote_source(other.remote_source),
470 ended(other.ended),
471 detached(other.detached),
hbos160e4a72017-01-17 02:53:23 -0800472 kind(other.kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200473 jitter_buffer_delay(other.jitter_buffer_delay),
Chen Xing0acffb52019-01-15 15:46:29 +0100474 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
hbos09bc1282016-11-08 06:29:22 -0800475 frame_width(other.frame_width),
476 frame_height(other.frame_height),
477 frames_per_second(other.frames_per_second),
478 frames_sent(other.frames_sent),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100479 huge_frames_sent(other.huge_frames_sent),
hbos09bc1282016-11-08 06:29:22 -0800480 frames_received(other.frames_received),
481 frames_decoded(other.frames_decoded),
482 frames_dropped(other.frames_dropped),
483 frames_corrupted(other.frames_corrupted),
484 partial_frames_lost(other.partial_frames_lost),
485 full_frames_lost(other.full_frames_lost),
486 audio_level(other.audio_level),
zsteine76bd3a2017-07-14 12:17:49 -0700487 total_audio_energy(other.total_audio_energy),
hbos09bc1282016-11-08 06:29:22 -0800488 echo_return_loss(other.echo_return_loss),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700489 echo_return_loss_enhancement(other.echo_return_loss_enhancement),
490 total_samples_received(other.total_samples_received),
491 total_samples_duration(other.total_samples_duration),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200492 concealed_samples(other.concealed_samples),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200493 silent_concealed_samples(other.silent_concealed_samples),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100494 concealment_events(other.concealment_events),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200495 inserted_samples_for_deceleration(
496 other.inserted_samples_for_deceleration),
497 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100498 jitter_buffer_flushes(other.jitter_buffer_flushes),
Sergey Silkin02371062019-01-31 16:45:42 +0100499 delayed_packet_outage_samples(other.delayed_packet_outage_samples),
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100500 relative_packet_arrival_delay(other.relative_packet_arrival_delay),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200501 interruption_count(other.interruption_count),
502 total_interruption_duration(other.total_interruption_duration),
Sergey Silkin02371062019-01-31 16:45:42 +0100503 freeze_count(other.freeze_count),
504 pause_count(other.pause_count),
505 total_freezes_duration(other.total_freezes_duration),
506 total_pauses_duration(other.total_pauses_duration),
507 total_frames_duration(other.total_frames_duration),
508 sum_squared_frame_durations(other.sum_squared_frame_durations) {}
hbos09bc1282016-11-08 06:29:22 -0800509
Yves Gerey665174f2018-06-19 15:03:05 +0200510RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {}
hbos09bc1282016-11-08 06:29:22 -0800511
Steve Antond6a5cbd2017-08-18 09:40:25 -0700512// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700513WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
514 &data_channels_opened,
Nico Weber22f99252019-02-20 10:13:16 -0500515 &data_channels_closed)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700516// clang-format on
hbosd565b732016-08-30 14:04:35 -0700517
Yves Gerey665174f2018-06-19 15:03:05 +0200518RTCPeerConnectionStats::RTCPeerConnectionStats(const std::string& id,
519 int64_t timestamp_us)
520 : RTCPeerConnectionStats(std::string(id), timestamp_us) {}
hbosd565b732016-08-30 14:04:35 -0700521
Yves Gerey665174f2018-06-19 15:03:05 +0200522RTCPeerConnectionStats::RTCPeerConnectionStats(std::string&& id,
523 int64_t timestamp_us)
hbos0e6758d2016-08-31 07:57:36 -0700524 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700525 data_channels_opened("dataChannelsOpened"),
Yves Gerey665174f2018-06-19 15:03:05 +0200526 data_channels_closed("dataChannelsClosed") {}
hbosd565b732016-08-30 14:04:35 -0700527
hbosfc5e0502016-10-06 02:06:10 -0700528RTCPeerConnectionStats::RTCPeerConnectionStats(
529 const RTCPeerConnectionStats& other)
530 : RTCStats(other.id(), other.timestamp_us()),
531 data_channels_opened(other.data_channels_opened),
Yves Gerey665174f2018-06-19 15:03:05 +0200532 data_channels_closed(other.data_channels_closed) {}
hbosfc5e0502016-10-06 02:06:10 -0700533
Yves Gerey665174f2018-06-19 15:03:05 +0200534RTCPeerConnectionStats::~RTCPeerConnectionStats() {}
hbosfc5e0502016-10-06 02:06:10 -0700535
Steve Antond6a5cbd2017-08-18 09:40:25 -0700536// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700537WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
538 &ssrc,
539 &associate_stats_id,
540 &is_remote,
541 &media_type,
Philipp Hancke3bc01662018-08-28 14:55:03 +0200542 &kind,
hbosb0ae9202017-01-27 06:35:16 -0800543 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700544 &transport_id,
545 &codec_id,
546 &fir_count,
547 &pli_count,
548 &nack_count,
hbos6769c492017-01-02 08:35:13 -0800549 &sli_count,
Nico Weber22f99252019-02-20 10:13:16 -0500550 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700551// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700552
Yves Gerey665174f2018-06-19 15:03:05 +0200553RTCRTPStreamStats::RTCRTPStreamStats(const std::string& id,
554 int64_t timestamp_us)
555 : RTCRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700556
Yves Gerey665174f2018-06-19 15:03:05 +0200557RTCRTPStreamStats::RTCRTPStreamStats(std::string&& id, int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700558 : RTCStats(std::move(id), timestamp_us),
559 ssrc("ssrc"),
560 associate_stats_id("associateStatsId"),
561 is_remote("isRemote", false),
562 media_type("mediaType"),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200563 kind("kind"),
hbosb0ae9202017-01-27 06:35:16 -0800564 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700565 transport_id("transportId"),
566 codec_id("codecId"),
567 fir_count("firCount"),
568 pli_count("pliCount"),
569 nack_count("nackCount"),
hbos6769c492017-01-02 08:35:13 -0800570 sli_count("sliCount"),
Yves Gerey665174f2018-06-19 15:03:05 +0200571 qp_sum("qpSum") {}
hbos6ded1902016-11-01 01:50:46 -0700572
Yves Gerey665174f2018-06-19 15:03:05 +0200573RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other)
hbos6ded1902016-11-01 01:50:46 -0700574 : RTCStats(other.id(), other.timestamp_us()),
575 ssrc(other.ssrc),
576 associate_stats_id(other.associate_stats_id),
577 is_remote(other.is_remote),
578 media_type(other.media_type),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200579 kind(other.kind),
hbosb0ae9202017-01-27 06:35:16 -0800580 track_id(other.track_id),
hbos6ded1902016-11-01 01:50:46 -0700581 transport_id(other.transport_id),
582 codec_id(other.codec_id),
583 fir_count(other.fir_count),
584 pli_count(other.pli_count),
585 nack_count(other.nack_count),
hbos6769c492017-01-02 08:35:13 -0800586 sli_count(other.sli_count),
Yves Gerey665174f2018-06-19 15:03:05 +0200587 qp_sum(other.qp_sum) {}
hbos6ded1902016-11-01 01:50:46 -0700588
Yves Gerey665174f2018-06-19 15:03:05 +0200589RTCRTPStreamStats::~RTCRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700590
Steve Antond6a5cbd2017-08-18 09:40:25 -0700591// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700592WEBRTC_RTCSTATS_IMPL(
hboseeafe942016-11-01 03:00:17 -0700593 RTCInboundRTPStreamStats, RTCRTPStreamStats, "inbound-rtp",
594 &packets_received,
595 &bytes_received,
596 &packets_lost,
Henrik Boström01738c62019-04-15 17:32:00 +0200597 &last_packet_received_timestamp,
hboseeafe942016-11-01 03:00:17 -0700598 &jitter,
599 &fraction_lost,
hbosa7a9be12017-03-01 01:02:45 -0800600 &round_trip_time,
hboseeafe942016-11-01 03:00:17 -0700601 &packets_discarded,
602 &packets_repaired,
603 &burst_packets_lost,
604 &burst_packets_discarded,
605 &burst_loss_count,
606 &burst_discard_count,
607 &burst_loss_rate,
608 &burst_discard_rate,
609 &gap_loss_rate,
hbos6769c492017-01-02 08:35:13 -0800610 &gap_discard_rate,
Henrik Boström2e069262019-04-09 13:59:31 +0200611 &frames_decoded,
612 &content_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700613// clang-format on
hboseeafe942016-11-01 03:00:17 -0700614
Yves Gerey665174f2018-06-19 15:03:05 +0200615RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
616 int64_t timestamp_us)
617 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {}
hboseeafe942016-11-01 03:00:17 -0700618
Yves Gerey665174f2018-06-19 15:03:05 +0200619RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
620 int64_t timestamp_us)
hboseeafe942016-11-01 03:00:17 -0700621 : RTCRTPStreamStats(std::move(id), timestamp_us),
622 packets_received("packetsReceived"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200623 fec_packets_received("fecPacketsReceived"),
624 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700625 bytes_received("bytesReceived"),
626 packets_lost("packetsLost"),
Henrik Boström01738c62019-04-15 17:32:00 +0200627 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
hboseeafe942016-11-01 03:00:17 -0700628 jitter("jitter"),
629 fraction_lost("fractionLost"),
hbosa7a9be12017-03-01 01:02:45 -0800630 round_trip_time("roundTripTime"),
hboseeafe942016-11-01 03:00:17 -0700631 packets_discarded("packetsDiscarded"),
632 packets_repaired("packetsRepaired"),
633 burst_packets_lost("burstPacketsLost"),
634 burst_packets_discarded("burstPacketsDiscarded"),
635 burst_loss_count("burstLossCount"),
636 burst_discard_count("burstDiscardCount"),
637 burst_loss_rate("burstLossRate"),
638 burst_discard_rate("burstDiscardRate"),
639 gap_loss_rate("gapLossRate"),
hbos6769c492017-01-02 08:35:13 -0800640 gap_discard_rate("gapDiscardRate"),
Henrik Boström2e069262019-04-09 13:59:31 +0200641 frames_decoded("framesDecoded"),
642 content_type("contentType") {}
hboseeafe942016-11-01 03:00:17 -0700643
644RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
645 const RTCInboundRTPStreamStats& other)
646 : RTCRTPStreamStats(other),
647 packets_received(other.packets_received),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200648 fec_packets_received(other.fec_packets_received),
649 fec_packets_discarded(other.fec_packets_discarded),
hboseeafe942016-11-01 03:00:17 -0700650 bytes_received(other.bytes_received),
651 packets_lost(other.packets_lost),
Henrik Boström01738c62019-04-15 17:32:00 +0200652 last_packet_received_timestamp(other.last_packet_received_timestamp),
hboseeafe942016-11-01 03:00:17 -0700653 jitter(other.jitter),
654 fraction_lost(other.fraction_lost),
hbosa7a9be12017-03-01 01:02:45 -0800655 round_trip_time(other.round_trip_time),
hboseeafe942016-11-01 03:00:17 -0700656 packets_discarded(other.packets_discarded),
657 packets_repaired(other.packets_repaired),
658 burst_packets_lost(other.burst_packets_lost),
659 burst_packets_discarded(other.burst_packets_discarded),
660 burst_loss_count(other.burst_loss_count),
661 burst_discard_count(other.burst_discard_count),
662 burst_loss_rate(other.burst_loss_rate),
663 burst_discard_rate(other.burst_discard_rate),
664 gap_loss_rate(other.gap_loss_rate),
hbos6769c492017-01-02 08:35:13 -0800665 gap_discard_rate(other.gap_discard_rate),
Henrik Boström2e069262019-04-09 13:59:31 +0200666 frames_decoded(other.frames_decoded),
667 content_type(other.content_type) {}
hboseeafe942016-11-01 03:00:17 -0700668
Yves Gerey665174f2018-06-19 15:03:05 +0200669RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700670
Steve Antond6a5cbd2017-08-18 09:40:25 -0700671// clang-format off
hboseeafe942016-11-01 03:00:17 -0700672WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700673 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200674 &media_source_id,
hbos6ded1902016-11-01 01:50:46 -0700675 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200676 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700677 &bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200678 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700679 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200680 &frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200681 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200682 &total_encoded_bytes_target,
Henrik Boström9fe18342019-05-16 18:38:20 +0200683 &total_packet_send_delay,
Henrik Boström2e069262019-04-09 13:59:31 +0200684 &content_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700685// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700686
Yves Gerey665174f2018-06-19 15:03:05 +0200687RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id,
688 int64_t timestamp_us)
689 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700690
Yves Gerey665174f2018-06-19 15:03:05 +0200691RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id,
692 int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700693 : RTCRTPStreamStats(std::move(id), timestamp_us),
Henrik Boström646fda02019-05-22 15:49:42 +0200694 media_source_id("mediaSourceId"),
hbos6ded1902016-11-01 01:50:46 -0700695 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200696 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700697 bytes_sent("bytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200698 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700699 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200700 frames_encoded("framesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200701 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200702 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200703 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boström2e069262019-04-09 13:59:31 +0200704 content_type("contentType") {}
hbos6ded1902016-11-01 01:50:46 -0700705
706RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
707 const RTCOutboundRTPStreamStats& other)
708 : RTCRTPStreamStats(other),
Henrik Boström646fda02019-05-22 15:49:42 +0200709 media_source_id(other.media_source_id),
hbos6ded1902016-11-01 01:50:46 -0700710 packets_sent(other.packets_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200711 retransmitted_packets_sent(other.retransmitted_packets_sent),
hbos6ded1902016-11-01 01:50:46 -0700712 bytes_sent(other.bytes_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200713 retransmitted_bytes_sent(other.retransmitted_bytes_sent),
hbos6ded1902016-11-01 01:50:46 -0700714 target_bitrate(other.target_bitrate),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200715 frames_encoded(other.frames_encoded),
Henrik Boström2e069262019-04-09 13:59:31 +0200716 total_encode_time(other.total_encode_time),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200717 total_encoded_bytes_target(other.total_encoded_bytes_target),
Henrik Boström9fe18342019-05-16 18:38:20 +0200718 total_packet_send_delay(other.total_packet_send_delay),
Henrik Boström2e069262019-04-09 13:59:31 +0200719 content_type(other.content_type) {}
hbos6ded1902016-11-01 01:50:46 -0700720
Yves Gerey665174f2018-06-19 15:03:05 +0200721RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700722
Steve Antond6a5cbd2017-08-18 09:40:25 -0700723// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +0200724WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
725 &track_identifier,
726 &kind)
727// clang-format on
728
729RTCMediaSourceStats::RTCMediaSourceStats(const std::string& id,
730 int64_t timestamp_us)
731 : RTCMediaSourceStats(std::string(id), timestamp_us) {}
732
733RTCMediaSourceStats::RTCMediaSourceStats(std::string&& id, int64_t timestamp_us)
734 : RTCStats(std::move(id), timestamp_us),
735 track_identifier("trackIdentifier"),
736 kind("kind") {}
737
738RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other)
739 : RTCStats(other.id(), other.timestamp_us()),
740 track_identifier(other.track_identifier),
741 kind(other.kind) {}
742
743RTCMediaSourceStats::~RTCMediaSourceStats() {}
744
745// clang-format off
746WEBRTC_RTCSTATS_IMPL_NO_MEMBERS(
747 RTCAudioSourceStats, RTCMediaSourceStats, "media-source")
748// clang-format on
749
750RTCAudioSourceStats::RTCAudioSourceStats(const std::string& id,
751 int64_t timestamp_us)
752 : RTCAudioSourceStats(std::string(id), timestamp_us) {}
753
754RTCAudioSourceStats::RTCAudioSourceStats(std::string&& id, int64_t timestamp_us)
755 : RTCMediaSourceStats(std::move(id), timestamp_us) {}
756
757RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other)
758 : RTCMediaSourceStats(other) {}
759
760RTCAudioSourceStats::~RTCAudioSourceStats() {}
761
762// clang-format off
763WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
764 &width,
765 &height,
766 &frames,
767 &frames_per_second)
768// clang-format on
769
770RTCVideoSourceStats::RTCVideoSourceStats(const std::string& id,
771 int64_t timestamp_us)
772 : RTCVideoSourceStats(std::string(id), timestamp_us) {}
773
774RTCVideoSourceStats::RTCVideoSourceStats(std::string&& id, int64_t timestamp_us)
775 : RTCMediaSourceStats(std::move(id), timestamp_us),
776 width("width"),
777 height("height"),
778 frames("frames"),
779 frames_per_second("framesPerSecond") {}
780
781RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other)
782 : RTCMediaSourceStats(other),
783 width(other.width),
784 height(other.height),
785 frames(other.frames),
786 frames_per_second(other.frames_per_second) {}
787
788RTCVideoSourceStats::~RTCVideoSourceStats() {}
789
790// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700791WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
792 &bytes_sent,
793 &bytes_received,
794 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -0800795 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -0700796 &selected_candidate_pair_id,
797 &local_certificate_id,
Nico Weber22f99252019-02-20 10:13:16 -0500798 &remote_certificate_id)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700799// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700800
Yves Gerey665174f2018-06-19 15:03:05 +0200801RTCTransportStats::RTCTransportStats(const std::string& id,
802 int64_t timestamp_us)
803 : RTCTransportStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -0700804
Yves Gerey665174f2018-06-19 15:03:05 +0200805RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -0700806 : RTCStats(std::move(id), timestamp_us),
807 bytes_sent("bytesSent"),
808 bytes_received("bytesReceived"),
809 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -0800810 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -0700811 selected_candidate_pair_id("selectedCandidatePairId"),
812 local_certificate_id("localCertificateId"),
Yves Gerey665174f2018-06-19 15:03:05 +0200813 remote_certificate_id("remoteCertificateId") {}
hbos2fa7c672016-10-24 04:00:05 -0700814
Yves Gerey665174f2018-06-19 15:03:05 +0200815RTCTransportStats::RTCTransportStats(const RTCTransportStats& other)
hbos2fa7c672016-10-24 04:00:05 -0700816 : RTCStats(other.id(), other.timestamp_us()),
817 bytes_sent(other.bytes_sent),
818 bytes_received(other.bytes_received),
819 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -0800820 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -0700821 selected_candidate_pair_id(other.selected_candidate_pair_id),
822 local_certificate_id(other.local_certificate_id),
Yves Gerey665174f2018-06-19 15:03:05 +0200823 remote_certificate_id(other.remote_certificate_id) {}
hbos2fa7c672016-10-24 04:00:05 -0700824
Yves Gerey665174f2018-06-19 15:03:05 +0200825RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700826
hbosd565b732016-08-30 14:04:35 -0700827} // namespace webrtc