blob: 2b275ad9eb8607feb5dfdb13012ff363b608f339 [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,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700194 &packets_sent,
195 &packets_received,
hbosc47a0c32016-10-11 14:54:49 -0700196 &bytes_sent,
197 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800198 &total_round_trip_time,
199 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700200 &available_outgoing_bitrate,
201 &available_incoming_bitrate,
202 &requests_received,
203 &requests_sent,
204 &responses_received,
205 &responses_sent,
hbosc47a0c32016-10-11 14:54:49 -0700206 &consent_requests_sent,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700207 &packets_discarded_on_send,
208 &bytes_discarded_on_send)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700209// clang-format on
hbosc47a0c32016-10-11 14:54:49 -0700210
Yves Gerey665174f2018-06-19 15:03:05 +0200211RTCIceCandidatePairStats::RTCIceCandidatePairStats(const std::string& id,
212 int64_t timestamp_us)
213 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {}
hbosc47a0c32016-10-11 14:54:49 -0700214
Yves Gerey665174f2018-06-19 15:03:05 +0200215RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string&& id,
216 int64_t timestamp_us)
hbosc47a0c32016-10-11 14:54:49 -0700217 : RTCStats(std::move(id), timestamp_us),
218 transport_id("transportId"),
219 local_candidate_id("localCandidateId"),
220 remote_candidate_id("remoteCandidateId"),
221 state("state"),
222 priority("priority"),
223 nominated("nominated"),
224 writable("writable"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700225 packets_sent("packetsSent"),
226 packets_received("packetsReceived"),
hbosc47a0c32016-10-11 14:54:49 -0700227 bytes_sent("bytesSent"),
228 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800229 total_round_trip_time("totalRoundTripTime"),
230 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700231 available_outgoing_bitrate("availableOutgoingBitrate"),
232 available_incoming_bitrate("availableIncomingBitrate"),
233 requests_received("requestsReceived"),
234 requests_sent("requestsSent"),
235 responses_received("responsesReceived"),
236 responses_sent("responsesSent"),
hbosc47a0c32016-10-11 14:54:49 -0700237 consent_requests_sent("consentRequestsSent"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700238 packets_discarded_on_send("packetsDiscardedOnSend"),
239 bytes_discarded_on_send("bytesDiscardedOnSend") {}
hbosc47a0c32016-10-11 14:54:49 -0700240
241RTCIceCandidatePairStats::RTCIceCandidatePairStats(
242 const RTCIceCandidatePairStats& other)
243 : RTCStats(other.id(), other.timestamp_us()),
244 transport_id(other.transport_id),
245 local_candidate_id(other.local_candidate_id),
246 remote_candidate_id(other.remote_candidate_id),
247 state(other.state),
248 priority(other.priority),
249 nominated(other.nominated),
250 writable(other.writable),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700251 packets_sent(other.packets_sent),
252 packets_received(other.packets_received),
hbosc47a0c32016-10-11 14:54:49 -0700253 bytes_sent(other.bytes_sent),
254 bytes_received(other.bytes_received),
hbos3168c7a2016-12-15 06:17:08 -0800255 total_round_trip_time(other.total_round_trip_time),
256 current_round_trip_time(other.current_round_trip_time),
hbosc47a0c32016-10-11 14:54:49 -0700257 available_outgoing_bitrate(other.available_outgoing_bitrate),
258 available_incoming_bitrate(other.available_incoming_bitrate),
259 requests_received(other.requests_received),
260 requests_sent(other.requests_sent),
261 responses_received(other.responses_received),
262 responses_sent(other.responses_sent),
hbosc47a0c32016-10-11 14:54:49 -0700263 consent_requests_sent(other.consent_requests_sent),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700264 packets_discarded_on_send(other.packets_discarded_on_send),
265 bytes_discarded_on_send(other.bytes_discarded_on_send) {}
hbosc47a0c32016-10-11 14:54:49 -0700266
Yves Gerey665174f2018-06-19 15:03:05 +0200267RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {}
hbosc47a0c32016-10-11 14:54:49 -0700268
Steve Antond6a5cbd2017-08-18 09:40:25 -0700269// clang-format off
Henrik Boström1df1bf82018-03-20 13:24:20 +0100270WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800271 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800272 &is_remote,
Gary Liu37e489c2017-11-21 10:49:36 -0800273 &network_type,
hbosab9f6e42016-10-07 02:18:47 -0700274 &ip,
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100275 &address,
hbosab9f6e42016-10-07 02:18:47 -0700276 &port,
277 &protocol,
Philipp Hancke95513752018-09-27 14:40:08 +0200278 &relay_protocol,
hbosab9f6e42016-10-07 02:18:47 -0700279 &candidate_type,
280 &priority,
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100281 &url,
Philipp Hancke0e3cd632022-09-27 10:23:09 +0200282 &foundation,
283 &related_address,
284 &related_port,
285 &username_fragment,
286 &tcp_type,
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100287 &vpn,
288 &network_adapter_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700289// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700290
Yves Gerey665174f2018-06-19 15:03:05 +0200291RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id,
292 int64_t timestamp_us,
293 bool is_remote)
294 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {}
hbosab9f6e42016-10-07 02:18:47 -0700295
Gary Liu37e489c2017-11-21 10:49:36 -0800296RTCIceCandidateStats::RTCIceCandidateStats(std::string&& id,
297 int64_t timestamp_us,
298 bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700299 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800300 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800301 is_remote("isRemote", is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800302 network_type("networkType"),
hbosab9f6e42016-10-07 02:18:47 -0700303 ip("ip"),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100304 address("address"),
hbosab9f6e42016-10-07 02:18:47 -0700305 port("port"),
306 protocol("protocol"),
Philipp Hancke95513752018-09-27 14:40:08 +0200307 relay_protocol("relayProtocol"),
hbosab9f6e42016-10-07 02:18:47 -0700308 candidate_type("candidateType"),
309 priority("priority"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100310 url("url"),
Philipp Hancke0e3cd632022-09-27 10:23:09 +0200311 foundation("foundation"),
312 related_address("relatedAddress"),
313 related_port("relatedPort"),
314 username_fragment("usernameFragment"),
315 tcp_type("tcpType"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100316 vpn("vpn"),
317 network_adapter_type("networkAdapterType") {}
hbosab9f6e42016-10-07 02:18:47 -0700318
319RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
320 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800321 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800322 is_remote(other.is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800323 network_type(other.network_type),
hbosab9f6e42016-10-07 02:18:47 -0700324 ip(other.ip),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100325 address(other.address),
hbosab9f6e42016-10-07 02:18:47 -0700326 port(other.port),
327 protocol(other.protocol),
Philipp Hancke95513752018-09-27 14:40:08 +0200328 relay_protocol(other.relay_protocol),
hbosab9f6e42016-10-07 02:18:47 -0700329 candidate_type(other.candidate_type),
330 priority(other.priority),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100331 url(other.url),
Philipp Hancke0e3cd632022-09-27 10:23:09 +0200332 foundation(other.foundation),
333 related_address(other.related_address),
334 related_port(other.related_port),
335 username_fragment(other.username_fragment),
336 tcp_type(other.tcp_type),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100337 vpn(other.vpn),
338 network_adapter_type(other.network_adapter_type) {}
hbosab9f6e42016-10-07 02:18:47 -0700339
Yves Gerey665174f2018-06-19 15:03:05 +0200340RTCIceCandidateStats::~RTCIceCandidateStats() {}
hbosab9f6e42016-10-07 02:18:47 -0700341
342const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
343
Yves Gerey665174f2018-06-19 15:03:05 +0200344RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(const std::string& id,
345 int64_t timestamp_us)
346 : RTCIceCandidateStats(id, timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700347
Yves Gerey665174f2018-06-19 15:03:05 +0200348RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string&& id,
349 int64_t timestamp_us)
350 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700351
Henrik Boström1df1bf82018-03-20 13:24:20 +0100352std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const {
Philipp Hanckeb5cf12d2022-09-06 11:55:31 +0200353 return std::make_unique<RTCLocalIceCandidateStats>(*this);
Henrik Boström1df1bf82018-03-20 13:24:20 +0100354}
355
hbosab9f6e42016-10-07 02:18:47 -0700356const char* RTCLocalIceCandidateStats::type() const {
357 return kType;
358}
359
360const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
361
Yves Gerey665174f2018-06-19 15:03:05 +0200362RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(const std::string& id,
363 int64_t timestamp_us)
364 : RTCIceCandidateStats(id, timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700365
Yves Gerey665174f2018-06-19 15:03:05 +0200366RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string&& id,
367 int64_t timestamp_us)
368 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700369
Henrik Boström1df1bf82018-03-20 13:24:20 +0100370std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const {
Philipp Hanckeb5cf12d2022-09-06 11:55:31 +0200371 return std::make_unique<RTCRemoteIceCandidateStats>(*this);
Henrik Boström1df1bf82018-03-20 13:24:20 +0100372}
373
hbosab9f6e42016-10-07 02:18:47 -0700374const char* RTCRemoteIceCandidateStats::type() const {
375 return kType;
376}
377
Steve Antond6a5cbd2017-08-18 09:40:25 -0700378// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800379WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
380 &stream_identifier,
Nico Weber22f99252019-02-20 10:13:16 -0500381 &track_ids)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700382// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800383
Yves Gerey665174f2018-06-19 15:03:05 +0200384RTCMediaStreamStats::RTCMediaStreamStats(const std::string& id,
385 int64_t timestamp_us)
386 : RTCMediaStreamStats(std::string(id), timestamp_us) {}
hbos09bc1282016-11-08 06:29:22 -0800387
Yves Gerey665174f2018-06-19 15:03:05 +0200388RTCMediaStreamStats::RTCMediaStreamStats(std::string&& id, int64_t timestamp_us)
hbos09bc1282016-11-08 06:29:22 -0800389 : RTCStats(std::move(id), timestamp_us),
390 stream_identifier("streamIdentifier"),
Yves Gerey665174f2018-06-19 15:03:05 +0200391 track_ids("trackIds") {}
hbos09bc1282016-11-08 06:29:22 -0800392
Yves Gerey665174f2018-06-19 15:03:05 +0200393RTCMediaStreamStats::RTCMediaStreamStats(const RTCMediaStreamStats& other)
hbos09bc1282016-11-08 06:29:22 -0800394 : RTCStats(other.id(), other.timestamp_us()),
395 stream_identifier(other.stream_identifier),
Yves Gerey665174f2018-06-19 15:03:05 +0200396 track_ids(other.track_ids) {}
hbos09bc1282016-11-08 06:29:22 -0800397
Yves Gerey665174f2018-06-19 15:03:05 +0200398RTCMediaStreamStats::~RTCMediaStreamStats() {}
hbos09bc1282016-11-08 06:29:22 -0800399
Steve Antond6a5cbd2017-08-18 09:40:25 -0700400// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800401WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
zsteine76bd3a2017-07-14 12:17:49 -0700402 &track_identifier,
Henrik Boström646fda02019-05-22 15:49:42 +0200403 &media_source_id,
zsteine76bd3a2017-07-14 12:17:49 -0700404 &remote_source,
405 &ended,
406 &detached,
407 &kind,
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200408 &jitter_buffer_delay,
Chen Xing0acffb52019-01-15 15:46:29 +0100409 &jitter_buffer_emitted_count,
zsteine76bd3a2017-07-14 12:17:49 -0700410 &frame_width,
411 &frame_height,
zsteine76bd3a2017-07-14 12:17:49 -0700412 &frames_sent,
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100413 &huge_frames_sent,
zsteine76bd3a2017-07-14 12:17:49 -0700414 &frames_received,
415 &frames_decoded,
416 &frames_dropped,
zsteine76bd3a2017-07-14 12:17:49 -0700417 &audio_level,
418 &total_audio_energy,
zsteine76bd3a2017-07-14 12:17:49 -0700419 &echo_return_loss,
Steve Anton2dbc69f2017-08-24 17:15:13 -0700420 &echo_return_loss_enhancement,
421 &total_samples_received,
422 &total_samples_duration,
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200423 &concealed_samples,
Henrik Boström21e99da2019-08-21 12:09:51 +0200424 &silent_concealed_samples,
Ruslan Burakov8af88962018-11-22 17:21:10 +0100425 &concealment_events,
Henrik Boström21e99da2019-08-21 12:09:51 +0200426 &inserted_samples_for_deceleration,
427 &removed_samples_for_acceleration,
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100428 &jitter_buffer_flushes,
Sergey Silkin02371062019-01-31 16:45:42 +0100429 &delayed_packet_outage_samples,
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100430 &relative_packet_arrival_delay,
Henrik Lundin44125fa2019-04-29 17:00:46 +0200431 &interruption_count,
432 &total_interruption_duration,
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200433 &total_frames_duration,
434 &sum_squared_frame_durations,
Sergey Silkin02371062019-01-31 16:45:42 +0100435 &freeze_count,
436 &pause_count,
437 &total_freezes_duration,
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200438 &total_pauses_duration)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700439// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800440
Yves Gerey665174f2018-06-19 15:03:05 +0200441RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(const std::string& id,
442 int64_t timestamp_us,
443 const char* kind)
444 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {}
hbos09bc1282016-11-08 06:29:22 -0800445
zsteine76bd3a2017-07-14 12:17:49 -0700446RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(std::string&& id,
447 int64_t timestamp_us,
448 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800449 : RTCStats(std::move(id), timestamp_us),
450 track_identifier("trackIdentifier"),
Henrik Boström646fda02019-05-22 15:49:42 +0200451 media_source_id("mediaSourceId"),
hbos09bc1282016-11-08 06:29:22 -0800452 remote_source("remoteSource"),
453 ended("ended"),
454 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800455 kind("kind", kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200456 jitter_buffer_delay("jitterBufferDelay"),
Chen Xing0acffb52019-01-15 15:46:29 +0100457 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
hbos09bc1282016-11-08 06:29:22 -0800458 frame_width("frameWidth"),
459 frame_height("frameHeight"),
hbos09bc1282016-11-08 06:29:22 -0800460 frames_sent("framesSent"),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100461 huge_frames_sent("hugeFramesSent"),
hbos09bc1282016-11-08 06:29:22 -0800462 frames_received("framesReceived"),
463 frames_decoded("framesDecoded"),
464 frames_dropped("framesDropped"),
hbos09bc1282016-11-08 06:29:22 -0800465 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700466 total_audio_energy("totalAudioEnergy"),
hbos09bc1282016-11-08 06:29:22 -0800467 echo_return_loss("echoReturnLoss"),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700468 echo_return_loss_enhancement("echoReturnLossEnhancement"),
469 total_samples_received("totalSamplesReceived"),
470 total_samples_duration("totalSamplesDuration"),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200471 concealed_samples("concealedSamples"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200472 silent_concealed_samples("silentConcealedSamples"),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100473 concealment_events("concealmentEvents"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200474 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
475 removed_samples_for_acceleration("removedSamplesForAcceleration"),
Jakob Ivarsson758d9462019-03-19 15:38:49 +0100476 jitter_buffer_flushes(
477 "jitterBufferFlushes",
478 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
479 delayed_packet_outage_samples(
480 "delayedPacketOutageSamples",
481 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
482 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
483 relative_packet_arrival_delay(
484 "relativePacketArrivalDelay",
485 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200486 interruption_count("interruptionCount"),
487 total_interruption_duration("totalInterruptionDuration"),
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200488 total_frames_duration("totalFramesDuration"),
489 sum_squared_frame_durations("sumOfSquaredFramesDuration"),
Sergey Silkin02371062019-01-31 16:45:42 +0100490 freeze_count("freezeCount"),
491 pause_count("pauseCount"),
492 total_freezes_duration("totalFreezesDuration"),
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200493 total_pauses_duration("totalPausesDuration") {
hbos160e4a72017-01-17 02:53:23 -0800494 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
495 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800496}
497
498RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
499 const RTCMediaStreamTrackStats& other)
500 : RTCStats(other.id(), other.timestamp_us()),
501 track_identifier(other.track_identifier),
Henrik Boström646fda02019-05-22 15:49:42 +0200502 media_source_id(other.media_source_id),
hbos09bc1282016-11-08 06:29:22 -0800503 remote_source(other.remote_source),
504 ended(other.ended),
505 detached(other.detached),
hbos160e4a72017-01-17 02:53:23 -0800506 kind(other.kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200507 jitter_buffer_delay(other.jitter_buffer_delay),
Chen Xing0acffb52019-01-15 15:46:29 +0100508 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
hbos09bc1282016-11-08 06:29:22 -0800509 frame_width(other.frame_width),
510 frame_height(other.frame_height),
hbos09bc1282016-11-08 06:29:22 -0800511 frames_sent(other.frames_sent),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100512 huge_frames_sent(other.huge_frames_sent),
hbos09bc1282016-11-08 06:29:22 -0800513 frames_received(other.frames_received),
514 frames_decoded(other.frames_decoded),
515 frames_dropped(other.frames_dropped),
hbos09bc1282016-11-08 06:29:22 -0800516 audio_level(other.audio_level),
zsteine76bd3a2017-07-14 12:17:49 -0700517 total_audio_energy(other.total_audio_energy),
hbos09bc1282016-11-08 06:29:22 -0800518 echo_return_loss(other.echo_return_loss),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700519 echo_return_loss_enhancement(other.echo_return_loss_enhancement),
520 total_samples_received(other.total_samples_received),
521 total_samples_duration(other.total_samples_duration),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200522 concealed_samples(other.concealed_samples),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200523 silent_concealed_samples(other.silent_concealed_samples),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100524 concealment_events(other.concealment_events),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200525 inserted_samples_for_deceleration(
526 other.inserted_samples_for_deceleration),
527 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100528 jitter_buffer_flushes(other.jitter_buffer_flushes),
Sergey Silkin02371062019-01-31 16:45:42 +0100529 delayed_packet_outage_samples(other.delayed_packet_outage_samples),
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100530 relative_packet_arrival_delay(other.relative_packet_arrival_delay),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200531 interruption_count(other.interruption_count),
532 total_interruption_duration(other.total_interruption_duration),
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200533 total_frames_duration(other.total_frames_duration),
534 sum_squared_frame_durations(other.sum_squared_frame_durations),
Sergey Silkin02371062019-01-31 16:45:42 +0100535 freeze_count(other.freeze_count),
536 pause_count(other.pause_count),
537 total_freezes_duration(other.total_freezes_duration),
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200538 total_pauses_duration(other.total_pauses_duration) {}
hbos09bc1282016-11-08 06:29:22 -0800539
Yves Gerey665174f2018-06-19 15:03:05 +0200540RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {}
hbos09bc1282016-11-08 06:29:22 -0800541
Steve Antond6a5cbd2017-08-18 09:40:25 -0700542// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700543WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
544 &data_channels_opened,
Nico Weber22f99252019-02-20 10:13:16 -0500545 &data_channels_closed)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700546// clang-format on
hbosd565b732016-08-30 14:04:35 -0700547
Yves Gerey665174f2018-06-19 15:03:05 +0200548RTCPeerConnectionStats::RTCPeerConnectionStats(const std::string& id,
549 int64_t timestamp_us)
550 : RTCPeerConnectionStats(std::string(id), timestamp_us) {}
hbosd565b732016-08-30 14:04:35 -0700551
Yves Gerey665174f2018-06-19 15:03:05 +0200552RTCPeerConnectionStats::RTCPeerConnectionStats(std::string&& id,
553 int64_t timestamp_us)
hbos0e6758d2016-08-31 07:57:36 -0700554 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700555 data_channels_opened("dataChannelsOpened"),
Yves Gerey665174f2018-06-19 15:03:05 +0200556 data_channels_closed("dataChannelsClosed") {}
hbosd565b732016-08-30 14:04:35 -0700557
hbosfc5e0502016-10-06 02:06:10 -0700558RTCPeerConnectionStats::RTCPeerConnectionStats(
559 const RTCPeerConnectionStats& other)
560 : RTCStats(other.id(), other.timestamp_us()),
561 data_channels_opened(other.data_channels_opened),
Yves Gerey665174f2018-06-19 15:03:05 +0200562 data_channels_closed(other.data_channels_closed) {}
hbosfc5e0502016-10-06 02:06:10 -0700563
Yves Gerey665174f2018-06-19 15:03:05 +0200564RTCPeerConnectionStats::~RTCPeerConnectionStats() {}
hbosfc5e0502016-10-06 02:06:10 -0700565
Steve Antond6a5cbd2017-08-18 09:40:25 -0700566// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700567WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
568 &ssrc,
Philipp Hancke3bc01662018-08-28 14:55:03 +0200569 &kind,
hbosb0ae9202017-01-27 06:35:16 -0800570 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700571 &transport_id,
572 &codec_id,
Di Wufd1e9d12021-03-09 09:25:28 -0800573 &media_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700574// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700575
Yves Gerey665174f2018-06-19 15:03:05 +0200576RTCRTPStreamStats::RTCRTPStreamStats(const std::string& id,
577 int64_t timestamp_us)
578 : RTCRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700579
Yves Gerey665174f2018-06-19 15:03:05 +0200580RTCRTPStreamStats::RTCRTPStreamStats(std::string&& id, int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700581 : RTCStats(std::move(id), timestamp_us),
582 ssrc("ssrc"),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200583 kind("kind"),
hbosb0ae9202017-01-27 06:35:16 -0800584 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700585 transport_id("transportId"),
586 codec_id("codecId"),
Di Wufd1e9d12021-03-09 09:25:28 -0800587 media_type("mediaType") {}
hbos6ded1902016-11-01 01:50:46 -0700588
Yves Gerey665174f2018-06-19 15:03:05 +0200589RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other)
hbos6ded1902016-11-01 01:50:46 -0700590 : RTCStats(other.id(), other.timestamp_us()),
591 ssrc(other.ssrc),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200592 kind(other.kind),
hbosb0ae9202017-01-27 06:35:16 -0800593 track_id(other.track_id),
hbos6ded1902016-11-01 01:50:46 -0700594 transport_id(other.transport_id),
595 codec_id(other.codec_id),
Di Wufd1e9d12021-03-09 09:25:28 -0800596 media_type(other.media_type) {}
hbos6ded1902016-11-01 01:50:46 -0700597
Yves Gerey665174f2018-06-19 15:03:05 +0200598RTCRTPStreamStats::~RTCRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700599
Steve Antond6a5cbd2017-08-18 09:40:25 -0700600// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700601WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800602 RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp",
603 &jitter,
Henrik Boströma494e4b2022-10-03 17:26:41 +0200604 &packets_lost)
Di Wufd1e9d12021-03-09 09:25:28 -0800605// clang-format on
606
607RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(const std::string&& id,
608 int64_t timestamp_us)
609 : RTCReceivedRtpStreamStats(std::string(id), timestamp_us) {}
610
611RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string&& id,
612 int64_t timestamp_us)
613 : RTCRTPStreamStats(std::move(id), timestamp_us),
614 jitter("jitter"),
Henrik Boströma494e4b2022-10-03 17:26:41 +0200615 packets_lost("packetsLost") {}
Di Wufd1e9d12021-03-09 09:25:28 -0800616
617RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(
618 const RTCReceivedRtpStreamStats& other)
619 : RTCRTPStreamStats(other),
620 jitter(other.jitter),
Henrik Boströma494e4b2022-10-03 17:26:41 +0200621 packets_lost(other.packets_lost) {}
Di Wufd1e9d12021-03-09 09:25:28 -0800622
623RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {}
624
625// clang-format off
626WEBRTC_RTCSTATS_IMPL(
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100627 RTCSentRtpStreamStats, RTCRTPStreamStats, "sent-rtp",
628 &packets_sent,
629 &bytes_sent)
630// clang-format on
631
632RTCSentRtpStreamStats::RTCSentRtpStreamStats(const std::string&& id,
633 int64_t timestamp_us)
634 : RTCSentRtpStreamStats(std::string(id), timestamp_us) {}
635
636RTCSentRtpStreamStats::RTCSentRtpStreamStats(std::string&& id,
637 int64_t timestamp_us)
638 : RTCRTPStreamStats(std::move(id), timestamp_us),
639 packets_sent("packetsSent"),
640 bytes_sent("bytesSent") {}
641
642RTCSentRtpStreamStats::RTCSentRtpStreamStats(const RTCSentRtpStreamStats& other)
643 : RTCRTPStreamStats(other),
644 packets_sent(other.packets_sent),
645 bytes_sent(other.bytes_sent) {}
646
647RTCSentRtpStreamStats::~RTCSentRtpStreamStats() {}
648
649// clang-format off
650WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800651 RTCInboundRTPStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp",
Henrik Boströma6c7d5c2022-06-16 16:55:31 +0200652 &track_identifier,
Henrik Boström1ab61882022-06-16 17:07:33 +0200653 &mid,
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100654 &remote_id,
hboseeafe942016-11-01 03:00:17 -0700655 &packets_received,
Henrik Boströma494e4b2022-10-03 17:26:41 +0200656 &packets_discarded,
Henrik Boström4a5dab02020-01-28 11:15:35 +0100657 &fec_packets_received,
658 &fec_packets_discarded,
hboseeafe942016-11-01 03:00:17 -0700659 &bytes_received,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200660 &header_bytes_received,
Henrik Boström01738c62019-04-15 17:32:00 +0200661 &last_packet_received_timestamp,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300662 &jitter_buffer_delay,
Ivo Creusen11fdb082022-07-04 14:16:39 +0200663 &jitter_buffer_target_delay,
Ivo Creusen1a84b562022-07-19 16:33:10 +0200664 &jitter_buffer_minimum_delay,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300665 &jitter_buffer_emitted_count,
666 &total_samples_received,
667 &concealed_samples,
668 &silent_concealed_samples,
669 &concealment_events,
670 &inserted_samples_for_deceleration,
671 &removed_samples_for_acceleration,
672 &audio_level,
673 &total_audio_energy,
674 &total_samples_duration,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200675 &frames_received,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300676 &frame_width,
677 &frame_height,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300678 &frames_per_second,
Henrik Boström2e069262019-04-09 13:59:31 +0200679 &frames_decoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200680 &key_frames_decoded,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300681 &frames_dropped,
Johannes Kronbfd343b2019-07-01 10:07:50 +0200682 &total_decode_time,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200683 &total_processing_delay,
Philipp Hancke0359ba22022-05-05 15:55:36 +0200684 &total_assembly_time,
685 &frames_assembled_from_multiple_packets,
Johannes Kron00376e12019-11-25 10:25:42 +0100686 &total_inter_frame_delay,
687 &total_squared_inter_frame_delay,
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200688 &pause_count,
689 &total_pauses_duration,
690 &freeze_count,
691 &total_freezes_duration,
Henrik Boström6b430862019-08-16 13:09:51 +0200692 &content_type,
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200693 &estimated_playout_timestamp,
Di Wufd1e9d12021-03-09 09:25:28 -0800694 &decoder_implementation,
695 &fir_count,
696 &pli_count,
697 &nack_count,
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200698 &qp_sum,
Henrik Boström2fb83072022-10-06 13:37:11 +0200699 &jitter_buffer_flushes,
700 &delayed_packet_outage_samples,
701 &relative_packet_arrival_delay,
702 &interruption_count,
703 &total_interruption_duration,
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200704 &min_playout_delay)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700705// clang-format on
hboseeafe942016-11-01 03:00:17 -0700706
Yves Gerey665174f2018-06-19 15:03:05 +0200707RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
708 int64_t timestamp_us)
709 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {}
hboseeafe942016-11-01 03:00:17 -0700710
Yves Gerey665174f2018-06-19 15:03:05 +0200711RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
712 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800713 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boströma6c7d5c2022-06-16 16:55:31 +0200714 track_identifier("trackIdentifier"),
Henrik Boström1ab61882022-06-16 17:07:33 +0200715 mid("mid"),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100716 remote_id("remoteId"),
hboseeafe942016-11-01 03:00:17 -0700717 packets_received("packetsReceived"),
Henrik Boströma494e4b2022-10-03 17:26:41 +0200718 packets_discarded("packetsDiscarded"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200719 fec_packets_received("fecPacketsReceived"),
720 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700721 bytes_received("bytesReceived"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200722 header_bytes_received("headerBytesReceived"),
Henrik Boström01738c62019-04-15 17:32:00 +0200723 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300724 jitter_buffer_delay("jitterBufferDelay"),
Ivo Creusen11fdb082022-07-04 14:16:39 +0200725 jitter_buffer_target_delay("jitterBufferTargetDelay"),
Ivo Creusen1a84b562022-07-19 16:33:10 +0200726 jitter_buffer_minimum_delay("jitterBufferMinimumDelay"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300727 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
728 total_samples_received("totalSamplesReceived"),
729 concealed_samples("concealedSamples"),
730 silent_concealed_samples("silentConcealedSamples"),
731 concealment_events("concealmentEvents"),
732 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
733 removed_samples_for_acceleration("removedSamplesForAcceleration"),
734 audio_level("audioLevel"),
735 total_audio_energy("totalAudioEnergy"),
736 total_samples_duration("totalSamplesDuration"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200737 frames_received("framesReceived"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300738 frame_width("frameWidth"),
739 frame_height("frameHeight"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300740 frames_per_second("framesPerSecond"),
Henrik Boström2e069262019-04-09 13:59:31 +0200741 frames_decoded("framesDecoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200742 key_frames_decoded("keyFramesDecoded"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300743 frames_dropped("framesDropped"),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200744 total_decode_time("totalDecodeTime"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200745 total_processing_delay("totalProcessingDelay"),
Philipp Hancke0359ba22022-05-05 15:55:36 +0200746 total_assembly_time("totalAssemblyTime"),
747 frames_assembled_from_multiple_packets(
748 "framesAssembledFromMultiplePackets"),
Johannes Kron00376e12019-11-25 10:25:42 +0100749 total_inter_frame_delay("totalInterFrameDelay"),
750 total_squared_inter_frame_delay("totalSquaredInterFrameDelay"),
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200751 pause_count("pauseCount"),
752 total_pauses_duration("totalPausesDuration"),
753 freeze_count("freezeCount"),
754 total_freezes_duration("totalFreezesDuration"),
Henrik Boström6b430862019-08-16 13:09:51 +0200755 content_type("contentType"),
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200756 estimated_playout_timestamp("estimatedPlayoutTimestamp"),
Di Wufd1e9d12021-03-09 09:25:28 -0800757 decoder_implementation("decoderImplementation"),
758 fir_count("firCount"),
759 pli_count("pliCount"),
760 nack_count("nackCount"),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200761 qp_sum("qpSum"),
Henrik Boström2fb83072022-10-06 13:37:11 +0200762 jitter_buffer_flushes(
763 "jitterBufferFlushes",
764 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
765 delayed_packet_outage_samples(
766 "delayedPacketOutageSamples",
767 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
768 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
769 relative_packet_arrival_delay(
770 "relativePacketArrivalDelay",
771 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
772 interruption_count("interruptionCount"),
773 total_interruption_duration("totalInterruptionDuration"),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200774 min_playout_delay("minPlayoutDelay") {}
hboseeafe942016-11-01 03:00:17 -0700775
776RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
777 const RTCInboundRTPStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800778 : RTCReceivedRtpStreamStats(other),
Henrik Boströma6c7d5c2022-06-16 16:55:31 +0200779 track_identifier(other.track_identifier),
Henrik Boström1ab61882022-06-16 17:07:33 +0200780 mid(other.mid),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100781 remote_id(other.remote_id),
hboseeafe942016-11-01 03:00:17 -0700782 packets_received(other.packets_received),
Henrik Boströma494e4b2022-10-03 17:26:41 +0200783 packets_discarded(other.packets_discarded),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200784 fec_packets_received(other.fec_packets_received),
785 fec_packets_discarded(other.fec_packets_discarded),
hboseeafe942016-11-01 03:00:17 -0700786 bytes_received(other.bytes_received),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200787 header_bytes_received(other.header_bytes_received),
Henrik Boström01738c62019-04-15 17:32:00 +0200788 last_packet_received_timestamp(other.last_packet_received_timestamp),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300789 jitter_buffer_delay(other.jitter_buffer_delay),
Ivo Creusen11fdb082022-07-04 14:16:39 +0200790 jitter_buffer_target_delay(other.jitter_buffer_target_delay),
Ivo Creusen1a84b562022-07-19 16:33:10 +0200791 jitter_buffer_minimum_delay(other.jitter_buffer_minimum_delay),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300792 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
793 total_samples_received(other.total_samples_received),
794 concealed_samples(other.concealed_samples),
795 silent_concealed_samples(other.silent_concealed_samples),
796 concealment_events(other.concealment_events),
797 inserted_samples_for_deceleration(
798 other.inserted_samples_for_deceleration),
799 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
800 audio_level(other.audio_level),
801 total_audio_energy(other.total_audio_energy),
802 total_samples_duration(other.total_samples_duration),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200803 frames_received(other.frames_received),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300804 frame_width(other.frame_width),
805 frame_height(other.frame_height),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300806 frames_per_second(other.frames_per_second),
Henrik Boström2e069262019-04-09 13:59:31 +0200807 frames_decoded(other.frames_decoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200808 key_frames_decoded(other.key_frames_decoded),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300809 frames_dropped(other.frames_dropped),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200810 total_decode_time(other.total_decode_time),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200811 total_processing_delay(other.total_processing_delay),
Philipp Hancke0359ba22022-05-05 15:55:36 +0200812 total_assembly_time(other.total_assembly_time),
813 frames_assembled_from_multiple_packets(
814 other.frames_assembled_from_multiple_packets),
Johannes Kron00376e12019-11-25 10:25:42 +0100815 total_inter_frame_delay(other.total_inter_frame_delay),
816 total_squared_inter_frame_delay(other.total_squared_inter_frame_delay),
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200817 pause_count(other.pause_count),
818 total_pauses_duration(other.total_pauses_duration),
819 freeze_count(other.freeze_count),
820 total_freezes_duration(other.total_freezes_duration),
Henrik Boström6b430862019-08-16 13:09:51 +0200821 content_type(other.content_type),
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200822 estimated_playout_timestamp(other.estimated_playout_timestamp),
Di Wufd1e9d12021-03-09 09:25:28 -0800823 decoder_implementation(other.decoder_implementation),
824 fir_count(other.fir_count),
825 pli_count(other.pli_count),
826 nack_count(other.nack_count),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200827 qp_sum(other.qp_sum),
Henrik Boström2fb83072022-10-06 13:37:11 +0200828 jitter_buffer_flushes(other.jitter_buffer_flushes),
829 delayed_packet_outage_samples(other.delayed_packet_outage_samples),
830 relative_packet_arrival_delay(other.relative_packet_arrival_delay),
831 interruption_count(other.interruption_count),
832 total_interruption_duration(other.total_interruption_duration),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200833 min_playout_delay(other.min_playout_delay) {}
hboseeafe942016-11-01 03:00:17 -0700834
Yves Gerey665174f2018-06-19 15:03:05 +0200835RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700836
Steve Antond6a5cbd2017-08-18 09:40:25 -0700837// clang-format off
hboseeafe942016-11-01 03:00:17 -0700838WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700839 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200840 &media_source_id,
Henrik Boström4f40fa52019-12-19 13:27:27 +0100841 &remote_id,
Henrik Boström1ab61882022-06-16 17:07:33 +0200842 &mid,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200843 &rid,
hbos6ded1902016-11-01 01:50:46 -0700844 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200845 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700846 &bytes_sent,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200847 &header_bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200848 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700849 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200850 &frames_encoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200851 &key_frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200852 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200853 &total_encoded_bytes_target,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200854 &frame_width,
855 &frame_height,
856 &frames_per_second,
857 &frames_sent,
858 &huge_frames_sent,
Henrik Boström9fe18342019-05-16 18:38:20 +0200859 &total_packet_send_delay,
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200860 &quality_limitation_reason,
Byoungchan Lee7d235352021-05-28 21:32:04 +0900861 &quality_limitation_durations,
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200862 &quality_limitation_resolution_changes,
Henrik Boström6b430862019-08-16 13:09:51 +0200863 &content_type,
Di Wufd1e9d12021-03-09 09:25:28 -0800864 &encoder_implementation,
865 &fir_count,
866 &pli_count,
867 &nack_count,
Philipp Hancke684e2412022-07-28 12:41:00 +0200868 &qp_sum,
869 &active)
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öm1ab61882022-06-16 17:07:33 +0200881 mid("mid"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200882 rid("rid"),
hbos6ded1902016-11-01 01:50:46 -0700883 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200884 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700885 bytes_sent("bytesSent"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200886 header_bytes_sent("headerBytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200887 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700888 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200889 frames_encoded("framesEncoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200890 key_frames_encoded("keyFramesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200891 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200892 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200893 frame_width("frameWidth"),
894 frame_height("frameHeight"),
895 frames_per_second("framesPerSecond"),
896 frames_sent("framesSent"),
897 huge_frames_sent("hugeFramesSent"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200898 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200899 quality_limitation_reason("qualityLimitationReason"),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900900 quality_limitation_durations("qualityLimitationDurations"),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200901 quality_limitation_resolution_changes(
902 "qualityLimitationResolutionChanges"),
Henrik Boström6b430862019-08-16 13:09:51 +0200903 content_type("contentType"),
Di Wufd1e9d12021-03-09 09:25:28 -0800904 encoder_implementation("encoderImplementation"),
905 fir_count("firCount"),
906 pli_count("pliCount"),
907 nack_count("nackCount"),
Philipp Hancke684e2412022-07-28 12:41:00 +0200908 qp_sum("qpSum"),
909 active("active") {}
hbos6ded1902016-11-01 01:50:46 -0700910
911RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
912 const RTCOutboundRTPStreamStats& other)
913 : RTCRTPStreamStats(other),
Henrik Boström646fda02019-05-22 15:49:42 +0200914 media_source_id(other.media_source_id),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100915 remote_id(other.remote_id),
Henrik Boström1ab61882022-06-16 17:07:33 +0200916 mid(other.mid),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200917 rid(other.rid),
hbos6ded1902016-11-01 01:50:46 -0700918 packets_sent(other.packets_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200919 retransmitted_packets_sent(other.retransmitted_packets_sent),
hbos6ded1902016-11-01 01:50:46 -0700920 bytes_sent(other.bytes_sent),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200921 header_bytes_sent(other.header_bytes_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200922 retransmitted_bytes_sent(other.retransmitted_bytes_sent),
hbos6ded1902016-11-01 01:50:46 -0700923 target_bitrate(other.target_bitrate),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200924 frames_encoded(other.frames_encoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200925 key_frames_encoded(other.key_frames_encoded),
Henrik Boström2e069262019-04-09 13:59:31 +0200926 total_encode_time(other.total_encode_time),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200927 total_encoded_bytes_target(other.total_encoded_bytes_target),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200928 frame_width(other.frame_width),
929 frame_height(other.frame_height),
930 frames_per_second(other.frames_per_second),
931 frames_sent(other.frames_sent),
932 huge_frames_sent(other.huge_frames_sent),
Henrik Boström9fe18342019-05-16 18:38:20 +0200933 total_packet_send_delay(other.total_packet_send_delay),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200934 quality_limitation_reason(other.quality_limitation_reason),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900935 quality_limitation_durations(other.quality_limitation_durations),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200936 quality_limitation_resolution_changes(
937 other.quality_limitation_resolution_changes),
Henrik Boström6b430862019-08-16 13:09:51 +0200938 content_type(other.content_type),
Di Wufd1e9d12021-03-09 09:25:28 -0800939 encoder_implementation(other.encoder_implementation),
940 fir_count(other.fir_count),
941 pli_count(other.pli_count),
942 nack_count(other.nack_count),
Philipp Hancke684e2412022-07-28 12:41:00 +0200943 qp_sum(other.qp_sum),
944 active(other.active) {}
hbos6ded1902016-11-01 01:50:46 -0700945
Yves Gerey665174f2018-06-19 15:03:05 +0200946RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700947
Steve Antond6a5cbd2017-08-18 09:40:25 -0700948// clang-format off
Henrik Boström883eefc2019-05-27 13:40:25 +0200949WEBRTC_RTCSTATS_IMPL(
Henrik Boström2f71b612021-03-23 15:18:55 +0100950 RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
951 "remote-inbound-rtp",
Henrik Boström883eefc2019-05-27 13:40:25 +0200952 &local_id,
Di Wu86f04ad2021-02-28 23:36:03 -0800953 &round_trip_time,
Di Wu88a51b22021-03-01 11:22:06 -0800954 &fraction_lost,
955 &total_round_trip_time,
956 &round_trip_time_measurements)
Henrik Boström883eefc2019-05-27 13:40:25 +0200957// clang-format on
958
959RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
960 const std::string& id,
961 int64_t timestamp_us)
962 : RTCRemoteInboundRtpStreamStats(std::string(id), timestamp_us) {}
963
964RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
965 std::string&& id,
966 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800967 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boström883eefc2019-05-27 13:40:25 +0200968 local_id("localId"),
Di Wu86f04ad2021-02-28 23:36:03 -0800969 round_trip_time("roundTripTime"),
Di Wu88a51b22021-03-01 11:22:06 -0800970 fraction_lost("fractionLost"),
971 total_round_trip_time("totalRoundTripTime"),
972 round_trip_time_measurements("roundTripTimeMeasurements") {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200973
974RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
975 const RTCRemoteInboundRtpStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800976 : RTCReceivedRtpStreamStats(other),
Henrik Boström883eefc2019-05-27 13:40:25 +0200977 local_id(other.local_id),
Di Wu86f04ad2021-02-28 23:36:03 -0800978 round_trip_time(other.round_trip_time),
Di Wu88a51b22021-03-01 11:22:06 -0800979 fraction_lost(other.fraction_lost),
980 total_round_trip_time(other.total_round_trip_time),
981 round_trip_time_measurements(other.round_trip_time_measurements) {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200982
983RTCRemoteInboundRtpStreamStats::~RTCRemoteInboundRtpStreamStats() {}
984
985// clang-format off
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100986WEBRTC_RTCSTATS_IMPL(
987 RTCRemoteOutboundRtpStreamStats, RTCSentRtpStreamStats,
988 "remote-outbound-rtp",
989 &local_id,
990 &remote_timestamp,
Ivo Creusen2562cf02021-09-03 14:51:22 +0000991 &reports_sent,
992 &round_trip_time,
993 &round_trip_time_measurements,
994 &total_round_trip_time)
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100995// clang-format on
996
997RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
998 const std::string& id,
999 int64_t timestamp_us)
1000 : RTCRemoteOutboundRtpStreamStats(std::string(id), timestamp_us) {}
1001
1002RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
1003 std::string&& id,
1004 int64_t timestamp_us)
1005 : RTCSentRtpStreamStats(std::move(id), timestamp_us),
1006 local_id("localId"),
1007 remote_timestamp("remoteTimestamp"),
Ivo Creusen2562cf02021-09-03 14:51:22 +00001008 reports_sent("reportsSent"),
1009 round_trip_time("roundTripTime"),
1010 round_trip_time_measurements("roundTripTimeMeasurements"),
1011 total_round_trip_time("totalRoundTripTime") {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +01001012
1013RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
1014 const RTCRemoteOutboundRtpStreamStats& other)
1015 : RTCSentRtpStreamStats(other),
1016 local_id(other.local_id),
1017 remote_timestamp(other.remote_timestamp),
Ivo Creusen2562cf02021-09-03 14:51:22 +00001018 reports_sent(other.reports_sent),
1019 round_trip_time(other.round_trip_time),
1020 round_trip_time_measurements(other.round_trip_time_measurements),
1021 total_round_trip_time(other.total_round_trip_time) {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +01001022
1023RTCRemoteOutboundRtpStreamStats::~RTCRemoteOutboundRtpStreamStats() {}
1024
1025// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +02001026WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
1027 &track_identifier,
1028 &kind)
1029// clang-format on
1030
1031RTCMediaSourceStats::RTCMediaSourceStats(const std::string& id,
1032 int64_t timestamp_us)
1033 : RTCMediaSourceStats(std::string(id), timestamp_us) {}
1034
1035RTCMediaSourceStats::RTCMediaSourceStats(std::string&& id, int64_t timestamp_us)
1036 : RTCStats(std::move(id), timestamp_us),
1037 track_identifier("trackIdentifier"),
1038 kind("kind") {}
1039
1040RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other)
1041 : RTCStats(other.id(), other.timestamp_us()),
1042 track_identifier(other.track_identifier),
1043 kind(other.kind) {}
1044
1045RTCMediaSourceStats::~RTCMediaSourceStats() {}
1046
1047// clang-format off
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001048WEBRTC_RTCSTATS_IMPL(RTCAudioSourceStats, RTCMediaSourceStats, "media-source",
1049 &audio_level,
1050 &total_audio_energy,
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001051 &total_samples_duration,
1052 &echo_return_loss,
1053 &echo_return_loss_enhancement)
Henrik Boström646fda02019-05-22 15:49:42 +02001054// clang-format on
1055
1056RTCAudioSourceStats::RTCAudioSourceStats(const std::string& id,
1057 int64_t timestamp_us)
1058 : RTCAudioSourceStats(std::string(id), timestamp_us) {}
1059
1060RTCAudioSourceStats::RTCAudioSourceStats(std::string&& id, int64_t timestamp_us)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001061 : RTCMediaSourceStats(std::move(id), timestamp_us),
1062 audio_level("audioLevel"),
1063 total_audio_energy("totalAudioEnergy"),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001064 total_samples_duration("totalSamplesDuration"),
1065 echo_return_loss("echoReturnLoss"),
1066 echo_return_loss_enhancement("echoReturnLossEnhancement") {}
Henrik Boström646fda02019-05-22 15:49:42 +02001067
1068RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001069 : RTCMediaSourceStats(other),
1070 audio_level(other.audio_level),
1071 total_audio_energy(other.total_audio_energy),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001072 total_samples_duration(other.total_samples_duration),
1073 echo_return_loss(other.echo_return_loss),
1074 echo_return_loss_enhancement(other.echo_return_loss_enhancement) {}
Henrik Boström646fda02019-05-22 15:49:42 +02001075
1076RTCAudioSourceStats::~RTCAudioSourceStats() {}
1077
1078// clang-format off
1079WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
1080 &width,
1081 &height,
1082 &frames,
1083 &frames_per_second)
1084// clang-format on
1085
1086RTCVideoSourceStats::RTCVideoSourceStats(const std::string& id,
1087 int64_t timestamp_us)
1088 : RTCVideoSourceStats(std::string(id), timestamp_us) {}
1089
1090RTCVideoSourceStats::RTCVideoSourceStats(std::string&& id, int64_t timestamp_us)
1091 : RTCMediaSourceStats(std::move(id), timestamp_us),
1092 width("width"),
1093 height("height"),
1094 frames("frames"),
1095 frames_per_second("framesPerSecond") {}
1096
1097RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other)
1098 : RTCMediaSourceStats(other),
1099 width(other.width),
1100 height(other.height),
1101 frames(other.frames),
1102 frames_per_second(other.frames_per_second) {}
1103
1104RTCVideoSourceStats::~RTCVideoSourceStats() {}
1105
1106// clang-format off
hbos2fa7c672016-10-24 04:00:05 -07001107WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
1108 &bytes_sent,
Artem Titovedacbd52020-07-06 16:06:37 +02001109 &packets_sent,
hbos2fa7c672016-10-24 04:00:05 -07001110 &bytes_received,
Artem Titovedacbd52020-07-06 16:06:37 +02001111 &packets_received,
hbos2fa7c672016-10-24 04:00:05 -07001112 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -08001113 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -07001114 &selected_candidate_pair_id,
1115 &local_certificate_id,
Jonas Oreland149dc722019-08-28 08:10:27 +02001116 &remote_certificate_id,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001117 &tls_version,
1118 &dtls_cipher,
Philipp Hancke69c1df22022-04-22 15:46:24 +02001119 &dtls_role,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001120 &srtp_cipher,
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001121 &selected_candidate_pair_changes,
Philipp Hancke95b1a342022-05-05 07:53:54 +02001122 &ice_role,
Philipp Hancke1f491572022-05-09 17:43:31 +02001123 &ice_local_username_fragment,
1124 &ice_state)
Steve Antond6a5cbd2017-08-18 09:40:25 -07001125// clang-format on
hbos2fa7c672016-10-24 04:00:05 -07001126
Yves Gerey665174f2018-06-19 15:03:05 +02001127RTCTransportStats::RTCTransportStats(const std::string& id,
1128 int64_t timestamp_us)
1129 : RTCTransportStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -07001130
Yves Gerey665174f2018-06-19 15:03:05 +02001131RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -07001132 : RTCStats(std::move(id), timestamp_us),
1133 bytes_sent("bytesSent"),
Artem Titovedacbd52020-07-06 16:06:37 +02001134 packets_sent("packetsSent"),
hbos2fa7c672016-10-24 04:00:05 -07001135 bytes_received("bytesReceived"),
Artem Titovedacbd52020-07-06 16:06:37 +02001136 packets_received("packetsReceived"),
hbos2fa7c672016-10-24 04:00:05 -07001137 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -08001138 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -07001139 selected_candidate_pair_id("selectedCandidatePairId"),
1140 local_certificate_id("localCertificateId"),
Jonas Oreland149dc722019-08-28 08:10:27 +02001141 remote_certificate_id("remoteCertificateId"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001142 tls_version("tlsVersion"),
1143 dtls_cipher("dtlsCipher"),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001144 dtls_role("dtlsRole"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001145 srtp_cipher("srtpCipher"),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001146 selected_candidate_pair_changes("selectedCandidatePairChanges"),
Philipp Hancke95b1a342022-05-05 07:53:54 +02001147 ice_role("iceRole"),
Philipp Hancke1f491572022-05-09 17:43:31 +02001148 ice_local_username_fragment("iceLocalUsernameFragment"),
1149 ice_state("iceState") {}
hbos2fa7c672016-10-24 04:00:05 -07001150
Yves Gerey665174f2018-06-19 15:03:05 +02001151RTCTransportStats::RTCTransportStats(const RTCTransportStats& other)
hbos2fa7c672016-10-24 04:00:05 -07001152 : RTCStats(other.id(), other.timestamp_us()),
1153 bytes_sent(other.bytes_sent),
Artem Titovedacbd52020-07-06 16:06:37 +02001154 packets_sent(other.packets_sent),
hbos2fa7c672016-10-24 04:00:05 -07001155 bytes_received(other.bytes_received),
Artem Titovedacbd52020-07-06 16:06:37 +02001156 packets_received(other.packets_received),
hbos2fa7c672016-10-24 04:00:05 -07001157 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -08001158 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -07001159 selected_candidate_pair_id(other.selected_candidate_pair_id),
1160 local_certificate_id(other.local_certificate_id),
Jonas Oreland149dc722019-08-28 08:10:27 +02001161 remote_certificate_id(other.remote_certificate_id),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001162 tls_version(other.tls_version),
1163 dtls_cipher(other.dtls_cipher),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001164 dtls_role(other.dtls_role),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001165 srtp_cipher(other.srtp_cipher),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001166 selected_candidate_pair_changes(other.selected_candidate_pair_changes),
Philipp Hancke95b1a342022-05-05 07:53:54 +02001167 ice_role(other.ice_role),
Philipp Hancke1f491572022-05-09 17:43:31 +02001168 ice_local_username_fragment(other.ice_local_username_fragment),
1169 ice_state(other.ice_state) {}
hbos2fa7c672016-10-24 04:00:05 -07001170
Yves Gerey665174f2018-06-19 15:03:05 +02001171RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -07001172
hbosd565b732016-08-30 14:04:35 -07001173} // namespace webrtc