blob: d2c6a6b7e4a97fc700fd9773b82539694ac0d093 [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
Jakob Ivarsson758d9462019-03-19 15:38:49 +010015#include "api/stats/rtc_stats.h"
Jonas Olssona4d87372019-07-05 19:08:33 +020016#include "rtc_base/checks.h"
Jakob Ivarsson758d9462019-03-19 15:38:49 +010017
hbosd565b732016-08-30 14:04:35 -070018namespace webrtc {
19
agrieve26622d32017-08-08 10:48:15 -070020const char* const RTCDataChannelState::kConnecting = "connecting";
21const char* const RTCDataChannelState::kOpen = "open";
22const char* const RTCDataChannelState::kClosing = "closing";
23const char* const RTCDataChannelState::kClosed = "closed";
hboscc555c52016-10-18 12:48:31 -070024
agrieve26622d32017-08-08 10:48:15 -070025const char* const RTCStatsIceCandidatePairState::kFrozen = "frozen";
26const char* const RTCStatsIceCandidatePairState::kWaiting = "waiting";
27const char* const RTCStatsIceCandidatePairState::kInProgress = "in-progress";
28const char* const RTCStatsIceCandidatePairState::kFailed = "failed";
29const char* const RTCStatsIceCandidatePairState::kSucceeded = "succeeded";
hbosc47a0c32016-10-11 14:54:49 -070030
31// Strings defined in https://tools.ietf.org/html/rfc5245.
agrieve26622d32017-08-08 10:48:15 -070032const char* const RTCIceCandidateType::kHost = "host";
33const char* const RTCIceCandidateType::kSrflx = "srflx";
34const char* const RTCIceCandidateType::kPrflx = "prflx";
35const char* const RTCIceCandidateType::kRelay = "relay";
hbosab9f6e42016-10-07 02:18:47 -070036
agrieve26622d32017-08-08 10:48:15 -070037const char* const RTCDtlsTransportState::kNew = "new";
38const char* const RTCDtlsTransportState::kConnecting = "connecting";
39const char* const RTCDtlsTransportState::kConnected = "connected";
40const char* const RTCDtlsTransportState::kClosed = "closed";
41const char* const RTCDtlsTransportState::kFailed = "failed";
hbos7064d592017-01-16 07:38:02 -080042
agrieve26622d32017-08-08 10:48:15 -070043const char* const RTCMediaStreamTrackKind::kAudio = "audio";
44const char* const RTCMediaStreamTrackKind::kVideo = "video";
hbos160e4a72017-01-17 02:53:23 -080045
Gary Liu37e489c2017-11-21 10:49:36 -080046// https://w3c.github.io/webrtc-stats/#dom-rtcnetworktype
47const char* const RTCNetworkType::kBluetooth = "bluetooth";
48const char* const RTCNetworkType::kCellular = "cellular";
49const char* const RTCNetworkType::kEthernet = "ethernet";
50const char* const RTCNetworkType::kWifi = "wifi";
51const char* const RTCNetworkType::kWimax = "wimax";
52const char* const RTCNetworkType::kVpn = "vpn";
53const char* const RTCNetworkType::kUnknown = "unknown";
54
Henrik Boströmce33b6a2019-05-28 17:42:38 +020055// https://w3c.github.io/webrtc-stats/#dom-rtcqualitylimitationreason
56const char* const RTCQualityLimitationReason::kNone = "none";
57const char* const RTCQualityLimitationReason::kCpu = "cpu";
58const char* const RTCQualityLimitationReason::kBandwidth = "bandwidth";
59const char* const RTCQualityLimitationReason::kOther = "other";
60
Henrik Boström2e069262019-04-09 13:59:31 +020061// https://webrtc.org/experiments/rtp-hdrext/video-content-type/
62const char* const RTCContentType::kUnspecified = "unspecified";
63const char* const RTCContentType::kScreenshare = "screenshare";
64
Philipp Hancke69c1df22022-04-22 15:46:24 +020065// https://w3c.github.io/webrtc-stats/#dom-rtcdtlsrole
66const char* const RTCDtlsRole::kUnknown = "unknown";
67const char* const RTCDtlsRole::kClient = "client";
68const char* const RTCDtlsRole::kServer = "server";
69
Philipp Hanckecc1b9b02022-05-04 18:58:26 +020070// https://www.w3.org/TR/webrtc/#rtcicerole
71const char* const RTCIceRole::kUnknown = "unknown";
72const char* const RTCIceRole::kControlled = "controlled";
73const char* const RTCIceRole::kControlling = "controlling";
74
Philipp Hancke1f491572022-05-09 17:43:31 +020075// https://www.w3.org/TR/webrtc/#dom-rtcicetransportstate
76const char* const RTCIceTransportState::kNew = "new";
77const char* const RTCIceTransportState::kChecking = "checking";
78const char* const RTCIceTransportState::kConnected = "connected";
79const char* const RTCIceTransportState::kCompleted = "completed";
80const char* const RTCIceTransportState::kDisconnected = "disconnected";
81const char* const RTCIceTransportState::kFailed = "failed";
82const char* const RTCIceTransportState::kClosed = "closed";
83
Steve Antond6a5cbd2017-08-18 09:40:25 -070084// clang-format off
hbos2fa7c672016-10-24 04:00:05 -070085WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate",
86 &fingerprint,
87 &fingerprint_algorithm,
88 &base64_certificate,
Nico Weber22f99252019-02-20 10:13:16 -050089 &issuer_certificate_id)
Steve Antond6a5cbd2017-08-18 09:40:25 -070090// clang-format on
hbos2fa7c672016-10-24 04:00:05 -070091
Yves Gerey665174f2018-06-19 15:03:05 +020092RTCCertificateStats::RTCCertificateStats(const std::string& id,
93 int64_t timestamp_us)
94 : RTCCertificateStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -070095
Yves Gerey665174f2018-06-19 15:03:05 +020096RTCCertificateStats::RTCCertificateStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -070097 : RTCStats(std::move(id), timestamp_us),
98 fingerprint("fingerprint"),
99 fingerprint_algorithm("fingerprintAlgorithm"),
100 base64_certificate("base64Certificate"),
Yves Gerey665174f2018-06-19 15:03:05 +0200101 issuer_certificate_id("issuerCertificateId") {}
hbos2fa7c672016-10-24 04:00:05 -0700102
Yves Gerey665174f2018-06-19 15:03:05 +0200103RTCCertificateStats::RTCCertificateStats(const RTCCertificateStats& other)
hbos2fa7c672016-10-24 04:00:05 -0700104 : RTCStats(other.id(), other.timestamp_us()),
105 fingerprint(other.fingerprint),
106 fingerprint_algorithm(other.fingerprint_algorithm),
107 base64_certificate(other.base64_certificate),
Yves Gerey665174f2018-06-19 15:03:05 +0200108 issuer_certificate_id(other.issuer_certificate_id) {}
hbos2fa7c672016-10-24 04:00:05 -0700109
Yves Gerey665174f2018-06-19 15:03:05 +0200110RTCCertificateStats::~RTCCertificateStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700111
Steve Antond6a5cbd2017-08-18 09:40:25 -0700112// clang-format off
hbos0adb8282016-11-23 02:32:06 -0800113WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec",
Philipp Hancke95157a02020-11-16 20:08:27 +0100114 &transport_id,
hbos0adb8282016-11-23 02:32:06 -0800115 &payload_type,
hbos13f54b22017-02-28 06:56:04 -0800116 &mime_type,
hbos0adb8282016-11-23 02:32:06 -0800117 &clock_rate,
118 &channels,
Henrik Boström6b430862019-08-16 13:09:51 +0200119 &sdp_fmtp_line)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700120// clang-format on
hbos0adb8282016-11-23 02:32:06 -0800121
Yves Gerey665174f2018-06-19 15:03:05 +0200122RTCCodecStats::RTCCodecStats(const std::string& id, int64_t timestamp_us)
123 : RTCCodecStats(std::string(id), timestamp_us) {}
hbos0adb8282016-11-23 02:32:06 -0800124
Yves Gerey665174f2018-06-19 15:03:05 +0200125RTCCodecStats::RTCCodecStats(std::string&& id, int64_t timestamp_us)
hbos0adb8282016-11-23 02:32:06 -0800126 : RTCStats(std::move(id), timestamp_us),
Philipp Hancke95157a02020-11-16 20:08:27 +0100127 transport_id("transportId"),
hbos0adb8282016-11-23 02:32:06 -0800128 payload_type("payloadType"),
hbos13f54b22017-02-28 06:56:04 -0800129 mime_type("mimeType"),
hbos0adb8282016-11-23 02:32:06 -0800130 clock_rate("clockRate"),
131 channels("channels"),
Henrik Boström6b430862019-08-16 13:09:51 +0200132 sdp_fmtp_line("sdpFmtpLine") {}
hbos0adb8282016-11-23 02:32:06 -0800133
Yves Gerey665174f2018-06-19 15:03:05 +0200134RTCCodecStats::RTCCodecStats(const RTCCodecStats& other)
hbos0adb8282016-11-23 02:32:06 -0800135 : RTCStats(other.id(), other.timestamp_us()),
Philipp Hancke95157a02020-11-16 20:08:27 +0100136 transport_id(other.transport_id),
hbos0adb8282016-11-23 02:32:06 -0800137 payload_type(other.payload_type),
hbos13f54b22017-02-28 06:56:04 -0800138 mime_type(other.mime_type),
hbos0adb8282016-11-23 02:32:06 -0800139 clock_rate(other.clock_rate),
140 channels(other.channels),
Henrik Boström6b430862019-08-16 13:09:51 +0200141 sdp_fmtp_line(other.sdp_fmtp_line) {}
hbos0adb8282016-11-23 02:32:06 -0800142
Yves Gerey665174f2018-06-19 15:03:05 +0200143RTCCodecStats::~RTCCodecStats() {}
hbos0adb8282016-11-23 02:32:06 -0800144
Steve Antond6a5cbd2017-08-18 09:40:25 -0700145// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700146WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel",
147 &label,
148 &protocol,
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200149 &data_channel_identifier,
hbos2fa7c672016-10-24 04:00:05 -0700150 &state,
151 &messages_sent,
152 &bytes_sent,
153 &messages_received,
Nico Weber22f99252019-02-20 10:13:16 -0500154 &bytes_received)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700155// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700156
Yves Gerey665174f2018-06-19 15:03:05 +0200157RTCDataChannelStats::RTCDataChannelStats(const std::string& id,
158 int64_t timestamp_us)
159 : RTCDataChannelStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -0700160
Yves Gerey665174f2018-06-19 15:03:05 +0200161RTCDataChannelStats::RTCDataChannelStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -0700162 : RTCStats(std::move(id), timestamp_us),
163 label("label"),
164 protocol("protocol"),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200165 data_channel_identifier("dataChannelIdentifier"),
hbos2fa7c672016-10-24 04:00:05 -0700166 state("state"),
167 messages_sent("messagesSent"),
168 bytes_sent("bytesSent"),
169 messages_received("messagesReceived"),
Yves Gerey665174f2018-06-19 15:03:05 +0200170 bytes_received("bytesReceived") {}
hbos2fa7c672016-10-24 04:00:05 -0700171
Yves Gerey665174f2018-06-19 15:03:05 +0200172RTCDataChannelStats::RTCDataChannelStats(const RTCDataChannelStats& other)
hbos2fa7c672016-10-24 04:00:05 -0700173 : RTCStats(other.id(), other.timestamp_us()),
174 label(other.label),
175 protocol(other.protocol),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200176 data_channel_identifier(other.data_channel_identifier),
hbos2fa7c672016-10-24 04:00:05 -0700177 state(other.state),
178 messages_sent(other.messages_sent),
179 bytes_sent(other.bytes_sent),
180 messages_received(other.messages_received),
Yves Gerey665174f2018-06-19 15:03:05 +0200181 bytes_received(other.bytes_received) {}
hbos2fa7c672016-10-24 04:00:05 -0700182
Yves Gerey665174f2018-06-19 15:03:05 +0200183RTCDataChannelStats::~RTCDataChannelStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700184
Steve Antond6a5cbd2017-08-18 09:40:25 -0700185// clang-format off
hbosc47a0c32016-10-11 14:54:49 -0700186WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair",
187 &transport_id,
188 &local_candidate_id,
189 &remote_candidate_id,
190 &state,
191 &priority,
192 &nominated,
193 &writable,
194 &readable,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700195 &packets_sent,
196 &packets_received,
hbosc47a0c32016-10-11 14:54:49 -0700197 &bytes_sent,
198 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800199 &total_round_trip_time,
200 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700201 &available_outgoing_bitrate,
202 &available_incoming_bitrate,
203 &requests_received,
204 &requests_sent,
205 &responses_received,
206 &responses_sent,
207 &retransmissions_received,
208 &retransmissions_sent,
209 &consent_requests_received,
210 &consent_requests_sent,
211 &consent_responses_received,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700212 &consent_responses_sent,
213 &packets_discarded_on_send,
214 &bytes_discarded_on_send)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700215// clang-format on
hbosc47a0c32016-10-11 14:54:49 -0700216
Yves Gerey665174f2018-06-19 15:03:05 +0200217RTCIceCandidatePairStats::RTCIceCandidatePairStats(const std::string& id,
218 int64_t timestamp_us)
219 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {}
hbosc47a0c32016-10-11 14:54:49 -0700220
Yves Gerey665174f2018-06-19 15:03:05 +0200221RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string&& id,
222 int64_t timestamp_us)
hbosc47a0c32016-10-11 14:54:49 -0700223 : RTCStats(std::move(id), timestamp_us),
224 transport_id("transportId"),
225 local_candidate_id("localCandidateId"),
226 remote_candidate_id("remoteCandidateId"),
227 state("state"),
228 priority("priority"),
229 nominated("nominated"),
230 writable("writable"),
231 readable("readable"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700232 packets_sent("packetsSent"),
233 packets_received("packetsReceived"),
hbosc47a0c32016-10-11 14:54:49 -0700234 bytes_sent("bytesSent"),
235 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800236 total_round_trip_time("totalRoundTripTime"),
237 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700238 available_outgoing_bitrate("availableOutgoingBitrate"),
239 available_incoming_bitrate("availableIncomingBitrate"),
240 requests_received("requestsReceived"),
241 requests_sent("requestsSent"),
242 responses_received("responsesReceived"),
243 responses_sent("responsesSent"),
244 retransmissions_received("retransmissionsReceived"),
245 retransmissions_sent("retransmissionsSent"),
246 consent_requests_received("consentRequestsReceived"),
247 consent_requests_sent("consentRequestsSent"),
248 consent_responses_received("consentResponsesReceived"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700249 consent_responses_sent("consentResponsesSent"),
250 packets_discarded_on_send("packetsDiscardedOnSend"),
251 bytes_discarded_on_send("bytesDiscardedOnSend") {}
hbosc47a0c32016-10-11 14:54:49 -0700252
253RTCIceCandidatePairStats::RTCIceCandidatePairStats(
254 const RTCIceCandidatePairStats& other)
255 : RTCStats(other.id(), other.timestamp_us()),
256 transport_id(other.transport_id),
257 local_candidate_id(other.local_candidate_id),
258 remote_candidate_id(other.remote_candidate_id),
259 state(other.state),
260 priority(other.priority),
261 nominated(other.nominated),
262 writable(other.writable),
263 readable(other.readable),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700264 packets_sent(other.packets_sent),
265 packets_received(other.packets_received),
hbosc47a0c32016-10-11 14:54:49 -0700266 bytes_sent(other.bytes_sent),
267 bytes_received(other.bytes_received),
hbos3168c7a2016-12-15 06:17:08 -0800268 total_round_trip_time(other.total_round_trip_time),
269 current_round_trip_time(other.current_round_trip_time),
hbosc47a0c32016-10-11 14:54:49 -0700270 available_outgoing_bitrate(other.available_outgoing_bitrate),
271 available_incoming_bitrate(other.available_incoming_bitrate),
272 requests_received(other.requests_received),
273 requests_sent(other.requests_sent),
274 responses_received(other.responses_received),
275 responses_sent(other.responses_sent),
276 retransmissions_received(other.retransmissions_received),
277 retransmissions_sent(other.retransmissions_sent),
278 consent_requests_received(other.consent_requests_received),
279 consent_requests_sent(other.consent_requests_sent),
280 consent_responses_received(other.consent_responses_received),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700281 consent_responses_sent(other.consent_responses_sent),
282 packets_discarded_on_send(other.packets_discarded_on_send),
283 bytes_discarded_on_send(other.bytes_discarded_on_send) {}
hbosc47a0c32016-10-11 14:54:49 -0700284
Yves Gerey665174f2018-06-19 15:03:05 +0200285RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {}
hbosc47a0c32016-10-11 14:54:49 -0700286
Steve Antond6a5cbd2017-08-18 09:40:25 -0700287// clang-format off
Henrik Boström1df1bf82018-03-20 13:24:20 +0100288WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800289 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800290 &is_remote,
Gary Liu37e489c2017-11-21 10:49:36 -0800291 &network_type,
hbosab9f6e42016-10-07 02:18:47 -0700292 &ip,
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100293 &address,
hbosab9f6e42016-10-07 02:18:47 -0700294 &port,
295 &protocol,
Philipp Hancke95513752018-09-27 14:40:08 +0200296 &relay_protocol,
hbosab9f6e42016-10-07 02:18:47 -0700297 &candidate_type,
298 &priority,
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100299 &url,
300 &vpn,
301 &network_adapter_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700302// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700303
Yves Gerey665174f2018-06-19 15:03:05 +0200304RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id,
305 int64_t timestamp_us,
306 bool is_remote)
307 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {}
hbosab9f6e42016-10-07 02:18:47 -0700308
Gary Liu37e489c2017-11-21 10:49:36 -0800309RTCIceCandidateStats::RTCIceCandidateStats(std::string&& id,
310 int64_t timestamp_us,
311 bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700312 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800313 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800314 is_remote("isRemote", is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800315 network_type("networkType"),
hbosab9f6e42016-10-07 02:18:47 -0700316 ip("ip"),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100317 address("address"),
hbosab9f6e42016-10-07 02:18:47 -0700318 port("port"),
319 protocol("protocol"),
Philipp Hancke95513752018-09-27 14:40:08 +0200320 relay_protocol("relayProtocol"),
hbosab9f6e42016-10-07 02:18:47 -0700321 candidate_type("candidateType"),
322 priority("priority"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100323 url("url"),
324 vpn("vpn"),
325 network_adapter_type("networkAdapterType") {}
hbosab9f6e42016-10-07 02:18:47 -0700326
327RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
328 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800329 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800330 is_remote(other.is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800331 network_type(other.network_type),
hbosab9f6e42016-10-07 02:18:47 -0700332 ip(other.ip),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100333 address(other.address),
hbosab9f6e42016-10-07 02:18:47 -0700334 port(other.port),
335 protocol(other.protocol),
Philipp Hancke95513752018-09-27 14:40:08 +0200336 relay_protocol(other.relay_protocol),
hbosab9f6e42016-10-07 02:18:47 -0700337 candidate_type(other.candidate_type),
338 priority(other.priority),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100339 url(other.url),
340 vpn(other.vpn),
341 network_adapter_type(other.network_adapter_type) {}
hbosab9f6e42016-10-07 02:18:47 -0700342
Yves Gerey665174f2018-06-19 15:03:05 +0200343RTCIceCandidateStats::~RTCIceCandidateStats() {}
hbosab9f6e42016-10-07 02:18:47 -0700344
345const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
346
Yves Gerey665174f2018-06-19 15:03:05 +0200347RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(const std::string& id,
348 int64_t timestamp_us)
349 : RTCIceCandidateStats(id, timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700350
Yves Gerey665174f2018-06-19 15:03:05 +0200351RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string&& id,
352 int64_t timestamp_us)
353 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700354
Henrik Boström1df1bf82018-03-20 13:24:20 +0100355std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const {
356 return std::unique_ptr<RTCStats>(new RTCLocalIceCandidateStats(*this));
357}
358
hbosab9f6e42016-10-07 02:18:47 -0700359const char* RTCLocalIceCandidateStats::type() const {
360 return kType;
361}
362
363const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
364
Yves Gerey665174f2018-06-19 15:03:05 +0200365RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(const std::string& id,
366 int64_t timestamp_us)
367 : RTCIceCandidateStats(id, timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700368
Yves Gerey665174f2018-06-19 15:03:05 +0200369RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string&& id,
370 int64_t timestamp_us)
371 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700372
Henrik Boström1df1bf82018-03-20 13:24:20 +0100373std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const {
374 return std::unique_ptr<RTCStats>(new RTCRemoteIceCandidateStats(*this));
375}
376
hbosab9f6e42016-10-07 02:18:47 -0700377const char* RTCRemoteIceCandidateStats::type() const {
378 return kType;
379}
380
Steve Antond6a5cbd2017-08-18 09:40:25 -0700381// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800382WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
383 &stream_identifier,
Nico Weber22f99252019-02-20 10:13:16 -0500384 &track_ids)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700385// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800386
Yves Gerey665174f2018-06-19 15:03:05 +0200387RTCMediaStreamStats::RTCMediaStreamStats(const std::string& id,
388 int64_t timestamp_us)
389 : RTCMediaStreamStats(std::string(id), timestamp_us) {}
hbos09bc1282016-11-08 06:29:22 -0800390
Yves Gerey665174f2018-06-19 15:03:05 +0200391RTCMediaStreamStats::RTCMediaStreamStats(std::string&& id, int64_t timestamp_us)
hbos09bc1282016-11-08 06:29:22 -0800392 : RTCStats(std::move(id), timestamp_us),
393 stream_identifier("streamIdentifier"),
Yves Gerey665174f2018-06-19 15:03:05 +0200394 track_ids("trackIds") {}
hbos09bc1282016-11-08 06:29:22 -0800395
Yves Gerey665174f2018-06-19 15:03:05 +0200396RTCMediaStreamStats::RTCMediaStreamStats(const RTCMediaStreamStats& other)
hbos09bc1282016-11-08 06:29:22 -0800397 : RTCStats(other.id(), other.timestamp_us()),
398 stream_identifier(other.stream_identifier),
Yves Gerey665174f2018-06-19 15:03:05 +0200399 track_ids(other.track_ids) {}
hbos09bc1282016-11-08 06:29:22 -0800400
Yves Gerey665174f2018-06-19 15:03:05 +0200401RTCMediaStreamStats::~RTCMediaStreamStats() {}
hbos09bc1282016-11-08 06:29:22 -0800402
Steve Antond6a5cbd2017-08-18 09:40:25 -0700403// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800404WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
zsteine76bd3a2017-07-14 12:17:49 -0700405 &track_identifier,
Henrik Boström646fda02019-05-22 15:49:42 +0200406 &media_source_id,
zsteine76bd3a2017-07-14 12:17:49 -0700407 &remote_source,
408 &ended,
409 &detached,
410 &kind,
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200411 &jitter_buffer_delay,
Chen Xing0acffb52019-01-15 15:46:29 +0100412 &jitter_buffer_emitted_count,
zsteine76bd3a2017-07-14 12:17:49 -0700413 &frame_width,
414 &frame_height,
415 &frames_per_second,
416 &frames_sent,
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100417 &huge_frames_sent,
zsteine76bd3a2017-07-14 12:17:49 -0700418 &frames_received,
419 &frames_decoded,
420 &frames_dropped,
421 &frames_corrupted,
422 &partial_frames_lost,
423 &full_frames_lost,
424 &audio_level,
425 &total_audio_energy,
zsteine76bd3a2017-07-14 12:17:49 -0700426 &echo_return_loss,
Steve Anton2dbc69f2017-08-24 17:15:13 -0700427 &echo_return_loss_enhancement,
428 &total_samples_received,
429 &total_samples_duration,
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200430 &concealed_samples,
Henrik Boström21e99da2019-08-21 12:09:51 +0200431 &silent_concealed_samples,
Ruslan Burakov8af88962018-11-22 17:21:10 +0100432 &concealment_events,
Henrik Boström21e99da2019-08-21 12:09:51 +0200433 &inserted_samples_for_deceleration,
434 &removed_samples_for_acceleration,
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100435 &jitter_buffer_flushes,
Sergey Silkin02371062019-01-31 16:45:42 +0100436 &delayed_packet_outage_samples,
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100437 &relative_packet_arrival_delay,
Artem Titove618cc92020-03-11 11:18:54 +0100438 &jitter_buffer_target_delay,
Henrik Lundin44125fa2019-04-29 17:00:46 +0200439 &interruption_count,
440 &total_interruption_duration,
Sergey Silkin02371062019-01-31 16:45:42 +0100441 &freeze_count,
442 &pause_count,
443 &total_freezes_duration,
444 &total_pauses_duration,
445 &total_frames_duration,
Nico Weber22f99252019-02-20 10:13:16 -0500446 &sum_squared_frame_durations)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700447// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800448
Yves Gerey665174f2018-06-19 15:03:05 +0200449RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(const std::string& id,
450 int64_t timestamp_us,
451 const char* kind)
452 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {}
hbos09bc1282016-11-08 06:29:22 -0800453
zsteine76bd3a2017-07-14 12:17:49 -0700454RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(std::string&& id,
455 int64_t timestamp_us,
456 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800457 : RTCStats(std::move(id), timestamp_us),
458 track_identifier("trackIdentifier"),
Henrik Boström646fda02019-05-22 15:49:42 +0200459 media_source_id("mediaSourceId"),
hbos09bc1282016-11-08 06:29:22 -0800460 remote_source("remoteSource"),
461 ended("ended"),
462 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800463 kind("kind", kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200464 jitter_buffer_delay("jitterBufferDelay"),
Chen Xing0acffb52019-01-15 15:46:29 +0100465 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
hbos09bc1282016-11-08 06:29:22 -0800466 frame_width("frameWidth"),
467 frame_height("frameHeight"),
468 frames_per_second("framesPerSecond"),
469 frames_sent("framesSent"),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100470 huge_frames_sent("hugeFramesSent"),
hbos09bc1282016-11-08 06:29:22 -0800471 frames_received("framesReceived"),
472 frames_decoded("framesDecoded"),
473 frames_dropped("framesDropped"),
474 frames_corrupted("framesCorrupted"),
475 partial_frames_lost("partialFramesLost"),
476 full_frames_lost("fullFramesLost"),
477 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700478 total_audio_energy("totalAudioEnergy"),
hbos09bc1282016-11-08 06:29:22 -0800479 echo_return_loss("echoReturnLoss"),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700480 echo_return_loss_enhancement("echoReturnLossEnhancement"),
481 total_samples_received("totalSamplesReceived"),
482 total_samples_duration("totalSamplesDuration"),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200483 concealed_samples("concealedSamples"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200484 silent_concealed_samples("silentConcealedSamples"),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100485 concealment_events("concealmentEvents"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200486 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
487 removed_samples_for_acceleration("removedSamplesForAcceleration"),
Jakob Ivarsson758d9462019-03-19 15:38:49 +0100488 jitter_buffer_flushes(
489 "jitterBufferFlushes",
490 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
491 delayed_packet_outage_samples(
492 "delayedPacketOutageSamples",
493 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
494 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
495 relative_packet_arrival_delay(
496 "relativePacketArrivalDelay",
497 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
Artem Titove618cc92020-03-11 11:18:54 +0100498 jitter_buffer_target_delay("jitterBufferTargetDelay"),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200499 interruption_count("interruptionCount"),
500 total_interruption_duration("totalInterruptionDuration"),
Sergey Silkin02371062019-01-31 16:45:42 +0100501 freeze_count("freezeCount"),
502 pause_count("pauseCount"),
503 total_freezes_duration("totalFreezesDuration"),
504 total_pauses_duration("totalPausesDuration"),
505 total_frames_duration("totalFramesDuration"),
506 sum_squared_frame_durations("sumOfSquaredFramesDuration") {
hbos160e4a72017-01-17 02:53:23 -0800507 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
508 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800509}
510
511RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
512 const RTCMediaStreamTrackStats& other)
513 : RTCStats(other.id(), other.timestamp_us()),
514 track_identifier(other.track_identifier),
Henrik Boström646fda02019-05-22 15:49:42 +0200515 media_source_id(other.media_source_id),
hbos09bc1282016-11-08 06:29:22 -0800516 remote_source(other.remote_source),
517 ended(other.ended),
518 detached(other.detached),
hbos160e4a72017-01-17 02:53:23 -0800519 kind(other.kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200520 jitter_buffer_delay(other.jitter_buffer_delay),
Chen Xing0acffb52019-01-15 15:46:29 +0100521 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
hbos09bc1282016-11-08 06:29:22 -0800522 frame_width(other.frame_width),
523 frame_height(other.frame_height),
524 frames_per_second(other.frames_per_second),
525 frames_sent(other.frames_sent),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100526 huge_frames_sent(other.huge_frames_sent),
hbos09bc1282016-11-08 06:29:22 -0800527 frames_received(other.frames_received),
528 frames_decoded(other.frames_decoded),
529 frames_dropped(other.frames_dropped),
530 frames_corrupted(other.frames_corrupted),
531 partial_frames_lost(other.partial_frames_lost),
532 full_frames_lost(other.full_frames_lost),
533 audio_level(other.audio_level),
zsteine76bd3a2017-07-14 12:17:49 -0700534 total_audio_energy(other.total_audio_energy),
hbos09bc1282016-11-08 06:29:22 -0800535 echo_return_loss(other.echo_return_loss),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700536 echo_return_loss_enhancement(other.echo_return_loss_enhancement),
537 total_samples_received(other.total_samples_received),
538 total_samples_duration(other.total_samples_duration),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200539 concealed_samples(other.concealed_samples),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200540 silent_concealed_samples(other.silent_concealed_samples),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100541 concealment_events(other.concealment_events),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200542 inserted_samples_for_deceleration(
543 other.inserted_samples_for_deceleration),
544 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100545 jitter_buffer_flushes(other.jitter_buffer_flushes),
Sergey Silkin02371062019-01-31 16:45:42 +0100546 delayed_packet_outage_samples(other.delayed_packet_outage_samples),
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100547 relative_packet_arrival_delay(other.relative_packet_arrival_delay),
Artem Titove618cc92020-03-11 11:18:54 +0100548 jitter_buffer_target_delay(other.jitter_buffer_target_delay),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200549 interruption_count(other.interruption_count),
550 total_interruption_duration(other.total_interruption_duration),
Sergey Silkin02371062019-01-31 16:45:42 +0100551 freeze_count(other.freeze_count),
552 pause_count(other.pause_count),
553 total_freezes_duration(other.total_freezes_duration),
554 total_pauses_duration(other.total_pauses_duration),
555 total_frames_duration(other.total_frames_duration),
556 sum_squared_frame_durations(other.sum_squared_frame_durations) {}
hbos09bc1282016-11-08 06:29:22 -0800557
Yves Gerey665174f2018-06-19 15:03:05 +0200558RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {}
hbos09bc1282016-11-08 06:29:22 -0800559
Steve Antond6a5cbd2017-08-18 09:40:25 -0700560// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700561WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
562 &data_channels_opened,
Nico Weber22f99252019-02-20 10:13:16 -0500563 &data_channels_closed)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700564// clang-format on
hbosd565b732016-08-30 14:04:35 -0700565
Yves Gerey665174f2018-06-19 15:03:05 +0200566RTCPeerConnectionStats::RTCPeerConnectionStats(const std::string& id,
567 int64_t timestamp_us)
568 : RTCPeerConnectionStats(std::string(id), timestamp_us) {}
hbosd565b732016-08-30 14:04:35 -0700569
Yves Gerey665174f2018-06-19 15:03:05 +0200570RTCPeerConnectionStats::RTCPeerConnectionStats(std::string&& id,
571 int64_t timestamp_us)
hbos0e6758d2016-08-31 07:57:36 -0700572 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700573 data_channels_opened("dataChannelsOpened"),
Yves Gerey665174f2018-06-19 15:03:05 +0200574 data_channels_closed("dataChannelsClosed") {}
hbosd565b732016-08-30 14:04:35 -0700575
hbosfc5e0502016-10-06 02:06:10 -0700576RTCPeerConnectionStats::RTCPeerConnectionStats(
577 const RTCPeerConnectionStats& other)
578 : RTCStats(other.id(), other.timestamp_us()),
579 data_channels_opened(other.data_channels_opened),
Yves Gerey665174f2018-06-19 15:03:05 +0200580 data_channels_closed(other.data_channels_closed) {}
hbosfc5e0502016-10-06 02:06:10 -0700581
Yves Gerey665174f2018-06-19 15:03:05 +0200582RTCPeerConnectionStats::~RTCPeerConnectionStats() {}
hbosfc5e0502016-10-06 02:06:10 -0700583
Steve Antond6a5cbd2017-08-18 09:40:25 -0700584// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700585WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
586 &ssrc,
Philipp Hancke3bc01662018-08-28 14:55:03 +0200587 &kind,
hbosb0ae9202017-01-27 06:35:16 -0800588 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700589 &transport_id,
590 &codec_id,
Di Wufd1e9d12021-03-09 09:25:28 -0800591 &media_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700592// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700593
Yves Gerey665174f2018-06-19 15:03:05 +0200594RTCRTPStreamStats::RTCRTPStreamStats(const std::string& id,
595 int64_t timestamp_us)
596 : RTCRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700597
Yves Gerey665174f2018-06-19 15:03:05 +0200598RTCRTPStreamStats::RTCRTPStreamStats(std::string&& id, int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700599 : RTCStats(std::move(id), timestamp_us),
600 ssrc("ssrc"),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200601 kind("kind"),
hbosb0ae9202017-01-27 06:35:16 -0800602 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700603 transport_id("transportId"),
604 codec_id("codecId"),
Di Wufd1e9d12021-03-09 09:25:28 -0800605 media_type("mediaType") {}
hbos6ded1902016-11-01 01:50:46 -0700606
Yves Gerey665174f2018-06-19 15:03:05 +0200607RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other)
hbos6ded1902016-11-01 01:50:46 -0700608 : RTCStats(other.id(), other.timestamp_us()),
609 ssrc(other.ssrc),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200610 kind(other.kind),
hbosb0ae9202017-01-27 06:35:16 -0800611 track_id(other.track_id),
hbos6ded1902016-11-01 01:50:46 -0700612 transport_id(other.transport_id),
613 codec_id(other.codec_id),
Di Wufd1e9d12021-03-09 09:25:28 -0800614 media_type(other.media_type) {}
hbos6ded1902016-11-01 01:50:46 -0700615
Yves Gerey665174f2018-06-19 15:03:05 +0200616RTCRTPStreamStats::~RTCRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700617
Steve Antond6a5cbd2017-08-18 09:40:25 -0700618// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700619WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800620 RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp",
621 &jitter,
Minyue Li28a2c632021-07-07 15:53:38 +0200622 &packets_lost,
623 &packets_discarded)
Di Wufd1e9d12021-03-09 09:25:28 -0800624// clang-format on
625
626RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(const std::string&& id,
627 int64_t timestamp_us)
628 : RTCReceivedRtpStreamStats(std::string(id), timestamp_us) {}
629
630RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string&& id,
631 int64_t timestamp_us)
632 : RTCRTPStreamStats(std::move(id), timestamp_us),
633 jitter("jitter"),
Minyue Li28a2c632021-07-07 15:53:38 +0200634 packets_lost("packetsLost"),
635 packets_discarded("packetsDiscarded") {}
Di Wufd1e9d12021-03-09 09:25:28 -0800636
637RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(
638 const RTCReceivedRtpStreamStats& other)
639 : RTCRTPStreamStats(other),
640 jitter(other.jitter),
Minyue Li28a2c632021-07-07 15:53:38 +0200641 packets_lost(other.packets_lost),
642 packets_discarded(other.packets_discarded) {}
Di Wufd1e9d12021-03-09 09:25:28 -0800643
644RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {}
645
646// clang-format off
647WEBRTC_RTCSTATS_IMPL(
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100648 RTCSentRtpStreamStats, RTCRTPStreamStats, "sent-rtp",
649 &packets_sent,
650 &bytes_sent)
651// clang-format on
652
653RTCSentRtpStreamStats::RTCSentRtpStreamStats(const std::string&& id,
654 int64_t timestamp_us)
655 : RTCSentRtpStreamStats(std::string(id), timestamp_us) {}
656
657RTCSentRtpStreamStats::RTCSentRtpStreamStats(std::string&& id,
658 int64_t timestamp_us)
659 : RTCRTPStreamStats(std::move(id), timestamp_us),
660 packets_sent("packetsSent"),
661 bytes_sent("bytesSent") {}
662
663RTCSentRtpStreamStats::RTCSentRtpStreamStats(const RTCSentRtpStreamStats& other)
664 : RTCRTPStreamStats(other),
665 packets_sent(other.packets_sent),
666 bytes_sent(other.bytes_sent) {}
667
668RTCSentRtpStreamStats::~RTCSentRtpStreamStats() {}
669
670// clang-format off
671WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800672 RTCInboundRTPStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp",
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100673 &remote_id,
hboseeafe942016-11-01 03:00:17 -0700674 &packets_received,
Henrik Boström4a5dab02020-01-28 11:15:35 +0100675 &fec_packets_received,
676 &fec_packets_discarded,
hboseeafe942016-11-01 03:00:17 -0700677 &bytes_received,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200678 &header_bytes_received,
Henrik Boström01738c62019-04-15 17:32:00 +0200679 &last_packet_received_timestamp,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300680 &jitter_buffer_delay,
681 &jitter_buffer_emitted_count,
682 &total_samples_received,
683 &concealed_samples,
684 &silent_concealed_samples,
685 &concealment_events,
686 &inserted_samples_for_deceleration,
687 &removed_samples_for_acceleration,
688 &audio_level,
689 &total_audio_energy,
690 &total_samples_duration,
hbosa7a9be12017-03-01 01:02:45 -0800691 &round_trip_time,
hboseeafe942016-11-01 03:00:17 -0700692 &packets_repaired,
693 &burst_packets_lost,
694 &burst_packets_discarded,
695 &burst_loss_count,
696 &burst_discard_count,
697 &burst_loss_rate,
698 &burst_discard_rate,
699 &gap_loss_rate,
hbos6769c492017-01-02 08:35:13 -0800700 &gap_discard_rate,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200701 &frames_received,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300702 &frame_width,
703 &frame_height,
704 &frame_bit_depth,
705 &frames_per_second,
Henrik Boström2e069262019-04-09 13:59:31 +0200706 &frames_decoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200707 &key_frames_decoded,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300708 &frames_dropped,
Johannes Kronbfd343b2019-07-01 10:07:50 +0200709 &total_decode_time,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200710 &total_processing_delay,
Philipp Hancke0359ba22022-05-05 15:55:36 +0200711 &total_assembly_time,
712 &frames_assembled_from_multiple_packets,
Johannes Kron00376e12019-11-25 10:25:42 +0100713 &total_inter_frame_delay,
714 &total_squared_inter_frame_delay,
Henrik Boström6b430862019-08-16 13:09:51 +0200715 &content_type,
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200716 &estimated_playout_timestamp,
Di Wufd1e9d12021-03-09 09:25:28 -0800717 &decoder_implementation,
718 &fir_count,
719 &pli_count,
720 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700721 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700722// clang-format on
hboseeafe942016-11-01 03:00:17 -0700723
Yves Gerey665174f2018-06-19 15:03:05 +0200724RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
725 int64_t timestamp_us)
726 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {}
hboseeafe942016-11-01 03:00:17 -0700727
Yves Gerey665174f2018-06-19 15:03:05 +0200728RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
729 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800730 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100731 remote_id("remoteId"),
hboseeafe942016-11-01 03:00:17 -0700732 packets_received("packetsReceived"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200733 fec_packets_received("fecPacketsReceived"),
734 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700735 bytes_received("bytesReceived"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200736 header_bytes_received("headerBytesReceived"),
Henrik Boström01738c62019-04-15 17:32:00 +0200737 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300738 jitter_buffer_delay("jitterBufferDelay"),
739 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
740 total_samples_received("totalSamplesReceived"),
741 concealed_samples("concealedSamples"),
742 silent_concealed_samples("silentConcealedSamples"),
743 concealment_events("concealmentEvents"),
744 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
745 removed_samples_for_acceleration("removedSamplesForAcceleration"),
746 audio_level("audioLevel"),
747 total_audio_energy("totalAudioEnergy"),
748 total_samples_duration("totalSamplesDuration"),
hbosa7a9be12017-03-01 01:02:45 -0800749 round_trip_time("roundTripTime"),
hboseeafe942016-11-01 03:00:17 -0700750 packets_repaired("packetsRepaired"),
751 burst_packets_lost("burstPacketsLost"),
752 burst_packets_discarded("burstPacketsDiscarded"),
753 burst_loss_count("burstLossCount"),
754 burst_discard_count("burstDiscardCount"),
755 burst_loss_rate("burstLossRate"),
756 burst_discard_rate("burstDiscardRate"),
757 gap_loss_rate("gapLossRate"),
hbos6769c492017-01-02 08:35:13 -0800758 gap_discard_rate("gapDiscardRate"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200759 frames_received("framesReceived"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300760 frame_width("frameWidth"),
761 frame_height("frameHeight"),
762 frame_bit_depth("frameBitDepth"),
763 frames_per_second("framesPerSecond"),
Henrik Boström2e069262019-04-09 13:59:31 +0200764 frames_decoded("framesDecoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200765 key_frames_decoded("keyFramesDecoded"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300766 frames_dropped("framesDropped"),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200767 total_decode_time("totalDecodeTime"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200768 total_processing_delay("totalProcessingDelay"),
Philipp Hancke0359ba22022-05-05 15:55:36 +0200769 total_assembly_time("totalAssemblyTime"),
770 frames_assembled_from_multiple_packets(
771 "framesAssembledFromMultiplePackets"),
Johannes Kron00376e12019-11-25 10:25:42 +0100772 total_inter_frame_delay("totalInterFrameDelay"),
773 total_squared_inter_frame_delay("totalSquaredInterFrameDelay"),
Henrik Boström6b430862019-08-16 13:09:51 +0200774 content_type("contentType"),
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200775 estimated_playout_timestamp("estimatedPlayoutTimestamp"),
Di Wufd1e9d12021-03-09 09:25:28 -0800776 decoder_implementation("decoderImplementation"),
777 fir_count("firCount"),
778 pli_count("pliCount"),
779 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700780 qp_sum("qpSum") {}
hboseeafe942016-11-01 03:00:17 -0700781
782RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
783 const RTCInboundRTPStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800784 : RTCReceivedRtpStreamStats(other),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100785 remote_id(other.remote_id),
hboseeafe942016-11-01 03:00:17 -0700786 packets_received(other.packets_received),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200787 fec_packets_received(other.fec_packets_received),
788 fec_packets_discarded(other.fec_packets_discarded),
hboseeafe942016-11-01 03:00:17 -0700789 bytes_received(other.bytes_received),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200790 header_bytes_received(other.header_bytes_received),
Henrik Boström01738c62019-04-15 17:32:00 +0200791 last_packet_received_timestamp(other.last_packet_received_timestamp),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300792 jitter_buffer_delay(other.jitter_buffer_delay),
793 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
794 total_samples_received(other.total_samples_received),
795 concealed_samples(other.concealed_samples),
796 silent_concealed_samples(other.silent_concealed_samples),
797 concealment_events(other.concealment_events),
798 inserted_samples_for_deceleration(
799 other.inserted_samples_for_deceleration),
800 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
801 audio_level(other.audio_level),
802 total_audio_energy(other.total_audio_energy),
803 total_samples_duration(other.total_samples_duration),
hbosa7a9be12017-03-01 01:02:45 -0800804 round_trip_time(other.round_trip_time),
hboseeafe942016-11-01 03:00:17 -0700805 packets_repaired(other.packets_repaired),
806 burst_packets_lost(other.burst_packets_lost),
807 burst_packets_discarded(other.burst_packets_discarded),
808 burst_loss_count(other.burst_loss_count),
809 burst_discard_count(other.burst_discard_count),
810 burst_loss_rate(other.burst_loss_rate),
811 burst_discard_rate(other.burst_discard_rate),
812 gap_loss_rate(other.gap_loss_rate),
hbos6769c492017-01-02 08:35:13 -0800813 gap_discard_rate(other.gap_discard_rate),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200814 frames_received(other.frames_received),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300815 frame_width(other.frame_width),
816 frame_height(other.frame_height),
817 frame_bit_depth(other.frame_bit_depth),
818 frames_per_second(other.frames_per_second),
Henrik Boström2e069262019-04-09 13:59:31 +0200819 frames_decoded(other.frames_decoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200820 key_frames_decoded(other.key_frames_decoded),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300821 frames_dropped(other.frames_dropped),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200822 total_decode_time(other.total_decode_time),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200823 total_processing_delay(other.total_processing_delay),
Philipp Hancke0359ba22022-05-05 15:55:36 +0200824 total_assembly_time(other.total_assembly_time),
825 frames_assembled_from_multiple_packets(
826 other.frames_assembled_from_multiple_packets),
Johannes Kron00376e12019-11-25 10:25:42 +0100827 total_inter_frame_delay(other.total_inter_frame_delay),
828 total_squared_inter_frame_delay(other.total_squared_inter_frame_delay),
Henrik Boström6b430862019-08-16 13:09:51 +0200829 content_type(other.content_type),
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200830 estimated_playout_timestamp(other.estimated_playout_timestamp),
Di Wufd1e9d12021-03-09 09:25:28 -0800831 decoder_implementation(other.decoder_implementation),
832 fir_count(other.fir_count),
833 pli_count(other.pli_count),
834 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700835 qp_sum(other.qp_sum) {}
hboseeafe942016-11-01 03:00:17 -0700836
Yves Gerey665174f2018-06-19 15:03:05 +0200837RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700838
Steve Antond6a5cbd2017-08-18 09:40:25 -0700839// clang-format off
hboseeafe942016-11-01 03:00:17 -0700840WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700841 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200842 &media_source_id,
Henrik Boström4f40fa52019-12-19 13:27:27 +0100843 &remote_id,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200844 &rid,
hbos6ded1902016-11-01 01:50:46 -0700845 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200846 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700847 &bytes_sent,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200848 &header_bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200849 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700850 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200851 &frames_encoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200852 &key_frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200853 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200854 &total_encoded_bytes_target,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200855 &frame_width,
856 &frame_height,
857 &frames_per_second,
858 &frames_sent,
859 &huge_frames_sent,
Henrik Boström9fe18342019-05-16 18:38:20 +0200860 &total_packet_send_delay,
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200861 &quality_limitation_reason,
Byoungchan Lee7d235352021-05-28 21:32:04 +0900862 &quality_limitation_durations,
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200863 &quality_limitation_resolution_changes,
Henrik Boström6b430862019-08-16 13:09:51 +0200864 &content_type,
Di Wufd1e9d12021-03-09 09:25:28 -0800865 &encoder_implementation,
866 &fir_count,
867 &pli_count,
868 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700869 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700870// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700871
Yves Gerey665174f2018-06-19 15:03:05 +0200872RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id,
873 int64_t timestamp_us)
874 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700875
Yves Gerey665174f2018-06-19 15:03:05 +0200876RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id,
877 int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700878 : RTCRTPStreamStats(std::move(id), timestamp_us),
Henrik Boström646fda02019-05-22 15:49:42 +0200879 media_source_id("mediaSourceId"),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100880 remote_id("remoteId"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200881 rid("rid"),
hbos6ded1902016-11-01 01:50:46 -0700882 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200883 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700884 bytes_sent("bytesSent"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200885 header_bytes_sent("headerBytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200886 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700887 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200888 frames_encoded("framesEncoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200889 key_frames_encoded("keyFramesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200890 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200891 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200892 frame_width("frameWidth"),
893 frame_height("frameHeight"),
894 frames_per_second("framesPerSecond"),
895 frames_sent("framesSent"),
896 huge_frames_sent("hugeFramesSent"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200897 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200898 quality_limitation_reason("qualityLimitationReason"),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900899 quality_limitation_durations("qualityLimitationDurations"),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200900 quality_limitation_resolution_changes(
901 "qualityLimitationResolutionChanges"),
Henrik Boström6b430862019-08-16 13:09:51 +0200902 content_type("contentType"),
Di Wufd1e9d12021-03-09 09:25:28 -0800903 encoder_implementation("encoderImplementation"),
904 fir_count("firCount"),
905 pli_count("pliCount"),
906 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700907 qp_sum("qpSum") {}
hbos6ded1902016-11-01 01:50:46 -0700908
909RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
910 const RTCOutboundRTPStreamStats& other)
911 : RTCRTPStreamStats(other),
Henrik Boström646fda02019-05-22 15:49:42 +0200912 media_source_id(other.media_source_id),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100913 remote_id(other.remote_id),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200914 rid(other.rid),
hbos6ded1902016-11-01 01:50:46 -0700915 packets_sent(other.packets_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200916 retransmitted_packets_sent(other.retransmitted_packets_sent),
hbos6ded1902016-11-01 01:50:46 -0700917 bytes_sent(other.bytes_sent),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200918 header_bytes_sent(other.header_bytes_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200919 retransmitted_bytes_sent(other.retransmitted_bytes_sent),
hbos6ded1902016-11-01 01:50:46 -0700920 target_bitrate(other.target_bitrate),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200921 frames_encoded(other.frames_encoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200922 key_frames_encoded(other.key_frames_encoded),
Henrik Boström2e069262019-04-09 13:59:31 +0200923 total_encode_time(other.total_encode_time),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200924 total_encoded_bytes_target(other.total_encoded_bytes_target),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200925 frame_width(other.frame_width),
926 frame_height(other.frame_height),
927 frames_per_second(other.frames_per_second),
928 frames_sent(other.frames_sent),
929 huge_frames_sent(other.huge_frames_sent),
Henrik Boström9fe18342019-05-16 18:38:20 +0200930 total_packet_send_delay(other.total_packet_send_delay),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200931 quality_limitation_reason(other.quality_limitation_reason),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900932 quality_limitation_durations(other.quality_limitation_durations),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200933 quality_limitation_resolution_changes(
934 other.quality_limitation_resolution_changes),
Henrik Boström6b430862019-08-16 13:09:51 +0200935 content_type(other.content_type),
Di Wufd1e9d12021-03-09 09:25:28 -0800936 encoder_implementation(other.encoder_implementation),
937 fir_count(other.fir_count),
938 pli_count(other.pli_count),
939 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700940 qp_sum(other.qp_sum) {}
hbos6ded1902016-11-01 01:50:46 -0700941
Yves Gerey665174f2018-06-19 15:03:05 +0200942RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700943
Steve Antond6a5cbd2017-08-18 09:40:25 -0700944// clang-format off
Henrik Boström883eefc2019-05-27 13:40:25 +0200945WEBRTC_RTCSTATS_IMPL(
Henrik Boström2f71b612021-03-23 15:18:55 +0100946 RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
947 "remote-inbound-rtp",
Henrik Boström883eefc2019-05-27 13:40:25 +0200948 &local_id,
Di Wu86f04ad2021-02-28 23:36:03 -0800949 &round_trip_time,
Di Wu88a51b22021-03-01 11:22:06 -0800950 &fraction_lost,
951 &total_round_trip_time,
952 &round_trip_time_measurements)
Henrik Boström883eefc2019-05-27 13:40:25 +0200953// clang-format on
954
955RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
956 const std::string& id,
957 int64_t timestamp_us)
958 : RTCRemoteInboundRtpStreamStats(std::string(id), timestamp_us) {}
959
960RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
961 std::string&& id,
962 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800963 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boström883eefc2019-05-27 13:40:25 +0200964 local_id("localId"),
Di Wu86f04ad2021-02-28 23:36:03 -0800965 round_trip_time("roundTripTime"),
Di Wu88a51b22021-03-01 11:22:06 -0800966 fraction_lost("fractionLost"),
967 total_round_trip_time("totalRoundTripTime"),
968 round_trip_time_measurements("roundTripTimeMeasurements") {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200969
970RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
971 const RTCRemoteInboundRtpStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800972 : RTCReceivedRtpStreamStats(other),
Henrik Boström883eefc2019-05-27 13:40:25 +0200973 local_id(other.local_id),
Di Wu86f04ad2021-02-28 23:36:03 -0800974 round_trip_time(other.round_trip_time),
Di Wu88a51b22021-03-01 11:22:06 -0800975 fraction_lost(other.fraction_lost),
976 total_round_trip_time(other.total_round_trip_time),
977 round_trip_time_measurements(other.round_trip_time_measurements) {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200978
979RTCRemoteInboundRtpStreamStats::~RTCRemoteInboundRtpStreamStats() {}
980
981// clang-format off
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100982WEBRTC_RTCSTATS_IMPL(
983 RTCRemoteOutboundRtpStreamStats, RTCSentRtpStreamStats,
984 "remote-outbound-rtp",
985 &local_id,
986 &remote_timestamp,
Ivo Creusen2562cf02021-09-03 14:51:22 +0000987 &reports_sent,
988 &round_trip_time,
989 &round_trip_time_measurements,
990 &total_round_trip_time)
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100991// clang-format on
992
993RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
994 const std::string& id,
995 int64_t timestamp_us)
996 : RTCRemoteOutboundRtpStreamStats(std::string(id), timestamp_us) {}
997
998RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
999 std::string&& id,
1000 int64_t timestamp_us)
1001 : RTCSentRtpStreamStats(std::move(id), timestamp_us),
1002 local_id("localId"),
1003 remote_timestamp("remoteTimestamp"),
Ivo Creusen2562cf02021-09-03 14:51:22 +00001004 reports_sent("reportsSent"),
1005 round_trip_time("roundTripTime"),
1006 round_trip_time_measurements("roundTripTimeMeasurements"),
1007 total_round_trip_time("totalRoundTripTime") {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +01001008
1009RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
1010 const RTCRemoteOutboundRtpStreamStats& other)
1011 : RTCSentRtpStreamStats(other),
1012 local_id(other.local_id),
1013 remote_timestamp(other.remote_timestamp),
Ivo Creusen2562cf02021-09-03 14:51:22 +00001014 reports_sent(other.reports_sent),
1015 round_trip_time(other.round_trip_time),
1016 round_trip_time_measurements(other.round_trip_time_measurements),
1017 total_round_trip_time(other.total_round_trip_time) {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +01001018
1019RTCRemoteOutboundRtpStreamStats::~RTCRemoteOutboundRtpStreamStats() {}
1020
1021// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +02001022WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
1023 &track_identifier,
1024 &kind)
1025// clang-format on
1026
1027RTCMediaSourceStats::RTCMediaSourceStats(const std::string& id,
1028 int64_t timestamp_us)
1029 : RTCMediaSourceStats(std::string(id), timestamp_us) {}
1030
1031RTCMediaSourceStats::RTCMediaSourceStats(std::string&& id, int64_t timestamp_us)
1032 : RTCStats(std::move(id), timestamp_us),
1033 track_identifier("trackIdentifier"),
1034 kind("kind") {}
1035
1036RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other)
1037 : RTCStats(other.id(), other.timestamp_us()),
1038 track_identifier(other.track_identifier),
1039 kind(other.kind) {}
1040
1041RTCMediaSourceStats::~RTCMediaSourceStats() {}
1042
1043// clang-format off
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001044WEBRTC_RTCSTATS_IMPL(RTCAudioSourceStats, RTCMediaSourceStats, "media-source",
1045 &audio_level,
1046 &total_audio_energy,
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001047 &total_samples_duration,
1048 &echo_return_loss,
1049 &echo_return_loss_enhancement)
Henrik Boström646fda02019-05-22 15:49:42 +02001050// clang-format on
1051
1052RTCAudioSourceStats::RTCAudioSourceStats(const std::string& id,
1053 int64_t timestamp_us)
1054 : RTCAudioSourceStats(std::string(id), timestamp_us) {}
1055
1056RTCAudioSourceStats::RTCAudioSourceStats(std::string&& id, int64_t timestamp_us)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001057 : RTCMediaSourceStats(std::move(id), timestamp_us),
1058 audio_level("audioLevel"),
1059 total_audio_energy("totalAudioEnergy"),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001060 total_samples_duration("totalSamplesDuration"),
1061 echo_return_loss("echoReturnLoss"),
1062 echo_return_loss_enhancement("echoReturnLossEnhancement") {}
Henrik Boström646fda02019-05-22 15:49:42 +02001063
1064RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001065 : RTCMediaSourceStats(other),
1066 audio_level(other.audio_level),
1067 total_audio_energy(other.total_audio_energy),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001068 total_samples_duration(other.total_samples_duration),
1069 echo_return_loss(other.echo_return_loss),
1070 echo_return_loss_enhancement(other.echo_return_loss_enhancement) {}
Henrik Boström646fda02019-05-22 15:49:42 +02001071
1072RTCAudioSourceStats::~RTCAudioSourceStats() {}
1073
1074// clang-format off
1075WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
1076 &width,
1077 &height,
1078 &frames,
1079 &frames_per_second)
1080// clang-format on
1081
1082RTCVideoSourceStats::RTCVideoSourceStats(const std::string& id,
1083 int64_t timestamp_us)
1084 : RTCVideoSourceStats(std::string(id), timestamp_us) {}
1085
1086RTCVideoSourceStats::RTCVideoSourceStats(std::string&& id, int64_t timestamp_us)
1087 : RTCMediaSourceStats(std::move(id), timestamp_us),
1088 width("width"),
1089 height("height"),
1090 frames("frames"),
1091 frames_per_second("framesPerSecond") {}
1092
1093RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other)
1094 : RTCMediaSourceStats(other),
1095 width(other.width),
1096 height(other.height),
1097 frames(other.frames),
1098 frames_per_second(other.frames_per_second) {}
1099
1100RTCVideoSourceStats::~RTCVideoSourceStats() {}
1101
1102// clang-format off
hbos2fa7c672016-10-24 04:00:05 -07001103WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
1104 &bytes_sent,
Artem Titovedacbd52020-07-06 16:06:37 +02001105 &packets_sent,
hbos2fa7c672016-10-24 04:00:05 -07001106 &bytes_received,
Artem Titovedacbd52020-07-06 16:06:37 +02001107 &packets_received,
hbos2fa7c672016-10-24 04:00:05 -07001108 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -08001109 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -07001110 &selected_candidate_pair_id,
1111 &local_certificate_id,
Jonas Oreland149dc722019-08-28 08:10:27 +02001112 &remote_certificate_id,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001113 &tls_version,
1114 &dtls_cipher,
Philipp Hancke69c1df22022-04-22 15:46:24 +02001115 &dtls_role,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001116 &srtp_cipher,
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001117 &selected_candidate_pair_changes,
Philipp Hancke95b1a342022-05-05 07:53:54 +02001118 &ice_role,
Philipp Hancke1f491572022-05-09 17:43:31 +02001119 &ice_local_username_fragment,
1120 &ice_state)
Steve Antond6a5cbd2017-08-18 09:40:25 -07001121// clang-format on
hbos2fa7c672016-10-24 04:00:05 -07001122
Yves Gerey665174f2018-06-19 15:03:05 +02001123RTCTransportStats::RTCTransportStats(const std::string& id,
1124 int64_t timestamp_us)
1125 : RTCTransportStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -07001126
Yves Gerey665174f2018-06-19 15:03:05 +02001127RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -07001128 : RTCStats(std::move(id), timestamp_us),
1129 bytes_sent("bytesSent"),
Artem Titovedacbd52020-07-06 16:06:37 +02001130 packets_sent("packetsSent"),
hbos2fa7c672016-10-24 04:00:05 -07001131 bytes_received("bytesReceived"),
Artem Titovedacbd52020-07-06 16:06:37 +02001132 packets_received("packetsReceived"),
hbos2fa7c672016-10-24 04:00:05 -07001133 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -08001134 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -07001135 selected_candidate_pair_id("selectedCandidatePairId"),
1136 local_certificate_id("localCertificateId"),
Jonas Oreland149dc722019-08-28 08:10:27 +02001137 remote_certificate_id("remoteCertificateId"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001138 tls_version("tlsVersion"),
1139 dtls_cipher("dtlsCipher"),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001140 dtls_role("dtlsRole"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001141 srtp_cipher("srtpCipher"),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001142 selected_candidate_pair_changes("selectedCandidatePairChanges"),
Philipp Hancke95b1a342022-05-05 07:53:54 +02001143 ice_role("iceRole"),
Philipp Hancke1f491572022-05-09 17:43:31 +02001144 ice_local_username_fragment("iceLocalUsernameFragment"),
1145 ice_state("iceState") {}
hbos2fa7c672016-10-24 04:00:05 -07001146
Yves Gerey665174f2018-06-19 15:03:05 +02001147RTCTransportStats::RTCTransportStats(const RTCTransportStats& other)
hbos2fa7c672016-10-24 04:00:05 -07001148 : RTCStats(other.id(), other.timestamp_us()),
1149 bytes_sent(other.bytes_sent),
Artem Titovedacbd52020-07-06 16:06:37 +02001150 packets_sent(other.packets_sent),
hbos2fa7c672016-10-24 04:00:05 -07001151 bytes_received(other.bytes_received),
Artem Titovedacbd52020-07-06 16:06:37 +02001152 packets_received(other.packets_received),
hbos2fa7c672016-10-24 04:00:05 -07001153 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -08001154 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -07001155 selected_candidate_pair_id(other.selected_candidate_pair_id),
1156 local_certificate_id(other.local_certificate_id),
Jonas Oreland149dc722019-08-28 08:10:27 +02001157 remote_certificate_id(other.remote_certificate_id),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001158 tls_version(other.tls_version),
1159 dtls_cipher(other.dtls_cipher),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001160 dtls_role(other.dtls_role),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001161 srtp_cipher(other.srtp_cipher),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001162 selected_candidate_pair_changes(other.selected_candidate_pair_changes),
Philipp Hancke95b1a342022-05-05 07:53:54 +02001163 ice_role(other.ice_role),
Philipp Hancke1f491572022-05-09 17:43:31 +02001164 ice_local_username_fragment(other.ice_local_username_fragment),
1165 ice_state(other.ice_state) {}
hbos2fa7c672016-10-24 04:00:05 -07001166
Yves Gerey665174f2018-06-19 15:03:05 +02001167RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -07001168
hbosd565b732016-08-30 14:04:35 -07001169} // namespace webrtc