blob: 28a956acc5beeb9ba11836a4e9c4244a2fc5539d [file] [log] [blame]
hbosd565b732016-08-30 14:04:35 -07001/*
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "api/stats/rtcstats_objects.h"
hbosd565b732016-08-30 14:04:35 -070012
Yves Gerey3e707812018-11-28 16:47:49 +010013#include <utility>
14
Jakob Ivarsson758d9462019-03-19 15:38:49 +010015#include "api/stats/rtc_stats.h"
Jonas Olssona4d87372019-07-05 19:08:33 +020016#include "rtc_base/checks.h"
Jakob Ivarsson758d9462019-03-19 15:38:49 +010017
hbosd565b732016-08-30 14:04:35 -070018namespace webrtc {
19
agrieve26622d32017-08-08 10:48:15 -070020const char* const RTCDataChannelState::kConnecting = "connecting";
21const char* const RTCDataChannelState::kOpen = "open";
22const char* const RTCDataChannelState::kClosing = "closing";
23const char* const RTCDataChannelState::kClosed = "closed";
hboscc555c52016-10-18 12:48:31 -070024
agrieve26622d32017-08-08 10:48:15 -070025const char* const RTCStatsIceCandidatePairState::kFrozen = "frozen";
26const char* const RTCStatsIceCandidatePairState::kWaiting = "waiting";
27const char* const RTCStatsIceCandidatePairState::kInProgress = "in-progress";
28const char* const RTCStatsIceCandidatePairState::kFailed = "failed";
29const char* const RTCStatsIceCandidatePairState::kSucceeded = "succeeded";
hbosc47a0c32016-10-11 14:54:49 -070030
31// Strings defined in https://tools.ietf.org/html/rfc5245.
agrieve26622d32017-08-08 10:48:15 -070032const char* const RTCIceCandidateType::kHost = "host";
33const char* const RTCIceCandidateType::kSrflx = "srflx";
34const char* const RTCIceCandidateType::kPrflx = "prflx";
35const char* const RTCIceCandidateType::kRelay = "relay";
hbosab9f6e42016-10-07 02:18:47 -070036
agrieve26622d32017-08-08 10:48:15 -070037const char* const RTCDtlsTransportState::kNew = "new";
38const char* const RTCDtlsTransportState::kConnecting = "connecting";
39const char* const RTCDtlsTransportState::kConnected = "connected";
40const char* const RTCDtlsTransportState::kClosed = "closed";
41const char* const RTCDtlsTransportState::kFailed = "failed";
hbos7064d592017-01-16 07:38:02 -080042
agrieve26622d32017-08-08 10:48:15 -070043const char* const RTCMediaStreamTrackKind::kAudio = "audio";
44const char* const RTCMediaStreamTrackKind::kVideo = "video";
hbos160e4a72017-01-17 02:53:23 -080045
Gary Liu37e489c2017-11-21 10:49:36 -080046// https://w3c.github.io/webrtc-stats/#dom-rtcnetworktype
47const char* const RTCNetworkType::kBluetooth = "bluetooth";
48const char* const RTCNetworkType::kCellular = "cellular";
49const char* const RTCNetworkType::kEthernet = "ethernet";
50const char* const RTCNetworkType::kWifi = "wifi";
51const char* const RTCNetworkType::kWimax = "wimax";
52const char* const RTCNetworkType::kVpn = "vpn";
53const char* const RTCNetworkType::kUnknown = "unknown";
54
Henrik Boströmce33b6a2019-05-28 17:42:38 +020055// https://w3c.github.io/webrtc-stats/#dom-rtcqualitylimitationreason
56const char* const RTCQualityLimitationReason::kNone = "none";
57const char* const RTCQualityLimitationReason::kCpu = "cpu";
58const char* const RTCQualityLimitationReason::kBandwidth = "bandwidth";
59const char* const RTCQualityLimitationReason::kOther = "other";
60
Henrik Boström2e069262019-04-09 13:59:31 +020061// https://webrtc.org/experiments/rtp-hdrext/video-content-type/
62const char* const RTCContentType::kUnspecified = "unspecified";
63const char* const RTCContentType::kScreenshare = "screenshare";
64
Philipp Hancke69c1df22022-04-22 15:46:24 +020065// https://w3c.github.io/webrtc-stats/#dom-rtcdtlsrole
66const char* const RTCDtlsRole::kUnknown = "unknown";
67const char* const RTCDtlsRole::kClient = "client";
68const char* const RTCDtlsRole::kServer = "server";
69
Philipp Hanckecc1b9b02022-05-04 18:58:26 +020070// https://www.w3.org/TR/webrtc/#rtcicerole
71const char* const RTCIceRole::kUnknown = "unknown";
72const char* const RTCIceRole::kControlled = "controlled";
73const char* const RTCIceRole::kControlling = "controlling";
74
Philipp Hancke1f491572022-05-09 17:43:31 +020075// https://www.w3.org/TR/webrtc/#dom-rtcicetransportstate
76const char* const RTCIceTransportState::kNew = "new";
77const char* const RTCIceTransportState::kChecking = "checking";
78const char* const RTCIceTransportState::kConnected = "connected";
79const char* const RTCIceTransportState::kCompleted = "completed";
80const char* const RTCIceTransportState::kDisconnected = "disconnected";
81const char* const RTCIceTransportState::kFailed = "failed";
82const char* const RTCIceTransportState::kClosed = "closed";
83
Steve Antond6a5cbd2017-08-18 09:40:25 -070084// clang-format off
hbos2fa7c672016-10-24 04:00:05 -070085WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate",
86 &fingerprint,
87 &fingerprint_algorithm,
88 &base64_certificate,
Nico Weber22f99252019-02-20 10:13:16 -050089 &issuer_certificate_id)
Steve Antond6a5cbd2017-08-18 09:40:25 -070090// clang-format on
hbos2fa7c672016-10-24 04:00:05 -070091
Yves Gerey665174f2018-06-19 15:03:05 +020092RTCCertificateStats::RTCCertificateStats(const std::string& id,
93 int64_t timestamp_us)
94 : RTCCertificateStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -070095
Yves Gerey665174f2018-06-19 15:03:05 +020096RTCCertificateStats::RTCCertificateStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -070097 : RTCStats(std::move(id), timestamp_us),
98 fingerprint("fingerprint"),
99 fingerprint_algorithm("fingerprintAlgorithm"),
100 base64_certificate("base64Certificate"),
Yves Gerey665174f2018-06-19 15:03:05 +0200101 issuer_certificate_id("issuerCertificateId") {}
hbos2fa7c672016-10-24 04:00:05 -0700102
Philipp Hancke6738b012022-10-11 13:04:03 +0200103RTCCertificateStats::RTCCertificateStats(const RTCCertificateStats& other) =
104 default;
Yves Gerey665174f2018-06-19 15:03:05 +0200105RTCCertificateStats::~RTCCertificateStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700106
Steve Antond6a5cbd2017-08-18 09:40:25 -0700107// clang-format off
hbos0adb8282016-11-23 02:32:06 -0800108WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec",
Philipp Hancke95157a02020-11-16 20:08:27 +0100109 &transport_id,
hbos0adb8282016-11-23 02:32:06 -0800110 &payload_type,
hbos13f54b22017-02-28 06:56:04 -0800111 &mime_type,
hbos0adb8282016-11-23 02:32:06 -0800112 &clock_rate,
113 &channels,
Henrik Boström6b430862019-08-16 13:09:51 +0200114 &sdp_fmtp_line)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700115// clang-format on
hbos0adb8282016-11-23 02:32:06 -0800116
Yves Gerey665174f2018-06-19 15:03:05 +0200117RTCCodecStats::RTCCodecStats(const std::string& id, int64_t timestamp_us)
118 : RTCCodecStats(std::string(id), timestamp_us) {}
hbos0adb8282016-11-23 02:32:06 -0800119
Yves Gerey665174f2018-06-19 15:03:05 +0200120RTCCodecStats::RTCCodecStats(std::string&& id, int64_t timestamp_us)
hbos0adb8282016-11-23 02:32:06 -0800121 : RTCStats(std::move(id), timestamp_us),
Philipp Hancke95157a02020-11-16 20:08:27 +0100122 transport_id("transportId"),
hbos0adb8282016-11-23 02:32:06 -0800123 payload_type("payloadType"),
hbos13f54b22017-02-28 06:56:04 -0800124 mime_type("mimeType"),
hbos0adb8282016-11-23 02:32:06 -0800125 clock_rate("clockRate"),
126 channels("channels"),
Henrik Boström6b430862019-08-16 13:09:51 +0200127 sdp_fmtp_line("sdpFmtpLine") {}
hbos0adb8282016-11-23 02:32:06 -0800128
Philipp Hancke6738b012022-10-11 13:04:03 +0200129RTCCodecStats::RTCCodecStats(const RTCCodecStats& other) = default;
hbos0adb8282016-11-23 02:32:06 -0800130
Yves Gerey665174f2018-06-19 15:03:05 +0200131RTCCodecStats::~RTCCodecStats() {}
hbos0adb8282016-11-23 02:32:06 -0800132
Steve Antond6a5cbd2017-08-18 09:40:25 -0700133// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700134WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel",
135 &label,
136 &protocol,
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200137 &data_channel_identifier,
hbos2fa7c672016-10-24 04:00:05 -0700138 &state,
139 &messages_sent,
140 &bytes_sent,
141 &messages_received,
Nico Weber22f99252019-02-20 10:13:16 -0500142 &bytes_received)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700143// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700144
Yves Gerey665174f2018-06-19 15:03:05 +0200145RTCDataChannelStats::RTCDataChannelStats(const std::string& id,
146 int64_t timestamp_us)
147 : RTCDataChannelStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -0700148
Yves Gerey665174f2018-06-19 15:03:05 +0200149RTCDataChannelStats::RTCDataChannelStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -0700150 : RTCStats(std::move(id), timestamp_us),
151 label("label"),
152 protocol("protocol"),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200153 data_channel_identifier("dataChannelIdentifier"),
hbos2fa7c672016-10-24 04:00:05 -0700154 state("state"),
155 messages_sent("messagesSent"),
156 bytes_sent("bytesSent"),
157 messages_received("messagesReceived"),
Yves Gerey665174f2018-06-19 15:03:05 +0200158 bytes_received("bytesReceived") {}
hbos2fa7c672016-10-24 04:00:05 -0700159
Philipp Hancke6738b012022-10-11 13:04:03 +0200160RTCDataChannelStats::RTCDataChannelStats(const RTCDataChannelStats& other) =
161 default;
hbos2fa7c672016-10-24 04:00:05 -0700162
Yves Gerey665174f2018-06-19 15:03:05 +0200163RTCDataChannelStats::~RTCDataChannelStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700164
Steve Antond6a5cbd2017-08-18 09:40:25 -0700165// clang-format off
hbosc47a0c32016-10-11 14:54:49 -0700166WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair",
167 &transport_id,
168 &local_candidate_id,
169 &remote_candidate_id,
170 &state,
171 &priority,
172 &nominated,
173 &writable,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700174 &packets_sent,
175 &packets_received,
hbosc47a0c32016-10-11 14:54:49 -0700176 &bytes_sent,
177 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800178 &total_round_trip_time,
179 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700180 &available_outgoing_bitrate,
181 &available_incoming_bitrate,
182 &requests_received,
183 &requests_sent,
184 &responses_received,
185 &responses_sent,
hbosc47a0c32016-10-11 14:54:49 -0700186 &consent_requests_sent,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700187 &packets_discarded_on_send,
188 &bytes_discarded_on_send)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700189// clang-format on
hbosc47a0c32016-10-11 14:54:49 -0700190
Yves Gerey665174f2018-06-19 15:03:05 +0200191RTCIceCandidatePairStats::RTCIceCandidatePairStats(const std::string& id,
192 int64_t timestamp_us)
193 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {}
hbosc47a0c32016-10-11 14:54:49 -0700194
Yves Gerey665174f2018-06-19 15:03:05 +0200195RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string&& id,
196 int64_t timestamp_us)
hbosc47a0c32016-10-11 14:54:49 -0700197 : RTCStats(std::move(id), timestamp_us),
198 transport_id("transportId"),
199 local_candidate_id("localCandidateId"),
200 remote_candidate_id("remoteCandidateId"),
201 state("state"),
202 priority("priority"),
203 nominated("nominated"),
204 writable("writable"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700205 packets_sent("packetsSent"),
206 packets_received("packetsReceived"),
hbosc47a0c32016-10-11 14:54:49 -0700207 bytes_sent("bytesSent"),
208 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800209 total_round_trip_time("totalRoundTripTime"),
210 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700211 available_outgoing_bitrate("availableOutgoingBitrate"),
212 available_incoming_bitrate("availableIncomingBitrate"),
213 requests_received("requestsReceived"),
214 requests_sent("requestsSent"),
215 responses_received("responsesReceived"),
216 responses_sent("responsesSent"),
hbosc47a0c32016-10-11 14:54:49 -0700217 consent_requests_sent("consentRequestsSent"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700218 packets_discarded_on_send("packetsDiscardedOnSend"),
219 bytes_discarded_on_send("bytesDiscardedOnSend") {}
hbosc47a0c32016-10-11 14:54:49 -0700220
221RTCIceCandidatePairStats::RTCIceCandidatePairStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200222 const RTCIceCandidatePairStats& other) = default;
hbosc47a0c32016-10-11 14:54:49 -0700223
Yves Gerey665174f2018-06-19 15:03:05 +0200224RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {}
hbosc47a0c32016-10-11 14:54:49 -0700225
Steve Antond6a5cbd2017-08-18 09:40:25 -0700226// clang-format off
Henrik Boström1df1bf82018-03-20 13:24:20 +0100227WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800228 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800229 &is_remote,
Gary Liu37e489c2017-11-21 10:49:36 -0800230 &network_type,
hbosab9f6e42016-10-07 02:18:47 -0700231 &ip,
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100232 &address,
hbosab9f6e42016-10-07 02:18:47 -0700233 &port,
234 &protocol,
Philipp Hancke95513752018-09-27 14:40:08 +0200235 &relay_protocol,
hbosab9f6e42016-10-07 02:18:47 -0700236 &candidate_type,
237 &priority,
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100238 &url,
Philipp Hancke0e3cd632022-09-27 10:23:09 +0200239 &foundation,
240 &related_address,
241 &related_port,
242 &username_fragment,
243 &tcp_type,
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100244 &vpn,
245 &network_adapter_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700246// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700247
Yves Gerey665174f2018-06-19 15:03:05 +0200248RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id,
249 int64_t timestamp_us,
250 bool is_remote)
251 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {}
hbosab9f6e42016-10-07 02:18:47 -0700252
Gary Liu37e489c2017-11-21 10:49:36 -0800253RTCIceCandidateStats::RTCIceCandidateStats(std::string&& id,
254 int64_t timestamp_us,
255 bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700256 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800257 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800258 is_remote("isRemote", is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800259 network_type("networkType"),
hbosab9f6e42016-10-07 02:18:47 -0700260 ip("ip"),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100261 address("address"),
hbosab9f6e42016-10-07 02:18:47 -0700262 port("port"),
263 protocol("protocol"),
Philipp Hancke95513752018-09-27 14:40:08 +0200264 relay_protocol("relayProtocol"),
hbosab9f6e42016-10-07 02:18:47 -0700265 candidate_type("candidateType"),
266 priority("priority"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100267 url("url"),
Philipp Hancke0e3cd632022-09-27 10:23:09 +0200268 foundation("foundation"),
269 related_address("relatedAddress"),
270 related_port("relatedPort"),
271 username_fragment("usernameFragment"),
272 tcp_type("tcpType"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100273 vpn("vpn"),
274 network_adapter_type("networkAdapterType") {}
hbosab9f6e42016-10-07 02:18:47 -0700275
Philipp Hancke6738b012022-10-11 13:04:03 +0200276RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other) =
277 default;
hbosab9f6e42016-10-07 02:18:47 -0700278
Yves Gerey665174f2018-06-19 15:03:05 +0200279RTCIceCandidateStats::~RTCIceCandidateStats() {}
hbosab9f6e42016-10-07 02:18:47 -0700280
281const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
282
Yves Gerey665174f2018-06-19 15:03:05 +0200283RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(const std::string& id,
284 int64_t timestamp_us)
285 : RTCIceCandidateStats(id, timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700286
Yves Gerey665174f2018-06-19 15:03:05 +0200287RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string&& id,
288 int64_t timestamp_us)
289 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700290
Henrik Boström1df1bf82018-03-20 13:24:20 +0100291std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const {
Philipp Hanckeb5cf12d2022-09-06 11:55:31 +0200292 return std::make_unique<RTCLocalIceCandidateStats>(*this);
Henrik Boström1df1bf82018-03-20 13:24:20 +0100293}
294
hbosab9f6e42016-10-07 02:18:47 -0700295const char* RTCLocalIceCandidateStats::type() const {
296 return kType;
297}
298
299const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
300
Yves Gerey665174f2018-06-19 15:03:05 +0200301RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(const std::string& id,
302 int64_t timestamp_us)
303 : RTCIceCandidateStats(id, timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700304
Yves Gerey665174f2018-06-19 15:03:05 +0200305RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string&& id,
306 int64_t timestamp_us)
307 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700308
Henrik Boström1df1bf82018-03-20 13:24:20 +0100309std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const {
Philipp Hanckeb5cf12d2022-09-06 11:55:31 +0200310 return std::make_unique<RTCRemoteIceCandidateStats>(*this);
Henrik Boström1df1bf82018-03-20 13:24:20 +0100311}
312
hbosab9f6e42016-10-07 02:18:47 -0700313const char* RTCRemoteIceCandidateStats::type() const {
314 return kType;
315}
316
Steve Antond6a5cbd2017-08-18 09:40:25 -0700317// clang-format off
Henrik Boström15166b22022-10-19 11:06:58 +0200318WEBRTC_RTCSTATS_IMPL(DEPRECATED_RTCMediaStreamStats, RTCStats, "stream",
hbos09bc1282016-11-08 06:29:22 -0800319 &stream_identifier,
Nico Weber22f99252019-02-20 10:13:16 -0500320 &track_ids)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700321// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800322
Henrik Boström15166b22022-10-19 11:06:58 +0200323DEPRECATED_RTCMediaStreamStats::DEPRECATED_RTCMediaStreamStats(
324 const std::string& id,
325 int64_t timestamp_us)
326 : DEPRECATED_RTCMediaStreamStats(std::string(id), timestamp_us) {}
hbos09bc1282016-11-08 06:29:22 -0800327
Henrik Boström15166b22022-10-19 11:06:58 +0200328DEPRECATED_RTCMediaStreamStats::DEPRECATED_RTCMediaStreamStats(
329 std::string&& id,
330 int64_t timestamp_us)
hbos09bc1282016-11-08 06:29:22 -0800331 : RTCStats(std::move(id), timestamp_us),
332 stream_identifier("streamIdentifier"),
Yves Gerey665174f2018-06-19 15:03:05 +0200333 track_ids("trackIds") {}
hbos09bc1282016-11-08 06:29:22 -0800334
Henrik Boström15166b22022-10-19 11:06:58 +0200335DEPRECATED_RTCMediaStreamStats::DEPRECATED_RTCMediaStreamStats(
336 const DEPRECATED_RTCMediaStreamStats& other) = default;
hbos09bc1282016-11-08 06:29:22 -0800337
Henrik Boström15166b22022-10-19 11:06:58 +0200338DEPRECATED_RTCMediaStreamStats::~DEPRECATED_RTCMediaStreamStats() {}
hbos09bc1282016-11-08 06:29:22 -0800339
Steve Antond6a5cbd2017-08-18 09:40:25 -0700340// clang-format off
Henrik Boström15166b22022-10-19 11:06:58 +0200341WEBRTC_RTCSTATS_IMPL(DEPRECATED_RTCMediaStreamTrackStats, RTCStats, "track",
zsteine76bd3a2017-07-14 12:17:49 -0700342 &track_identifier,
Henrik Boström646fda02019-05-22 15:49:42 +0200343 &media_source_id,
zsteine76bd3a2017-07-14 12:17:49 -0700344 &remote_source,
345 &ended,
346 &detached,
347 &kind,
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200348 &jitter_buffer_delay,
Chen Xing0acffb52019-01-15 15:46:29 +0100349 &jitter_buffer_emitted_count,
zsteine76bd3a2017-07-14 12:17:49 -0700350 &frame_width,
351 &frame_height,
zsteine76bd3a2017-07-14 12:17:49 -0700352 &frames_sent,
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100353 &huge_frames_sent,
zsteine76bd3a2017-07-14 12:17:49 -0700354 &frames_received,
355 &frames_decoded,
356 &frames_dropped,
zsteine76bd3a2017-07-14 12:17:49 -0700357 &audio_level,
358 &total_audio_energy,
zsteine76bd3a2017-07-14 12:17:49 -0700359 &echo_return_loss,
Steve Anton2dbc69f2017-08-24 17:15:13 -0700360 &echo_return_loss_enhancement,
361 &total_samples_received,
362 &total_samples_duration,
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200363 &concealed_samples,
Henrik Boström21e99da2019-08-21 12:09:51 +0200364 &silent_concealed_samples,
Ruslan Burakov8af88962018-11-22 17:21:10 +0100365 &concealment_events,
Henrik Boström21e99da2019-08-21 12:09:51 +0200366 &inserted_samples_for_deceleration,
367 &removed_samples_for_acceleration,
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100368 &jitter_buffer_flushes,
Sergey Silkin02371062019-01-31 16:45:42 +0100369 &delayed_packet_outage_samples,
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100370 &relative_packet_arrival_delay,
Henrik Lundin44125fa2019-04-29 17:00:46 +0200371 &interruption_count,
372 &total_interruption_duration,
Sergey Silkin02371062019-01-31 16:45:42 +0100373 &freeze_count,
374 &pause_count,
375 &total_freezes_duration,
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200376 &total_pauses_duration)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700377// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800378
Henrik Boström15166b22022-10-19 11:06:58 +0200379DEPRECATED_RTCMediaStreamTrackStats::DEPRECATED_RTCMediaStreamTrackStats(
380 const std::string& id,
381 int64_t timestamp_us,
382 const char* kind)
383 : DEPRECATED_RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {
384}
hbos09bc1282016-11-08 06:29:22 -0800385
Henrik Boström15166b22022-10-19 11:06:58 +0200386DEPRECATED_RTCMediaStreamTrackStats::DEPRECATED_RTCMediaStreamTrackStats(
387 std::string&& id,
388 int64_t timestamp_us,
389 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800390 : RTCStats(std::move(id), timestamp_us),
391 track_identifier("trackIdentifier"),
Henrik Boström646fda02019-05-22 15:49:42 +0200392 media_source_id("mediaSourceId"),
hbos09bc1282016-11-08 06:29:22 -0800393 remote_source("remoteSource"),
394 ended("ended"),
395 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800396 kind("kind", kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200397 jitter_buffer_delay("jitterBufferDelay"),
Chen Xing0acffb52019-01-15 15:46:29 +0100398 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
hbos09bc1282016-11-08 06:29:22 -0800399 frame_width("frameWidth"),
400 frame_height("frameHeight"),
hbos09bc1282016-11-08 06:29:22 -0800401 frames_sent("framesSent"),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100402 huge_frames_sent("hugeFramesSent"),
hbos09bc1282016-11-08 06:29:22 -0800403 frames_received("framesReceived"),
404 frames_decoded("framesDecoded"),
405 frames_dropped("framesDropped"),
hbos09bc1282016-11-08 06:29:22 -0800406 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700407 total_audio_energy("totalAudioEnergy"),
hbos09bc1282016-11-08 06:29:22 -0800408 echo_return_loss("echoReturnLoss"),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700409 echo_return_loss_enhancement("echoReturnLossEnhancement"),
410 total_samples_received("totalSamplesReceived"),
411 total_samples_duration("totalSamplesDuration"),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200412 concealed_samples("concealedSamples"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200413 silent_concealed_samples("silentConcealedSamples"),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100414 concealment_events("concealmentEvents"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200415 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
416 removed_samples_for_acceleration("removedSamplesForAcceleration"),
Jakob Ivarsson758d9462019-03-19 15:38:49 +0100417 jitter_buffer_flushes(
418 "jitterBufferFlushes",
419 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
420 delayed_packet_outage_samples(
421 "delayedPacketOutageSamples",
422 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
423 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
424 relative_packet_arrival_delay(
425 "relativePacketArrivalDelay",
426 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200427 interruption_count("interruptionCount"),
428 total_interruption_duration("totalInterruptionDuration"),
Sergey Silkin02371062019-01-31 16:45:42 +0100429 freeze_count("freezeCount"),
430 pause_count("pauseCount"),
431 total_freezes_duration("totalFreezesDuration"),
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200432 total_pauses_duration("totalPausesDuration") {
hbos160e4a72017-01-17 02:53:23 -0800433 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
434 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800435}
436
Henrik Boström15166b22022-10-19 11:06:58 +0200437DEPRECATED_RTCMediaStreamTrackStats::DEPRECATED_RTCMediaStreamTrackStats(
438 const DEPRECATED_RTCMediaStreamTrackStats& other) = default;
hbos09bc1282016-11-08 06:29:22 -0800439
Henrik Boström15166b22022-10-19 11:06:58 +0200440DEPRECATED_RTCMediaStreamTrackStats::~DEPRECATED_RTCMediaStreamTrackStats() {}
hbos09bc1282016-11-08 06:29:22 -0800441
Steve Antond6a5cbd2017-08-18 09:40:25 -0700442// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700443WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
444 &data_channels_opened,
Nico Weber22f99252019-02-20 10:13:16 -0500445 &data_channels_closed)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700446// clang-format on
hbosd565b732016-08-30 14:04:35 -0700447
Yves Gerey665174f2018-06-19 15:03:05 +0200448RTCPeerConnectionStats::RTCPeerConnectionStats(const std::string& id,
449 int64_t timestamp_us)
450 : RTCPeerConnectionStats(std::string(id), timestamp_us) {}
hbosd565b732016-08-30 14:04:35 -0700451
Yves Gerey665174f2018-06-19 15:03:05 +0200452RTCPeerConnectionStats::RTCPeerConnectionStats(std::string&& id,
453 int64_t timestamp_us)
hbos0e6758d2016-08-31 07:57:36 -0700454 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700455 data_channels_opened("dataChannelsOpened"),
Yves Gerey665174f2018-06-19 15:03:05 +0200456 data_channels_closed("dataChannelsClosed") {}
hbosd565b732016-08-30 14:04:35 -0700457
hbosfc5e0502016-10-06 02:06:10 -0700458RTCPeerConnectionStats::RTCPeerConnectionStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200459 const RTCPeerConnectionStats& other) = default;
hbosfc5e0502016-10-06 02:06:10 -0700460
Yves Gerey665174f2018-06-19 15:03:05 +0200461RTCPeerConnectionStats::~RTCPeerConnectionStats() {}
hbosfc5e0502016-10-06 02:06:10 -0700462
Steve Antond6a5cbd2017-08-18 09:40:25 -0700463// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700464WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
465 &ssrc,
Philipp Hancke3bc01662018-08-28 14:55:03 +0200466 &kind,
hbosb0ae9202017-01-27 06:35:16 -0800467 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700468 &transport_id,
469 &codec_id,
Di Wufd1e9d12021-03-09 09:25:28 -0800470 &media_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700471// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700472
Yves Gerey665174f2018-06-19 15:03:05 +0200473RTCRTPStreamStats::RTCRTPStreamStats(const std::string& id,
474 int64_t timestamp_us)
475 : RTCRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700476
Yves Gerey665174f2018-06-19 15:03:05 +0200477RTCRTPStreamStats::RTCRTPStreamStats(std::string&& id, int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700478 : RTCStats(std::move(id), timestamp_us),
479 ssrc("ssrc"),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200480 kind("kind"),
hbosb0ae9202017-01-27 06:35:16 -0800481 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700482 transport_id("transportId"),
483 codec_id("codecId"),
Di Wufd1e9d12021-03-09 09:25:28 -0800484 media_type("mediaType") {}
hbos6ded1902016-11-01 01:50:46 -0700485
Philipp Hancke6738b012022-10-11 13:04:03 +0200486RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other) = default;
hbos6ded1902016-11-01 01:50:46 -0700487
Yves Gerey665174f2018-06-19 15:03:05 +0200488RTCRTPStreamStats::~RTCRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700489
Steve Antond6a5cbd2017-08-18 09:40:25 -0700490// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700491WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800492 RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp",
493 &jitter,
Henrik Boströma494e4b2022-10-03 17:26:41 +0200494 &packets_lost)
Di Wufd1e9d12021-03-09 09:25:28 -0800495// clang-format on
496
497RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(const std::string&& id,
498 int64_t timestamp_us)
499 : RTCReceivedRtpStreamStats(std::string(id), timestamp_us) {}
500
501RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string&& id,
502 int64_t timestamp_us)
503 : RTCRTPStreamStats(std::move(id), timestamp_us),
504 jitter("jitter"),
Henrik Boströma494e4b2022-10-03 17:26:41 +0200505 packets_lost("packetsLost") {}
Di Wufd1e9d12021-03-09 09:25:28 -0800506
507RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200508 const RTCReceivedRtpStreamStats& other) = default;
Di Wufd1e9d12021-03-09 09:25:28 -0800509
510RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {}
511
512// clang-format off
513WEBRTC_RTCSTATS_IMPL(
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100514 RTCSentRtpStreamStats, RTCRTPStreamStats, "sent-rtp",
515 &packets_sent,
516 &bytes_sent)
517// clang-format on
518
519RTCSentRtpStreamStats::RTCSentRtpStreamStats(const std::string&& id,
520 int64_t timestamp_us)
521 : RTCSentRtpStreamStats(std::string(id), timestamp_us) {}
522
523RTCSentRtpStreamStats::RTCSentRtpStreamStats(std::string&& id,
524 int64_t timestamp_us)
525 : RTCRTPStreamStats(std::move(id), timestamp_us),
526 packets_sent("packetsSent"),
527 bytes_sent("bytesSent") {}
528
Philipp Hancke6738b012022-10-11 13:04:03 +0200529RTCSentRtpStreamStats::RTCSentRtpStreamStats(
530 const RTCSentRtpStreamStats& other) = default;
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100531
532RTCSentRtpStreamStats::~RTCSentRtpStreamStats() {}
533
534// clang-format off
535WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800536 RTCInboundRTPStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp",
Henrik Boströma6c7d5c2022-06-16 16:55:31 +0200537 &track_identifier,
Henrik Boström1ab61882022-06-16 17:07:33 +0200538 &mid,
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100539 &remote_id,
hboseeafe942016-11-01 03:00:17 -0700540 &packets_received,
Henrik Boströma494e4b2022-10-03 17:26:41 +0200541 &packets_discarded,
Henrik Boström4a5dab02020-01-28 11:15:35 +0100542 &fec_packets_received,
543 &fec_packets_discarded,
hboseeafe942016-11-01 03:00:17 -0700544 &bytes_received,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200545 &header_bytes_received,
Henrik Boström01738c62019-04-15 17:32:00 +0200546 &last_packet_received_timestamp,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300547 &jitter_buffer_delay,
Ivo Creusen11fdb082022-07-04 14:16:39 +0200548 &jitter_buffer_target_delay,
Ivo Creusen1a84b562022-07-19 16:33:10 +0200549 &jitter_buffer_minimum_delay,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300550 &jitter_buffer_emitted_count,
551 &total_samples_received,
552 &concealed_samples,
553 &silent_concealed_samples,
554 &concealment_events,
555 &inserted_samples_for_deceleration,
556 &removed_samples_for_acceleration,
557 &audio_level,
558 &total_audio_energy,
559 &total_samples_duration,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200560 &frames_received,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300561 &frame_width,
562 &frame_height,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300563 &frames_per_second,
Henrik Boström2e069262019-04-09 13:59:31 +0200564 &frames_decoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200565 &key_frames_decoded,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300566 &frames_dropped,
Johannes Kronbfd343b2019-07-01 10:07:50 +0200567 &total_decode_time,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200568 &total_processing_delay,
Philipp Hancke0359ba22022-05-05 15:55:36 +0200569 &total_assembly_time,
570 &frames_assembled_from_multiple_packets,
Johannes Kron00376e12019-11-25 10:25:42 +0100571 &total_inter_frame_delay,
572 &total_squared_inter_frame_delay,
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200573 &pause_count,
574 &total_pauses_duration,
575 &freeze_count,
576 &total_freezes_duration,
Henrik Boström6b430862019-08-16 13:09:51 +0200577 &content_type,
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200578 &estimated_playout_timestamp,
Di Wufd1e9d12021-03-09 09:25:28 -0800579 &decoder_implementation,
580 &fir_count,
581 &pli_count,
582 &nack_count,
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200583 &qp_sum,
Henrik Boströmc5f8f802022-10-19 17:50:09 +0200584 &goog_timing_frame_info,
Henrik Boström2fb83072022-10-06 13:37:11 +0200585 &jitter_buffer_flushes,
586 &delayed_packet_outage_samples,
587 &relative_packet_arrival_delay,
588 &interruption_count,
589 &total_interruption_duration,
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200590 &min_playout_delay)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700591// clang-format on
hboseeafe942016-11-01 03:00:17 -0700592
Yves Gerey665174f2018-06-19 15:03:05 +0200593RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
594 int64_t timestamp_us)
595 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {}
hboseeafe942016-11-01 03:00:17 -0700596
Yves Gerey665174f2018-06-19 15:03:05 +0200597RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
598 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800599 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boströma6c7d5c2022-06-16 16:55:31 +0200600 track_identifier("trackIdentifier"),
Henrik Boström1ab61882022-06-16 17:07:33 +0200601 mid("mid"),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100602 remote_id("remoteId"),
hboseeafe942016-11-01 03:00:17 -0700603 packets_received("packetsReceived"),
Henrik Boströma494e4b2022-10-03 17:26:41 +0200604 packets_discarded("packetsDiscarded"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200605 fec_packets_received("fecPacketsReceived"),
606 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700607 bytes_received("bytesReceived"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200608 header_bytes_received("headerBytesReceived"),
Henrik Boström01738c62019-04-15 17:32:00 +0200609 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300610 jitter_buffer_delay("jitterBufferDelay"),
Ivo Creusen11fdb082022-07-04 14:16:39 +0200611 jitter_buffer_target_delay("jitterBufferTargetDelay"),
Ivo Creusen1a84b562022-07-19 16:33:10 +0200612 jitter_buffer_minimum_delay("jitterBufferMinimumDelay"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300613 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
614 total_samples_received("totalSamplesReceived"),
615 concealed_samples("concealedSamples"),
616 silent_concealed_samples("silentConcealedSamples"),
617 concealment_events("concealmentEvents"),
618 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
619 removed_samples_for_acceleration("removedSamplesForAcceleration"),
620 audio_level("audioLevel"),
621 total_audio_energy("totalAudioEnergy"),
622 total_samples_duration("totalSamplesDuration"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200623 frames_received("framesReceived"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300624 frame_width("frameWidth"),
625 frame_height("frameHeight"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300626 frames_per_second("framesPerSecond"),
Henrik Boström2e069262019-04-09 13:59:31 +0200627 frames_decoded("framesDecoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200628 key_frames_decoded("keyFramesDecoded"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300629 frames_dropped("framesDropped"),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200630 total_decode_time("totalDecodeTime"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200631 total_processing_delay("totalProcessingDelay"),
Philipp Hancke0359ba22022-05-05 15:55:36 +0200632 total_assembly_time("totalAssemblyTime"),
633 frames_assembled_from_multiple_packets(
634 "framesAssembledFromMultiplePackets"),
Johannes Kron00376e12019-11-25 10:25:42 +0100635 total_inter_frame_delay("totalInterFrameDelay"),
636 total_squared_inter_frame_delay("totalSquaredInterFrameDelay"),
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200637 pause_count("pauseCount"),
638 total_pauses_duration("totalPausesDuration"),
639 freeze_count("freezeCount"),
640 total_freezes_duration("totalFreezesDuration"),
Henrik Boström6b430862019-08-16 13:09:51 +0200641 content_type("contentType"),
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200642 estimated_playout_timestamp("estimatedPlayoutTimestamp"),
Di Wufd1e9d12021-03-09 09:25:28 -0800643 decoder_implementation("decoderImplementation"),
644 fir_count("firCount"),
645 pli_count("pliCount"),
646 nack_count("nackCount"),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200647 qp_sum("qpSum"),
Henrik Boströmc5f8f802022-10-19 17:50:09 +0200648 goog_timing_frame_info("googTimingFrameInfo"),
Henrik Boström2fb83072022-10-06 13:37:11 +0200649 jitter_buffer_flushes(
650 "jitterBufferFlushes",
651 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
652 delayed_packet_outage_samples(
653 "delayedPacketOutageSamples",
654 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
655 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
656 relative_packet_arrival_delay(
657 "relativePacketArrivalDelay",
658 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
659 interruption_count("interruptionCount"),
660 total_interruption_duration("totalInterruptionDuration"),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200661 min_playout_delay("minPlayoutDelay") {}
hboseeafe942016-11-01 03:00:17 -0700662
663RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200664 const RTCInboundRTPStreamStats& other) = default;
Yves Gerey665174f2018-06-19 15:03:05 +0200665RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700666
Steve Antond6a5cbd2017-08-18 09:40:25 -0700667// clang-format off
hboseeafe942016-11-01 03:00:17 -0700668WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700669 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200670 &media_source_id,
Henrik Boström4f40fa52019-12-19 13:27:27 +0100671 &remote_id,
Henrik Boström1ab61882022-06-16 17:07:33 +0200672 &mid,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200673 &rid,
hbos6ded1902016-11-01 01:50:46 -0700674 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200675 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700676 &bytes_sent,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200677 &header_bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200678 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700679 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200680 &frames_encoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200681 &key_frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200682 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200683 &total_encoded_bytes_target,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200684 &frame_width,
685 &frame_height,
686 &frames_per_second,
687 &frames_sent,
688 &huge_frames_sent,
Henrik Boström9fe18342019-05-16 18:38:20 +0200689 &total_packet_send_delay,
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200690 &quality_limitation_reason,
Byoungchan Lee7d235352021-05-28 21:32:04 +0900691 &quality_limitation_durations,
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200692 &quality_limitation_resolution_changes,
Henrik Boström6b430862019-08-16 13:09:51 +0200693 &content_type,
Di Wufd1e9d12021-03-09 09:25:28 -0800694 &encoder_implementation,
695 &fir_count,
696 &pli_count,
697 &nack_count,
Philipp Hancke684e2412022-07-28 12:41:00 +0200698 &qp_sum,
699 &active)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700700// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700701
Yves Gerey665174f2018-06-19 15:03:05 +0200702RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id,
703 int64_t timestamp_us)
704 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700705
Yves Gerey665174f2018-06-19 15:03:05 +0200706RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id,
707 int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700708 : RTCRTPStreamStats(std::move(id), timestamp_us),
Henrik Boström646fda02019-05-22 15:49:42 +0200709 media_source_id("mediaSourceId"),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100710 remote_id("remoteId"),
Henrik Boström1ab61882022-06-16 17:07:33 +0200711 mid("mid"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200712 rid("rid"),
hbos6ded1902016-11-01 01:50:46 -0700713 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200714 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700715 bytes_sent("bytesSent"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200716 header_bytes_sent("headerBytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200717 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700718 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200719 frames_encoded("framesEncoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200720 key_frames_encoded("keyFramesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200721 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200722 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200723 frame_width("frameWidth"),
724 frame_height("frameHeight"),
725 frames_per_second("framesPerSecond"),
726 frames_sent("framesSent"),
727 huge_frames_sent("hugeFramesSent"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200728 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200729 quality_limitation_reason("qualityLimitationReason"),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900730 quality_limitation_durations("qualityLimitationDurations"),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200731 quality_limitation_resolution_changes(
732 "qualityLimitationResolutionChanges"),
Henrik Boström6b430862019-08-16 13:09:51 +0200733 content_type("contentType"),
Di Wufd1e9d12021-03-09 09:25:28 -0800734 encoder_implementation("encoderImplementation"),
735 fir_count("firCount"),
736 pli_count("pliCount"),
737 nack_count("nackCount"),
Philipp Hancke684e2412022-07-28 12:41:00 +0200738 qp_sum("qpSum"),
739 active("active") {}
hbos6ded1902016-11-01 01:50:46 -0700740
741RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200742 const RTCOutboundRTPStreamStats& other) = default;
hbos6ded1902016-11-01 01:50:46 -0700743
Yves Gerey665174f2018-06-19 15:03:05 +0200744RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700745
Steve Antond6a5cbd2017-08-18 09:40:25 -0700746// clang-format off
Henrik Boström883eefc2019-05-27 13:40:25 +0200747WEBRTC_RTCSTATS_IMPL(
Henrik Boström2f71b612021-03-23 15:18:55 +0100748 RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
749 "remote-inbound-rtp",
Henrik Boström883eefc2019-05-27 13:40:25 +0200750 &local_id,
Di Wu86f04ad2021-02-28 23:36:03 -0800751 &round_trip_time,
Di Wu88a51b22021-03-01 11:22:06 -0800752 &fraction_lost,
753 &total_round_trip_time,
754 &round_trip_time_measurements)
Henrik Boström883eefc2019-05-27 13:40:25 +0200755// clang-format on
756
757RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
758 const std::string& id,
759 int64_t timestamp_us)
760 : RTCRemoteInboundRtpStreamStats(std::string(id), timestamp_us) {}
761
762RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
763 std::string&& id,
764 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800765 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boström883eefc2019-05-27 13:40:25 +0200766 local_id("localId"),
Di Wu86f04ad2021-02-28 23:36:03 -0800767 round_trip_time("roundTripTime"),
Di Wu88a51b22021-03-01 11:22:06 -0800768 fraction_lost("fractionLost"),
769 total_round_trip_time("totalRoundTripTime"),
770 round_trip_time_measurements("roundTripTimeMeasurements") {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200771
772RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200773 const RTCRemoteInboundRtpStreamStats& other) = default;
Henrik Boström883eefc2019-05-27 13:40:25 +0200774
775RTCRemoteInboundRtpStreamStats::~RTCRemoteInboundRtpStreamStats() {}
776
777// clang-format off
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100778WEBRTC_RTCSTATS_IMPL(
779 RTCRemoteOutboundRtpStreamStats, RTCSentRtpStreamStats,
780 "remote-outbound-rtp",
781 &local_id,
782 &remote_timestamp,
Ivo Creusen2562cf02021-09-03 14:51:22 +0000783 &reports_sent,
784 &round_trip_time,
785 &round_trip_time_measurements,
786 &total_round_trip_time)
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100787// clang-format on
788
789RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
790 const std::string& id,
791 int64_t timestamp_us)
792 : RTCRemoteOutboundRtpStreamStats(std::string(id), timestamp_us) {}
793
794RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
795 std::string&& id,
796 int64_t timestamp_us)
797 : RTCSentRtpStreamStats(std::move(id), timestamp_us),
798 local_id("localId"),
799 remote_timestamp("remoteTimestamp"),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000800 reports_sent("reportsSent"),
801 round_trip_time("roundTripTime"),
802 round_trip_time_measurements("roundTripTimeMeasurements"),
803 total_round_trip_time("totalRoundTripTime") {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100804
805RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200806 const RTCRemoteOutboundRtpStreamStats& other) = default;
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100807
808RTCRemoteOutboundRtpStreamStats::~RTCRemoteOutboundRtpStreamStats() {}
809
810// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +0200811WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
812 &track_identifier,
813 &kind)
814// clang-format on
815
816RTCMediaSourceStats::RTCMediaSourceStats(const std::string& id,
817 int64_t timestamp_us)
818 : RTCMediaSourceStats(std::string(id), timestamp_us) {}
819
820RTCMediaSourceStats::RTCMediaSourceStats(std::string&& id, int64_t timestamp_us)
821 : RTCStats(std::move(id), timestamp_us),
822 track_identifier("trackIdentifier"),
823 kind("kind") {}
824
Philipp Hancke6738b012022-10-11 13:04:03 +0200825RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other) =
826 default;
Henrik Boström646fda02019-05-22 15:49:42 +0200827
828RTCMediaSourceStats::~RTCMediaSourceStats() {}
829
830// clang-format off
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200831WEBRTC_RTCSTATS_IMPL(RTCAudioSourceStats, RTCMediaSourceStats, "media-source",
832 &audio_level,
833 &total_audio_energy,
Taylor Brandstetter64851c02021-06-24 13:32:50 -0700834 &total_samples_duration,
835 &echo_return_loss,
836 &echo_return_loss_enhancement)
Henrik Boström646fda02019-05-22 15:49:42 +0200837// clang-format on
838
839RTCAudioSourceStats::RTCAudioSourceStats(const std::string& id,
840 int64_t timestamp_us)
841 : RTCAudioSourceStats(std::string(id), timestamp_us) {}
842
843RTCAudioSourceStats::RTCAudioSourceStats(std::string&& id, int64_t timestamp_us)
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200844 : RTCMediaSourceStats(std::move(id), timestamp_us),
845 audio_level("audioLevel"),
846 total_audio_energy("totalAudioEnergy"),
Taylor Brandstetter64851c02021-06-24 13:32:50 -0700847 total_samples_duration("totalSamplesDuration"),
848 echo_return_loss("echoReturnLoss"),
849 echo_return_loss_enhancement("echoReturnLossEnhancement") {}
Henrik Boström646fda02019-05-22 15:49:42 +0200850
Philipp Hancke6738b012022-10-11 13:04:03 +0200851RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other) =
852 default;
Henrik Boström646fda02019-05-22 15:49:42 +0200853
854RTCAudioSourceStats::~RTCAudioSourceStats() {}
855
856// clang-format off
857WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
858 &width,
859 &height,
860 &frames,
861 &frames_per_second)
862// clang-format on
863
864RTCVideoSourceStats::RTCVideoSourceStats(const std::string& id,
865 int64_t timestamp_us)
866 : RTCVideoSourceStats(std::string(id), timestamp_us) {}
867
868RTCVideoSourceStats::RTCVideoSourceStats(std::string&& id, int64_t timestamp_us)
869 : RTCMediaSourceStats(std::move(id), timestamp_us),
870 width("width"),
871 height("height"),
872 frames("frames"),
873 frames_per_second("framesPerSecond") {}
874
Philipp Hancke6738b012022-10-11 13:04:03 +0200875RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other) =
876 default;
Henrik Boström646fda02019-05-22 15:49:42 +0200877
878RTCVideoSourceStats::~RTCVideoSourceStats() {}
879
880// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700881WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
882 &bytes_sent,
Artem Titovedacbd52020-07-06 16:06:37 +0200883 &packets_sent,
hbos2fa7c672016-10-24 04:00:05 -0700884 &bytes_received,
Artem Titovedacbd52020-07-06 16:06:37 +0200885 &packets_received,
hbos2fa7c672016-10-24 04:00:05 -0700886 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -0800887 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -0700888 &selected_candidate_pair_id,
889 &local_certificate_id,
Jonas Oreland149dc722019-08-28 08:10:27 +0200890 &remote_certificate_id,
Harald Alvestrand5cb78072019-10-28 09:51:17 +0100891 &tls_version,
892 &dtls_cipher,
Philipp Hancke69c1df22022-04-22 15:46:24 +0200893 &dtls_role,
Harald Alvestrand5cb78072019-10-28 09:51:17 +0100894 &srtp_cipher,
Philipp Hanckecc1b9b02022-05-04 18:58:26 +0200895 &selected_candidate_pair_changes,
Philipp Hancke95b1a342022-05-05 07:53:54 +0200896 &ice_role,
Philipp Hancke1f491572022-05-09 17:43:31 +0200897 &ice_local_username_fragment,
898 &ice_state)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700899// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700900
Yves Gerey665174f2018-06-19 15:03:05 +0200901RTCTransportStats::RTCTransportStats(const std::string& id,
902 int64_t timestamp_us)
903 : RTCTransportStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -0700904
Yves Gerey665174f2018-06-19 15:03:05 +0200905RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -0700906 : RTCStats(std::move(id), timestamp_us),
907 bytes_sent("bytesSent"),
Artem Titovedacbd52020-07-06 16:06:37 +0200908 packets_sent("packetsSent"),
hbos2fa7c672016-10-24 04:00:05 -0700909 bytes_received("bytesReceived"),
Artem Titovedacbd52020-07-06 16:06:37 +0200910 packets_received("packetsReceived"),
hbos2fa7c672016-10-24 04:00:05 -0700911 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -0800912 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -0700913 selected_candidate_pair_id("selectedCandidatePairId"),
914 local_certificate_id("localCertificateId"),
Jonas Oreland149dc722019-08-28 08:10:27 +0200915 remote_certificate_id("remoteCertificateId"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +0100916 tls_version("tlsVersion"),
917 dtls_cipher("dtlsCipher"),
Philipp Hancke69c1df22022-04-22 15:46:24 +0200918 dtls_role("dtlsRole"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +0100919 srtp_cipher("srtpCipher"),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +0200920 selected_candidate_pair_changes("selectedCandidatePairChanges"),
Philipp Hancke95b1a342022-05-05 07:53:54 +0200921 ice_role("iceRole"),
Philipp Hancke1f491572022-05-09 17:43:31 +0200922 ice_local_username_fragment("iceLocalUsernameFragment"),
923 ice_state("iceState") {}
hbos2fa7c672016-10-24 04:00:05 -0700924
Philipp Hancke6738b012022-10-11 13:04:03 +0200925RTCTransportStats::RTCTransportStats(const RTCTransportStats& other) = default;
hbos2fa7c672016-10-24 04:00:05 -0700926
Yves Gerey665174f2018-06-19 15:03:05 +0200927RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700928
hbosd565b732016-08-30 14:04:35 -0700929} // namespace webrtc