blob: 0362f6b51f4a45e1d7491d9cccb4620ddeb02e97 [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
Steve Antond6a5cbd2017-08-18 09:40:25 -070075// clang-format off
hbos2fa7c672016-10-24 04:00:05 -070076WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate",
77 &fingerprint,
78 &fingerprint_algorithm,
79 &base64_certificate,
Nico Weber22f99252019-02-20 10:13:16 -050080 &issuer_certificate_id)
Steve Antond6a5cbd2017-08-18 09:40:25 -070081// clang-format on
hbos2fa7c672016-10-24 04:00:05 -070082
Yves Gerey665174f2018-06-19 15:03:05 +020083RTCCertificateStats::RTCCertificateStats(const std::string& id,
84 int64_t timestamp_us)
85 : RTCCertificateStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -070086
Yves Gerey665174f2018-06-19 15:03:05 +020087RTCCertificateStats::RTCCertificateStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -070088 : RTCStats(std::move(id), timestamp_us),
89 fingerprint("fingerprint"),
90 fingerprint_algorithm("fingerprintAlgorithm"),
91 base64_certificate("base64Certificate"),
Yves Gerey665174f2018-06-19 15:03:05 +020092 issuer_certificate_id("issuerCertificateId") {}
hbos2fa7c672016-10-24 04:00:05 -070093
Yves Gerey665174f2018-06-19 15:03:05 +020094RTCCertificateStats::RTCCertificateStats(const RTCCertificateStats& other)
hbos2fa7c672016-10-24 04:00:05 -070095 : RTCStats(other.id(), other.timestamp_us()),
96 fingerprint(other.fingerprint),
97 fingerprint_algorithm(other.fingerprint_algorithm),
98 base64_certificate(other.base64_certificate),
Yves Gerey665174f2018-06-19 15:03:05 +020099 issuer_certificate_id(other.issuer_certificate_id) {}
hbos2fa7c672016-10-24 04:00:05 -0700100
Yves Gerey665174f2018-06-19 15:03:05 +0200101RTCCertificateStats::~RTCCertificateStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700102
Steve Antond6a5cbd2017-08-18 09:40:25 -0700103// clang-format off
hbos0adb8282016-11-23 02:32:06 -0800104WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec",
Philipp Hancke95157a02020-11-16 20:08:27 +0100105 &transport_id,
hbos0adb8282016-11-23 02:32:06 -0800106 &payload_type,
hbos13f54b22017-02-28 06:56:04 -0800107 &mime_type,
hbos0adb8282016-11-23 02:32:06 -0800108 &clock_rate,
109 &channels,
Henrik Boström6b430862019-08-16 13:09:51 +0200110 &sdp_fmtp_line)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700111// clang-format on
hbos0adb8282016-11-23 02:32:06 -0800112
Yves Gerey665174f2018-06-19 15:03:05 +0200113RTCCodecStats::RTCCodecStats(const std::string& id, int64_t timestamp_us)
114 : RTCCodecStats(std::string(id), timestamp_us) {}
hbos0adb8282016-11-23 02:32:06 -0800115
Yves Gerey665174f2018-06-19 15:03:05 +0200116RTCCodecStats::RTCCodecStats(std::string&& id, int64_t timestamp_us)
hbos0adb8282016-11-23 02:32:06 -0800117 : RTCStats(std::move(id), timestamp_us),
Philipp Hancke95157a02020-11-16 20:08:27 +0100118 transport_id("transportId"),
hbos0adb8282016-11-23 02:32:06 -0800119 payload_type("payloadType"),
hbos13f54b22017-02-28 06:56:04 -0800120 mime_type("mimeType"),
hbos0adb8282016-11-23 02:32:06 -0800121 clock_rate("clockRate"),
122 channels("channels"),
Henrik Boström6b430862019-08-16 13:09:51 +0200123 sdp_fmtp_line("sdpFmtpLine") {}
hbos0adb8282016-11-23 02:32:06 -0800124
Yves Gerey665174f2018-06-19 15:03:05 +0200125RTCCodecStats::RTCCodecStats(const RTCCodecStats& other)
hbos0adb8282016-11-23 02:32:06 -0800126 : RTCStats(other.id(), other.timestamp_us()),
Philipp Hancke95157a02020-11-16 20:08:27 +0100127 transport_id(other.transport_id),
hbos0adb8282016-11-23 02:32:06 -0800128 payload_type(other.payload_type),
hbos13f54b22017-02-28 06:56:04 -0800129 mime_type(other.mime_type),
hbos0adb8282016-11-23 02:32:06 -0800130 clock_rate(other.clock_rate),
131 channels(other.channels),
Henrik Boström6b430862019-08-16 13:09:51 +0200132 sdp_fmtp_line(other.sdp_fmtp_line) {}
hbos0adb8282016-11-23 02:32:06 -0800133
Yves Gerey665174f2018-06-19 15:03:05 +0200134RTCCodecStats::~RTCCodecStats() {}
hbos0adb8282016-11-23 02:32:06 -0800135
Steve Antond6a5cbd2017-08-18 09:40:25 -0700136// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700137WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel",
138 &label,
139 &protocol,
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200140 &data_channel_identifier,
hbos2fa7c672016-10-24 04:00:05 -0700141 &state,
142 &messages_sent,
143 &bytes_sent,
144 &messages_received,
Nico Weber22f99252019-02-20 10:13:16 -0500145 &bytes_received)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700146// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700147
Yves Gerey665174f2018-06-19 15:03:05 +0200148RTCDataChannelStats::RTCDataChannelStats(const std::string& id,
149 int64_t timestamp_us)
150 : RTCDataChannelStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -0700151
Yves Gerey665174f2018-06-19 15:03:05 +0200152RTCDataChannelStats::RTCDataChannelStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -0700153 : RTCStats(std::move(id), timestamp_us),
154 label("label"),
155 protocol("protocol"),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200156 data_channel_identifier("dataChannelIdentifier"),
hbos2fa7c672016-10-24 04:00:05 -0700157 state("state"),
158 messages_sent("messagesSent"),
159 bytes_sent("bytesSent"),
160 messages_received("messagesReceived"),
Yves Gerey665174f2018-06-19 15:03:05 +0200161 bytes_received("bytesReceived") {}
hbos2fa7c672016-10-24 04:00:05 -0700162
Yves Gerey665174f2018-06-19 15:03:05 +0200163RTCDataChannelStats::RTCDataChannelStats(const RTCDataChannelStats& other)
hbos2fa7c672016-10-24 04:00:05 -0700164 : RTCStats(other.id(), other.timestamp_us()),
165 label(other.label),
166 protocol(other.protocol),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200167 data_channel_identifier(other.data_channel_identifier),
hbos2fa7c672016-10-24 04:00:05 -0700168 state(other.state),
169 messages_sent(other.messages_sent),
170 bytes_sent(other.bytes_sent),
171 messages_received(other.messages_received),
Yves Gerey665174f2018-06-19 15:03:05 +0200172 bytes_received(other.bytes_received) {}
hbos2fa7c672016-10-24 04:00:05 -0700173
Yves Gerey665174f2018-06-19 15:03:05 +0200174RTCDataChannelStats::~RTCDataChannelStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700175
Steve Antond6a5cbd2017-08-18 09:40:25 -0700176// clang-format off
hbosc47a0c32016-10-11 14:54:49 -0700177WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair",
178 &transport_id,
179 &local_candidate_id,
180 &remote_candidate_id,
181 &state,
182 &priority,
183 &nominated,
184 &writable,
185 &readable,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700186 &packets_sent,
187 &packets_received,
hbosc47a0c32016-10-11 14:54:49 -0700188 &bytes_sent,
189 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800190 &total_round_trip_time,
191 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700192 &available_outgoing_bitrate,
193 &available_incoming_bitrate,
194 &requests_received,
195 &requests_sent,
196 &responses_received,
197 &responses_sent,
198 &retransmissions_received,
199 &retransmissions_sent,
200 &consent_requests_received,
201 &consent_requests_sent,
202 &consent_responses_received,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700203 &consent_responses_sent,
204 &packets_discarded_on_send,
205 &bytes_discarded_on_send)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700206// clang-format on
hbosc47a0c32016-10-11 14:54:49 -0700207
Yves Gerey665174f2018-06-19 15:03:05 +0200208RTCIceCandidatePairStats::RTCIceCandidatePairStats(const std::string& id,
209 int64_t timestamp_us)
210 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {}
hbosc47a0c32016-10-11 14:54:49 -0700211
Yves Gerey665174f2018-06-19 15:03:05 +0200212RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string&& id,
213 int64_t timestamp_us)
hbosc47a0c32016-10-11 14:54:49 -0700214 : RTCStats(std::move(id), timestamp_us),
215 transport_id("transportId"),
216 local_candidate_id("localCandidateId"),
217 remote_candidate_id("remoteCandidateId"),
218 state("state"),
219 priority("priority"),
220 nominated("nominated"),
221 writable("writable"),
222 readable("readable"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700223 packets_sent("packetsSent"),
224 packets_received("packetsReceived"),
hbosc47a0c32016-10-11 14:54:49 -0700225 bytes_sent("bytesSent"),
226 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800227 total_round_trip_time("totalRoundTripTime"),
228 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700229 available_outgoing_bitrate("availableOutgoingBitrate"),
230 available_incoming_bitrate("availableIncomingBitrate"),
231 requests_received("requestsReceived"),
232 requests_sent("requestsSent"),
233 responses_received("responsesReceived"),
234 responses_sent("responsesSent"),
235 retransmissions_received("retransmissionsReceived"),
236 retransmissions_sent("retransmissionsSent"),
237 consent_requests_received("consentRequestsReceived"),
238 consent_requests_sent("consentRequestsSent"),
239 consent_responses_received("consentResponsesReceived"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700240 consent_responses_sent("consentResponsesSent"),
241 packets_discarded_on_send("packetsDiscardedOnSend"),
242 bytes_discarded_on_send("bytesDiscardedOnSend") {}
hbosc47a0c32016-10-11 14:54:49 -0700243
244RTCIceCandidatePairStats::RTCIceCandidatePairStats(
245 const RTCIceCandidatePairStats& other)
246 : RTCStats(other.id(), other.timestamp_us()),
247 transport_id(other.transport_id),
248 local_candidate_id(other.local_candidate_id),
249 remote_candidate_id(other.remote_candidate_id),
250 state(other.state),
251 priority(other.priority),
252 nominated(other.nominated),
253 writable(other.writable),
254 readable(other.readable),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700255 packets_sent(other.packets_sent),
256 packets_received(other.packets_received),
hbosc47a0c32016-10-11 14:54:49 -0700257 bytes_sent(other.bytes_sent),
258 bytes_received(other.bytes_received),
hbos3168c7a2016-12-15 06:17:08 -0800259 total_round_trip_time(other.total_round_trip_time),
260 current_round_trip_time(other.current_round_trip_time),
hbosc47a0c32016-10-11 14:54:49 -0700261 available_outgoing_bitrate(other.available_outgoing_bitrate),
262 available_incoming_bitrate(other.available_incoming_bitrate),
263 requests_received(other.requests_received),
264 requests_sent(other.requests_sent),
265 responses_received(other.responses_received),
266 responses_sent(other.responses_sent),
267 retransmissions_received(other.retransmissions_received),
268 retransmissions_sent(other.retransmissions_sent),
269 consent_requests_received(other.consent_requests_received),
270 consent_requests_sent(other.consent_requests_sent),
271 consent_responses_received(other.consent_responses_received),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700272 consent_responses_sent(other.consent_responses_sent),
273 packets_discarded_on_send(other.packets_discarded_on_send),
274 bytes_discarded_on_send(other.bytes_discarded_on_send) {}
hbosc47a0c32016-10-11 14:54:49 -0700275
Yves Gerey665174f2018-06-19 15:03:05 +0200276RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {}
hbosc47a0c32016-10-11 14:54:49 -0700277
Steve Antond6a5cbd2017-08-18 09:40:25 -0700278// clang-format off
Henrik Boström1df1bf82018-03-20 13:24:20 +0100279WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800280 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800281 &is_remote,
Gary Liu37e489c2017-11-21 10:49:36 -0800282 &network_type,
hbosab9f6e42016-10-07 02:18:47 -0700283 &ip,
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100284 &address,
hbosab9f6e42016-10-07 02:18:47 -0700285 &port,
286 &protocol,
Philipp Hancke95513752018-09-27 14:40:08 +0200287 &relay_protocol,
hbosab9f6e42016-10-07 02:18:47 -0700288 &candidate_type,
289 &priority,
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100290 &url,
291 &vpn,
292 &network_adapter_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700293// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700294
Yves Gerey665174f2018-06-19 15:03:05 +0200295RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id,
296 int64_t timestamp_us,
297 bool is_remote)
298 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {}
hbosab9f6e42016-10-07 02:18:47 -0700299
Gary Liu37e489c2017-11-21 10:49:36 -0800300RTCIceCandidateStats::RTCIceCandidateStats(std::string&& id,
301 int64_t timestamp_us,
302 bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700303 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800304 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800305 is_remote("isRemote", is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800306 network_type("networkType"),
hbosab9f6e42016-10-07 02:18:47 -0700307 ip("ip"),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100308 address("address"),
hbosab9f6e42016-10-07 02:18:47 -0700309 port("port"),
310 protocol("protocol"),
Philipp Hancke95513752018-09-27 14:40:08 +0200311 relay_protocol("relayProtocol"),
hbosab9f6e42016-10-07 02:18:47 -0700312 candidate_type("candidateType"),
313 priority("priority"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100314 url("url"),
315 vpn("vpn"),
316 network_adapter_type("networkAdapterType") {}
hbosab9f6e42016-10-07 02:18:47 -0700317
318RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
319 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800320 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800321 is_remote(other.is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800322 network_type(other.network_type),
hbosab9f6e42016-10-07 02:18:47 -0700323 ip(other.ip),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100324 address(other.address),
hbosab9f6e42016-10-07 02:18:47 -0700325 port(other.port),
326 protocol(other.protocol),
Philipp Hancke95513752018-09-27 14:40:08 +0200327 relay_protocol(other.relay_protocol),
hbosab9f6e42016-10-07 02:18:47 -0700328 candidate_type(other.candidate_type),
329 priority(other.priority),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100330 url(other.url),
331 vpn(other.vpn),
332 network_adapter_type(other.network_adapter_type) {}
hbosab9f6e42016-10-07 02:18:47 -0700333
Yves Gerey665174f2018-06-19 15:03:05 +0200334RTCIceCandidateStats::~RTCIceCandidateStats() {}
hbosab9f6e42016-10-07 02:18:47 -0700335
336const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
337
Yves Gerey665174f2018-06-19 15:03:05 +0200338RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(const std::string& id,
339 int64_t timestamp_us)
340 : RTCIceCandidateStats(id, timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700341
Yves Gerey665174f2018-06-19 15:03:05 +0200342RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string&& id,
343 int64_t timestamp_us)
344 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700345
Henrik Boström1df1bf82018-03-20 13:24:20 +0100346std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const {
347 return std::unique_ptr<RTCStats>(new RTCLocalIceCandidateStats(*this));
348}
349
hbosab9f6e42016-10-07 02:18:47 -0700350const char* RTCLocalIceCandidateStats::type() const {
351 return kType;
352}
353
354const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
355
Yves Gerey665174f2018-06-19 15:03:05 +0200356RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(const std::string& id,
357 int64_t timestamp_us)
358 : RTCIceCandidateStats(id, timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700359
Yves Gerey665174f2018-06-19 15:03:05 +0200360RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string&& id,
361 int64_t timestamp_us)
362 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700363
Henrik Boström1df1bf82018-03-20 13:24:20 +0100364std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const {
365 return std::unique_ptr<RTCStats>(new RTCRemoteIceCandidateStats(*this));
366}
367
hbosab9f6e42016-10-07 02:18:47 -0700368const char* RTCRemoteIceCandidateStats::type() const {
369 return kType;
370}
371
Steve Antond6a5cbd2017-08-18 09:40:25 -0700372// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800373WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
374 &stream_identifier,
Nico Weber22f99252019-02-20 10:13:16 -0500375 &track_ids)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700376// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800377
Yves Gerey665174f2018-06-19 15:03:05 +0200378RTCMediaStreamStats::RTCMediaStreamStats(const std::string& id,
379 int64_t timestamp_us)
380 : RTCMediaStreamStats(std::string(id), timestamp_us) {}
hbos09bc1282016-11-08 06:29:22 -0800381
Yves Gerey665174f2018-06-19 15:03:05 +0200382RTCMediaStreamStats::RTCMediaStreamStats(std::string&& id, int64_t timestamp_us)
hbos09bc1282016-11-08 06:29:22 -0800383 : RTCStats(std::move(id), timestamp_us),
384 stream_identifier("streamIdentifier"),
Yves Gerey665174f2018-06-19 15:03:05 +0200385 track_ids("trackIds") {}
hbos09bc1282016-11-08 06:29:22 -0800386
Yves Gerey665174f2018-06-19 15:03:05 +0200387RTCMediaStreamStats::RTCMediaStreamStats(const RTCMediaStreamStats& other)
hbos09bc1282016-11-08 06:29:22 -0800388 : RTCStats(other.id(), other.timestamp_us()),
389 stream_identifier(other.stream_identifier),
Yves Gerey665174f2018-06-19 15:03:05 +0200390 track_ids(other.track_ids) {}
hbos09bc1282016-11-08 06:29:22 -0800391
Yves Gerey665174f2018-06-19 15:03:05 +0200392RTCMediaStreamStats::~RTCMediaStreamStats() {}
hbos09bc1282016-11-08 06:29:22 -0800393
Steve Antond6a5cbd2017-08-18 09:40:25 -0700394// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800395WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
zsteine76bd3a2017-07-14 12:17:49 -0700396 &track_identifier,
Henrik Boström646fda02019-05-22 15:49:42 +0200397 &media_source_id,
zsteine76bd3a2017-07-14 12:17:49 -0700398 &remote_source,
399 &ended,
400 &detached,
401 &kind,
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200402 &jitter_buffer_delay,
Chen Xing0acffb52019-01-15 15:46:29 +0100403 &jitter_buffer_emitted_count,
zsteine76bd3a2017-07-14 12:17:49 -0700404 &frame_width,
405 &frame_height,
406 &frames_per_second,
407 &frames_sent,
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100408 &huge_frames_sent,
zsteine76bd3a2017-07-14 12:17:49 -0700409 &frames_received,
410 &frames_decoded,
411 &frames_dropped,
412 &frames_corrupted,
413 &partial_frames_lost,
414 &full_frames_lost,
415 &audio_level,
416 &total_audio_energy,
zsteine76bd3a2017-07-14 12:17:49 -0700417 &echo_return_loss,
Steve Anton2dbc69f2017-08-24 17:15:13 -0700418 &echo_return_loss_enhancement,
419 &total_samples_received,
420 &total_samples_duration,
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200421 &concealed_samples,
Henrik Boström21e99da2019-08-21 12:09:51 +0200422 &silent_concealed_samples,
Ruslan Burakov8af88962018-11-22 17:21:10 +0100423 &concealment_events,
Henrik Boström21e99da2019-08-21 12:09:51 +0200424 &inserted_samples_for_deceleration,
425 &removed_samples_for_acceleration,
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100426 &jitter_buffer_flushes,
Sergey Silkin02371062019-01-31 16:45:42 +0100427 &delayed_packet_outage_samples,
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100428 &relative_packet_arrival_delay,
Artem Titove618cc92020-03-11 11:18:54 +0100429 &jitter_buffer_target_delay,
Henrik Lundin44125fa2019-04-29 17:00:46 +0200430 &interruption_count,
431 &total_interruption_duration,
Sergey Silkin02371062019-01-31 16:45:42 +0100432 &freeze_count,
433 &pause_count,
434 &total_freezes_duration,
435 &total_pauses_duration,
436 &total_frames_duration,
Nico Weber22f99252019-02-20 10:13:16 -0500437 &sum_squared_frame_durations)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700438// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800439
Yves Gerey665174f2018-06-19 15:03:05 +0200440RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(const std::string& id,
441 int64_t timestamp_us,
442 const char* kind)
443 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {}
hbos09bc1282016-11-08 06:29:22 -0800444
zsteine76bd3a2017-07-14 12:17:49 -0700445RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(std::string&& id,
446 int64_t timestamp_us,
447 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800448 : RTCStats(std::move(id), timestamp_us),
449 track_identifier("trackIdentifier"),
Henrik Boström646fda02019-05-22 15:49:42 +0200450 media_source_id("mediaSourceId"),
hbos09bc1282016-11-08 06:29:22 -0800451 remote_source("remoteSource"),
452 ended("ended"),
453 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800454 kind("kind", kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200455 jitter_buffer_delay("jitterBufferDelay"),
Chen Xing0acffb52019-01-15 15:46:29 +0100456 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
hbos09bc1282016-11-08 06:29:22 -0800457 frame_width("frameWidth"),
458 frame_height("frameHeight"),
459 frames_per_second("framesPerSecond"),
460 frames_sent("framesSent"),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100461 huge_frames_sent("hugeFramesSent"),
hbos09bc1282016-11-08 06:29:22 -0800462 frames_received("framesReceived"),
463 frames_decoded("framesDecoded"),
464 frames_dropped("framesDropped"),
465 frames_corrupted("framesCorrupted"),
466 partial_frames_lost("partialFramesLost"),
467 full_frames_lost("fullFramesLost"),
468 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700469 total_audio_energy("totalAudioEnergy"),
hbos09bc1282016-11-08 06:29:22 -0800470 echo_return_loss("echoReturnLoss"),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700471 echo_return_loss_enhancement("echoReturnLossEnhancement"),
472 total_samples_received("totalSamplesReceived"),
473 total_samples_duration("totalSamplesDuration"),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200474 concealed_samples("concealedSamples"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200475 silent_concealed_samples("silentConcealedSamples"),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100476 concealment_events("concealmentEvents"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200477 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
478 removed_samples_for_acceleration("removedSamplesForAcceleration"),
Jakob Ivarsson758d9462019-03-19 15:38:49 +0100479 jitter_buffer_flushes(
480 "jitterBufferFlushes",
481 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
482 delayed_packet_outage_samples(
483 "delayedPacketOutageSamples",
484 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
485 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
486 relative_packet_arrival_delay(
487 "relativePacketArrivalDelay",
488 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
Artem Titove618cc92020-03-11 11:18:54 +0100489 jitter_buffer_target_delay("jitterBufferTargetDelay"),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200490 interruption_count("interruptionCount"),
491 total_interruption_duration("totalInterruptionDuration"),
Sergey Silkin02371062019-01-31 16:45:42 +0100492 freeze_count("freezeCount"),
493 pause_count("pauseCount"),
494 total_freezes_duration("totalFreezesDuration"),
495 total_pauses_duration("totalPausesDuration"),
496 total_frames_duration("totalFramesDuration"),
497 sum_squared_frame_durations("sumOfSquaredFramesDuration") {
hbos160e4a72017-01-17 02:53:23 -0800498 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
499 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800500}
501
502RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
503 const RTCMediaStreamTrackStats& other)
504 : RTCStats(other.id(), other.timestamp_us()),
505 track_identifier(other.track_identifier),
Henrik Boström646fda02019-05-22 15:49:42 +0200506 media_source_id(other.media_source_id),
hbos09bc1282016-11-08 06:29:22 -0800507 remote_source(other.remote_source),
508 ended(other.ended),
509 detached(other.detached),
hbos160e4a72017-01-17 02:53:23 -0800510 kind(other.kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200511 jitter_buffer_delay(other.jitter_buffer_delay),
Chen Xing0acffb52019-01-15 15:46:29 +0100512 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
hbos09bc1282016-11-08 06:29:22 -0800513 frame_width(other.frame_width),
514 frame_height(other.frame_height),
515 frames_per_second(other.frames_per_second),
516 frames_sent(other.frames_sent),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100517 huge_frames_sent(other.huge_frames_sent),
hbos09bc1282016-11-08 06:29:22 -0800518 frames_received(other.frames_received),
519 frames_decoded(other.frames_decoded),
520 frames_dropped(other.frames_dropped),
521 frames_corrupted(other.frames_corrupted),
522 partial_frames_lost(other.partial_frames_lost),
523 full_frames_lost(other.full_frames_lost),
524 audio_level(other.audio_level),
zsteine76bd3a2017-07-14 12:17:49 -0700525 total_audio_energy(other.total_audio_energy),
hbos09bc1282016-11-08 06:29:22 -0800526 echo_return_loss(other.echo_return_loss),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700527 echo_return_loss_enhancement(other.echo_return_loss_enhancement),
528 total_samples_received(other.total_samples_received),
529 total_samples_duration(other.total_samples_duration),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200530 concealed_samples(other.concealed_samples),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200531 silent_concealed_samples(other.silent_concealed_samples),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100532 concealment_events(other.concealment_events),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200533 inserted_samples_for_deceleration(
534 other.inserted_samples_for_deceleration),
535 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100536 jitter_buffer_flushes(other.jitter_buffer_flushes),
Sergey Silkin02371062019-01-31 16:45:42 +0100537 delayed_packet_outage_samples(other.delayed_packet_outage_samples),
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100538 relative_packet_arrival_delay(other.relative_packet_arrival_delay),
Artem Titove618cc92020-03-11 11:18:54 +0100539 jitter_buffer_target_delay(other.jitter_buffer_target_delay),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200540 interruption_count(other.interruption_count),
541 total_interruption_duration(other.total_interruption_duration),
Sergey Silkin02371062019-01-31 16:45:42 +0100542 freeze_count(other.freeze_count),
543 pause_count(other.pause_count),
544 total_freezes_duration(other.total_freezes_duration),
545 total_pauses_duration(other.total_pauses_duration),
546 total_frames_duration(other.total_frames_duration),
547 sum_squared_frame_durations(other.sum_squared_frame_durations) {}
hbos09bc1282016-11-08 06:29:22 -0800548
Yves Gerey665174f2018-06-19 15:03:05 +0200549RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {}
hbos09bc1282016-11-08 06:29:22 -0800550
Steve Antond6a5cbd2017-08-18 09:40:25 -0700551// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700552WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
553 &data_channels_opened,
Nico Weber22f99252019-02-20 10:13:16 -0500554 &data_channels_closed)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700555// clang-format on
hbosd565b732016-08-30 14:04:35 -0700556
Yves Gerey665174f2018-06-19 15:03:05 +0200557RTCPeerConnectionStats::RTCPeerConnectionStats(const std::string& id,
558 int64_t timestamp_us)
559 : RTCPeerConnectionStats(std::string(id), timestamp_us) {}
hbosd565b732016-08-30 14:04:35 -0700560
Yves Gerey665174f2018-06-19 15:03:05 +0200561RTCPeerConnectionStats::RTCPeerConnectionStats(std::string&& id,
562 int64_t timestamp_us)
hbos0e6758d2016-08-31 07:57:36 -0700563 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700564 data_channels_opened("dataChannelsOpened"),
Yves Gerey665174f2018-06-19 15:03:05 +0200565 data_channels_closed("dataChannelsClosed") {}
hbosd565b732016-08-30 14:04:35 -0700566
hbosfc5e0502016-10-06 02:06:10 -0700567RTCPeerConnectionStats::RTCPeerConnectionStats(
568 const RTCPeerConnectionStats& other)
569 : RTCStats(other.id(), other.timestamp_us()),
570 data_channels_opened(other.data_channels_opened),
Yves Gerey665174f2018-06-19 15:03:05 +0200571 data_channels_closed(other.data_channels_closed) {}
hbosfc5e0502016-10-06 02:06:10 -0700572
Yves Gerey665174f2018-06-19 15:03:05 +0200573RTCPeerConnectionStats::~RTCPeerConnectionStats() {}
hbosfc5e0502016-10-06 02:06:10 -0700574
Steve Antond6a5cbd2017-08-18 09:40:25 -0700575// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700576WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
577 &ssrc,
Philipp Hancke3bc01662018-08-28 14:55:03 +0200578 &kind,
hbosb0ae9202017-01-27 06:35:16 -0800579 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700580 &transport_id,
581 &codec_id,
Di Wufd1e9d12021-03-09 09:25:28 -0800582 &media_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700583// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700584
Yves Gerey665174f2018-06-19 15:03:05 +0200585RTCRTPStreamStats::RTCRTPStreamStats(const std::string& id,
586 int64_t timestamp_us)
587 : RTCRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700588
Yves Gerey665174f2018-06-19 15:03:05 +0200589RTCRTPStreamStats::RTCRTPStreamStats(std::string&& id, int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700590 : RTCStats(std::move(id), timestamp_us),
591 ssrc("ssrc"),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200592 kind("kind"),
hbosb0ae9202017-01-27 06:35:16 -0800593 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700594 transport_id("transportId"),
595 codec_id("codecId"),
Di Wufd1e9d12021-03-09 09:25:28 -0800596 media_type("mediaType") {}
hbos6ded1902016-11-01 01:50:46 -0700597
Yves Gerey665174f2018-06-19 15:03:05 +0200598RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other)
hbos6ded1902016-11-01 01:50:46 -0700599 : RTCStats(other.id(), other.timestamp_us()),
600 ssrc(other.ssrc),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200601 kind(other.kind),
hbosb0ae9202017-01-27 06:35:16 -0800602 track_id(other.track_id),
hbos6ded1902016-11-01 01:50:46 -0700603 transport_id(other.transport_id),
604 codec_id(other.codec_id),
Di Wufd1e9d12021-03-09 09:25:28 -0800605 media_type(other.media_type) {}
hbos6ded1902016-11-01 01:50:46 -0700606
Yves Gerey665174f2018-06-19 15:03:05 +0200607RTCRTPStreamStats::~RTCRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700608
Steve Antond6a5cbd2017-08-18 09:40:25 -0700609// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700610WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800611 RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp",
612 &jitter,
Minyue Li28a2c632021-07-07 15:53:38 +0200613 &packets_lost,
614 &packets_discarded)
Di Wufd1e9d12021-03-09 09:25:28 -0800615// clang-format on
616
617RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(const std::string&& id,
618 int64_t timestamp_us)
619 : RTCReceivedRtpStreamStats(std::string(id), timestamp_us) {}
620
621RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string&& id,
622 int64_t timestamp_us)
623 : RTCRTPStreamStats(std::move(id), timestamp_us),
624 jitter("jitter"),
Minyue Li28a2c632021-07-07 15:53:38 +0200625 packets_lost("packetsLost"),
626 packets_discarded("packetsDiscarded") {}
Di Wufd1e9d12021-03-09 09:25:28 -0800627
628RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(
629 const RTCReceivedRtpStreamStats& other)
630 : RTCRTPStreamStats(other),
631 jitter(other.jitter),
Minyue Li28a2c632021-07-07 15:53:38 +0200632 packets_lost(other.packets_lost),
633 packets_discarded(other.packets_discarded) {}
Di Wufd1e9d12021-03-09 09:25:28 -0800634
635RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {}
636
637// clang-format off
638WEBRTC_RTCSTATS_IMPL(
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100639 RTCSentRtpStreamStats, RTCRTPStreamStats, "sent-rtp",
640 &packets_sent,
641 &bytes_sent)
642// clang-format on
643
644RTCSentRtpStreamStats::RTCSentRtpStreamStats(const std::string&& id,
645 int64_t timestamp_us)
646 : RTCSentRtpStreamStats(std::string(id), timestamp_us) {}
647
648RTCSentRtpStreamStats::RTCSentRtpStreamStats(std::string&& id,
649 int64_t timestamp_us)
650 : RTCRTPStreamStats(std::move(id), timestamp_us),
651 packets_sent("packetsSent"),
652 bytes_sent("bytesSent") {}
653
654RTCSentRtpStreamStats::RTCSentRtpStreamStats(const RTCSentRtpStreamStats& other)
655 : RTCRTPStreamStats(other),
656 packets_sent(other.packets_sent),
657 bytes_sent(other.bytes_sent) {}
658
659RTCSentRtpStreamStats::~RTCSentRtpStreamStats() {}
660
661// clang-format off
662WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800663 RTCInboundRTPStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp",
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100664 &remote_id,
hboseeafe942016-11-01 03:00:17 -0700665 &packets_received,
Henrik Boström4a5dab02020-01-28 11:15:35 +0100666 &fec_packets_received,
667 &fec_packets_discarded,
hboseeafe942016-11-01 03:00:17 -0700668 &bytes_received,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200669 &header_bytes_received,
Henrik Boström01738c62019-04-15 17:32:00 +0200670 &last_packet_received_timestamp,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300671 &jitter_buffer_delay,
672 &jitter_buffer_emitted_count,
673 &total_samples_received,
674 &concealed_samples,
675 &silent_concealed_samples,
676 &concealment_events,
677 &inserted_samples_for_deceleration,
678 &removed_samples_for_acceleration,
679 &audio_level,
680 &total_audio_energy,
681 &total_samples_duration,
hbosa7a9be12017-03-01 01:02:45 -0800682 &round_trip_time,
hboseeafe942016-11-01 03:00:17 -0700683 &packets_repaired,
684 &burst_packets_lost,
685 &burst_packets_discarded,
686 &burst_loss_count,
687 &burst_discard_count,
688 &burst_loss_rate,
689 &burst_discard_rate,
690 &gap_loss_rate,
hbos6769c492017-01-02 08:35:13 -0800691 &gap_discard_rate,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200692 &frames_received,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300693 &frame_width,
694 &frame_height,
695 &frame_bit_depth,
696 &frames_per_second,
Henrik Boström2e069262019-04-09 13:59:31 +0200697 &frames_decoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200698 &key_frames_decoded,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300699 &frames_dropped,
Johannes Kronbfd343b2019-07-01 10:07:50 +0200700 &total_decode_time,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200701 &total_processing_delay,
Johannes Kron00376e12019-11-25 10:25:42 +0100702 &total_inter_frame_delay,
703 &total_squared_inter_frame_delay,
Henrik Boström6b430862019-08-16 13:09:51 +0200704 &content_type,
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200705 &estimated_playout_timestamp,
Di Wufd1e9d12021-03-09 09:25:28 -0800706 &decoder_implementation,
707 &fir_count,
708 &pli_count,
709 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700710 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700711// clang-format on
hboseeafe942016-11-01 03:00:17 -0700712
Yves Gerey665174f2018-06-19 15:03:05 +0200713RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
714 int64_t timestamp_us)
715 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {}
hboseeafe942016-11-01 03:00:17 -0700716
Yves Gerey665174f2018-06-19 15:03:05 +0200717RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
718 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800719 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100720 remote_id("remoteId"),
hboseeafe942016-11-01 03:00:17 -0700721 packets_received("packetsReceived"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200722 fec_packets_received("fecPacketsReceived"),
723 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700724 bytes_received("bytesReceived"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200725 header_bytes_received("headerBytesReceived"),
Henrik Boström01738c62019-04-15 17:32:00 +0200726 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300727 jitter_buffer_delay("jitterBufferDelay"),
728 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
729 total_samples_received("totalSamplesReceived"),
730 concealed_samples("concealedSamples"),
731 silent_concealed_samples("silentConcealedSamples"),
732 concealment_events("concealmentEvents"),
733 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
734 removed_samples_for_acceleration("removedSamplesForAcceleration"),
735 audio_level("audioLevel"),
736 total_audio_energy("totalAudioEnergy"),
737 total_samples_duration("totalSamplesDuration"),
hbosa7a9be12017-03-01 01:02:45 -0800738 round_trip_time("roundTripTime"),
hboseeafe942016-11-01 03:00:17 -0700739 packets_repaired("packetsRepaired"),
740 burst_packets_lost("burstPacketsLost"),
741 burst_packets_discarded("burstPacketsDiscarded"),
742 burst_loss_count("burstLossCount"),
743 burst_discard_count("burstDiscardCount"),
744 burst_loss_rate("burstLossRate"),
745 burst_discard_rate("burstDiscardRate"),
746 gap_loss_rate("gapLossRate"),
hbos6769c492017-01-02 08:35:13 -0800747 gap_discard_rate("gapDiscardRate"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200748 frames_received("framesReceived"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300749 frame_width("frameWidth"),
750 frame_height("frameHeight"),
751 frame_bit_depth("frameBitDepth"),
752 frames_per_second("framesPerSecond"),
Henrik Boström2e069262019-04-09 13:59:31 +0200753 frames_decoded("framesDecoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200754 key_frames_decoded("keyFramesDecoded"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300755 frames_dropped("framesDropped"),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200756 total_decode_time("totalDecodeTime"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200757 total_processing_delay("totalProcessingDelay"),
Johannes Kron00376e12019-11-25 10:25:42 +0100758 total_inter_frame_delay("totalInterFrameDelay"),
759 total_squared_inter_frame_delay("totalSquaredInterFrameDelay"),
Henrik Boström6b430862019-08-16 13:09:51 +0200760 content_type("contentType"),
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200761 estimated_playout_timestamp("estimatedPlayoutTimestamp"),
Di Wufd1e9d12021-03-09 09:25:28 -0800762 decoder_implementation("decoderImplementation"),
763 fir_count("firCount"),
764 pli_count("pliCount"),
765 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700766 qp_sum("qpSum") {}
hboseeafe942016-11-01 03:00:17 -0700767
768RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
769 const RTCInboundRTPStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800770 : RTCReceivedRtpStreamStats(other),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100771 remote_id(other.remote_id),
hboseeafe942016-11-01 03:00:17 -0700772 packets_received(other.packets_received),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200773 fec_packets_received(other.fec_packets_received),
774 fec_packets_discarded(other.fec_packets_discarded),
hboseeafe942016-11-01 03:00:17 -0700775 bytes_received(other.bytes_received),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200776 header_bytes_received(other.header_bytes_received),
Henrik Boström01738c62019-04-15 17:32:00 +0200777 last_packet_received_timestamp(other.last_packet_received_timestamp),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300778 jitter_buffer_delay(other.jitter_buffer_delay),
779 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
780 total_samples_received(other.total_samples_received),
781 concealed_samples(other.concealed_samples),
782 silent_concealed_samples(other.silent_concealed_samples),
783 concealment_events(other.concealment_events),
784 inserted_samples_for_deceleration(
785 other.inserted_samples_for_deceleration),
786 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
787 audio_level(other.audio_level),
788 total_audio_energy(other.total_audio_energy),
789 total_samples_duration(other.total_samples_duration),
hbosa7a9be12017-03-01 01:02:45 -0800790 round_trip_time(other.round_trip_time),
hboseeafe942016-11-01 03:00:17 -0700791 packets_repaired(other.packets_repaired),
792 burst_packets_lost(other.burst_packets_lost),
793 burst_packets_discarded(other.burst_packets_discarded),
794 burst_loss_count(other.burst_loss_count),
795 burst_discard_count(other.burst_discard_count),
796 burst_loss_rate(other.burst_loss_rate),
797 burst_discard_rate(other.burst_discard_rate),
798 gap_loss_rate(other.gap_loss_rate),
hbos6769c492017-01-02 08:35:13 -0800799 gap_discard_rate(other.gap_discard_rate),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200800 frames_received(other.frames_received),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300801 frame_width(other.frame_width),
802 frame_height(other.frame_height),
803 frame_bit_depth(other.frame_bit_depth),
804 frames_per_second(other.frames_per_second),
Henrik Boström2e069262019-04-09 13:59:31 +0200805 frames_decoded(other.frames_decoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200806 key_frames_decoded(other.key_frames_decoded),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300807 frames_dropped(other.frames_dropped),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200808 total_decode_time(other.total_decode_time),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200809 total_processing_delay(other.total_processing_delay),
Johannes Kron00376e12019-11-25 10:25:42 +0100810 total_inter_frame_delay(other.total_inter_frame_delay),
811 total_squared_inter_frame_delay(other.total_squared_inter_frame_delay),
Henrik Boström6b430862019-08-16 13:09:51 +0200812 content_type(other.content_type),
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200813 estimated_playout_timestamp(other.estimated_playout_timestamp),
Di Wufd1e9d12021-03-09 09:25:28 -0800814 decoder_implementation(other.decoder_implementation),
815 fir_count(other.fir_count),
816 pli_count(other.pli_count),
817 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700818 qp_sum(other.qp_sum) {}
hboseeafe942016-11-01 03:00:17 -0700819
Yves Gerey665174f2018-06-19 15:03:05 +0200820RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700821
Steve Antond6a5cbd2017-08-18 09:40:25 -0700822// clang-format off
hboseeafe942016-11-01 03:00:17 -0700823WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700824 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200825 &media_source_id,
Henrik Boström4f40fa52019-12-19 13:27:27 +0100826 &remote_id,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200827 &rid,
hbos6ded1902016-11-01 01:50:46 -0700828 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200829 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700830 &bytes_sent,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200831 &header_bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200832 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700833 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200834 &frames_encoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200835 &key_frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200836 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200837 &total_encoded_bytes_target,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200838 &frame_width,
839 &frame_height,
840 &frames_per_second,
841 &frames_sent,
842 &huge_frames_sent,
Henrik Boström9fe18342019-05-16 18:38:20 +0200843 &total_packet_send_delay,
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200844 &quality_limitation_reason,
Byoungchan Lee7d235352021-05-28 21:32:04 +0900845 &quality_limitation_durations,
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200846 &quality_limitation_resolution_changes,
Henrik Boström6b430862019-08-16 13:09:51 +0200847 &content_type,
Di Wufd1e9d12021-03-09 09:25:28 -0800848 &encoder_implementation,
849 &fir_count,
850 &pli_count,
851 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700852 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700853// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700854
Yves Gerey665174f2018-06-19 15:03:05 +0200855RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id,
856 int64_t timestamp_us)
857 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700858
Yves Gerey665174f2018-06-19 15:03:05 +0200859RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id,
860 int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700861 : RTCRTPStreamStats(std::move(id), timestamp_us),
Henrik Boström646fda02019-05-22 15:49:42 +0200862 media_source_id("mediaSourceId"),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100863 remote_id("remoteId"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200864 rid("rid"),
hbos6ded1902016-11-01 01:50:46 -0700865 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200866 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700867 bytes_sent("bytesSent"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200868 header_bytes_sent("headerBytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200869 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700870 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200871 frames_encoded("framesEncoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200872 key_frames_encoded("keyFramesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200873 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200874 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200875 frame_width("frameWidth"),
876 frame_height("frameHeight"),
877 frames_per_second("framesPerSecond"),
878 frames_sent("framesSent"),
879 huge_frames_sent("hugeFramesSent"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200880 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200881 quality_limitation_reason("qualityLimitationReason"),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900882 quality_limitation_durations("qualityLimitationDurations"),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200883 quality_limitation_resolution_changes(
884 "qualityLimitationResolutionChanges"),
Henrik Boström6b430862019-08-16 13:09:51 +0200885 content_type("contentType"),
Di Wufd1e9d12021-03-09 09:25:28 -0800886 encoder_implementation("encoderImplementation"),
887 fir_count("firCount"),
888 pli_count("pliCount"),
889 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700890 qp_sum("qpSum") {}
hbos6ded1902016-11-01 01:50:46 -0700891
892RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
893 const RTCOutboundRTPStreamStats& other)
894 : RTCRTPStreamStats(other),
Henrik Boström646fda02019-05-22 15:49:42 +0200895 media_source_id(other.media_source_id),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100896 remote_id(other.remote_id),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200897 rid(other.rid),
hbos6ded1902016-11-01 01:50:46 -0700898 packets_sent(other.packets_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200899 retransmitted_packets_sent(other.retransmitted_packets_sent),
hbos6ded1902016-11-01 01:50:46 -0700900 bytes_sent(other.bytes_sent),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200901 header_bytes_sent(other.header_bytes_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200902 retransmitted_bytes_sent(other.retransmitted_bytes_sent),
hbos6ded1902016-11-01 01:50:46 -0700903 target_bitrate(other.target_bitrate),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200904 frames_encoded(other.frames_encoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200905 key_frames_encoded(other.key_frames_encoded),
Henrik Boström2e069262019-04-09 13:59:31 +0200906 total_encode_time(other.total_encode_time),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200907 total_encoded_bytes_target(other.total_encoded_bytes_target),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200908 frame_width(other.frame_width),
909 frame_height(other.frame_height),
910 frames_per_second(other.frames_per_second),
911 frames_sent(other.frames_sent),
912 huge_frames_sent(other.huge_frames_sent),
Henrik Boström9fe18342019-05-16 18:38:20 +0200913 total_packet_send_delay(other.total_packet_send_delay),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200914 quality_limitation_reason(other.quality_limitation_reason),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900915 quality_limitation_durations(other.quality_limitation_durations),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200916 quality_limitation_resolution_changes(
917 other.quality_limitation_resolution_changes),
Henrik Boström6b430862019-08-16 13:09:51 +0200918 content_type(other.content_type),
Di Wufd1e9d12021-03-09 09:25:28 -0800919 encoder_implementation(other.encoder_implementation),
920 fir_count(other.fir_count),
921 pli_count(other.pli_count),
922 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700923 qp_sum(other.qp_sum) {}
hbos6ded1902016-11-01 01:50:46 -0700924
Yves Gerey665174f2018-06-19 15:03:05 +0200925RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700926
Steve Antond6a5cbd2017-08-18 09:40:25 -0700927// clang-format off
Henrik Boström883eefc2019-05-27 13:40:25 +0200928WEBRTC_RTCSTATS_IMPL(
Henrik Boström2f71b612021-03-23 15:18:55 +0100929 RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
930 "remote-inbound-rtp",
Henrik Boström883eefc2019-05-27 13:40:25 +0200931 &local_id,
Di Wu86f04ad2021-02-28 23:36:03 -0800932 &round_trip_time,
Di Wu88a51b22021-03-01 11:22:06 -0800933 &fraction_lost,
934 &total_round_trip_time,
935 &round_trip_time_measurements)
Henrik Boström883eefc2019-05-27 13:40:25 +0200936// clang-format on
937
938RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
939 const std::string& id,
940 int64_t timestamp_us)
941 : RTCRemoteInboundRtpStreamStats(std::string(id), timestamp_us) {}
942
943RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
944 std::string&& id,
945 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800946 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boström883eefc2019-05-27 13:40:25 +0200947 local_id("localId"),
Di Wu86f04ad2021-02-28 23:36:03 -0800948 round_trip_time("roundTripTime"),
Di Wu88a51b22021-03-01 11:22:06 -0800949 fraction_lost("fractionLost"),
950 total_round_trip_time("totalRoundTripTime"),
951 round_trip_time_measurements("roundTripTimeMeasurements") {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200952
953RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
954 const RTCRemoteInboundRtpStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800955 : RTCReceivedRtpStreamStats(other),
Henrik Boström883eefc2019-05-27 13:40:25 +0200956 local_id(other.local_id),
Di Wu86f04ad2021-02-28 23:36:03 -0800957 round_trip_time(other.round_trip_time),
Di Wu88a51b22021-03-01 11:22:06 -0800958 fraction_lost(other.fraction_lost),
959 total_round_trip_time(other.total_round_trip_time),
960 round_trip_time_measurements(other.round_trip_time_measurements) {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200961
962RTCRemoteInboundRtpStreamStats::~RTCRemoteInboundRtpStreamStats() {}
963
964// clang-format off
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100965WEBRTC_RTCSTATS_IMPL(
966 RTCRemoteOutboundRtpStreamStats, RTCSentRtpStreamStats,
967 "remote-outbound-rtp",
968 &local_id,
969 &remote_timestamp,
Ivo Creusen2562cf02021-09-03 14:51:22 +0000970 &reports_sent,
971 &round_trip_time,
972 &round_trip_time_measurements,
973 &total_round_trip_time)
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100974// clang-format on
975
976RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
977 const std::string& id,
978 int64_t timestamp_us)
979 : RTCRemoteOutboundRtpStreamStats(std::string(id), timestamp_us) {}
980
981RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
982 std::string&& id,
983 int64_t timestamp_us)
984 : RTCSentRtpStreamStats(std::move(id), timestamp_us),
985 local_id("localId"),
986 remote_timestamp("remoteTimestamp"),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000987 reports_sent("reportsSent"),
988 round_trip_time("roundTripTime"),
989 round_trip_time_measurements("roundTripTimeMeasurements"),
990 total_round_trip_time("totalRoundTripTime") {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100991
992RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
993 const RTCRemoteOutboundRtpStreamStats& other)
994 : RTCSentRtpStreamStats(other),
995 local_id(other.local_id),
996 remote_timestamp(other.remote_timestamp),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000997 reports_sent(other.reports_sent),
998 round_trip_time(other.round_trip_time),
999 round_trip_time_measurements(other.round_trip_time_measurements),
1000 total_round_trip_time(other.total_round_trip_time) {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +01001001
1002RTCRemoteOutboundRtpStreamStats::~RTCRemoteOutboundRtpStreamStats() {}
1003
1004// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +02001005WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
1006 &track_identifier,
1007 &kind)
1008// clang-format on
1009
1010RTCMediaSourceStats::RTCMediaSourceStats(const std::string& id,
1011 int64_t timestamp_us)
1012 : RTCMediaSourceStats(std::string(id), timestamp_us) {}
1013
1014RTCMediaSourceStats::RTCMediaSourceStats(std::string&& id, int64_t timestamp_us)
1015 : RTCStats(std::move(id), timestamp_us),
1016 track_identifier("trackIdentifier"),
1017 kind("kind") {}
1018
1019RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other)
1020 : RTCStats(other.id(), other.timestamp_us()),
1021 track_identifier(other.track_identifier),
1022 kind(other.kind) {}
1023
1024RTCMediaSourceStats::~RTCMediaSourceStats() {}
1025
1026// clang-format off
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001027WEBRTC_RTCSTATS_IMPL(RTCAudioSourceStats, RTCMediaSourceStats, "media-source",
1028 &audio_level,
1029 &total_audio_energy,
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001030 &total_samples_duration,
1031 &echo_return_loss,
1032 &echo_return_loss_enhancement)
Henrik Boström646fda02019-05-22 15:49:42 +02001033// clang-format on
1034
1035RTCAudioSourceStats::RTCAudioSourceStats(const std::string& id,
1036 int64_t timestamp_us)
1037 : RTCAudioSourceStats(std::string(id), timestamp_us) {}
1038
1039RTCAudioSourceStats::RTCAudioSourceStats(std::string&& id, int64_t timestamp_us)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001040 : RTCMediaSourceStats(std::move(id), timestamp_us),
1041 audio_level("audioLevel"),
1042 total_audio_energy("totalAudioEnergy"),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001043 total_samples_duration("totalSamplesDuration"),
1044 echo_return_loss("echoReturnLoss"),
1045 echo_return_loss_enhancement("echoReturnLossEnhancement") {}
Henrik Boström646fda02019-05-22 15:49:42 +02001046
1047RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001048 : RTCMediaSourceStats(other),
1049 audio_level(other.audio_level),
1050 total_audio_energy(other.total_audio_energy),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001051 total_samples_duration(other.total_samples_duration),
1052 echo_return_loss(other.echo_return_loss),
1053 echo_return_loss_enhancement(other.echo_return_loss_enhancement) {}
Henrik Boström646fda02019-05-22 15:49:42 +02001054
1055RTCAudioSourceStats::~RTCAudioSourceStats() {}
1056
1057// clang-format off
1058WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
1059 &width,
1060 &height,
1061 &frames,
1062 &frames_per_second)
1063// clang-format on
1064
1065RTCVideoSourceStats::RTCVideoSourceStats(const std::string& id,
1066 int64_t timestamp_us)
1067 : RTCVideoSourceStats(std::string(id), timestamp_us) {}
1068
1069RTCVideoSourceStats::RTCVideoSourceStats(std::string&& id, int64_t timestamp_us)
1070 : RTCMediaSourceStats(std::move(id), timestamp_us),
1071 width("width"),
1072 height("height"),
1073 frames("frames"),
1074 frames_per_second("framesPerSecond") {}
1075
1076RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other)
1077 : RTCMediaSourceStats(other),
1078 width(other.width),
1079 height(other.height),
1080 frames(other.frames),
1081 frames_per_second(other.frames_per_second) {}
1082
1083RTCVideoSourceStats::~RTCVideoSourceStats() {}
1084
1085// clang-format off
hbos2fa7c672016-10-24 04:00:05 -07001086WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
1087 &bytes_sent,
Artem Titovedacbd52020-07-06 16:06:37 +02001088 &packets_sent,
hbos2fa7c672016-10-24 04:00:05 -07001089 &bytes_received,
Artem Titovedacbd52020-07-06 16:06:37 +02001090 &packets_received,
hbos2fa7c672016-10-24 04:00:05 -07001091 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -08001092 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -07001093 &selected_candidate_pair_id,
1094 &local_certificate_id,
Jonas Oreland149dc722019-08-28 08:10:27 +02001095 &remote_certificate_id,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001096 &tls_version,
1097 &dtls_cipher,
Philipp Hancke69c1df22022-04-22 15:46:24 +02001098 &dtls_role,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001099 &srtp_cipher,
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001100 &selected_candidate_pair_changes,
1101 &ice_role)
Steve Antond6a5cbd2017-08-18 09:40:25 -07001102// clang-format on
hbos2fa7c672016-10-24 04:00:05 -07001103
Yves Gerey665174f2018-06-19 15:03:05 +02001104RTCTransportStats::RTCTransportStats(const std::string& id,
1105 int64_t timestamp_us)
1106 : RTCTransportStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -07001107
Yves Gerey665174f2018-06-19 15:03:05 +02001108RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -07001109 : RTCStats(std::move(id), timestamp_us),
1110 bytes_sent("bytesSent"),
Artem Titovedacbd52020-07-06 16:06:37 +02001111 packets_sent("packetsSent"),
hbos2fa7c672016-10-24 04:00:05 -07001112 bytes_received("bytesReceived"),
Artem Titovedacbd52020-07-06 16:06:37 +02001113 packets_received("packetsReceived"),
hbos2fa7c672016-10-24 04:00:05 -07001114 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -08001115 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -07001116 selected_candidate_pair_id("selectedCandidatePairId"),
1117 local_certificate_id("localCertificateId"),
Jonas Oreland149dc722019-08-28 08:10:27 +02001118 remote_certificate_id("remoteCertificateId"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001119 tls_version("tlsVersion"),
1120 dtls_cipher("dtlsCipher"),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001121 dtls_role("dtlsRole"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001122 srtp_cipher("srtpCipher"),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001123 selected_candidate_pair_changes("selectedCandidatePairChanges"),
1124 ice_role("iceRole") {}
hbos2fa7c672016-10-24 04:00:05 -07001125
Yves Gerey665174f2018-06-19 15:03:05 +02001126RTCTransportStats::RTCTransportStats(const RTCTransportStats& other)
hbos2fa7c672016-10-24 04:00:05 -07001127 : RTCStats(other.id(), other.timestamp_us()),
1128 bytes_sent(other.bytes_sent),
Artem Titovedacbd52020-07-06 16:06:37 +02001129 packets_sent(other.packets_sent),
hbos2fa7c672016-10-24 04:00:05 -07001130 bytes_received(other.bytes_received),
Artem Titovedacbd52020-07-06 16:06:37 +02001131 packets_received(other.packets_received),
hbos2fa7c672016-10-24 04:00:05 -07001132 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -08001133 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -07001134 selected_candidate_pair_id(other.selected_candidate_pair_id),
1135 local_certificate_id(other.local_certificate_id),
Jonas Oreland149dc722019-08-28 08:10:27 +02001136 remote_certificate_id(other.remote_certificate_id),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001137 tls_version(other.tls_version),
1138 dtls_cipher(other.dtls_cipher),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001139 dtls_role(other.dtls_role),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001140 srtp_cipher(other.srtp_cipher),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001141 selected_candidate_pair_changes(other.selected_candidate_pair_changes),
1142 ice_role(other.ice_role) {}
hbos2fa7c672016-10-24 04:00:05 -07001143
Yves Gerey665174f2018-06-19 15:03:05 +02001144RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -07001145
hbosd565b732016-08-30 14:04:35 -07001146} // namespace webrtc