blob: 77a2414e41147080b08358e20553b203cd2b8d31 [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,
282 &vpn,
283 &network_adapter_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700284// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700285
Yves Gerey665174f2018-06-19 15:03:05 +0200286RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id,
287 int64_t timestamp_us,
288 bool is_remote)
289 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {}
hbosab9f6e42016-10-07 02:18:47 -0700290
Gary Liu37e489c2017-11-21 10:49:36 -0800291RTCIceCandidateStats::RTCIceCandidateStats(std::string&& id,
292 int64_t timestamp_us,
293 bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700294 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800295 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800296 is_remote("isRemote", is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800297 network_type("networkType"),
hbosab9f6e42016-10-07 02:18:47 -0700298 ip("ip"),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100299 address("address"),
hbosab9f6e42016-10-07 02:18:47 -0700300 port("port"),
301 protocol("protocol"),
Philipp Hancke95513752018-09-27 14:40:08 +0200302 relay_protocol("relayProtocol"),
hbosab9f6e42016-10-07 02:18:47 -0700303 candidate_type("candidateType"),
304 priority("priority"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100305 url("url"),
306 vpn("vpn"),
307 network_adapter_type("networkAdapterType") {}
hbosab9f6e42016-10-07 02:18:47 -0700308
309RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
310 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800311 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800312 is_remote(other.is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800313 network_type(other.network_type),
hbosab9f6e42016-10-07 02:18:47 -0700314 ip(other.ip),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100315 address(other.address),
hbosab9f6e42016-10-07 02:18:47 -0700316 port(other.port),
317 protocol(other.protocol),
Philipp Hancke95513752018-09-27 14:40:08 +0200318 relay_protocol(other.relay_protocol),
hbosab9f6e42016-10-07 02:18:47 -0700319 candidate_type(other.candidate_type),
320 priority(other.priority),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100321 url(other.url),
322 vpn(other.vpn),
323 network_adapter_type(other.network_adapter_type) {}
hbosab9f6e42016-10-07 02:18:47 -0700324
Yves Gerey665174f2018-06-19 15:03:05 +0200325RTCIceCandidateStats::~RTCIceCandidateStats() {}
hbosab9f6e42016-10-07 02:18:47 -0700326
327const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
328
Yves Gerey665174f2018-06-19 15:03:05 +0200329RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(const std::string& id,
330 int64_t timestamp_us)
331 : RTCIceCandidateStats(id, timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700332
Yves Gerey665174f2018-06-19 15:03:05 +0200333RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string&& id,
334 int64_t timestamp_us)
335 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700336
Henrik Boström1df1bf82018-03-20 13:24:20 +0100337std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const {
338 return std::unique_ptr<RTCStats>(new RTCLocalIceCandidateStats(*this));
339}
340
hbosab9f6e42016-10-07 02:18:47 -0700341const char* RTCLocalIceCandidateStats::type() const {
342 return kType;
343}
344
345const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
346
Yves Gerey665174f2018-06-19 15:03:05 +0200347RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(const std::string& id,
348 int64_t timestamp_us)
349 : RTCIceCandidateStats(id, timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700350
Yves Gerey665174f2018-06-19 15:03:05 +0200351RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string&& id,
352 int64_t timestamp_us)
353 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700354
Henrik Boström1df1bf82018-03-20 13:24:20 +0100355std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const {
356 return std::unique_ptr<RTCStats>(new RTCRemoteIceCandidateStats(*this));
357}
358
hbosab9f6e42016-10-07 02:18:47 -0700359const char* RTCRemoteIceCandidateStats::type() const {
360 return kType;
361}
362
Steve Antond6a5cbd2017-08-18 09:40:25 -0700363// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800364WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
365 &stream_identifier,
Nico Weber22f99252019-02-20 10:13:16 -0500366 &track_ids)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700367// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800368
Yves Gerey665174f2018-06-19 15:03:05 +0200369RTCMediaStreamStats::RTCMediaStreamStats(const std::string& id,
370 int64_t timestamp_us)
371 : RTCMediaStreamStats(std::string(id), timestamp_us) {}
hbos09bc1282016-11-08 06:29:22 -0800372
Yves Gerey665174f2018-06-19 15:03:05 +0200373RTCMediaStreamStats::RTCMediaStreamStats(std::string&& id, int64_t timestamp_us)
hbos09bc1282016-11-08 06:29:22 -0800374 : RTCStats(std::move(id), timestamp_us),
375 stream_identifier("streamIdentifier"),
Yves Gerey665174f2018-06-19 15:03:05 +0200376 track_ids("trackIds") {}
hbos09bc1282016-11-08 06:29:22 -0800377
Yves Gerey665174f2018-06-19 15:03:05 +0200378RTCMediaStreamStats::RTCMediaStreamStats(const RTCMediaStreamStats& other)
hbos09bc1282016-11-08 06:29:22 -0800379 : RTCStats(other.id(), other.timestamp_us()),
380 stream_identifier(other.stream_identifier),
Yves Gerey665174f2018-06-19 15:03:05 +0200381 track_ids(other.track_ids) {}
hbos09bc1282016-11-08 06:29:22 -0800382
Yves Gerey665174f2018-06-19 15:03:05 +0200383RTCMediaStreamStats::~RTCMediaStreamStats() {}
hbos09bc1282016-11-08 06:29:22 -0800384
Steve Antond6a5cbd2017-08-18 09:40:25 -0700385// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800386WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
zsteine76bd3a2017-07-14 12:17:49 -0700387 &track_identifier,
Henrik Boström646fda02019-05-22 15:49:42 +0200388 &media_source_id,
zsteine76bd3a2017-07-14 12:17:49 -0700389 &remote_source,
390 &ended,
391 &detached,
392 &kind,
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200393 &jitter_buffer_delay,
Chen Xing0acffb52019-01-15 15:46:29 +0100394 &jitter_buffer_emitted_count,
zsteine76bd3a2017-07-14 12:17:49 -0700395 &frame_width,
396 &frame_height,
zsteine76bd3a2017-07-14 12:17:49 -0700397 &frames_sent,
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100398 &huge_frames_sent,
zsteine76bd3a2017-07-14 12:17:49 -0700399 &frames_received,
400 &frames_decoded,
401 &frames_dropped,
zsteine76bd3a2017-07-14 12:17:49 -0700402 &audio_level,
403 &total_audio_energy,
zsteine76bd3a2017-07-14 12:17:49 -0700404 &echo_return_loss,
Steve Anton2dbc69f2017-08-24 17:15:13 -0700405 &echo_return_loss_enhancement,
406 &total_samples_received,
407 &total_samples_duration,
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200408 &concealed_samples,
Henrik Boström21e99da2019-08-21 12:09:51 +0200409 &silent_concealed_samples,
Ruslan Burakov8af88962018-11-22 17:21:10 +0100410 &concealment_events,
Henrik Boström21e99da2019-08-21 12:09:51 +0200411 &inserted_samples_for_deceleration,
412 &removed_samples_for_acceleration,
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100413 &jitter_buffer_flushes,
Sergey Silkin02371062019-01-31 16:45:42 +0100414 &delayed_packet_outage_samples,
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100415 &relative_packet_arrival_delay,
Artem Titove618cc92020-03-11 11:18:54 +0100416 &jitter_buffer_target_delay,
Henrik Lundin44125fa2019-04-29 17:00:46 +0200417 &interruption_count,
418 &total_interruption_duration,
Sergey Silkin02371062019-01-31 16:45:42 +0100419 &freeze_count,
420 &pause_count,
421 &total_freezes_duration,
422 &total_pauses_duration,
423 &total_frames_duration,
Nico Weber22f99252019-02-20 10:13:16 -0500424 &sum_squared_frame_durations)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700425// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800426
Yves Gerey665174f2018-06-19 15:03:05 +0200427RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(const std::string& id,
428 int64_t timestamp_us,
429 const char* kind)
430 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {}
hbos09bc1282016-11-08 06:29:22 -0800431
zsteine76bd3a2017-07-14 12:17:49 -0700432RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(std::string&& id,
433 int64_t timestamp_us,
434 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800435 : RTCStats(std::move(id), timestamp_us),
436 track_identifier("trackIdentifier"),
Henrik Boström646fda02019-05-22 15:49:42 +0200437 media_source_id("mediaSourceId"),
hbos09bc1282016-11-08 06:29:22 -0800438 remote_source("remoteSource"),
439 ended("ended"),
440 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800441 kind("kind", kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200442 jitter_buffer_delay("jitterBufferDelay"),
Chen Xing0acffb52019-01-15 15:46:29 +0100443 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
hbos09bc1282016-11-08 06:29:22 -0800444 frame_width("frameWidth"),
445 frame_height("frameHeight"),
hbos09bc1282016-11-08 06:29:22 -0800446 frames_sent("framesSent"),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100447 huge_frames_sent("hugeFramesSent"),
hbos09bc1282016-11-08 06:29:22 -0800448 frames_received("framesReceived"),
449 frames_decoded("framesDecoded"),
450 frames_dropped("framesDropped"),
hbos09bc1282016-11-08 06:29:22 -0800451 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700452 total_audio_energy("totalAudioEnergy"),
hbos09bc1282016-11-08 06:29:22 -0800453 echo_return_loss("echoReturnLoss"),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700454 echo_return_loss_enhancement("echoReturnLossEnhancement"),
455 total_samples_received("totalSamplesReceived"),
456 total_samples_duration("totalSamplesDuration"),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200457 concealed_samples("concealedSamples"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200458 silent_concealed_samples("silentConcealedSamples"),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100459 concealment_events("concealmentEvents"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200460 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
461 removed_samples_for_acceleration("removedSamplesForAcceleration"),
Jakob Ivarsson758d9462019-03-19 15:38:49 +0100462 jitter_buffer_flushes(
463 "jitterBufferFlushes",
464 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
465 delayed_packet_outage_samples(
466 "delayedPacketOutageSamples",
467 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
468 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
469 relative_packet_arrival_delay(
470 "relativePacketArrivalDelay",
471 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
Artem Titove618cc92020-03-11 11:18:54 +0100472 jitter_buffer_target_delay("jitterBufferTargetDelay"),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200473 interruption_count("interruptionCount"),
474 total_interruption_duration("totalInterruptionDuration"),
Sergey Silkin02371062019-01-31 16:45:42 +0100475 freeze_count("freezeCount"),
476 pause_count("pauseCount"),
477 total_freezes_duration("totalFreezesDuration"),
478 total_pauses_duration("totalPausesDuration"),
479 total_frames_duration("totalFramesDuration"),
480 sum_squared_frame_durations("sumOfSquaredFramesDuration") {
hbos160e4a72017-01-17 02:53:23 -0800481 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
482 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800483}
484
485RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
486 const RTCMediaStreamTrackStats& other)
487 : RTCStats(other.id(), other.timestamp_us()),
488 track_identifier(other.track_identifier),
Henrik Boström646fda02019-05-22 15:49:42 +0200489 media_source_id(other.media_source_id),
hbos09bc1282016-11-08 06:29:22 -0800490 remote_source(other.remote_source),
491 ended(other.ended),
492 detached(other.detached),
hbos160e4a72017-01-17 02:53:23 -0800493 kind(other.kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200494 jitter_buffer_delay(other.jitter_buffer_delay),
Chen Xing0acffb52019-01-15 15:46:29 +0100495 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
hbos09bc1282016-11-08 06:29:22 -0800496 frame_width(other.frame_width),
497 frame_height(other.frame_height),
hbos09bc1282016-11-08 06:29:22 -0800498 frames_sent(other.frames_sent),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100499 huge_frames_sent(other.huge_frames_sent),
hbos09bc1282016-11-08 06:29:22 -0800500 frames_received(other.frames_received),
501 frames_decoded(other.frames_decoded),
502 frames_dropped(other.frames_dropped),
hbos09bc1282016-11-08 06:29:22 -0800503 audio_level(other.audio_level),
zsteine76bd3a2017-07-14 12:17:49 -0700504 total_audio_energy(other.total_audio_energy),
hbos09bc1282016-11-08 06:29:22 -0800505 echo_return_loss(other.echo_return_loss),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700506 echo_return_loss_enhancement(other.echo_return_loss_enhancement),
507 total_samples_received(other.total_samples_received),
508 total_samples_duration(other.total_samples_duration),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200509 concealed_samples(other.concealed_samples),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200510 silent_concealed_samples(other.silent_concealed_samples),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100511 concealment_events(other.concealment_events),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200512 inserted_samples_for_deceleration(
513 other.inserted_samples_for_deceleration),
514 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100515 jitter_buffer_flushes(other.jitter_buffer_flushes),
Sergey Silkin02371062019-01-31 16:45:42 +0100516 delayed_packet_outage_samples(other.delayed_packet_outage_samples),
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100517 relative_packet_arrival_delay(other.relative_packet_arrival_delay),
Artem Titove618cc92020-03-11 11:18:54 +0100518 jitter_buffer_target_delay(other.jitter_buffer_target_delay),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200519 interruption_count(other.interruption_count),
520 total_interruption_duration(other.total_interruption_duration),
Sergey Silkin02371062019-01-31 16:45:42 +0100521 freeze_count(other.freeze_count),
522 pause_count(other.pause_count),
523 total_freezes_duration(other.total_freezes_duration),
524 total_pauses_duration(other.total_pauses_duration),
525 total_frames_duration(other.total_frames_duration),
526 sum_squared_frame_durations(other.sum_squared_frame_durations) {}
hbos09bc1282016-11-08 06:29:22 -0800527
Yves Gerey665174f2018-06-19 15:03:05 +0200528RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {}
hbos09bc1282016-11-08 06:29:22 -0800529
Steve Antond6a5cbd2017-08-18 09:40:25 -0700530// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700531WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
532 &data_channels_opened,
Nico Weber22f99252019-02-20 10:13:16 -0500533 &data_channels_closed)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700534// clang-format on
hbosd565b732016-08-30 14:04:35 -0700535
Yves Gerey665174f2018-06-19 15:03:05 +0200536RTCPeerConnectionStats::RTCPeerConnectionStats(const std::string& id,
537 int64_t timestamp_us)
538 : RTCPeerConnectionStats(std::string(id), timestamp_us) {}
hbosd565b732016-08-30 14:04:35 -0700539
Yves Gerey665174f2018-06-19 15:03:05 +0200540RTCPeerConnectionStats::RTCPeerConnectionStats(std::string&& id,
541 int64_t timestamp_us)
hbos0e6758d2016-08-31 07:57:36 -0700542 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700543 data_channels_opened("dataChannelsOpened"),
Yves Gerey665174f2018-06-19 15:03:05 +0200544 data_channels_closed("dataChannelsClosed") {}
hbosd565b732016-08-30 14:04:35 -0700545
hbosfc5e0502016-10-06 02:06:10 -0700546RTCPeerConnectionStats::RTCPeerConnectionStats(
547 const RTCPeerConnectionStats& other)
548 : RTCStats(other.id(), other.timestamp_us()),
549 data_channels_opened(other.data_channels_opened),
Yves Gerey665174f2018-06-19 15:03:05 +0200550 data_channels_closed(other.data_channels_closed) {}
hbosfc5e0502016-10-06 02:06:10 -0700551
Yves Gerey665174f2018-06-19 15:03:05 +0200552RTCPeerConnectionStats::~RTCPeerConnectionStats() {}
hbosfc5e0502016-10-06 02:06:10 -0700553
Steve Antond6a5cbd2017-08-18 09:40:25 -0700554// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700555WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
556 &ssrc,
Philipp Hancke3bc01662018-08-28 14:55:03 +0200557 &kind,
hbosb0ae9202017-01-27 06:35:16 -0800558 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700559 &transport_id,
560 &codec_id,
Di Wufd1e9d12021-03-09 09:25:28 -0800561 &media_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700562// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700563
Yves Gerey665174f2018-06-19 15:03:05 +0200564RTCRTPStreamStats::RTCRTPStreamStats(const std::string& id,
565 int64_t timestamp_us)
566 : RTCRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700567
Yves Gerey665174f2018-06-19 15:03:05 +0200568RTCRTPStreamStats::RTCRTPStreamStats(std::string&& id, int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700569 : RTCStats(std::move(id), timestamp_us),
570 ssrc("ssrc"),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200571 kind("kind"),
hbosb0ae9202017-01-27 06:35:16 -0800572 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700573 transport_id("transportId"),
574 codec_id("codecId"),
Di Wufd1e9d12021-03-09 09:25:28 -0800575 media_type("mediaType") {}
hbos6ded1902016-11-01 01:50:46 -0700576
Yves Gerey665174f2018-06-19 15:03:05 +0200577RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other)
hbos6ded1902016-11-01 01:50:46 -0700578 : RTCStats(other.id(), other.timestamp_us()),
579 ssrc(other.ssrc),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200580 kind(other.kind),
hbosb0ae9202017-01-27 06:35:16 -0800581 track_id(other.track_id),
hbos6ded1902016-11-01 01:50:46 -0700582 transport_id(other.transport_id),
583 codec_id(other.codec_id),
Di Wufd1e9d12021-03-09 09:25:28 -0800584 media_type(other.media_type) {}
hbos6ded1902016-11-01 01:50:46 -0700585
Yves Gerey665174f2018-06-19 15:03:05 +0200586RTCRTPStreamStats::~RTCRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700587
Steve Antond6a5cbd2017-08-18 09:40:25 -0700588// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700589WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800590 RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp",
591 &jitter,
Minyue Li28a2c632021-07-07 15:53:38 +0200592 &packets_lost,
593 &packets_discarded)
Di Wufd1e9d12021-03-09 09:25:28 -0800594// clang-format on
595
596RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(const std::string&& id,
597 int64_t timestamp_us)
598 : RTCReceivedRtpStreamStats(std::string(id), timestamp_us) {}
599
600RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string&& id,
601 int64_t timestamp_us)
602 : RTCRTPStreamStats(std::move(id), timestamp_us),
603 jitter("jitter"),
Minyue Li28a2c632021-07-07 15:53:38 +0200604 packets_lost("packetsLost"),
605 packets_discarded("packetsDiscarded") {}
Di Wufd1e9d12021-03-09 09:25:28 -0800606
607RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(
608 const RTCReceivedRtpStreamStats& other)
609 : RTCRTPStreamStats(other),
610 jitter(other.jitter),
Minyue Li28a2c632021-07-07 15:53:38 +0200611 packets_lost(other.packets_lost),
612 packets_discarded(other.packets_discarded) {}
Di Wufd1e9d12021-03-09 09:25:28 -0800613
614RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {}
615
616// clang-format off
617WEBRTC_RTCSTATS_IMPL(
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100618 RTCSentRtpStreamStats, RTCRTPStreamStats, "sent-rtp",
619 &packets_sent,
620 &bytes_sent)
621// clang-format on
622
623RTCSentRtpStreamStats::RTCSentRtpStreamStats(const std::string&& id,
624 int64_t timestamp_us)
625 : RTCSentRtpStreamStats(std::string(id), timestamp_us) {}
626
627RTCSentRtpStreamStats::RTCSentRtpStreamStats(std::string&& id,
628 int64_t timestamp_us)
629 : RTCRTPStreamStats(std::move(id), timestamp_us),
630 packets_sent("packetsSent"),
631 bytes_sent("bytesSent") {}
632
633RTCSentRtpStreamStats::RTCSentRtpStreamStats(const RTCSentRtpStreamStats& other)
634 : RTCRTPStreamStats(other),
635 packets_sent(other.packets_sent),
636 bytes_sent(other.bytes_sent) {}
637
638RTCSentRtpStreamStats::~RTCSentRtpStreamStats() {}
639
640// clang-format off
641WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800642 RTCInboundRTPStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp",
Henrik Boströma6c7d5c2022-06-16 16:55:31 +0200643 &track_identifier,
Henrik Boström1ab61882022-06-16 17:07:33 +0200644 &mid,
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100645 &remote_id,
hboseeafe942016-11-01 03:00:17 -0700646 &packets_received,
Henrik Boström4a5dab02020-01-28 11:15:35 +0100647 &fec_packets_received,
648 &fec_packets_discarded,
hboseeafe942016-11-01 03:00:17 -0700649 &bytes_received,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200650 &header_bytes_received,
Henrik Boström01738c62019-04-15 17:32:00 +0200651 &last_packet_received_timestamp,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300652 &jitter_buffer_delay,
653 &jitter_buffer_emitted_count,
654 &total_samples_received,
655 &concealed_samples,
656 &silent_concealed_samples,
657 &concealment_events,
658 &inserted_samples_for_deceleration,
659 &removed_samples_for_acceleration,
660 &audio_level,
661 &total_audio_energy,
662 &total_samples_duration,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200663 &frames_received,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300664 &frame_width,
665 &frame_height,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300666 &frames_per_second,
Henrik Boström2e069262019-04-09 13:59:31 +0200667 &frames_decoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200668 &key_frames_decoded,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300669 &frames_dropped,
Johannes Kronbfd343b2019-07-01 10:07:50 +0200670 &total_decode_time,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200671 &total_processing_delay,
Philipp Hancke0359ba22022-05-05 15:55:36 +0200672 &total_assembly_time,
673 &frames_assembled_from_multiple_packets,
Johannes Kron00376e12019-11-25 10:25:42 +0100674 &total_inter_frame_delay,
675 &total_squared_inter_frame_delay,
Henrik Boström6b430862019-08-16 13:09:51 +0200676 &content_type,
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200677 &estimated_playout_timestamp,
Di Wufd1e9d12021-03-09 09:25:28 -0800678 &decoder_implementation,
679 &fir_count,
680 &pli_count,
681 &nack_count,
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200682 &qp_sum,
683 &min_playout_delay)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700684// clang-format on
hboseeafe942016-11-01 03:00:17 -0700685
Yves Gerey665174f2018-06-19 15:03:05 +0200686RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
687 int64_t timestamp_us)
688 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {}
hboseeafe942016-11-01 03:00:17 -0700689
Yves Gerey665174f2018-06-19 15:03:05 +0200690RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
691 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800692 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boströma6c7d5c2022-06-16 16:55:31 +0200693 track_identifier("trackIdentifier"),
Henrik Boström1ab61882022-06-16 17:07:33 +0200694 mid("mid"),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100695 remote_id("remoteId"),
hboseeafe942016-11-01 03:00:17 -0700696 packets_received("packetsReceived"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200697 fec_packets_received("fecPacketsReceived"),
698 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700699 bytes_received("bytesReceived"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200700 header_bytes_received("headerBytesReceived"),
Henrik Boström01738c62019-04-15 17:32:00 +0200701 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300702 jitter_buffer_delay("jitterBufferDelay"),
703 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
704 total_samples_received("totalSamplesReceived"),
705 concealed_samples("concealedSamples"),
706 silent_concealed_samples("silentConcealedSamples"),
707 concealment_events("concealmentEvents"),
708 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
709 removed_samples_for_acceleration("removedSamplesForAcceleration"),
710 audio_level("audioLevel"),
711 total_audio_energy("totalAudioEnergy"),
712 total_samples_duration("totalSamplesDuration"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200713 frames_received("framesReceived"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300714 frame_width("frameWidth"),
715 frame_height("frameHeight"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300716 frames_per_second("framesPerSecond"),
Henrik Boström2e069262019-04-09 13:59:31 +0200717 frames_decoded("framesDecoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200718 key_frames_decoded("keyFramesDecoded"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300719 frames_dropped("framesDropped"),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200720 total_decode_time("totalDecodeTime"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200721 total_processing_delay("totalProcessingDelay"),
Philipp Hancke0359ba22022-05-05 15:55:36 +0200722 total_assembly_time("totalAssemblyTime"),
723 frames_assembled_from_multiple_packets(
724 "framesAssembledFromMultiplePackets"),
Johannes Kron00376e12019-11-25 10:25:42 +0100725 total_inter_frame_delay("totalInterFrameDelay"),
726 total_squared_inter_frame_delay("totalSquaredInterFrameDelay"),
Henrik Boström6b430862019-08-16 13:09:51 +0200727 content_type("contentType"),
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200728 estimated_playout_timestamp("estimatedPlayoutTimestamp"),
Di Wufd1e9d12021-03-09 09:25:28 -0800729 decoder_implementation("decoderImplementation"),
730 fir_count("firCount"),
731 pli_count("pliCount"),
732 nack_count("nackCount"),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200733 qp_sum("qpSum"),
734 min_playout_delay("minPlayoutDelay") {}
hboseeafe942016-11-01 03:00:17 -0700735
736RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
737 const RTCInboundRTPStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800738 : RTCReceivedRtpStreamStats(other),
Henrik Boströma6c7d5c2022-06-16 16:55:31 +0200739 track_identifier(other.track_identifier),
Henrik Boström1ab61882022-06-16 17:07:33 +0200740 mid(other.mid),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100741 remote_id(other.remote_id),
hboseeafe942016-11-01 03:00:17 -0700742 packets_received(other.packets_received),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200743 fec_packets_received(other.fec_packets_received),
744 fec_packets_discarded(other.fec_packets_discarded),
hboseeafe942016-11-01 03:00:17 -0700745 bytes_received(other.bytes_received),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200746 header_bytes_received(other.header_bytes_received),
Henrik Boström01738c62019-04-15 17:32:00 +0200747 last_packet_received_timestamp(other.last_packet_received_timestamp),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300748 jitter_buffer_delay(other.jitter_buffer_delay),
749 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
750 total_samples_received(other.total_samples_received),
751 concealed_samples(other.concealed_samples),
752 silent_concealed_samples(other.silent_concealed_samples),
753 concealment_events(other.concealment_events),
754 inserted_samples_for_deceleration(
755 other.inserted_samples_for_deceleration),
756 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
757 audio_level(other.audio_level),
758 total_audio_energy(other.total_audio_energy),
759 total_samples_duration(other.total_samples_duration),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200760 frames_received(other.frames_received),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300761 frame_width(other.frame_width),
762 frame_height(other.frame_height),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300763 frames_per_second(other.frames_per_second),
Henrik Boström2e069262019-04-09 13:59:31 +0200764 frames_decoded(other.frames_decoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200765 key_frames_decoded(other.key_frames_decoded),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300766 frames_dropped(other.frames_dropped),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200767 total_decode_time(other.total_decode_time),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200768 total_processing_delay(other.total_processing_delay),
Philipp Hancke0359ba22022-05-05 15:55:36 +0200769 total_assembly_time(other.total_assembly_time),
770 frames_assembled_from_multiple_packets(
771 other.frames_assembled_from_multiple_packets),
Johannes Kron00376e12019-11-25 10:25:42 +0100772 total_inter_frame_delay(other.total_inter_frame_delay),
773 total_squared_inter_frame_delay(other.total_squared_inter_frame_delay),
Henrik Boström6b430862019-08-16 13:09:51 +0200774 content_type(other.content_type),
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200775 estimated_playout_timestamp(other.estimated_playout_timestamp),
Di Wufd1e9d12021-03-09 09:25:28 -0800776 decoder_implementation(other.decoder_implementation),
777 fir_count(other.fir_count),
778 pli_count(other.pli_count),
779 nack_count(other.nack_count),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200780 qp_sum(other.qp_sum),
781 min_playout_delay(other.min_playout_delay) {}
hboseeafe942016-11-01 03:00:17 -0700782
Yves Gerey665174f2018-06-19 15:03:05 +0200783RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700784
Steve Antond6a5cbd2017-08-18 09:40:25 -0700785// clang-format off
hboseeafe942016-11-01 03:00:17 -0700786WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700787 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200788 &media_source_id,
Henrik Boström4f40fa52019-12-19 13:27:27 +0100789 &remote_id,
Henrik Boström1ab61882022-06-16 17:07:33 +0200790 &mid,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200791 &rid,
hbos6ded1902016-11-01 01:50:46 -0700792 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200793 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700794 &bytes_sent,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200795 &header_bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200796 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700797 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200798 &frames_encoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200799 &key_frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200800 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200801 &total_encoded_bytes_target,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200802 &frame_width,
803 &frame_height,
804 &frames_per_second,
805 &frames_sent,
806 &huge_frames_sent,
Henrik Boström9fe18342019-05-16 18:38:20 +0200807 &total_packet_send_delay,
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200808 &quality_limitation_reason,
Byoungchan Lee7d235352021-05-28 21:32:04 +0900809 &quality_limitation_durations,
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200810 &quality_limitation_resolution_changes,
Henrik Boström6b430862019-08-16 13:09:51 +0200811 &content_type,
Di Wufd1e9d12021-03-09 09:25:28 -0800812 &encoder_implementation,
813 &fir_count,
814 &pli_count,
815 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700816 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700817// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700818
Yves Gerey665174f2018-06-19 15:03:05 +0200819RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id,
820 int64_t timestamp_us)
821 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700822
Yves Gerey665174f2018-06-19 15:03:05 +0200823RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id,
824 int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700825 : RTCRTPStreamStats(std::move(id), timestamp_us),
Henrik Boström646fda02019-05-22 15:49:42 +0200826 media_source_id("mediaSourceId"),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100827 remote_id("remoteId"),
Henrik Boström1ab61882022-06-16 17:07:33 +0200828 mid("mid"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200829 rid("rid"),
hbos6ded1902016-11-01 01:50:46 -0700830 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200831 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700832 bytes_sent("bytesSent"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200833 header_bytes_sent("headerBytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200834 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700835 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200836 frames_encoded("framesEncoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200837 key_frames_encoded("keyFramesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200838 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200839 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200840 frame_width("frameWidth"),
841 frame_height("frameHeight"),
842 frames_per_second("framesPerSecond"),
843 frames_sent("framesSent"),
844 huge_frames_sent("hugeFramesSent"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200845 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200846 quality_limitation_reason("qualityLimitationReason"),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900847 quality_limitation_durations("qualityLimitationDurations"),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200848 quality_limitation_resolution_changes(
849 "qualityLimitationResolutionChanges"),
Henrik Boström6b430862019-08-16 13:09:51 +0200850 content_type("contentType"),
Di Wufd1e9d12021-03-09 09:25:28 -0800851 encoder_implementation("encoderImplementation"),
852 fir_count("firCount"),
853 pli_count("pliCount"),
854 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700855 qp_sum("qpSum") {}
hbos6ded1902016-11-01 01:50:46 -0700856
857RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
858 const RTCOutboundRTPStreamStats& other)
859 : RTCRTPStreamStats(other),
Henrik Boström646fda02019-05-22 15:49:42 +0200860 media_source_id(other.media_source_id),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100861 remote_id(other.remote_id),
Henrik Boström1ab61882022-06-16 17:07:33 +0200862 mid(other.mid),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200863 rid(other.rid),
hbos6ded1902016-11-01 01:50:46 -0700864 packets_sent(other.packets_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200865 retransmitted_packets_sent(other.retransmitted_packets_sent),
hbos6ded1902016-11-01 01:50:46 -0700866 bytes_sent(other.bytes_sent),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200867 header_bytes_sent(other.header_bytes_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200868 retransmitted_bytes_sent(other.retransmitted_bytes_sent),
hbos6ded1902016-11-01 01:50:46 -0700869 target_bitrate(other.target_bitrate),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200870 frames_encoded(other.frames_encoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200871 key_frames_encoded(other.key_frames_encoded),
Henrik Boström2e069262019-04-09 13:59:31 +0200872 total_encode_time(other.total_encode_time),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200873 total_encoded_bytes_target(other.total_encoded_bytes_target),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200874 frame_width(other.frame_width),
875 frame_height(other.frame_height),
876 frames_per_second(other.frames_per_second),
877 frames_sent(other.frames_sent),
878 huge_frames_sent(other.huge_frames_sent),
Henrik Boström9fe18342019-05-16 18:38:20 +0200879 total_packet_send_delay(other.total_packet_send_delay),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200880 quality_limitation_reason(other.quality_limitation_reason),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900881 quality_limitation_durations(other.quality_limitation_durations),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200882 quality_limitation_resolution_changes(
883 other.quality_limitation_resolution_changes),
Henrik Boström6b430862019-08-16 13:09:51 +0200884 content_type(other.content_type),
Di Wufd1e9d12021-03-09 09:25:28 -0800885 encoder_implementation(other.encoder_implementation),
886 fir_count(other.fir_count),
887 pli_count(other.pli_count),
888 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700889 qp_sum(other.qp_sum) {}
hbos6ded1902016-11-01 01:50:46 -0700890
Yves Gerey665174f2018-06-19 15:03:05 +0200891RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700892
Steve Antond6a5cbd2017-08-18 09:40:25 -0700893// clang-format off
Henrik Boström883eefc2019-05-27 13:40:25 +0200894WEBRTC_RTCSTATS_IMPL(
Henrik Boström2f71b612021-03-23 15:18:55 +0100895 RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
896 "remote-inbound-rtp",
Henrik Boström883eefc2019-05-27 13:40:25 +0200897 &local_id,
Di Wu86f04ad2021-02-28 23:36:03 -0800898 &round_trip_time,
Di Wu88a51b22021-03-01 11:22:06 -0800899 &fraction_lost,
900 &total_round_trip_time,
901 &round_trip_time_measurements)
Henrik Boström883eefc2019-05-27 13:40:25 +0200902// clang-format on
903
904RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
905 const std::string& id,
906 int64_t timestamp_us)
907 : RTCRemoteInboundRtpStreamStats(std::string(id), timestamp_us) {}
908
909RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
910 std::string&& id,
911 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800912 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boström883eefc2019-05-27 13:40:25 +0200913 local_id("localId"),
Di Wu86f04ad2021-02-28 23:36:03 -0800914 round_trip_time("roundTripTime"),
Di Wu88a51b22021-03-01 11:22:06 -0800915 fraction_lost("fractionLost"),
916 total_round_trip_time("totalRoundTripTime"),
917 round_trip_time_measurements("roundTripTimeMeasurements") {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200918
919RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
920 const RTCRemoteInboundRtpStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800921 : RTCReceivedRtpStreamStats(other),
Henrik Boström883eefc2019-05-27 13:40:25 +0200922 local_id(other.local_id),
Di Wu86f04ad2021-02-28 23:36:03 -0800923 round_trip_time(other.round_trip_time),
Di Wu88a51b22021-03-01 11:22:06 -0800924 fraction_lost(other.fraction_lost),
925 total_round_trip_time(other.total_round_trip_time),
926 round_trip_time_measurements(other.round_trip_time_measurements) {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200927
928RTCRemoteInboundRtpStreamStats::~RTCRemoteInboundRtpStreamStats() {}
929
930// clang-format off
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100931WEBRTC_RTCSTATS_IMPL(
932 RTCRemoteOutboundRtpStreamStats, RTCSentRtpStreamStats,
933 "remote-outbound-rtp",
934 &local_id,
935 &remote_timestamp,
Ivo Creusen2562cf02021-09-03 14:51:22 +0000936 &reports_sent,
937 &round_trip_time,
938 &round_trip_time_measurements,
939 &total_round_trip_time)
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100940// clang-format on
941
942RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
943 const std::string& id,
944 int64_t timestamp_us)
945 : RTCRemoteOutboundRtpStreamStats(std::string(id), timestamp_us) {}
946
947RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
948 std::string&& id,
949 int64_t timestamp_us)
950 : RTCSentRtpStreamStats(std::move(id), timestamp_us),
951 local_id("localId"),
952 remote_timestamp("remoteTimestamp"),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000953 reports_sent("reportsSent"),
954 round_trip_time("roundTripTime"),
955 round_trip_time_measurements("roundTripTimeMeasurements"),
956 total_round_trip_time("totalRoundTripTime") {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100957
958RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
959 const RTCRemoteOutboundRtpStreamStats& other)
960 : RTCSentRtpStreamStats(other),
961 local_id(other.local_id),
962 remote_timestamp(other.remote_timestamp),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000963 reports_sent(other.reports_sent),
964 round_trip_time(other.round_trip_time),
965 round_trip_time_measurements(other.round_trip_time_measurements),
966 total_round_trip_time(other.total_round_trip_time) {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100967
968RTCRemoteOutboundRtpStreamStats::~RTCRemoteOutboundRtpStreamStats() {}
969
970// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +0200971WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
972 &track_identifier,
973 &kind)
974// clang-format on
975
976RTCMediaSourceStats::RTCMediaSourceStats(const std::string& id,
977 int64_t timestamp_us)
978 : RTCMediaSourceStats(std::string(id), timestamp_us) {}
979
980RTCMediaSourceStats::RTCMediaSourceStats(std::string&& id, int64_t timestamp_us)
981 : RTCStats(std::move(id), timestamp_us),
982 track_identifier("trackIdentifier"),
983 kind("kind") {}
984
985RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other)
986 : RTCStats(other.id(), other.timestamp_us()),
987 track_identifier(other.track_identifier),
988 kind(other.kind) {}
989
990RTCMediaSourceStats::~RTCMediaSourceStats() {}
991
992// clang-format off
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200993WEBRTC_RTCSTATS_IMPL(RTCAudioSourceStats, RTCMediaSourceStats, "media-source",
994 &audio_level,
995 &total_audio_energy,
Taylor Brandstetter64851c02021-06-24 13:32:50 -0700996 &total_samples_duration,
997 &echo_return_loss,
998 &echo_return_loss_enhancement)
Henrik Boström646fda02019-05-22 15:49:42 +0200999// clang-format on
1000
1001RTCAudioSourceStats::RTCAudioSourceStats(const std::string& id,
1002 int64_t timestamp_us)
1003 : RTCAudioSourceStats(std::string(id), timestamp_us) {}
1004
1005RTCAudioSourceStats::RTCAudioSourceStats(std::string&& id, int64_t timestamp_us)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001006 : RTCMediaSourceStats(std::move(id), timestamp_us),
1007 audio_level("audioLevel"),
1008 total_audio_energy("totalAudioEnergy"),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001009 total_samples_duration("totalSamplesDuration"),
1010 echo_return_loss("echoReturnLoss"),
1011 echo_return_loss_enhancement("echoReturnLossEnhancement") {}
Henrik Boström646fda02019-05-22 15:49:42 +02001012
1013RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001014 : RTCMediaSourceStats(other),
1015 audio_level(other.audio_level),
1016 total_audio_energy(other.total_audio_energy),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001017 total_samples_duration(other.total_samples_duration),
1018 echo_return_loss(other.echo_return_loss),
1019 echo_return_loss_enhancement(other.echo_return_loss_enhancement) {}
Henrik Boström646fda02019-05-22 15:49:42 +02001020
1021RTCAudioSourceStats::~RTCAudioSourceStats() {}
1022
1023// clang-format off
1024WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
1025 &width,
1026 &height,
1027 &frames,
1028 &frames_per_second)
1029// clang-format on
1030
1031RTCVideoSourceStats::RTCVideoSourceStats(const std::string& id,
1032 int64_t timestamp_us)
1033 : RTCVideoSourceStats(std::string(id), timestamp_us) {}
1034
1035RTCVideoSourceStats::RTCVideoSourceStats(std::string&& id, int64_t timestamp_us)
1036 : RTCMediaSourceStats(std::move(id), timestamp_us),
1037 width("width"),
1038 height("height"),
1039 frames("frames"),
1040 frames_per_second("framesPerSecond") {}
1041
1042RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other)
1043 : RTCMediaSourceStats(other),
1044 width(other.width),
1045 height(other.height),
1046 frames(other.frames),
1047 frames_per_second(other.frames_per_second) {}
1048
1049RTCVideoSourceStats::~RTCVideoSourceStats() {}
1050
1051// clang-format off
hbos2fa7c672016-10-24 04:00:05 -07001052WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
1053 &bytes_sent,
Artem Titovedacbd52020-07-06 16:06:37 +02001054 &packets_sent,
hbos2fa7c672016-10-24 04:00:05 -07001055 &bytes_received,
Artem Titovedacbd52020-07-06 16:06:37 +02001056 &packets_received,
hbos2fa7c672016-10-24 04:00:05 -07001057 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -08001058 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -07001059 &selected_candidate_pair_id,
1060 &local_certificate_id,
Jonas Oreland149dc722019-08-28 08:10:27 +02001061 &remote_certificate_id,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001062 &tls_version,
1063 &dtls_cipher,
Philipp Hancke69c1df22022-04-22 15:46:24 +02001064 &dtls_role,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001065 &srtp_cipher,
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001066 &selected_candidate_pair_changes,
Philipp Hancke95b1a342022-05-05 07:53:54 +02001067 &ice_role,
Philipp Hancke1f491572022-05-09 17:43:31 +02001068 &ice_local_username_fragment,
1069 &ice_state)
Steve Antond6a5cbd2017-08-18 09:40:25 -07001070// clang-format on
hbos2fa7c672016-10-24 04:00:05 -07001071
Yves Gerey665174f2018-06-19 15:03:05 +02001072RTCTransportStats::RTCTransportStats(const std::string& id,
1073 int64_t timestamp_us)
1074 : RTCTransportStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -07001075
Yves Gerey665174f2018-06-19 15:03:05 +02001076RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -07001077 : RTCStats(std::move(id), timestamp_us),
1078 bytes_sent("bytesSent"),
Artem Titovedacbd52020-07-06 16:06:37 +02001079 packets_sent("packetsSent"),
hbos2fa7c672016-10-24 04:00:05 -07001080 bytes_received("bytesReceived"),
Artem Titovedacbd52020-07-06 16:06:37 +02001081 packets_received("packetsReceived"),
hbos2fa7c672016-10-24 04:00:05 -07001082 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -08001083 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -07001084 selected_candidate_pair_id("selectedCandidatePairId"),
1085 local_certificate_id("localCertificateId"),
Jonas Oreland149dc722019-08-28 08:10:27 +02001086 remote_certificate_id("remoteCertificateId"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001087 tls_version("tlsVersion"),
1088 dtls_cipher("dtlsCipher"),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001089 dtls_role("dtlsRole"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001090 srtp_cipher("srtpCipher"),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001091 selected_candidate_pair_changes("selectedCandidatePairChanges"),
Philipp Hancke95b1a342022-05-05 07:53:54 +02001092 ice_role("iceRole"),
Philipp Hancke1f491572022-05-09 17:43:31 +02001093 ice_local_username_fragment("iceLocalUsernameFragment"),
1094 ice_state("iceState") {}
hbos2fa7c672016-10-24 04:00:05 -07001095
Yves Gerey665174f2018-06-19 15:03:05 +02001096RTCTransportStats::RTCTransportStats(const RTCTransportStats& other)
hbos2fa7c672016-10-24 04:00:05 -07001097 : RTCStats(other.id(), other.timestamp_us()),
1098 bytes_sent(other.bytes_sent),
Artem Titovedacbd52020-07-06 16:06:37 +02001099 packets_sent(other.packets_sent),
hbos2fa7c672016-10-24 04:00:05 -07001100 bytes_received(other.bytes_received),
Artem Titovedacbd52020-07-06 16:06:37 +02001101 packets_received(other.packets_received),
hbos2fa7c672016-10-24 04:00:05 -07001102 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -08001103 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -07001104 selected_candidate_pair_id(other.selected_candidate_pair_id),
1105 local_certificate_id(other.local_certificate_id),
Jonas Oreland149dc722019-08-28 08:10:27 +02001106 remote_certificate_id(other.remote_certificate_id),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001107 tls_version(other.tls_version),
1108 dtls_cipher(other.dtls_cipher),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001109 dtls_role(other.dtls_role),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001110 srtp_cipher(other.srtp_cipher),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001111 selected_candidate_pair_changes(other.selected_candidate_pair_changes),
Philipp Hancke95b1a342022-05-05 07:53:54 +02001112 ice_role(other.ice_role),
Philipp Hancke1f491572022-05-09 17:43:31 +02001113 ice_local_username_fragment(other.ice_local_username_fragment),
1114 ice_state(other.ice_state) {}
hbos2fa7c672016-10-24 04:00:05 -07001115
Yves Gerey665174f2018-06-19 15:03:05 +02001116RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -07001117
hbosd565b732016-08-30 14:04:35 -07001118} // namespace webrtc