blob: a0873599e05ff13468071082b36954b8ca0e95c9 [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",
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100643 &remote_id,
hboseeafe942016-11-01 03:00:17 -0700644 &packets_received,
Henrik Boström4a5dab02020-01-28 11:15:35 +0100645 &fec_packets_received,
646 &fec_packets_discarded,
hboseeafe942016-11-01 03:00:17 -0700647 &bytes_received,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200648 &header_bytes_received,
Henrik Boström01738c62019-04-15 17:32:00 +0200649 &last_packet_received_timestamp,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300650 &jitter_buffer_delay,
651 &jitter_buffer_emitted_count,
652 &total_samples_received,
653 &concealed_samples,
654 &silent_concealed_samples,
655 &concealment_events,
656 &inserted_samples_for_deceleration,
657 &removed_samples_for_acceleration,
658 &audio_level,
659 &total_audio_energy,
660 &total_samples_duration,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200661 &frames_received,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300662 &frame_width,
663 &frame_height,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300664 &frames_per_second,
Henrik Boström2e069262019-04-09 13:59:31 +0200665 &frames_decoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200666 &key_frames_decoded,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300667 &frames_dropped,
Johannes Kronbfd343b2019-07-01 10:07:50 +0200668 &total_decode_time,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200669 &total_processing_delay,
Philipp Hancke0359ba22022-05-05 15:55:36 +0200670 &total_assembly_time,
671 &frames_assembled_from_multiple_packets,
Johannes Kron00376e12019-11-25 10:25:42 +0100672 &total_inter_frame_delay,
673 &total_squared_inter_frame_delay,
Henrik Boström6b430862019-08-16 13:09:51 +0200674 &content_type,
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200675 &estimated_playout_timestamp,
Di Wufd1e9d12021-03-09 09:25:28 -0800676 &decoder_implementation,
677 &fir_count,
678 &pli_count,
679 &nack_count,
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200680 &qp_sum,
681 &min_playout_delay)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700682// clang-format on
hboseeafe942016-11-01 03:00:17 -0700683
Yves Gerey665174f2018-06-19 15:03:05 +0200684RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
685 int64_t timestamp_us)
686 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {}
hboseeafe942016-11-01 03:00:17 -0700687
Yves Gerey665174f2018-06-19 15:03:05 +0200688RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
689 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800690 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100691 remote_id("remoteId"),
hboseeafe942016-11-01 03:00:17 -0700692 packets_received("packetsReceived"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200693 fec_packets_received("fecPacketsReceived"),
694 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700695 bytes_received("bytesReceived"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200696 header_bytes_received("headerBytesReceived"),
Henrik Boström01738c62019-04-15 17:32:00 +0200697 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300698 jitter_buffer_delay("jitterBufferDelay"),
699 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
700 total_samples_received("totalSamplesReceived"),
701 concealed_samples("concealedSamples"),
702 silent_concealed_samples("silentConcealedSamples"),
703 concealment_events("concealmentEvents"),
704 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
705 removed_samples_for_acceleration("removedSamplesForAcceleration"),
706 audio_level("audioLevel"),
707 total_audio_energy("totalAudioEnergy"),
708 total_samples_duration("totalSamplesDuration"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200709 frames_received("framesReceived"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300710 frame_width("frameWidth"),
711 frame_height("frameHeight"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300712 frames_per_second("framesPerSecond"),
Henrik Boström2e069262019-04-09 13:59:31 +0200713 frames_decoded("framesDecoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200714 key_frames_decoded("keyFramesDecoded"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300715 frames_dropped("framesDropped"),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200716 total_decode_time("totalDecodeTime"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200717 total_processing_delay("totalProcessingDelay"),
Philipp Hancke0359ba22022-05-05 15:55:36 +0200718 total_assembly_time("totalAssemblyTime"),
719 frames_assembled_from_multiple_packets(
720 "framesAssembledFromMultiplePackets"),
Johannes Kron00376e12019-11-25 10:25:42 +0100721 total_inter_frame_delay("totalInterFrameDelay"),
722 total_squared_inter_frame_delay("totalSquaredInterFrameDelay"),
Henrik Boström6b430862019-08-16 13:09:51 +0200723 content_type("contentType"),
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200724 estimated_playout_timestamp("estimatedPlayoutTimestamp"),
Di Wufd1e9d12021-03-09 09:25:28 -0800725 decoder_implementation("decoderImplementation"),
726 fir_count("firCount"),
727 pli_count("pliCount"),
728 nack_count("nackCount"),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200729 qp_sum("qpSum"),
730 min_playout_delay("minPlayoutDelay") {}
hboseeafe942016-11-01 03:00:17 -0700731
732RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
733 const RTCInboundRTPStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800734 : RTCReceivedRtpStreamStats(other),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100735 remote_id(other.remote_id),
hboseeafe942016-11-01 03:00:17 -0700736 packets_received(other.packets_received),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200737 fec_packets_received(other.fec_packets_received),
738 fec_packets_discarded(other.fec_packets_discarded),
hboseeafe942016-11-01 03:00:17 -0700739 bytes_received(other.bytes_received),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200740 header_bytes_received(other.header_bytes_received),
Henrik Boström01738c62019-04-15 17:32:00 +0200741 last_packet_received_timestamp(other.last_packet_received_timestamp),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300742 jitter_buffer_delay(other.jitter_buffer_delay),
743 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
744 total_samples_received(other.total_samples_received),
745 concealed_samples(other.concealed_samples),
746 silent_concealed_samples(other.silent_concealed_samples),
747 concealment_events(other.concealment_events),
748 inserted_samples_for_deceleration(
749 other.inserted_samples_for_deceleration),
750 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
751 audio_level(other.audio_level),
752 total_audio_energy(other.total_audio_energy),
753 total_samples_duration(other.total_samples_duration),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200754 frames_received(other.frames_received),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300755 frame_width(other.frame_width),
756 frame_height(other.frame_height),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300757 frames_per_second(other.frames_per_second),
Henrik Boström2e069262019-04-09 13:59:31 +0200758 frames_decoded(other.frames_decoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200759 key_frames_decoded(other.key_frames_decoded),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300760 frames_dropped(other.frames_dropped),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200761 total_decode_time(other.total_decode_time),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200762 total_processing_delay(other.total_processing_delay),
Philipp Hancke0359ba22022-05-05 15:55:36 +0200763 total_assembly_time(other.total_assembly_time),
764 frames_assembled_from_multiple_packets(
765 other.frames_assembled_from_multiple_packets),
Johannes Kron00376e12019-11-25 10:25:42 +0100766 total_inter_frame_delay(other.total_inter_frame_delay),
767 total_squared_inter_frame_delay(other.total_squared_inter_frame_delay),
Henrik Boström6b430862019-08-16 13:09:51 +0200768 content_type(other.content_type),
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200769 estimated_playout_timestamp(other.estimated_playout_timestamp),
Di Wufd1e9d12021-03-09 09:25:28 -0800770 decoder_implementation(other.decoder_implementation),
771 fir_count(other.fir_count),
772 pli_count(other.pli_count),
773 nack_count(other.nack_count),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200774 qp_sum(other.qp_sum),
775 min_playout_delay(other.min_playout_delay) {}
hboseeafe942016-11-01 03:00:17 -0700776
Yves Gerey665174f2018-06-19 15:03:05 +0200777RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700778
Steve Antond6a5cbd2017-08-18 09:40:25 -0700779// clang-format off
hboseeafe942016-11-01 03:00:17 -0700780WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700781 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200782 &media_source_id,
Henrik Boström4f40fa52019-12-19 13:27:27 +0100783 &remote_id,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200784 &rid,
hbos6ded1902016-11-01 01:50:46 -0700785 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200786 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700787 &bytes_sent,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200788 &header_bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200789 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700790 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200791 &frames_encoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200792 &key_frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200793 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200794 &total_encoded_bytes_target,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200795 &frame_width,
796 &frame_height,
797 &frames_per_second,
798 &frames_sent,
799 &huge_frames_sent,
Henrik Boström9fe18342019-05-16 18:38:20 +0200800 &total_packet_send_delay,
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200801 &quality_limitation_reason,
Byoungchan Lee7d235352021-05-28 21:32:04 +0900802 &quality_limitation_durations,
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200803 &quality_limitation_resolution_changes,
Henrik Boström6b430862019-08-16 13:09:51 +0200804 &content_type,
Di Wufd1e9d12021-03-09 09:25:28 -0800805 &encoder_implementation,
806 &fir_count,
807 &pli_count,
808 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700809 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700810// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700811
Yves Gerey665174f2018-06-19 15:03:05 +0200812RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id,
813 int64_t timestamp_us)
814 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700815
Yves Gerey665174f2018-06-19 15:03:05 +0200816RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id,
817 int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700818 : RTCRTPStreamStats(std::move(id), timestamp_us),
Henrik Boström646fda02019-05-22 15:49:42 +0200819 media_source_id("mediaSourceId"),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100820 remote_id("remoteId"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200821 rid("rid"),
hbos6ded1902016-11-01 01:50:46 -0700822 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200823 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700824 bytes_sent("bytesSent"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200825 header_bytes_sent("headerBytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200826 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700827 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200828 frames_encoded("framesEncoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200829 key_frames_encoded("keyFramesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200830 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200831 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200832 frame_width("frameWidth"),
833 frame_height("frameHeight"),
834 frames_per_second("framesPerSecond"),
835 frames_sent("framesSent"),
836 huge_frames_sent("hugeFramesSent"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200837 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200838 quality_limitation_reason("qualityLimitationReason"),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900839 quality_limitation_durations("qualityLimitationDurations"),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200840 quality_limitation_resolution_changes(
841 "qualityLimitationResolutionChanges"),
Henrik Boström6b430862019-08-16 13:09:51 +0200842 content_type("contentType"),
Di Wufd1e9d12021-03-09 09:25:28 -0800843 encoder_implementation("encoderImplementation"),
844 fir_count("firCount"),
845 pli_count("pliCount"),
846 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700847 qp_sum("qpSum") {}
hbos6ded1902016-11-01 01:50:46 -0700848
849RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
850 const RTCOutboundRTPStreamStats& other)
851 : RTCRTPStreamStats(other),
Henrik Boström646fda02019-05-22 15:49:42 +0200852 media_source_id(other.media_source_id),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100853 remote_id(other.remote_id),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200854 rid(other.rid),
hbos6ded1902016-11-01 01:50:46 -0700855 packets_sent(other.packets_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200856 retransmitted_packets_sent(other.retransmitted_packets_sent),
hbos6ded1902016-11-01 01:50:46 -0700857 bytes_sent(other.bytes_sent),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200858 header_bytes_sent(other.header_bytes_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200859 retransmitted_bytes_sent(other.retransmitted_bytes_sent),
hbos6ded1902016-11-01 01:50:46 -0700860 target_bitrate(other.target_bitrate),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200861 frames_encoded(other.frames_encoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200862 key_frames_encoded(other.key_frames_encoded),
Henrik Boström2e069262019-04-09 13:59:31 +0200863 total_encode_time(other.total_encode_time),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200864 total_encoded_bytes_target(other.total_encoded_bytes_target),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200865 frame_width(other.frame_width),
866 frame_height(other.frame_height),
867 frames_per_second(other.frames_per_second),
868 frames_sent(other.frames_sent),
869 huge_frames_sent(other.huge_frames_sent),
Henrik Boström9fe18342019-05-16 18:38:20 +0200870 total_packet_send_delay(other.total_packet_send_delay),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200871 quality_limitation_reason(other.quality_limitation_reason),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900872 quality_limitation_durations(other.quality_limitation_durations),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200873 quality_limitation_resolution_changes(
874 other.quality_limitation_resolution_changes),
Henrik Boström6b430862019-08-16 13:09:51 +0200875 content_type(other.content_type),
Di Wufd1e9d12021-03-09 09:25:28 -0800876 encoder_implementation(other.encoder_implementation),
877 fir_count(other.fir_count),
878 pli_count(other.pli_count),
879 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700880 qp_sum(other.qp_sum) {}
hbos6ded1902016-11-01 01:50:46 -0700881
Yves Gerey665174f2018-06-19 15:03:05 +0200882RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700883
Steve Antond6a5cbd2017-08-18 09:40:25 -0700884// clang-format off
Henrik Boström883eefc2019-05-27 13:40:25 +0200885WEBRTC_RTCSTATS_IMPL(
Henrik Boström2f71b612021-03-23 15:18:55 +0100886 RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
887 "remote-inbound-rtp",
Henrik Boström883eefc2019-05-27 13:40:25 +0200888 &local_id,
Di Wu86f04ad2021-02-28 23:36:03 -0800889 &round_trip_time,
Di Wu88a51b22021-03-01 11:22:06 -0800890 &fraction_lost,
891 &total_round_trip_time,
892 &round_trip_time_measurements)
Henrik Boström883eefc2019-05-27 13:40:25 +0200893// clang-format on
894
895RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
896 const std::string& id,
897 int64_t timestamp_us)
898 : RTCRemoteInboundRtpStreamStats(std::string(id), timestamp_us) {}
899
900RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
901 std::string&& id,
902 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800903 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boström883eefc2019-05-27 13:40:25 +0200904 local_id("localId"),
Di Wu86f04ad2021-02-28 23:36:03 -0800905 round_trip_time("roundTripTime"),
Di Wu88a51b22021-03-01 11:22:06 -0800906 fraction_lost("fractionLost"),
907 total_round_trip_time("totalRoundTripTime"),
908 round_trip_time_measurements("roundTripTimeMeasurements") {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200909
910RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
911 const RTCRemoteInboundRtpStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800912 : RTCReceivedRtpStreamStats(other),
Henrik Boström883eefc2019-05-27 13:40:25 +0200913 local_id(other.local_id),
Di Wu86f04ad2021-02-28 23:36:03 -0800914 round_trip_time(other.round_trip_time),
Di Wu88a51b22021-03-01 11:22:06 -0800915 fraction_lost(other.fraction_lost),
916 total_round_trip_time(other.total_round_trip_time),
917 round_trip_time_measurements(other.round_trip_time_measurements) {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200918
919RTCRemoteInboundRtpStreamStats::~RTCRemoteInboundRtpStreamStats() {}
920
921// clang-format off
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100922WEBRTC_RTCSTATS_IMPL(
923 RTCRemoteOutboundRtpStreamStats, RTCSentRtpStreamStats,
924 "remote-outbound-rtp",
925 &local_id,
926 &remote_timestamp,
Ivo Creusen2562cf02021-09-03 14:51:22 +0000927 &reports_sent,
928 &round_trip_time,
929 &round_trip_time_measurements,
930 &total_round_trip_time)
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100931// clang-format on
932
933RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
934 const std::string& id,
935 int64_t timestamp_us)
936 : RTCRemoteOutboundRtpStreamStats(std::string(id), timestamp_us) {}
937
938RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
939 std::string&& id,
940 int64_t timestamp_us)
941 : RTCSentRtpStreamStats(std::move(id), timestamp_us),
942 local_id("localId"),
943 remote_timestamp("remoteTimestamp"),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000944 reports_sent("reportsSent"),
945 round_trip_time("roundTripTime"),
946 round_trip_time_measurements("roundTripTimeMeasurements"),
947 total_round_trip_time("totalRoundTripTime") {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100948
949RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
950 const RTCRemoteOutboundRtpStreamStats& other)
951 : RTCSentRtpStreamStats(other),
952 local_id(other.local_id),
953 remote_timestamp(other.remote_timestamp),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000954 reports_sent(other.reports_sent),
955 round_trip_time(other.round_trip_time),
956 round_trip_time_measurements(other.round_trip_time_measurements),
957 total_round_trip_time(other.total_round_trip_time) {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100958
959RTCRemoteOutboundRtpStreamStats::~RTCRemoteOutboundRtpStreamStats() {}
960
961// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +0200962WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
963 &track_identifier,
964 &kind)
965// clang-format on
966
967RTCMediaSourceStats::RTCMediaSourceStats(const std::string& id,
968 int64_t timestamp_us)
969 : RTCMediaSourceStats(std::string(id), timestamp_us) {}
970
971RTCMediaSourceStats::RTCMediaSourceStats(std::string&& id, int64_t timestamp_us)
972 : RTCStats(std::move(id), timestamp_us),
973 track_identifier("trackIdentifier"),
974 kind("kind") {}
975
976RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other)
977 : RTCStats(other.id(), other.timestamp_us()),
978 track_identifier(other.track_identifier),
979 kind(other.kind) {}
980
981RTCMediaSourceStats::~RTCMediaSourceStats() {}
982
983// clang-format off
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200984WEBRTC_RTCSTATS_IMPL(RTCAudioSourceStats, RTCMediaSourceStats, "media-source",
985 &audio_level,
986 &total_audio_energy,
Taylor Brandstetter64851c02021-06-24 13:32:50 -0700987 &total_samples_duration,
988 &echo_return_loss,
989 &echo_return_loss_enhancement)
Henrik Boström646fda02019-05-22 15:49:42 +0200990// clang-format on
991
992RTCAudioSourceStats::RTCAudioSourceStats(const std::string& id,
993 int64_t timestamp_us)
994 : RTCAudioSourceStats(std::string(id), timestamp_us) {}
995
996RTCAudioSourceStats::RTCAudioSourceStats(std::string&& id, int64_t timestamp_us)
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200997 : RTCMediaSourceStats(std::move(id), timestamp_us),
998 audio_level("audioLevel"),
999 total_audio_energy("totalAudioEnergy"),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001000 total_samples_duration("totalSamplesDuration"),
1001 echo_return_loss("echoReturnLoss"),
1002 echo_return_loss_enhancement("echoReturnLossEnhancement") {}
Henrik Boström646fda02019-05-22 15:49:42 +02001003
1004RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001005 : RTCMediaSourceStats(other),
1006 audio_level(other.audio_level),
1007 total_audio_energy(other.total_audio_energy),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001008 total_samples_duration(other.total_samples_duration),
1009 echo_return_loss(other.echo_return_loss),
1010 echo_return_loss_enhancement(other.echo_return_loss_enhancement) {}
Henrik Boström646fda02019-05-22 15:49:42 +02001011
1012RTCAudioSourceStats::~RTCAudioSourceStats() {}
1013
1014// clang-format off
1015WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
1016 &width,
1017 &height,
1018 &frames,
1019 &frames_per_second)
1020// clang-format on
1021
1022RTCVideoSourceStats::RTCVideoSourceStats(const std::string& id,
1023 int64_t timestamp_us)
1024 : RTCVideoSourceStats(std::string(id), timestamp_us) {}
1025
1026RTCVideoSourceStats::RTCVideoSourceStats(std::string&& id, int64_t timestamp_us)
1027 : RTCMediaSourceStats(std::move(id), timestamp_us),
1028 width("width"),
1029 height("height"),
1030 frames("frames"),
1031 frames_per_second("framesPerSecond") {}
1032
1033RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other)
1034 : RTCMediaSourceStats(other),
1035 width(other.width),
1036 height(other.height),
1037 frames(other.frames),
1038 frames_per_second(other.frames_per_second) {}
1039
1040RTCVideoSourceStats::~RTCVideoSourceStats() {}
1041
1042// clang-format off
hbos2fa7c672016-10-24 04:00:05 -07001043WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
1044 &bytes_sent,
Artem Titovedacbd52020-07-06 16:06:37 +02001045 &packets_sent,
hbos2fa7c672016-10-24 04:00:05 -07001046 &bytes_received,
Artem Titovedacbd52020-07-06 16:06:37 +02001047 &packets_received,
hbos2fa7c672016-10-24 04:00:05 -07001048 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -08001049 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -07001050 &selected_candidate_pair_id,
1051 &local_certificate_id,
Jonas Oreland149dc722019-08-28 08:10:27 +02001052 &remote_certificate_id,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001053 &tls_version,
1054 &dtls_cipher,
Philipp Hancke69c1df22022-04-22 15:46:24 +02001055 &dtls_role,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001056 &srtp_cipher,
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001057 &selected_candidate_pair_changes,
Philipp Hancke95b1a342022-05-05 07:53:54 +02001058 &ice_role,
Philipp Hancke1f491572022-05-09 17:43:31 +02001059 &ice_local_username_fragment,
1060 &ice_state)
Steve Antond6a5cbd2017-08-18 09:40:25 -07001061// clang-format on
hbos2fa7c672016-10-24 04:00:05 -07001062
Yves Gerey665174f2018-06-19 15:03:05 +02001063RTCTransportStats::RTCTransportStats(const std::string& id,
1064 int64_t timestamp_us)
1065 : RTCTransportStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -07001066
Yves Gerey665174f2018-06-19 15:03:05 +02001067RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -07001068 : RTCStats(std::move(id), timestamp_us),
1069 bytes_sent("bytesSent"),
Artem Titovedacbd52020-07-06 16:06:37 +02001070 packets_sent("packetsSent"),
hbos2fa7c672016-10-24 04:00:05 -07001071 bytes_received("bytesReceived"),
Artem Titovedacbd52020-07-06 16:06:37 +02001072 packets_received("packetsReceived"),
hbos2fa7c672016-10-24 04:00:05 -07001073 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -08001074 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -07001075 selected_candidate_pair_id("selectedCandidatePairId"),
1076 local_certificate_id("localCertificateId"),
Jonas Oreland149dc722019-08-28 08:10:27 +02001077 remote_certificate_id("remoteCertificateId"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001078 tls_version("tlsVersion"),
1079 dtls_cipher("dtlsCipher"),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001080 dtls_role("dtlsRole"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001081 srtp_cipher("srtpCipher"),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001082 selected_candidate_pair_changes("selectedCandidatePairChanges"),
Philipp Hancke95b1a342022-05-05 07:53:54 +02001083 ice_role("iceRole"),
Philipp Hancke1f491572022-05-09 17:43:31 +02001084 ice_local_username_fragment("iceLocalUsernameFragment"),
1085 ice_state("iceState") {}
hbos2fa7c672016-10-24 04:00:05 -07001086
Yves Gerey665174f2018-06-19 15:03:05 +02001087RTCTransportStats::RTCTransportStats(const RTCTransportStats& other)
hbos2fa7c672016-10-24 04:00:05 -07001088 : RTCStats(other.id(), other.timestamp_us()),
1089 bytes_sent(other.bytes_sent),
Artem Titovedacbd52020-07-06 16:06:37 +02001090 packets_sent(other.packets_sent),
hbos2fa7c672016-10-24 04:00:05 -07001091 bytes_received(other.bytes_received),
Artem Titovedacbd52020-07-06 16:06:37 +02001092 packets_received(other.packets_received),
hbos2fa7c672016-10-24 04:00:05 -07001093 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -08001094 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -07001095 selected_candidate_pair_id(other.selected_candidate_pair_id),
1096 local_certificate_id(other.local_certificate_id),
Jonas Oreland149dc722019-08-28 08:10:27 +02001097 remote_certificate_id(other.remote_certificate_id),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001098 tls_version(other.tls_version),
1099 dtls_cipher(other.dtls_cipher),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001100 dtls_role(other.dtls_role),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001101 srtp_cipher(other.srtp_cipher),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001102 selected_candidate_pair_changes(other.selected_candidate_pair_changes),
Philipp Hancke95b1a342022-05-05 07:53:54 +02001103 ice_role(other.ice_role),
Philipp Hancke1f491572022-05-09 17:43:31 +02001104 ice_local_username_fragment(other.ice_local_username_fragment),
1105 ice_state(other.ice_state) {}
hbos2fa7c672016-10-24 04:00:05 -07001106
Yves Gerey665174f2018-06-19 15:03:05 +02001107RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -07001108
hbosd565b732016-08-30 14:04:35 -07001109} // namespace webrtc