blob: 9d9498ec4fb0c156a98d63c6e5f0e5b4ab186fac [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
Philipp Hancke7a5de442023-01-02 13:20:45 +010092RTCCertificateStats::RTCCertificateStats(std::string id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -070093 : RTCStats(std::move(id), timestamp_us),
94 fingerprint("fingerprint"),
95 fingerprint_algorithm("fingerprintAlgorithm"),
96 base64_certificate("base64Certificate"),
Yves Gerey665174f2018-06-19 15:03:05 +020097 issuer_certificate_id("issuerCertificateId") {}
hbos2fa7c672016-10-24 04:00:05 -070098
Philipp Hancke6738b012022-10-11 13:04:03 +020099RTCCertificateStats::RTCCertificateStats(const RTCCertificateStats& other) =
100 default;
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
Philipp Hancke7a5de442023-01-02 13:20:45 +0100113RTCCodecStats::RTCCodecStats(std::string id, int64_t timestamp_us)
hbos0adb8282016-11-23 02:32:06 -0800114 : RTCStats(std::move(id), timestamp_us),
Philipp Hancke95157a02020-11-16 20:08:27 +0100115 transport_id("transportId"),
hbos0adb8282016-11-23 02:32:06 -0800116 payload_type("payloadType"),
hbos13f54b22017-02-28 06:56:04 -0800117 mime_type("mimeType"),
hbos0adb8282016-11-23 02:32:06 -0800118 clock_rate("clockRate"),
119 channels("channels"),
Henrik Boström6b430862019-08-16 13:09:51 +0200120 sdp_fmtp_line("sdpFmtpLine") {}
hbos0adb8282016-11-23 02:32:06 -0800121
Philipp Hancke6738b012022-10-11 13:04:03 +0200122RTCCodecStats::RTCCodecStats(const RTCCodecStats& other) = default;
hbos0adb8282016-11-23 02:32:06 -0800123
Yves Gerey665174f2018-06-19 15:03:05 +0200124RTCCodecStats::~RTCCodecStats() {}
hbos0adb8282016-11-23 02:32:06 -0800125
Steve Antond6a5cbd2017-08-18 09:40:25 -0700126// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700127WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel",
128 &label,
129 &protocol,
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200130 &data_channel_identifier,
hbos2fa7c672016-10-24 04:00:05 -0700131 &state,
132 &messages_sent,
133 &bytes_sent,
134 &messages_received,
Nico Weber22f99252019-02-20 10:13:16 -0500135 &bytes_received)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700136// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700137
Philipp Hancke7a5de442023-01-02 13:20:45 +0100138RTCDataChannelStats::RTCDataChannelStats(std::string id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -0700139 : RTCStats(std::move(id), timestamp_us),
140 label("label"),
141 protocol("protocol"),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200142 data_channel_identifier("dataChannelIdentifier"),
hbos2fa7c672016-10-24 04:00:05 -0700143 state("state"),
144 messages_sent("messagesSent"),
145 bytes_sent("bytesSent"),
146 messages_received("messagesReceived"),
Yves Gerey665174f2018-06-19 15:03:05 +0200147 bytes_received("bytesReceived") {}
hbos2fa7c672016-10-24 04:00:05 -0700148
Philipp Hancke6738b012022-10-11 13:04:03 +0200149RTCDataChannelStats::RTCDataChannelStats(const RTCDataChannelStats& other) =
150 default;
hbos2fa7c672016-10-24 04:00:05 -0700151
Yves Gerey665174f2018-06-19 15:03:05 +0200152RTCDataChannelStats::~RTCDataChannelStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700153
Steve Antond6a5cbd2017-08-18 09:40:25 -0700154// clang-format off
hbosc47a0c32016-10-11 14:54:49 -0700155WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair",
156 &transport_id,
157 &local_candidate_id,
158 &remote_candidate_id,
159 &state,
160 &priority,
161 &nominated,
162 &writable,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700163 &packets_sent,
164 &packets_received,
hbosc47a0c32016-10-11 14:54:49 -0700165 &bytes_sent,
166 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800167 &total_round_trip_time,
168 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700169 &available_outgoing_bitrate,
170 &available_incoming_bitrate,
171 &requests_received,
172 &requests_sent,
173 &responses_received,
174 &responses_sent,
hbosc47a0c32016-10-11 14:54:49 -0700175 &consent_requests_sent,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700176 &packets_discarded_on_send,
Philipp Hancke0487c572022-11-01 17:03:01 +0100177 &bytes_discarded_on_send,
178 &last_packet_received_timestamp,
179 &last_packet_sent_timestamp)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700180// clang-format on
hbosc47a0c32016-10-11 14:54:49 -0700181
Philipp Hancke7a5de442023-01-02 13:20:45 +0100182RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string id,
Yves Gerey665174f2018-06-19 15:03:05 +0200183 int64_t timestamp_us)
hbosc47a0c32016-10-11 14:54:49 -0700184 : RTCStats(std::move(id), timestamp_us),
185 transport_id("transportId"),
186 local_candidate_id("localCandidateId"),
187 remote_candidate_id("remoteCandidateId"),
188 state("state"),
189 priority("priority"),
190 nominated("nominated"),
191 writable("writable"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700192 packets_sent("packetsSent"),
193 packets_received("packetsReceived"),
hbosc47a0c32016-10-11 14:54:49 -0700194 bytes_sent("bytesSent"),
195 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800196 total_round_trip_time("totalRoundTripTime"),
197 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700198 available_outgoing_bitrate("availableOutgoingBitrate"),
199 available_incoming_bitrate("availableIncomingBitrate"),
200 requests_received("requestsReceived"),
201 requests_sent("requestsSent"),
202 responses_received("responsesReceived"),
203 responses_sent("responsesSent"),
hbosc47a0c32016-10-11 14:54:49 -0700204 consent_requests_sent("consentRequestsSent"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700205 packets_discarded_on_send("packetsDiscardedOnSend"),
Philipp Hancke0487c572022-11-01 17:03:01 +0100206 bytes_discarded_on_send("bytesDiscardedOnSend"),
207 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
208 last_packet_sent_timestamp("lastPacketSentTimestamp") {}
hbosc47a0c32016-10-11 14:54:49 -0700209
210RTCIceCandidatePairStats::RTCIceCandidatePairStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200211 const RTCIceCandidatePairStats& other) = default;
hbosc47a0c32016-10-11 14:54:49 -0700212
Yves Gerey665174f2018-06-19 15:03:05 +0200213RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {}
hbosc47a0c32016-10-11 14:54:49 -0700214
Steve Antond6a5cbd2017-08-18 09:40:25 -0700215// clang-format off
Henrik Boström1df1bf82018-03-20 13:24:20 +0100216WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800217 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800218 &is_remote,
Gary Liu37e489c2017-11-21 10:49:36 -0800219 &network_type,
hbosab9f6e42016-10-07 02:18:47 -0700220 &ip,
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100221 &address,
hbosab9f6e42016-10-07 02:18:47 -0700222 &port,
223 &protocol,
Philipp Hancke95513752018-09-27 14:40:08 +0200224 &relay_protocol,
hbosab9f6e42016-10-07 02:18:47 -0700225 &candidate_type,
226 &priority,
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100227 &url,
Philipp Hancke0e3cd632022-09-27 10:23:09 +0200228 &foundation,
229 &related_address,
230 &related_port,
231 &username_fragment,
232 &tcp_type,
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100233 &vpn,
234 &network_adapter_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700235// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700236
Philipp Hancke7a5de442023-01-02 13:20:45 +0100237RTCIceCandidateStats::RTCIceCandidateStats(std::string id,
Gary Liu37e489c2017-11-21 10:49:36 -0800238 int64_t timestamp_us,
239 bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700240 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800241 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800242 is_remote("isRemote", is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800243 network_type("networkType"),
hbosab9f6e42016-10-07 02:18:47 -0700244 ip("ip"),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100245 address("address"),
hbosab9f6e42016-10-07 02:18:47 -0700246 port("port"),
247 protocol("protocol"),
Philipp Hancke95513752018-09-27 14:40:08 +0200248 relay_protocol("relayProtocol"),
hbosab9f6e42016-10-07 02:18:47 -0700249 candidate_type("candidateType"),
250 priority("priority"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100251 url("url"),
Philipp Hancke0e3cd632022-09-27 10:23:09 +0200252 foundation("foundation"),
253 related_address("relatedAddress"),
254 related_port("relatedPort"),
255 username_fragment("usernameFragment"),
256 tcp_type("tcpType"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100257 vpn("vpn"),
258 network_adapter_type("networkAdapterType") {}
hbosab9f6e42016-10-07 02:18:47 -0700259
Philipp Hancke6738b012022-10-11 13:04:03 +0200260RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other) =
261 default;
hbosab9f6e42016-10-07 02:18:47 -0700262
Yves Gerey665174f2018-06-19 15:03:05 +0200263RTCIceCandidateStats::~RTCIceCandidateStats() {}
hbosab9f6e42016-10-07 02:18:47 -0700264
265const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
266
Philipp Hancke7a5de442023-01-02 13:20:45 +0100267RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string id,
Yves Gerey665174f2018-06-19 15:03:05 +0200268 int64_t timestamp_us)
269 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700270
Henrik Boström1df1bf82018-03-20 13:24:20 +0100271std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const {
Philipp Hanckeb5cf12d2022-09-06 11:55:31 +0200272 return std::make_unique<RTCLocalIceCandidateStats>(*this);
Henrik Boström1df1bf82018-03-20 13:24:20 +0100273}
274
hbosab9f6e42016-10-07 02:18:47 -0700275const char* RTCLocalIceCandidateStats::type() const {
276 return kType;
277}
278
279const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
280
Philipp Hancke7a5de442023-01-02 13:20:45 +0100281RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string id,
Yves Gerey665174f2018-06-19 15:03:05 +0200282 int64_t timestamp_us)
283 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700284
Henrik Boström1df1bf82018-03-20 13:24:20 +0100285std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const {
Philipp Hanckeb5cf12d2022-09-06 11:55:31 +0200286 return std::make_unique<RTCRemoteIceCandidateStats>(*this);
Henrik Boström1df1bf82018-03-20 13:24:20 +0100287}
288
hbosab9f6e42016-10-07 02:18:47 -0700289const char* RTCRemoteIceCandidateStats::type() const {
290 return kType;
291}
292
Steve Antond6a5cbd2017-08-18 09:40:25 -0700293// clang-format off
Henrik Boström15166b22022-10-19 11:06:58 +0200294WEBRTC_RTCSTATS_IMPL(DEPRECATED_RTCMediaStreamStats, RTCStats, "stream",
hbos09bc1282016-11-08 06:29:22 -0800295 &stream_identifier,
Nico Weber22f99252019-02-20 10:13:16 -0500296 &track_ids)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700297// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800298
Henrik Boström15166b22022-10-19 11:06:58 +0200299DEPRECATED_RTCMediaStreamStats::DEPRECATED_RTCMediaStreamStats(
Philipp Hancke7a5de442023-01-02 13:20:45 +0100300 std::string id,
Henrik Boström15166b22022-10-19 11:06:58 +0200301 int64_t timestamp_us)
hbos09bc1282016-11-08 06:29:22 -0800302 : RTCStats(std::move(id), timestamp_us),
303 stream_identifier("streamIdentifier"),
Yves Gerey665174f2018-06-19 15:03:05 +0200304 track_ids("trackIds") {}
hbos09bc1282016-11-08 06:29:22 -0800305
Henrik Boström15166b22022-10-19 11:06:58 +0200306DEPRECATED_RTCMediaStreamStats::DEPRECATED_RTCMediaStreamStats(
307 const DEPRECATED_RTCMediaStreamStats& other) = default;
hbos09bc1282016-11-08 06:29:22 -0800308
Henrik Boström15166b22022-10-19 11:06:58 +0200309DEPRECATED_RTCMediaStreamStats::~DEPRECATED_RTCMediaStreamStats() {}
hbos09bc1282016-11-08 06:29:22 -0800310
Steve Antond6a5cbd2017-08-18 09:40:25 -0700311// clang-format off
Henrik Boström15166b22022-10-19 11:06:58 +0200312WEBRTC_RTCSTATS_IMPL(DEPRECATED_RTCMediaStreamTrackStats, RTCStats, "track",
zsteine76bd3a2017-07-14 12:17:49 -0700313 &track_identifier,
Henrik Boström646fda02019-05-22 15:49:42 +0200314 &media_source_id,
zsteine76bd3a2017-07-14 12:17:49 -0700315 &remote_source,
316 &ended,
317 &detached,
318 &kind,
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200319 &jitter_buffer_delay,
Chen Xing0acffb52019-01-15 15:46:29 +0100320 &jitter_buffer_emitted_count,
zsteine76bd3a2017-07-14 12:17:49 -0700321 &frame_width,
322 &frame_height,
zsteine76bd3a2017-07-14 12:17:49 -0700323 &frames_sent,
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100324 &huge_frames_sent,
zsteine76bd3a2017-07-14 12:17:49 -0700325 &frames_received,
326 &frames_decoded,
327 &frames_dropped,
zsteine76bd3a2017-07-14 12:17:49 -0700328 &audio_level,
329 &total_audio_energy,
zsteine76bd3a2017-07-14 12:17:49 -0700330 &echo_return_loss,
Steve Anton2dbc69f2017-08-24 17:15:13 -0700331 &echo_return_loss_enhancement,
332 &total_samples_received,
333 &total_samples_duration,
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200334 &concealed_samples,
Henrik Boström21e99da2019-08-21 12:09:51 +0200335 &silent_concealed_samples,
Ruslan Burakov8af88962018-11-22 17:21:10 +0100336 &concealment_events,
Henrik Boström21e99da2019-08-21 12:09:51 +0200337 &inserted_samples_for_deceleration,
Henrik Boströmadbcbf72022-10-31 16:31:40 +0100338 &removed_samples_for_acceleration)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700339// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800340
Henrik Boström15166b22022-10-19 11:06:58 +0200341DEPRECATED_RTCMediaStreamTrackStats::DEPRECATED_RTCMediaStreamTrackStats(
Philipp Hancke7a5de442023-01-02 13:20:45 +0100342 std::string id,
Henrik Boström15166b22022-10-19 11:06:58 +0200343 int64_t timestamp_us,
344 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800345 : RTCStats(std::move(id), timestamp_us),
346 track_identifier("trackIdentifier"),
Henrik Boström646fda02019-05-22 15:49:42 +0200347 media_source_id("mediaSourceId"),
hbos09bc1282016-11-08 06:29:22 -0800348 remote_source("remoteSource"),
349 ended("ended"),
350 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800351 kind("kind", kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200352 jitter_buffer_delay("jitterBufferDelay"),
Chen Xing0acffb52019-01-15 15:46:29 +0100353 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
hbos09bc1282016-11-08 06:29:22 -0800354 frame_width("frameWidth"),
355 frame_height("frameHeight"),
hbos09bc1282016-11-08 06:29:22 -0800356 frames_sent("framesSent"),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100357 huge_frames_sent("hugeFramesSent"),
hbos09bc1282016-11-08 06:29:22 -0800358 frames_received("framesReceived"),
359 frames_decoded("framesDecoded"),
360 frames_dropped("framesDropped"),
hbos09bc1282016-11-08 06:29:22 -0800361 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700362 total_audio_energy("totalAudioEnergy"),
hbos09bc1282016-11-08 06:29:22 -0800363 echo_return_loss("echoReturnLoss"),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700364 echo_return_loss_enhancement("echoReturnLossEnhancement"),
365 total_samples_received("totalSamplesReceived"),
366 total_samples_duration("totalSamplesDuration"),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200367 concealed_samples("concealedSamples"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200368 silent_concealed_samples("silentConcealedSamples"),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100369 concealment_events("concealmentEvents"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200370 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
Henrik Boströmadbcbf72022-10-31 16:31:40 +0100371 removed_samples_for_acceleration("removedSamplesForAcceleration") {
hbos160e4a72017-01-17 02:53:23 -0800372 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
373 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800374}
375
Henrik Boström15166b22022-10-19 11:06:58 +0200376DEPRECATED_RTCMediaStreamTrackStats::DEPRECATED_RTCMediaStreamTrackStats(
377 const DEPRECATED_RTCMediaStreamTrackStats& other) = default;
hbos09bc1282016-11-08 06:29:22 -0800378
Henrik Boström15166b22022-10-19 11:06:58 +0200379DEPRECATED_RTCMediaStreamTrackStats::~DEPRECATED_RTCMediaStreamTrackStats() {}
hbos09bc1282016-11-08 06:29:22 -0800380
Steve Antond6a5cbd2017-08-18 09:40:25 -0700381// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700382WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
383 &data_channels_opened,
Nico Weber22f99252019-02-20 10:13:16 -0500384 &data_channels_closed)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700385// clang-format on
hbosd565b732016-08-30 14:04:35 -0700386
Philipp Hancke7a5de442023-01-02 13:20:45 +0100387RTCPeerConnectionStats::RTCPeerConnectionStats(std::string id,
Yves Gerey665174f2018-06-19 15:03:05 +0200388 int64_t timestamp_us)
hbos0e6758d2016-08-31 07:57:36 -0700389 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700390 data_channels_opened("dataChannelsOpened"),
Yves Gerey665174f2018-06-19 15:03:05 +0200391 data_channels_closed("dataChannelsClosed") {}
hbosd565b732016-08-30 14:04:35 -0700392
hbosfc5e0502016-10-06 02:06:10 -0700393RTCPeerConnectionStats::RTCPeerConnectionStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200394 const RTCPeerConnectionStats& other) = default;
hbosfc5e0502016-10-06 02:06:10 -0700395
Yves Gerey665174f2018-06-19 15:03:05 +0200396RTCPeerConnectionStats::~RTCPeerConnectionStats() {}
hbosfc5e0502016-10-06 02:06:10 -0700397
Steve Antond6a5cbd2017-08-18 09:40:25 -0700398// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700399WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
400 &ssrc,
Philipp Hancke3bc01662018-08-28 14:55:03 +0200401 &kind,
hbosb0ae9202017-01-27 06:35:16 -0800402 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700403 &transport_id,
404 &codec_id,
Di Wufd1e9d12021-03-09 09:25:28 -0800405 &media_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700406// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700407
Philipp Hancke7a5de442023-01-02 13:20:45 +0100408RTCRTPStreamStats::RTCRTPStreamStats(std::string id, int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700409 : RTCStats(std::move(id), timestamp_us),
410 ssrc("ssrc"),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200411 kind("kind"),
hbosb0ae9202017-01-27 06:35:16 -0800412 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700413 transport_id("transportId"),
414 codec_id("codecId"),
Di Wufd1e9d12021-03-09 09:25:28 -0800415 media_type("mediaType") {}
hbos6ded1902016-11-01 01:50:46 -0700416
Philipp Hancke6738b012022-10-11 13:04:03 +0200417RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other) = default;
hbos6ded1902016-11-01 01:50:46 -0700418
Yves Gerey665174f2018-06-19 15:03:05 +0200419RTCRTPStreamStats::~RTCRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700420
Steve Antond6a5cbd2017-08-18 09:40:25 -0700421// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700422WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800423 RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp",
424 &jitter,
Henrik Boströma494e4b2022-10-03 17:26:41 +0200425 &packets_lost)
Di Wufd1e9d12021-03-09 09:25:28 -0800426// clang-format on
427
Philipp Hancke7a5de442023-01-02 13:20:45 +0100428RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string id,
Di Wufd1e9d12021-03-09 09:25:28 -0800429 int64_t timestamp_us)
430 : RTCRTPStreamStats(std::move(id), timestamp_us),
431 jitter("jitter"),
Henrik Boströma494e4b2022-10-03 17:26:41 +0200432 packets_lost("packetsLost") {}
Di Wufd1e9d12021-03-09 09:25:28 -0800433
434RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200435 const RTCReceivedRtpStreamStats& other) = default;
Di Wufd1e9d12021-03-09 09:25:28 -0800436
437RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {}
438
439// clang-format off
440WEBRTC_RTCSTATS_IMPL(
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100441 RTCSentRtpStreamStats, RTCRTPStreamStats, "sent-rtp",
442 &packets_sent,
443 &bytes_sent)
444// clang-format on
445
Philipp Hancke7a5de442023-01-02 13:20:45 +0100446RTCSentRtpStreamStats::RTCSentRtpStreamStats(std::string id,
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100447 int64_t timestamp_us)
448 : RTCRTPStreamStats(std::move(id), timestamp_us),
449 packets_sent("packetsSent"),
450 bytes_sent("bytesSent") {}
451
Philipp Hancke6738b012022-10-11 13:04:03 +0200452RTCSentRtpStreamStats::RTCSentRtpStreamStats(
453 const RTCSentRtpStreamStats& other) = default;
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100454
455RTCSentRtpStreamStats::~RTCSentRtpStreamStats() {}
456
457// clang-format off
458WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800459 RTCInboundRTPStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp",
Henrik Boströma6c7d5c2022-06-16 16:55:31 +0200460 &track_identifier,
Henrik Boström1ab61882022-06-16 17:07:33 +0200461 &mid,
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100462 &remote_id,
hboseeafe942016-11-01 03:00:17 -0700463 &packets_received,
Henrik Boströma494e4b2022-10-03 17:26:41 +0200464 &packets_discarded,
Henrik Boström4a5dab02020-01-28 11:15:35 +0100465 &fec_packets_received,
466 &fec_packets_discarded,
hboseeafe942016-11-01 03:00:17 -0700467 &bytes_received,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200468 &header_bytes_received,
Henrik Boström01738c62019-04-15 17:32:00 +0200469 &last_packet_received_timestamp,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300470 &jitter_buffer_delay,
Ivo Creusen11fdb082022-07-04 14:16:39 +0200471 &jitter_buffer_target_delay,
Ivo Creusen1a84b562022-07-19 16:33:10 +0200472 &jitter_buffer_minimum_delay,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300473 &jitter_buffer_emitted_count,
474 &total_samples_received,
475 &concealed_samples,
476 &silent_concealed_samples,
477 &concealment_events,
478 &inserted_samples_for_deceleration,
479 &removed_samples_for_acceleration,
480 &audio_level,
481 &total_audio_energy,
482 &total_samples_duration,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200483 &frames_received,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300484 &frame_width,
485 &frame_height,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300486 &frames_per_second,
Henrik Boström2e069262019-04-09 13:59:31 +0200487 &frames_decoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200488 &key_frames_decoded,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300489 &frames_dropped,
Johannes Kronbfd343b2019-07-01 10:07:50 +0200490 &total_decode_time,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200491 &total_processing_delay,
Philipp Hancke0359ba22022-05-05 15:55:36 +0200492 &total_assembly_time,
493 &frames_assembled_from_multiple_packets,
Johannes Kron00376e12019-11-25 10:25:42 +0100494 &total_inter_frame_delay,
495 &total_squared_inter_frame_delay,
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200496 &pause_count,
497 &total_pauses_duration,
498 &freeze_count,
499 &total_freezes_duration,
Henrik Boström6b430862019-08-16 13:09:51 +0200500 &content_type,
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200501 &estimated_playout_timestamp,
Di Wufd1e9d12021-03-09 09:25:28 -0800502 &decoder_implementation,
503 &fir_count,
504 &pli_count,
505 &nack_count,
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200506 &qp_sum,
Henrik Boströmc5f8f802022-10-19 17:50:09 +0200507 &goog_timing_frame_info,
Evan Shrubsole13c0be42022-10-31 11:03:10 +0000508 &power_efficient_decoder,
Henrik Boström2fb83072022-10-06 13:37:11 +0200509 &jitter_buffer_flushes,
510 &delayed_packet_outage_samples,
511 &relative_packet_arrival_delay,
512 &interruption_count,
513 &total_interruption_duration,
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200514 &min_playout_delay)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700515// clang-format on
hboseeafe942016-11-01 03:00:17 -0700516
Philipp Hancke7a5de442023-01-02 13:20:45 +0100517RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string id,
Yves Gerey665174f2018-06-19 15:03:05 +0200518 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800519 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boströma6c7d5c2022-06-16 16:55:31 +0200520 track_identifier("trackIdentifier"),
Henrik Boström1ab61882022-06-16 17:07:33 +0200521 mid("mid"),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100522 remote_id("remoteId"),
hboseeafe942016-11-01 03:00:17 -0700523 packets_received("packetsReceived"),
Henrik Boströma494e4b2022-10-03 17:26:41 +0200524 packets_discarded("packetsDiscarded"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200525 fec_packets_received("fecPacketsReceived"),
526 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700527 bytes_received("bytesReceived"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200528 header_bytes_received("headerBytesReceived"),
Henrik Boström01738c62019-04-15 17:32:00 +0200529 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300530 jitter_buffer_delay("jitterBufferDelay"),
Ivo Creusen11fdb082022-07-04 14:16:39 +0200531 jitter_buffer_target_delay("jitterBufferTargetDelay"),
Ivo Creusen1a84b562022-07-19 16:33:10 +0200532 jitter_buffer_minimum_delay("jitterBufferMinimumDelay"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300533 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
534 total_samples_received("totalSamplesReceived"),
535 concealed_samples("concealedSamples"),
536 silent_concealed_samples("silentConcealedSamples"),
537 concealment_events("concealmentEvents"),
538 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
539 removed_samples_for_acceleration("removedSamplesForAcceleration"),
540 audio_level("audioLevel"),
541 total_audio_energy("totalAudioEnergy"),
542 total_samples_duration("totalSamplesDuration"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200543 frames_received("framesReceived"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300544 frame_width("frameWidth"),
545 frame_height("frameHeight"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300546 frames_per_second("framesPerSecond"),
Henrik Boström2e069262019-04-09 13:59:31 +0200547 frames_decoded("framesDecoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200548 key_frames_decoded("keyFramesDecoded"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300549 frames_dropped("framesDropped"),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200550 total_decode_time("totalDecodeTime"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200551 total_processing_delay("totalProcessingDelay"),
Philipp Hancke0359ba22022-05-05 15:55:36 +0200552 total_assembly_time("totalAssemblyTime"),
553 frames_assembled_from_multiple_packets(
554 "framesAssembledFromMultiplePackets"),
Johannes Kron00376e12019-11-25 10:25:42 +0100555 total_inter_frame_delay("totalInterFrameDelay"),
556 total_squared_inter_frame_delay("totalSquaredInterFrameDelay"),
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200557 pause_count("pauseCount"),
558 total_pauses_duration("totalPausesDuration"),
559 freeze_count("freezeCount"),
560 total_freezes_duration("totalFreezesDuration"),
Henrik Boström6b430862019-08-16 13:09:51 +0200561 content_type("contentType"),
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200562 estimated_playout_timestamp("estimatedPlayoutTimestamp"),
Di Wufd1e9d12021-03-09 09:25:28 -0800563 decoder_implementation("decoderImplementation"),
564 fir_count("firCount"),
565 pli_count("pliCount"),
566 nack_count("nackCount"),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200567 qp_sum("qpSum"),
Henrik Boströmc5f8f802022-10-19 17:50:09 +0200568 goog_timing_frame_info("googTimingFrameInfo"),
Evan Shrubsole13c0be42022-10-31 11:03:10 +0000569 power_efficient_decoder("powerEfficientDecoder"),
Henrik Boström2fb83072022-10-06 13:37:11 +0200570 jitter_buffer_flushes(
571 "jitterBufferFlushes",
572 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
573 delayed_packet_outage_samples(
574 "delayedPacketOutageSamples",
575 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
576 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
577 relative_packet_arrival_delay(
578 "relativePacketArrivalDelay",
579 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
580 interruption_count("interruptionCount"),
581 total_interruption_duration("totalInterruptionDuration"),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200582 min_playout_delay("minPlayoutDelay") {}
hboseeafe942016-11-01 03:00:17 -0700583
584RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200585 const RTCInboundRTPStreamStats& other) = default;
Yves Gerey665174f2018-06-19 15:03:05 +0200586RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700587
Steve Antond6a5cbd2017-08-18 09:40:25 -0700588// clang-format off
hboseeafe942016-11-01 03:00:17 -0700589WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700590 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200591 &media_source_id,
Henrik Boström4f40fa52019-12-19 13:27:27 +0100592 &remote_id,
Henrik Boström1ab61882022-06-16 17:07:33 +0200593 &mid,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200594 &rid,
hbos6ded1902016-11-01 01:50:46 -0700595 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200596 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700597 &bytes_sent,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200598 &header_bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200599 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700600 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200601 &frames_encoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200602 &key_frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200603 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200604 &total_encoded_bytes_target,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200605 &frame_width,
606 &frame_height,
607 &frames_per_second,
608 &frames_sent,
609 &huge_frames_sent,
Henrik Boström9fe18342019-05-16 18:38:20 +0200610 &total_packet_send_delay,
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200611 &quality_limitation_reason,
Byoungchan Lee7d235352021-05-28 21:32:04 +0900612 &quality_limitation_durations,
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200613 &quality_limitation_resolution_changes,
Henrik Boström6b430862019-08-16 13:09:51 +0200614 &content_type,
Di Wufd1e9d12021-03-09 09:25:28 -0800615 &encoder_implementation,
616 &fir_count,
617 &pli_count,
618 &nack_count,
Philipp Hancke684e2412022-07-28 12:41:00 +0200619 &qp_sum,
Evan Shrubsole13c0be42022-10-31 11:03:10 +0000620 &active,
Evan Shrubsole9b235cd2022-12-06 10:09:10 +0000621 &power_efficient_encoder,
622 &scalability_mode)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700623// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700624
Philipp Hancke7a5de442023-01-02 13:20:45 +0100625RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string id,
Yves Gerey665174f2018-06-19 15:03:05 +0200626 int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700627 : RTCRTPStreamStats(std::move(id), timestamp_us),
Henrik Boström646fda02019-05-22 15:49:42 +0200628 media_source_id("mediaSourceId"),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100629 remote_id("remoteId"),
Henrik Boström1ab61882022-06-16 17:07:33 +0200630 mid("mid"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200631 rid("rid"),
hbos6ded1902016-11-01 01:50:46 -0700632 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200633 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700634 bytes_sent("bytesSent"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200635 header_bytes_sent("headerBytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200636 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700637 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200638 frames_encoded("framesEncoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200639 key_frames_encoded("keyFramesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200640 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200641 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200642 frame_width("frameWidth"),
643 frame_height("frameHeight"),
644 frames_per_second("framesPerSecond"),
645 frames_sent("framesSent"),
646 huge_frames_sent("hugeFramesSent"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200647 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200648 quality_limitation_reason("qualityLimitationReason"),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900649 quality_limitation_durations("qualityLimitationDurations"),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200650 quality_limitation_resolution_changes(
651 "qualityLimitationResolutionChanges"),
Henrik Boström6b430862019-08-16 13:09:51 +0200652 content_type("contentType"),
Di Wufd1e9d12021-03-09 09:25:28 -0800653 encoder_implementation("encoderImplementation"),
654 fir_count("firCount"),
655 pli_count("pliCount"),
656 nack_count("nackCount"),
Philipp Hancke684e2412022-07-28 12:41:00 +0200657 qp_sum("qpSum"),
Evan Shrubsole13c0be42022-10-31 11:03:10 +0000658 active("active"),
Evan Shrubsole9b235cd2022-12-06 10:09:10 +0000659 power_efficient_encoder("powerEfficientEncoder"),
660 scalability_mode("scalabilityMode") {}
hbos6ded1902016-11-01 01:50:46 -0700661
662RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200663 const RTCOutboundRTPStreamStats& other) = default;
hbos6ded1902016-11-01 01:50:46 -0700664
Yves Gerey665174f2018-06-19 15:03:05 +0200665RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700666
Steve Antond6a5cbd2017-08-18 09:40:25 -0700667// clang-format off
Henrik Boström883eefc2019-05-27 13:40:25 +0200668WEBRTC_RTCSTATS_IMPL(
Henrik Boström2f71b612021-03-23 15:18:55 +0100669 RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
670 "remote-inbound-rtp",
Henrik Boström883eefc2019-05-27 13:40:25 +0200671 &local_id,
Di Wu86f04ad2021-02-28 23:36:03 -0800672 &round_trip_time,
Di Wu88a51b22021-03-01 11:22:06 -0800673 &fraction_lost,
674 &total_round_trip_time,
675 &round_trip_time_measurements)
Henrik Boström883eefc2019-05-27 13:40:25 +0200676// clang-format on
677
678RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
Philipp Hancke7a5de442023-01-02 13:20:45 +0100679 std::string id,
Henrik Boström883eefc2019-05-27 13:40:25 +0200680 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800681 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boström883eefc2019-05-27 13:40:25 +0200682 local_id("localId"),
Di Wu86f04ad2021-02-28 23:36:03 -0800683 round_trip_time("roundTripTime"),
Di Wu88a51b22021-03-01 11:22:06 -0800684 fraction_lost("fractionLost"),
685 total_round_trip_time("totalRoundTripTime"),
686 round_trip_time_measurements("roundTripTimeMeasurements") {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200687
688RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200689 const RTCRemoteInboundRtpStreamStats& other) = default;
Henrik Boström883eefc2019-05-27 13:40:25 +0200690
691RTCRemoteInboundRtpStreamStats::~RTCRemoteInboundRtpStreamStats() {}
692
693// clang-format off
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100694WEBRTC_RTCSTATS_IMPL(
695 RTCRemoteOutboundRtpStreamStats, RTCSentRtpStreamStats,
696 "remote-outbound-rtp",
697 &local_id,
698 &remote_timestamp,
Ivo Creusen2562cf02021-09-03 14:51:22 +0000699 &reports_sent,
700 &round_trip_time,
701 &round_trip_time_measurements,
702 &total_round_trip_time)
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100703// clang-format on
704
705RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
Philipp Hancke7a5de442023-01-02 13:20:45 +0100706 std::string id,
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100707 int64_t timestamp_us)
708 : RTCSentRtpStreamStats(std::move(id), timestamp_us),
709 local_id("localId"),
710 remote_timestamp("remoteTimestamp"),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000711 reports_sent("reportsSent"),
712 round_trip_time("roundTripTime"),
713 round_trip_time_measurements("roundTripTimeMeasurements"),
714 total_round_trip_time("totalRoundTripTime") {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100715
716RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200717 const RTCRemoteOutboundRtpStreamStats& other) = default;
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100718
719RTCRemoteOutboundRtpStreamStats::~RTCRemoteOutboundRtpStreamStats() {}
720
721// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +0200722WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
723 &track_identifier,
724 &kind)
725// clang-format on
726
Philipp Hancke7a5de442023-01-02 13:20:45 +0100727RTCMediaSourceStats::RTCMediaSourceStats(std::string id, int64_t timestamp_us)
Henrik Boström646fda02019-05-22 15:49:42 +0200728 : RTCStats(std::move(id), timestamp_us),
729 track_identifier("trackIdentifier"),
730 kind("kind") {}
731
Philipp Hancke6738b012022-10-11 13:04:03 +0200732RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other) =
733 default;
Henrik Boström646fda02019-05-22 15:49:42 +0200734
735RTCMediaSourceStats::~RTCMediaSourceStats() {}
736
737// clang-format off
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200738WEBRTC_RTCSTATS_IMPL(RTCAudioSourceStats, RTCMediaSourceStats, "media-source",
739 &audio_level,
740 &total_audio_energy,
Taylor Brandstetter64851c02021-06-24 13:32:50 -0700741 &total_samples_duration,
742 &echo_return_loss,
743 &echo_return_loss_enhancement)
Henrik Boström646fda02019-05-22 15:49:42 +0200744// clang-format on
745
Philipp Hancke7a5de442023-01-02 13:20:45 +0100746RTCAudioSourceStats::RTCAudioSourceStats(std::string id, int64_t timestamp_us)
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200747 : RTCMediaSourceStats(std::move(id), timestamp_us),
748 audio_level("audioLevel"),
749 total_audio_energy("totalAudioEnergy"),
Taylor Brandstetter64851c02021-06-24 13:32:50 -0700750 total_samples_duration("totalSamplesDuration"),
751 echo_return_loss("echoReturnLoss"),
752 echo_return_loss_enhancement("echoReturnLossEnhancement") {}
Henrik Boström646fda02019-05-22 15:49:42 +0200753
Philipp Hancke6738b012022-10-11 13:04:03 +0200754RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other) =
755 default;
Henrik Boström646fda02019-05-22 15:49:42 +0200756
757RTCAudioSourceStats::~RTCAudioSourceStats() {}
758
759// clang-format off
760WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
761 &width,
762 &height,
763 &frames,
764 &frames_per_second)
765// clang-format on
766
Philipp Hancke7a5de442023-01-02 13:20:45 +0100767RTCVideoSourceStats::RTCVideoSourceStats(std::string id, int64_t timestamp_us)
Henrik Boström646fda02019-05-22 15:49:42 +0200768 : RTCMediaSourceStats(std::move(id), timestamp_us),
769 width("width"),
770 height("height"),
771 frames("frames"),
772 frames_per_second("framesPerSecond") {}
773
Philipp Hancke6738b012022-10-11 13:04:03 +0200774RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other) =
775 default;
Henrik Boström646fda02019-05-22 15:49:42 +0200776
777RTCVideoSourceStats::~RTCVideoSourceStats() {}
778
779// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700780WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
781 &bytes_sent,
Artem Titovedacbd52020-07-06 16:06:37 +0200782 &packets_sent,
hbos2fa7c672016-10-24 04:00:05 -0700783 &bytes_received,
Artem Titovedacbd52020-07-06 16:06:37 +0200784 &packets_received,
hbos2fa7c672016-10-24 04:00:05 -0700785 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -0800786 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -0700787 &selected_candidate_pair_id,
788 &local_certificate_id,
Jonas Oreland149dc722019-08-28 08:10:27 +0200789 &remote_certificate_id,
Harald Alvestrand5cb78072019-10-28 09:51:17 +0100790 &tls_version,
791 &dtls_cipher,
Philipp Hancke69c1df22022-04-22 15:46:24 +0200792 &dtls_role,
Harald Alvestrand5cb78072019-10-28 09:51:17 +0100793 &srtp_cipher,
Philipp Hanckecc1b9b02022-05-04 18:58:26 +0200794 &selected_candidate_pair_changes,
Philipp Hancke95b1a342022-05-05 07:53:54 +0200795 &ice_role,
Philipp Hancke1f491572022-05-09 17:43:31 +0200796 &ice_local_username_fragment,
797 &ice_state)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700798// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700799
Philipp Hancke7a5de442023-01-02 13:20:45 +0100800RTCTransportStats::RTCTransportStats(std::string id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -0700801 : RTCStats(std::move(id), timestamp_us),
802 bytes_sent("bytesSent"),
Artem Titovedacbd52020-07-06 16:06:37 +0200803 packets_sent("packetsSent"),
hbos2fa7c672016-10-24 04:00:05 -0700804 bytes_received("bytesReceived"),
Artem Titovedacbd52020-07-06 16:06:37 +0200805 packets_received("packetsReceived"),
hbos2fa7c672016-10-24 04:00:05 -0700806 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -0800807 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -0700808 selected_candidate_pair_id("selectedCandidatePairId"),
809 local_certificate_id("localCertificateId"),
Jonas Oreland149dc722019-08-28 08:10:27 +0200810 remote_certificate_id("remoteCertificateId"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +0100811 tls_version("tlsVersion"),
812 dtls_cipher("dtlsCipher"),
Philipp Hancke69c1df22022-04-22 15:46:24 +0200813 dtls_role("dtlsRole"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +0100814 srtp_cipher("srtpCipher"),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +0200815 selected_candidate_pair_changes("selectedCandidatePairChanges"),
Philipp Hancke95b1a342022-05-05 07:53:54 +0200816 ice_role("iceRole"),
Philipp Hancke1f491572022-05-09 17:43:31 +0200817 ice_local_username_fragment("iceLocalUsernameFragment"),
818 ice_state("iceState") {}
hbos2fa7c672016-10-24 04:00:05 -0700819
Philipp Hancke6738b012022-10-11 13:04:03 +0200820RTCTransportStats::RTCTransportStats(const RTCTransportStats& other) = default;
hbos2fa7c672016-10-24 04:00:05 -0700821
Yves Gerey665174f2018-06-19 15:03:05 +0200822RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700823
hbosd565b732016-08-30 14:04:35 -0700824} // namespace webrtc