blob: b25e2ddc0da74df347466199205d287601d83c7b [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 Hanckeb81823a2023-01-04 15:17:42 +010092RTCCertificateStats::RTCCertificateStats(std::string id, Timestamp timestamp)
93 : RTCStats(std::move(id), timestamp),
hbos2fa7c672016-10-24 04:00:05 -070094 fingerprint("fingerprint"),
95 fingerprint_algorithm("fingerprintAlgorithm"),
96 base64_certificate("base64Certificate"),
Yves Gerey665174f2018-06-19 15:03:05 +020097 issuer_certificate_id("issuerCertificateId") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +010098RTCCertificateStats::RTCCertificateStats(std::string id, int64_t timestamp_us)
99 : RTCCertificateStats(std::move(id), Timestamp::Micros(timestamp_us)) {}
hbos2fa7c672016-10-24 04:00:05 -0700100
Philipp Hancke6738b012022-10-11 13:04:03 +0200101RTCCertificateStats::RTCCertificateStats(const RTCCertificateStats& other) =
102 default;
Yves Gerey665174f2018-06-19 15:03:05 +0200103RTCCertificateStats::~RTCCertificateStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700104
Steve Antond6a5cbd2017-08-18 09:40:25 -0700105// clang-format off
hbos0adb8282016-11-23 02:32:06 -0800106WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec",
Philipp Hancke95157a02020-11-16 20:08:27 +0100107 &transport_id,
hbos0adb8282016-11-23 02:32:06 -0800108 &payload_type,
hbos13f54b22017-02-28 06:56:04 -0800109 &mime_type,
hbos0adb8282016-11-23 02:32:06 -0800110 &clock_rate,
111 &channels,
Henrik Boström6b430862019-08-16 13:09:51 +0200112 &sdp_fmtp_line)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700113// clang-format on
hbos0adb8282016-11-23 02:32:06 -0800114
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100115RTCCodecStats::RTCCodecStats(std::string id, Timestamp timestamp)
116 : RTCStats(std::move(id), timestamp),
Philipp Hancke95157a02020-11-16 20:08:27 +0100117 transport_id("transportId"),
hbos0adb8282016-11-23 02:32:06 -0800118 payload_type("payloadType"),
hbos13f54b22017-02-28 06:56:04 -0800119 mime_type("mimeType"),
hbos0adb8282016-11-23 02:32:06 -0800120 clock_rate("clockRate"),
121 channels("channels"),
Henrik Boström6b430862019-08-16 13:09:51 +0200122 sdp_fmtp_line("sdpFmtpLine") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100123RTCCodecStats::RTCCodecStats(std::string id, int64_t timestamp_us)
124 : RTCCodecStats(std::move(id), Timestamp::Micros(timestamp_us)) {}
hbos0adb8282016-11-23 02:32:06 -0800125
Philipp Hancke6738b012022-10-11 13:04:03 +0200126RTCCodecStats::RTCCodecStats(const RTCCodecStats& other) = default;
hbos0adb8282016-11-23 02:32:06 -0800127
Yves Gerey665174f2018-06-19 15:03:05 +0200128RTCCodecStats::~RTCCodecStats() {}
hbos0adb8282016-11-23 02:32:06 -0800129
Steve Antond6a5cbd2017-08-18 09:40:25 -0700130// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700131WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel",
132 &label,
133 &protocol,
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200134 &data_channel_identifier,
hbos2fa7c672016-10-24 04:00:05 -0700135 &state,
136 &messages_sent,
137 &bytes_sent,
138 &messages_received,
Nico Weber22f99252019-02-20 10:13:16 -0500139 &bytes_received)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700140// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700141
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100142RTCDataChannelStats::RTCDataChannelStats(std::string id, Timestamp timestamp)
143 : RTCStats(std::move(id), timestamp),
hbos2fa7c672016-10-24 04:00:05 -0700144 label("label"),
145 protocol("protocol"),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200146 data_channel_identifier("dataChannelIdentifier"),
hbos2fa7c672016-10-24 04:00:05 -0700147 state("state"),
148 messages_sent("messagesSent"),
149 bytes_sent("bytesSent"),
150 messages_received("messagesReceived"),
Yves Gerey665174f2018-06-19 15:03:05 +0200151 bytes_received("bytesReceived") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100152RTCDataChannelStats::RTCDataChannelStats(std::string id, int64_t timestamp_us)
153 : RTCDataChannelStats(std::move(id), Timestamp::Micros(timestamp_us)) {}
hbos2fa7c672016-10-24 04:00:05 -0700154
Philipp Hancke6738b012022-10-11 13:04:03 +0200155RTCDataChannelStats::RTCDataChannelStats(const RTCDataChannelStats& other) =
156 default;
hbos2fa7c672016-10-24 04:00:05 -0700157
Yves Gerey665174f2018-06-19 15:03:05 +0200158RTCDataChannelStats::~RTCDataChannelStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700159
Steve Antond6a5cbd2017-08-18 09:40:25 -0700160// clang-format off
hbosc47a0c32016-10-11 14:54:49 -0700161WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair",
162 &transport_id,
163 &local_candidate_id,
164 &remote_candidate_id,
165 &state,
166 &priority,
167 &nominated,
168 &writable,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700169 &packets_sent,
170 &packets_received,
hbosc47a0c32016-10-11 14:54:49 -0700171 &bytes_sent,
172 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800173 &total_round_trip_time,
174 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700175 &available_outgoing_bitrate,
176 &available_incoming_bitrate,
177 &requests_received,
178 &requests_sent,
179 &responses_received,
180 &responses_sent,
hbosc47a0c32016-10-11 14:54:49 -0700181 &consent_requests_sent,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700182 &packets_discarded_on_send,
Philipp Hancke0487c572022-11-01 17:03:01 +0100183 &bytes_discarded_on_send,
184 &last_packet_received_timestamp,
185 &last_packet_sent_timestamp)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700186// clang-format on
hbosc47a0c32016-10-11 14:54:49 -0700187
Philipp Hancke7a5de442023-01-02 13:20:45 +0100188RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100189 Timestamp timestamp)
190 : RTCStats(std::move(id), timestamp),
hbosc47a0c32016-10-11 14:54:49 -0700191 transport_id("transportId"),
192 local_candidate_id("localCandidateId"),
193 remote_candidate_id("remoteCandidateId"),
194 state("state"),
195 priority("priority"),
196 nominated("nominated"),
197 writable("writable"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700198 packets_sent("packetsSent"),
199 packets_received("packetsReceived"),
hbosc47a0c32016-10-11 14:54:49 -0700200 bytes_sent("bytesSent"),
201 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800202 total_round_trip_time("totalRoundTripTime"),
203 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700204 available_outgoing_bitrate("availableOutgoingBitrate"),
205 available_incoming_bitrate("availableIncomingBitrate"),
206 requests_received("requestsReceived"),
207 requests_sent("requestsSent"),
208 responses_received("responsesReceived"),
209 responses_sent("responsesSent"),
hbosc47a0c32016-10-11 14:54:49 -0700210 consent_requests_sent("consentRequestsSent"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700211 packets_discarded_on_send("packetsDiscardedOnSend"),
Philipp Hancke0487c572022-11-01 17:03:01 +0100212 bytes_discarded_on_send("bytesDiscardedOnSend"),
213 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
214 last_packet_sent_timestamp("lastPacketSentTimestamp") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100215RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string id,
216 int64_t timestamp_us)
217 : RTCIceCandidatePairStats(std::move(id), Timestamp::Micros(timestamp_us)) {
218}
hbosc47a0c32016-10-11 14:54:49 -0700219
220RTCIceCandidatePairStats::RTCIceCandidatePairStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200221 const RTCIceCandidatePairStats& other) = default;
hbosc47a0c32016-10-11 14:54:49 -0700222
Yves Gerey665174f2018-06-19 15:03:05 +0200223RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {}
hbosc47a0c32016-10-11 14:54:49 -0700224
Steve Antond6a5cbd2017-08-18 09:40:25 -0700225// clang-format off
Henrik Boström1df1bf82018-03-20 13:24:20 +0100226WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800227 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800228 &is_remote,
Gary Liu37e489c2017-11-21 10:49:36 -0800229 &network_type,
hbosab9f6e42016-10-07 02:18:47 -0700230 &ip,
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100231 &address,
hbosab9f6e42016-10-07 02:18:47 -0700232 &port,
233 &protocol,
Philipp Hancke95513752018-09-27 14:40:08 +0200234 &relay_protocol,
hbosab9f6e42016-10-07 02:18:47 -0700235 &candidate_type,
236 &priority,
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100237 &url,
Philipp Hancke0e3cd632022-09-27 10:23:09 +0200238 &foundation,
239 &related_address,
240 &related_port,
241 &username_fragment,
242 &tcp_type,
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100243 &vpn,
244 &network_adapter_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700245// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700246
Philipp Hancke7a5de442023-01-02 13:20:45 +0100247RTCIceCandidateStats::RTCIceCandidateStats(std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100248 Timestamp timestamp,
Gary Liu37e489c2017-11-21 10:49:36 -0800249 bool is_remote)
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100250 : RTCStats(std::move(id), timestamp),
hbosb4e426e2017-01-02 09:59:31 -0800251 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800252 is_remote("isRemote", is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800253 network_type("networkType"),
hbosab9f6e42016-10-07 02:18:47 -0700254 ip("ip"),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100255 address("address"),
hbosab9f6e42016-10-07 02:18:47 -0700256 port("port"),
257 protocol("protocol"),
Philipp Hancke95513752018-09-27 14:40:08 +0200258 relay_protocol("relayProtocol"),
hbosab9f6e42016-10-07 02:18:47 -0700259 candidate_type("candidateType"),
260 priority("priority"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100261 url("url"),
Philipp Hancke0e3cd632022-09-27 10:23:09 +0200262 foundation("foundation"),
263 related_address("relatedAddress"),
264 related_port("relatedPort"),
265 username_fragment("usernameFragment"),
266 tcp_type("tcpType"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100267 vpn("vpn"),
268 network_adapter_type("networkAdapterType") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100269RTCIceCandidateStats::RTCIceCandidateStats(std::string id,
270 int64_t timestamp_us,
271 bool is_remote)
272 : RTCIceCandidateStats(std::move(id),
273 Timestamp::Micros(timestamp_us),
274 is_remote) {}
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
Philipp Hancke7a5de442023-01-02 13:20:45 +0100283RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100284 Timestamp timestamp)
285 : RTCIceCandidateStats(std::move(id), timestamp, false) {}
286RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string id,
Yves Gerey665174f2018-06-19 15:03:05 +0200287 int64_t timestamp_us)
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100288 : RTCLocalIceCandidateStats(std::move(id),
289 Timestamp::Micros(timestamp_us)) {}
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
Philipp Hancke7a5de442023-01-02 13:20:45 +0100301RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100302 Timestamp timestamp)
303 : RTCIceCandidateStats(std::move(id), timestamp, true) {}
304RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string id,
Yves Gerey665174f2018-06-19 15:03:05 +0200305 int64_t timestamp_us)
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100306 : RTCRemoteIceCandidateStats(std::move(id),
307 Timestamp::Micros(timestamp_us)) {}
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(
Philipp Hancke7a5de442023-01-02 13:20:45 +0100324 std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100325 Timestamp timestamp)
326 : RTCStats(std::move(id), timestamp),
hbos09bc1282016-11-08 06:29:22 -0800327 stream_identifier("streamIdentifier"),
Yves Gerey665174f2018-06-19 15:03:05 +0200328 track_ids("trackIds") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100329DEPRECATED_RTCMediaStreamStats::DEPRECATED_RTCMediaStreamStats(
330 std::string id,
331 int64_t timestamp_us)
332 : DEPRECATED_RTCMediaStreamStats(std::move(id),
333 Timestamp::Micros(timestamp_us)) {}
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,
Henrik Boströmadbcbf72022-10-31 16:31:40 +0100367 &removed_samples_for_acceleration)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700368// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800369
Henrik Boström15166b22022-10-19 11:06:58 +0200370DEPRECATED_RTCMediaStreamTrackStats::DEPRECATED_RTCMediaStreamTrackStats(
Philipp Hancke7a5de442023-01-02 13:20:45 +0100371 std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100372 Timestamp timestamp,
Henrik Boström15166b22022-10-19 11:06:58 +0200373 const char* kind)
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100374 : RTCStats(std::move(id), timestamp),
hbos09bc1282016-11-08 06:29:22 -0800375 track_identifier("trackIdentifier"),
Henrik Boström646fda02019-05-22 15:49:42 +0200376 media_source_id("mediaSourceId"),
hbos09bc1282016-11-08 06:29:22 -0800377 remote_source("remoteSource"),
378 ended("ended"),
379 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800380 kind("kind", kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200381 jitter_buffer_delay("jitterBufferDelay"),
Chen Xing0acffb52019-01-15 15:46:29 +0100382 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
hbos09bc1282016-11-08 06:29:22 -0800383 frame_width("frameWidth"),
384 frame_height("frameHeight"),
hbos09bc1282016-11-08 06:29:22 -0800385 frames_sent("framesSent"),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100386 huge_frames_sent("hugeFramesSent"),
hbos09bc1282016-11-08 06:29:22 -0800387 frames_received("framesReceived"),
388 frames_decoded("framesDecoded"),
389 frames_dropped("framesDropped"),
hbos09bc1282016-11-08 06:29:22 -0800390 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700391 total_audio_energy("totalAudioEnergy"),
hbos09bc1282016-11-08 06:29:22 -0800392 echo_return_loss("echoReturnLoss"),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700393 echo_return_loss_enhancement("echoReturnLossEnhancement"),
394 total_samples_received("totalSamplesReceived"),
395 total_samples_duration("totalSamplesDuration"),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200396 concealed_samples("concealedSamples"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200397 silent_concealed_samples("silentConcealedSamples"),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100398 concealment_events("concealmentEvents"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200399 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
Henrik Boströmadbcbf72022-10-31 16:31:40 +0100400 removed_samples_for_acceleration("removedSamplesForAcceleration") {
hbos160e4a72017-01-17 02:53:23 -0800401 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
402 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800403}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100404DEPRECATED_RTCMediaStreamTrackStats::DEPRECATED_RTCMediaStreamTrackStats(
405 std::string id,
406 int64_t timestamp_us,
407 const char* kind)
408 : DEPRECATED_RTCMediaStreamTrackStats(std::move(id),
409 Timestamp::Micros(timestamp_us),
410 kind) {}
hbos09bc1282016-11-08 06:29:22 -0800411
Henrik Boström15166b22022-10-19 11:06:58 +0200412DEPRECATED_RTCMediaStreamTrackStats::DEPRECATED_RTCMediaStreamTrackStats(
413 const DEPRECATED_RTCMediaStreamTrackStats& other) = default;
hbos09bc1282016-11-08 06:29:22 -0800414
Henrik Boström15166b22022-10-19 11:06:58 +0200415DEPRECATED_RTCMediaStreamTrackStats::~DEPRECATED_RTCMediaStreamTrackStats() {}
hbos09bc1282016-11-08 06:29:22 -0800416
Steve Antond6a5cbd2017-08-18 09:40:25 -0700417// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700418WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
419 &data_channels_opened,
Nico Weber22f99252019-02-20 10:13:16 -0500420 &data_channels_closed)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700421// clang-format on
hbosd565b732016-08-30 14:04:35 -0700422
Philipp Hancke7a5de442023-01-02 13:20:45 +0100423RTCPeerConnectionStats::RTCPeerConnectionStats(std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100424 Timestamp timestamp)
425 : RTCStats(std::move(id), timestamp),
hbosd565b732016-08-30 14:04:35 -0700426 data_channels_opened("dataChannelsOpened"),
Yves Gerey665174f2018-06-19 15:03:05 +0200427 data_channels_closed("dataChannelsClosed") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100428RTCPeerConnectionStats::RTCPeerConnectionStats(std::string id,
429 int64_t timestamp_us)
430 : RTCPeerConnectionStats(std::move(id), Timestamp::Micros(timestamp_us)) {}
hbosd565b732016-08-30 14:04:35 -0700431
hbosfc5e0502016-10-06 02:06:10 -0700432RTCPeerConnectionStats::RTCPeerConnectionStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200433 const RTCPeerConnectionStats& other) = default;
hbosfc5e0502016-10-06 02:06:10 -0700434
Yves Gerey665174f2018-06-19 15:03:05 +0200435RTCPeerConnectionStats::~RTCPeerConnectionStats() {}
hbosfc5e0502016-10-06 02:06:10 -0700436
Steve Antond6a5cbd2017-08-18 09:40:25 -0700437// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700438WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
439 &ssrc,
Philipp Hancke3bc01662018-08-28 14:55:03 +0200440 &kind,
hbosb0ae9202017-01-27 06:35:16 -0800441 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700442 &transport_id,
443 &codec_id,
Di Wufd1e9d12021-03-09 09:25:28 -0800444 &media_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700445// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700446
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100447RTCRTPStreamStats::RTCRTPStreamStats(std::string id, Timestamp timestamp)
448 : RTCStats(std::move(id), timestamp),
hbos6ded1902016-11-01 01:50:46 -0700449 ssrc("ssrc"),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200450 kind("kind"),
hbosb0ae9202017-01-27 06:35:16 -0800451 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700452 transport_id("transportId"),
453 codec_id("codecId"),
Di Wufd1e9d12021-03-09 09:25:28 -0800454 media_type("mediaType") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100455RTCRTPStreamStats::RTCRTPStreamStats(std::string id, int64_t timestamp_us)
456 : RTCRTPStreamStats(std::move(id), Timestamp::Micros(timestamp_us)) {}
hbos6ded1902016-11-01 01:50:46 -0700457
Philipp Hancke6738b012022-10-11 13:04:03 +0200458RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other) = default;
hbos6ded1902016-11-01 01:50:46 -0700459
Yves Gerey665174f2018-06-19 15:03:05 +0200460RTCRTPStreamStats::~RTCRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700461
Steve Antond6a5cbd2017-08-18 09:40:25 -0700462// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700463WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800464 RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp",
465 &jitter,
Henrik Boströma494e4b2022-10-03 17:26:41 +0200466 &packets_lost)
Di Wufd1e9d12021-03-09 09:25:28 -0800467// clang-format on
468
Philipp Hancke7a5de442023-01-02 13:20:45 +0100469RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100470 Timestamp timestamp)
471 : RTCRTPStreamStats(std::move(id), timestamp),
Di Wufd1e9d12021-03-09 09:25:28 -0800472 jitter("jitter"),
Henrik Boströma494e4b2022-10-03 17:26:41 +0200473 packets_lost("packetsLost") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100474RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string id,
475 int64_t timestamp_us)
476 : RTCReceivedRtpStreamStats(std::move(id),
477 Timestamp::Micros(timestamp_us)) {}
Di Wufd1e9d12021-03-09 09:25:28 -0800478
479RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200480 const RTCReceivedRtpStreamStats& other) = default;
Di Wufd1e9d12021-03-09 09:25:28 -0800481
482RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {}
483
484// clang-format off
485WEBRTC_RTCSTATS_IMPL(
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100486 RTCSentRtpStreamStats, RTCRTPStreamStats, "sent-rtp",
487 &packets_sent,
488 &bytes_sent)
489// clang-format on
490
Philipp Hancke7a5de442023-01-02 13:20:45 +0100491RTCSentRtpStreamStats::RTCSentRtpStreamStats(std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100492 Timestamp timestamp)
493 : RTCRTPStreamStats(std::move(id), timestamp),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100494 packets_sent("packetsSent"),
495 bytes_sent("bytesSent") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100496RTCSentRtpStreamStats::RTCSentRtpStreamStats(std::string(id),
497 int64_t timestamp_us)
498 : RTCSentRtpStreamStats(std::move(id), Timestamp::Micros(timestamp_us)) {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100499
Philipp Hancke6738b012022-10-11 13:04:03 +0200500RTCSentRtpStreamStats::RTCSentRtpStreamStats(
501 const RTCSentRtpStreamStats& other) = default;
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100502
503RTCSentRtpStreamStats::~RTCSentRtpStreamStats() {}
504
505// clang-format off
506WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800507 RTCInboundRTPStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp",
Henrik Boströma6c7d5c2022-06-16 16:55:31 +0200508 &track_identifier,
Henrik Boström1ab61882022-06-16 17:07:33 +0200509 &mid,
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100510 &remote_id,
hboseeafe942016-11-01 03:00:17 -0700511 &packets_received,
Henrik Boströma494e4b2022-10-03 17:26:41 +0200512 &packets_discarded,
Henrik Boström4a5dab02020-01-28 11:15:35 +0100513 &fec_packets_received,
514 &fec_packets_discarded,
hboseeafe942016-11-01 03:00:17 -0700515 &bytes_received,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200516 &header_bytes_received,
Henrik Boström01738c62019-04-15 17:32:00 +0200517 &last_packet_received_timestamp,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300518 &jitter_buffer_delay,
Ivo Creusen11fdb082022-07-04 14:16:39 +0200519 &jitter_buffer_target_delay,
Ivo Creusen1a84b562022-07-19 16:33:10 +0200520 &jitter_buffer_minimum_delay,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300521 &jitter_buffer_emitted_count,
522 &total_samples_received,
523 &concealed_samples,
524 &silent_concealed_samples,
525 &concealment_events,
526 &inserted_samples_for_deceleration,
527 &removed_samples_for_acceleration,
528 &audio_level,
529 &total_audio_energy,
530 &total_samples_duration,
Fredrik Hernqvist828de802023-01-19 15:04:54 +0100531 &playout_id,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200532 &frames_received,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300533 &frame_width,
534 &frame_height,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300535 &frames_per_second,
Henrik Boström2e069262019-04-09 13:59:31 +0200536 &frames_decoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200537 &key_frames_decoded,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300538 &frames_dropped,
Johannes Kronbfd343b2019-07-01 10:07:50 +0200539 &total_decode_time,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200540 &total_processing_delay,
Philipp Hancke0359ba22022-05-05 15:55:36 +0200541 &total_assembly_time,
542 &frames_assembled_from_multiple_packets,
Johannes Kron00376e12019-11-25 10:25:42 +0100543 &total_inter_frame_delay,
544 &total_squared_inter_frame_delay,
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200545 &pause_count,
546 &total_pauses_duration,
547 &freeze_count,
548 &total_freezes_duration,
Henrik Boström6b430862019-08-16 13:09:51 +0200549 &content_type,
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200550 &estimated_playout_timestamp,
Di Wufd1e9d12021-03-09 09:25:28 -0800551 &decoder_implementation,
552 &fir_count,
553 &pli_count,
554 &nack_count,
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200555 &qp_sum,
Henrik Boströmc5f8f802022-10-19 17:50:09 +0200556 &goog_timing_frame_info,
Evan Shrubsole13c0be42022-10-31 11:03:10 +0000557 &power_efficient_decoder,
Henrik Boström2fb83072022-10-06 13:37:11 +0200558 &jitter_buffer_flushes,
559 &delayed_packet_outage_samples,
560 &relative_packet_arrival_delay,
561 &interruption_count,
562 &total_interruption_duration,
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200563 &min_playout_delay)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700564// clang-format on
hboseeafe942016-11-01 03:00:17 -0700565
Philipp Hancke7a5de442023-01-02 13:20:45 +0100566RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100567 Timestamp timestamp)
568 : RTCReceivedRtpStreamStats(std::move(id), timestamp),
Fredrik Hernqvist828de802023-01-19 15:04:54 +0100569 playout_id("playoutId"),
Henrik Boströma6c7d5c2022-06-16 16:55:31 +0200570 track_identifier("trackIdentifier"),
Henrik Boström1ab61882022-06-16 17:07:33 +0200571 mid("mid"),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100572 remote_id("remoteId"),
hboseeafe942016-11-01 03:00:17 -0700573 packets_received("packetsReceived"),
Henrik Boströma494e4b2022-10-03 17:26:41 +0200574 packets_discarded("packetsDiscarded"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200575 fec_packets_received("fecPacketsReceived"),
576 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700577 bytes_received("bytesReceived"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200578 header_bytes_received("headerBytesReceived"),
Henrik Boström01738c62019-04-15 17:32:00 +0200579 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300580 jitter_buffer_delay("jitterBufferDelay"),
Ivo Creusen11fdb082022-07-04 14:16:39 +0200581 jitter_buffer_target_delay("jitterBufferTargetDelay"),
Ivo Creusen1a84b562022-07-19 16:33:10 +0200582 jitter_buffer_minimum_delay("jitterBufferMinimumDelay"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300583 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
584 total_samples_received("totalSamplesReceived"),
585 concealed_samples("concealedSamples"),
586 silent_concealed_samples("silentConcealedSamples"),
587 concealment_events("concealmentEvents"),
588 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
589 removed_samples_for_acceleration("removedSamplesForAcceleration"),
590 audio_level("audioLevel"),
591 total_audio_energy("totalAudioEnergy"),
592 total_samples_duration("totalSamplesDuration"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200593 frames_received("framesReceived"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300594 frame_width("frameWidth"),
595 frame_height("frameHeight"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300596 frames_per_second("framesPerSecond"),
Henrik Boström2e069262019-04-09 13:59:31 +0200597 frames_decoded("framesDecoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200598 key_frames_decoded("keyFramesDecoded"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300599 frames_dropped("framesDropped"),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200600 total_decode_time("totalDecodeTime"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200601 total_processing_delay("totalProcessingDelay"),
Philipp Hancke0359ba22022-05-05 15:55:36 +0200602 total_assembly_time("totalAssemblyTime"),
603 frames_assembled_from_multiple_packets(
604 "framesAssembledFromMultiplePackets"),
Johannes Kron00376e12019-11-25 10:25:42 +0100605 total_inter_frame_delay("totalInterFrameDelay"),
606 total_squared_inter_frame_delay("totalSquaredInterFrameDelay"),
Henrik Boströmc57a28c2022-10-06 11:59:05 +0200607 pause_count("pauseCount"),
608 total_pauses_duration("totalPausesDuration"),
609 freeze_count("freezeCount"),
610 total_freezes_duration("totalFreezesDuration"),
Henrik Boström6b430862019-08-16 13:09:51 +0200611 content_type("contentType"),
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200612 estimated_playout_timestamp("estimatedPlayoutTimestamp"),
Di Wufd1e9d12021-03-09 09:25:28 -0800613 decoder_implementation("decoderImplementation"),
614 fir_count("firCount"),
615 pli_count("pliCount"),
616 nack_count("nackCount"),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200617 qp_sum("qpSum"),
Henrik Boströmc5f8f802022-10-19 17:50:09 +0200618 goog_timing_frame_info("googTimingFrameInfo"),
Evan Shrubsole13c0be42022-10-31 11:03:10 +0000619 power_efficient_decoder("powerEfficientDecoder"),
Henrik Boström2fb83072022-10-06 13:37:11 +0200620 jitter_buffer_flushes(
621 "jitterBufferFlushes",
622 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
623 delayed_packet_outage_samples(
624 "delayedPacketOutageSamples",
625 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
626 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
627 relative_packet_arrival_delay(
628 "relativePacketArrivalDelay",
629 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
630 interruption_count("interruptionCount"),
631 total_interruption_duration("totalInterruptionDuration"),
Philipp Hancke6fb8d1a2022-05-30 12:37:04 +0200632 min_playout_delay("minPlayoutDelay") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100633RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string id,
634 int64_t timestamp_us)
635 : RTCInboundRTPStreamStats(std::move(id), Timestamp::Micros(timestamp_us)) {
636}
hboseeafe942016-11-01 03:00:17 -0700637
638RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200639 const RTCInboundRTPStreamStats& other) = default;
Yves Gerey665174f2018-06-19 15:03:05 +0200640RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700641
Steve Antond6a5cbd2017-08-18 09:40:25 -0700642// clang-format off
hboseeafe942016-11-01 03:00:17 -0700643WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700644 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200645 &media_source_id,
Henrik Boström4f40fa52019-12-19 13:27:27 +0100646 &remote_id,
Henrik Boström1ab61882022-06-16 17:07:33 +0200647 &mid,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200648 &rid,
hbos6ded1902016-11-01 01:50:46 -0700649 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200650 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700651 &bytes_sent,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200652 &header_bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200653 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700654 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200655 &frames_encoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200656 &key_frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200657 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200658 &total_encoded_bytes_target,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200659 &frame_width,
660 &frame_height,
661 &frames_per_second,
662 &frames_sent,
663 &huge_frames_sent,
Henrik Boström9fe18342019-05-16 18:38:20 +0200664 &total_packet_send_delay,
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200665 &quality_limitation_reason,
Byoungchan Lee7d235352021-05-28 21:32:04 +0900666 &quality_limitation_durations,
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200667 &quality_limitation_resolution_changes,
Henrik Boström6b430862019-08-16 13:09:51 +0200668 &content_type,
Di Wufd1e9d12021-03-09 09:25:28 -0800669 &encoder_implementation,
670 &fir_count,
671 &pli_count,
672 &nack_count,
Philipp Hancke684e2412022-07-28 12:41:00 +0200673 &qp_sum,
Evan Shrubsole13c0be42022-10-31 11:03:10 +0000674 &active,
Evan Shrubsole9b235cd2022-12-06 10:09:10 +0000675 &power_efficient_encoder,
676 &scalability_mode)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700677// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700678
Philipp Hancke7a5de442023-01-02 13:20:45 +0100679RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100680 Timestamp timestamp)
681 : RTCRTPStreamStats(std::move(id), timestamp),
Henrik Boström646fda02019-05-22 15:49:42 +0200682 media_source_id("mediaSourceId"),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100683 remote_id("remoteId"),
Henrik Boström1ab61882022-06-16 17:07:33 +0200684 mid("mid"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200685 rid("rid"),
hbos6ded1902016-11-01 01:50:46 -0700686 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200687 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700688 bytes_sent("bytesSent"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200689 header_bytes_sent("headerBytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200690 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700691 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200692 frames_encoded("framesEncoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200693 key_frames_encoded("keyFramesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200694 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200695 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200696 frame_width("frameWidth"),
697 frame_height("frameHeight"),
698 frames_per_second("framesPerSecond"),
699 frames_sent("framesSent"),
700 huge_frames_sent("hugeFramesSent"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200701 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200702 quality_limitation_reason("qualityLimitationReason"),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900703 quality_limitation_durations("qualityLimitationDurations"),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200704 quality_limitation_resolution_changes(
705 "qualityLimitationResolutionChanges"),
Henrik Boström6b430862019-08-16 13:09:51 +0200706 content_type("contentType"),
Di Wufd1e9d12021-03-09 09:25:28 -0800707 encoder_implementation("encoderImplementation"),
708 fir_count("firCount"),
709 pli_count("pliCount"),
710 nack_count("nackCount"),
Philipp Hancke684e2412022-07-28 12:41:00 +0200711 qp_sum("qpSum"),
Evan Shrubsole13c0be42022-10-31 11:03:10 +0000712 active("active"),
Evan Shrubsole9b235cd2022-12-06 10:09:10 +0000713 power_efficient_encoder("powerEfficientEncoder"),
714 scalability_mode("scalabilityMode") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100715RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string id,
716 int64_t timestamp_us)
717 : RTCOutboundRTPStreamStats(std::move(id),
718 Timestamp::Micros(timestamp_us)) {}
hbos6ded1902016-11-01 01:50:46 -0700719
720RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200721 const RTCOutboundRTPStreamStats& other) = default;
hbos6ded1902016-11-01 01:50:46 -0700722
Yves Gerey665174f2018-06-19 15:03:05 +0200723RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700724
Steve Antond6a5cbd2017-08-18 09:40:25 -0700725// clang-format off
Henrik Boström883eefc2019-05-27 13:40:25 +0200726WEBRTC_RTCSTATS_IMPL(
Henrik Boström2f71b612021-03-23 15:18:55 +0100727 RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
728 "remote-inbound-rtp",
Henrik Boström883eefc2019-05-27 13:40:25 +0200729 &local_id,
Di Wu86f04ad2021-02-28 23:36:03 -0800730 &round_trip_time,
Di Wu88a51b22021-03-01 11:22:06 -0800731 &fraction_lost,
732 &total_round_trip_time,
733 &round_trip_time_measurements)
Henrik Boström883eefc2019-05-27 13:40:25 +0200734// clang-format on
735
736RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
Philipp Hancke7a5de442023-01-02 13:20:45 +0100737 std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100738 Timestamp timestamp)
739 : RTCReceivedRtpStreamStats(std::move(id), timestamp),
Henrik Boström883eefc2019-05-27 13:40:25 +0200740 local_id("localId"),
Di Wu86f04ad2021-02-28 23:36:03 -0800741 round_trip_time("roundTripTime"),
Di Wu88a51b22021-03-01 11:22:06 -0800742 fraction_lost("fractionLost"),
743 total_round_trip_time("totalRoundTripTime"),
744 round_trip_time_measurements("roundTripTimeMeasurements") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100745RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
746 std::string id,
747 int64_t timestamp_us)
748 : RTCRemoteInboundRtpStreamStats(std::move(id),
749 Timestamp::Micros(timestamp_us)) {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200750
751RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200752 const RTCRemoteInboundRtpStreamStats& other) = default;
Henrik Boström883eefc2019-05-27 13:40:25 +0200753
754RTCRemoteInboundRtpStreamStats::~RTCRemoteInboundRtpStreamStats() {}
755
756// clang-format off
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100757WEBRTC_RTCSTATS_IMPL(
758 RTCRemoteOutboundRtpStreamStats, RTCSentRtpStreamStats,
759 "remote-outbound-rtp",
760 &local_id,
761 &remote_timestamp,
Ivo Creusen2562cf02021-09-03 14:51:22 +0000762 &reports_sent,
763 &round_trip_time,
764 &round_trip_time_measurements,
765 &total_round_trip_time)
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100766// clang-format on
767
768RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
Philipp Hancke7a5de442023-01-02 13:20:45 +0100769 std::string id,
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100770 Timestamp timestamp)
771 : RTCSentRtpStreamStats(std::move(id), timestamp),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100772 local_id("localId"),
773 remote_timestamp("remoteTimestamp"),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000774 reports_sent("reportsSent"),
775 round_trip_time("roundTripTime"),
776 round_trip_time_measurements("roundTripTimeMeasurements"),
777 total_round_trip_time("totalRoundTripTime") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100778RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
779 std::string id,
780 int64_t timestamp)
781 : RTCRemoteOutboundRtpStreamStats(std::move(id),
782 Timestamp::Micros(timestamp)) {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100783
784RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
Philipp Hancke6738b012022-10-11 13:04:03 +0200785 const RTCRemoteOutboundRtpStreamStats& other) = default;
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100786
787RTCRemoteOutboundRtpStreamStats::~RTCRemoteOutboundRtpStreamStats() {}
788
789// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +0200790WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
791 &track_identifier,
792 &kind)
793// clang-format on
794
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100795RTCMediaSourceStats::RTCMediaSourceStats(std::string id, Timestamp timestamp)
796 : RTCStats(std::move(id), timestamp),
Henrik Boström646fda02019-05-22 15:49:42 +0200797 track_identifier("trackIdentifier"),
798 kind("kind") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100799RTCMediaSourceStats::RTCMediaSourceStats(std::string id, int64_t timestamp_us)
800 : RTCMediaSourceStats(std::move(id), Timestamp::Micros(timestamp_us)) {}
Henrik Boström646fda02019-05-22 15:49:42 +0200801
Philipp Hancke6738b012022-10-11 13:04:03 +0200802RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other) =
803 default;
Henrik Boström646fda02019-05-22 15:49:42 +0200804
805RTCMediaSourceStats::~RTCMediaSourceStats() {}
806
807// clang-format off
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200808WEBRTC_RTCSTATS_IMPL(RTCAudioSourceStats, RTCMediaSourceStats, "media-source",
809 &audio_level,
810 &total_audio_energy,
Taylor Brandstetter64851c02021-06-24 13:32:50 -0700811 &total_samples_duration,
812 &echo_return_loss,
813 &echo_return_loss_enhancement)
Henrik Boström646fda02019-05-22 15:49:42 +0200814// clang-format on
815
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100816RTCAudioSourceStats::RTCAudioSourceStats(std::string id, Timestamp timestamp)
817 : RTCMediaSourceStats(std::move(id), timestamp),
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200818 audio_level("audioLevel"),
819 total_audio_energy("totalAudioEnergy"),
Taylor Brandstetter64851c02021-06-24 13:32:50 -0700820 total_samples_duration("totalSamplesDuration"),
821 echo_return_loss("echoReturnLoss"),
822 echo_return_loss_enhancement("echoReturnLossEnhancement") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100823RTCAudioSourceStats::RTCAudioSourceStats(std::string id, int64_t timestamp_us)
824 : RTCAudioSourceStats(std::move(id), Timestamp::Micros(timestamp_us)) {}
Henrik Boström646fda02019-05-22 15:49:42 +0200825
Philipp Hancke6738b012022-10-11 13:04:03 +0200826RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other) =
827 default;
Henrik Boström646fda02019-05-22 15:49:42 +0200828
829RTCAudioSourceStats::~RTCAudioSourceStats() {}
830
831// clang-format off
832WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
833 &width,
834 &height,
835 &frames,
836 &frames_per_second)
837// clang-format on
838
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100839RTCVideoSourceStats::RTCVideoSourceStats(std::string id, Timestamp timestamp)
840 : RTCMediaSourceStats(std::move(id), timestamp),
Henrik Boström646fda02019-05-22 15:49:42 +0200841 width("width"),
842 height("height"),
843 frames("frames"),
844 frames_per_second("framesPerSecond") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100845RTCVideoSourceStats::RTCVideoSourceStats(std::string id, int64_t timestamp_us)
846 : RTCVideoSourceStats(std::move(id), Timestamp::Micros(timestamp_us)) {}
Henrik Boström646fda02019-05-22 15:49:42 +0200847
Philipp Hancke6738b012022-10-11 13:04:03 +0200848RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other) =
849 default;
Henrik Boström646fda02019-05-22 15:49:42 +0200850
851RTCVideoSourceStats::~RTCVideoSourceStats() {}
852
853// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700854WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
855 &bytes_sent,
Artem Titovedacbd52020-07-06 16:06:37 +0200856 &packets_sent,
hbos2fa7c672016-10-24 04:00:05 -0700857 &bytes_received,
Artem Titovedacbd52020-07-06 16:06:37 +0200858 &packets_received,
hbos2fa7c672016-10-24 04:00:05 -0700859 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -0800860 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -0700861 &selected_candidate_pair_id,
862 &local_certificate_id,
Jonas Oreland149dc722019-08-28 08:10:27 +0200863 &remote_certificate_id,
Harald Alvestrand5cb78072019-10-28 09:51:17 +0100864 &tls_version,
865 &dtls_cipher,
Philipp Hancke69c1df22022-04-22 15:46:24 +0200866 &dtls_role,
Harald Alvestrand5cb78072019-10-28 09:51:17 +0100867 &srtp_cipher,
Philipp Hanckecc1b9b02022-05-04 18:58:26 +0200868 &selected_candidate_pair_changes,
Philipp Hancke95b1a342022-05-05 07:53:54 +0200869 &ice_role,
Philipp Hancke1f491572022-05-09 17:43:31 +0200870 &ice_local_username_fragment,
871 &ice_state)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700872// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700873
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100874RTCTransportStats::RTCTransportStats(std::string id, Timestamp timestamp)
875 : RTCStats(std::move(id), timestamp),
hbos2fa7c672016-10-24 04:00:05 -0700876 bytes_sent("bytesSent"),
Artem Titovedacbd52020-07-06 16:06:37 +0200877 packets_sent("packetsSent"),
hbos2fa7c672016-10-24 04:00:05 -0700878 bytes_received("bytesReceived"),
Artem Titovedacbd52020-07-06 16:06:37 +0200879 packets_received("packetsReceived"),
hbos2fa7c672016-10-24 04:00:05 -0700880 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -0800881 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -0700882 selected_candidate_pair_id("selectedCandidatePairId"),
883 local_certificate_id("localCertificateId"),
Jonas Oreland149dc722019-08-28 08:10:27 +0200884 remote_certificate_id("remoteCertificateId"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +0100885 tls_version("tlsVersion"),
886 dtls_cipher("dtlsCipher"),
Philipp Hancke69c1df22022-04-22 15:46:24 +0200887 dtls_role("dtlsRole"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +0100888 srtp_cipher("srtpCipher"),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +0200889 selected_candidate_pair_changes("selectedCandidatePairChanges"),
Philipp Hancke95b1a342022-05-05 07:53:54 +0200890 ice_role("iceRole"),
Philipp Hancke1f491572022-05-09 17:43:31 +0200891 ice_local_username_fragment("iceLocalUsernameFragment"),
892 ice_state("iceState") {}
Philipp Hanckeb81823a2023-01-04 15:17:42 +0100893RTCTransportStats::RTCTransportStats(std::string id, int64_t timestamp_us)
894 : RTCTransportStats(std::move(id), Timestamp::Micros(timestamp_us)) {}
hbos2fa7c672016-10-24 04:00:05 -0700895
Philipp Hancke6738b012022-10-11 13:04:03 +0200896RTCTransportStats::RTCTransportStats(const RTCTransportStats& other) = default;
hbos2fa7c672016-10-24 04:00:05 -0700897
Yves Gerey665174f2018-06-19 15:03:05 +0200898RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700899
Fredrik Hernqvistefbe7532023-01-13 16:42:36 +0100900RTCAudioPlayoutStats::RTCAudioPlayoutStats(const std::string& id,
901 Timestamp timestamp)
902 : RTCStats(std::move(id), timestamp),
Fredrik Hernqvist5adc2b62023-01-25 13:49:16 +0100903 kind("kind", "audio"),
Fredrik Hernqvistefbe7532023-01-13 16:42:36 +0100904 synthesized_samples_duration("synthesizedSamplesDuration"),
905 synthesized_samples_events("synthesizedSamplesEvents"),
906 total_samples_duration("totalSamplesDuration"),
907 total_playout_delay("totalPlayoutDelay"),
908 total_samples_count("totalSamplesCount") {}
909
910RTCAudioPlayoutStats::RTCAudioPlayoutStats(const RTCAudioPlayoutStats& other) =
911 default;
912
913RTCAudioPlayoutStats::~RTCAudioPlayoutStats() {}
914
915// clang-format off
Fredrik Hernqvist5adc2b62023-01-25 13:49:16 +0100916WEBRTC_RTCSTATS_IMPL(RTCAudioPlayoutStats, RTCStats, "media-playout",
917 &kind,
Fredrik Hernqvistefbe7532023-01-13 16:42:36 +0100918 &synthesized_samples_duration,
919 &synthesized_samples_events,
920 &total_samples_duration,
921 &total_playout_delay,
922 &total_samples_count)
923// clang-format on
924
hbosd565b732016-08-30 14:04:35 -0700925} // namespace webrtc