blob: f45ea35f2582dc2dabf11b91da638da11fef9ca4 [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
Steve Antond6a5cbd2017-08-18 09:40:25 -070070// clang-format off
hbos2fa7c672016-10-24 04:00:05 -070071WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate",
72 &fingerprint,
73 &fingerprint_algorithm,
74 &base64_certificate,
Nico Weber22f99252019-02-20 10:13:16 -050075 &issuer_certificate_id)
Steve Antond6a5cbd2017-08-18 09:40:25 -070076// clang-format on
hbos2fa7c672016-10-24 04:00:05 -070077
Yves Gerey665174f2018-06-19 15:03:05 +020078RTCCertificateStats::RTCCertificateStats(const std::string& id,
79 int64_t timestamp_us)
80 : RTCCertificateStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -070081
Yves Gerey665174f2018-06-19 15:03:05 +020082RTCCertificateStats::RTCCertificateStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -070083 : RTCStats(std::move(id), timestamp_us),
84 fingerprint("fingerprint"),
85 fingerprint_algorithm("fingerprintAlgorithm"),
86 base64_certificate("base64Certificate"),
Yves Gerey665174f2018-06-19 15:03:05 +020087 issuer_certificate_id("issuerCertificateId") {}
hbos2fa7c672016-10-24 04:00:05 -070088
Yves Gerey665174f2018-06-19 15:03:05 +020089RTCCertificateStats::RTCCertificateStats(const RTCCertificateStats& other)
hbos2fa7c672016-10-24 04:00:05 -070090 : RTCStats(other.id(), other.timestamp_us()),
91 fingerprint(other.fingerprint),
92 fingerprint_algorithm(other.fingerprint_algorithm),
93 base64_certificate(other.base64_certificate),
Yves Gerey665174f2018-06-19 15:03:05 +020094 issuer_certificate_id(other.issuer_certificate_id) {}
hbos2fa7c672016-10-24 04:00:05 -070095
Yves Gerey665174f2018-06-19 15:03:05 +020096RTCCertificateStats::~RTCCertificateStats() {}
hbos2fa7c672016-10-24 04:00:05 -070097
Steve Antond6a5cbd2017-08-18 09:40:25 -070098// clang-format off
hbos0adb8282016-11-23 02:32:06 -080099WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec",
Philipp Hancke95157a02020-11-16 20:08:27 +0100100 &transport_id,
hbos0adb8282016-11-23 02:32:06 -0800101 &payload_type,
hbos13f54b22017-02-28 06:56:04 -0800102 &mime_type,
hbos0adb8282016-11-23 02:32:06 -0800103 &clock_rate,
104 &channels,
Henrik Boström6b430862019-08-16 13:09:51 +0200105 &sdp_fmtp_line)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700106// clang-format on
hbos0adb8282016-11-23 02:32:06 -0800107
Yves Gerey665174f2018-06-19 15:03:05 +0200108RTCCodecStats::RTCCodecStats(const std::string& id, int64_t timestamp_us)
109 : RTCCodecStats(std::string(id), timestamp_us) {}
hbos0adb8282016-11-23 02:32:06 -0800110
Yves Gerey665174f2018-06-19 15:03:05 +0200111RTCCodecStats::RTCCodecStats(std::string&& id, int64_t timestamp_us)
hbos0adb8282016-11-23 02:32:06 -0800112 : RTCStats(std::move(id), timestamp_us),
Philipp Hancke95157a02020-11-16 20:08:27 +0100113 transport_id("transportId"),
hbos0adb8282016-11-23 02:32:06 -0800114 payload_type("payloadType"),
hbos13f54b22017-02-28 06:56:04 -0800115 mime_type("mimeType"),
hbos0adb8282016-11-23 02:32:06 -0800116 clock_rate("clockRate"),
117 channels("channels"),
Henrik Boström6b430862019-08-16 13:09:51 +0200118 sdp_fmtp_line("sdpFmtpLine") {}
hbos0adb8282016-11-23 02:32:06 -0800119
Yves Gerey665174f2018-06-19 15:03:05 +0200120RTCCodecStats::RTCCodecStats(const RTCCodecStats& other)
hbos0adb8282016-11-23 02:32:06 -0800121 : RTCStats(other.id(), other.timestamp_us()),
Philipp Hancke95157a02020-11-16 20:08:27 +0100122 transport_id(other.transport_id),
hbos0adb8282016-11-23 02:32:06 -0800123 payload_type(other.payload_type),
hbos13f54b22017-02-28 06:56:04 -0800124 mime_type(other.mime_type),
hbos0adb8282016-11-23 02:32:06 -0800125 clock_rate(other.clock_rate),
126 channels(other.channels),
Henrik Boström6b430862019-08-16 13:09:51 +0200127 sdp_fmtp_line(other.sdp_fmtp_line) {}
hbos0adb8282016-11-23 02:32:06 -0800128
Yves Gerey665174f2018-06-19 15:03:05 +0200129RTCCodecStats::~RTCCodecStats() {}
hbos0adb8282016-11-23 02:32:06 -0800130
Steve Antond6a5cbd2017-08-18 09:40:25 -0700131// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700132WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel",
133 &label,
134 &protocol,
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200135 &data_channel_identifier,
hbos2fa7c672016-10-24 04:00:05 -0700136 &state,
137 &messages_sent,
138 &bytes_sent,
139 &messages_received,
Nico Weber22f99252019-02-20 10:13:16 -0500140 &bytes_received)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700141// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700142
Yves Gerey665174f2018-06-19 15:03:05 +0200143RTCDataChannelStats::RTCDataChannelStats(const std::string& id,
144 int64_t timestamp_us)
145 : RTCDataChannelStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -0700146
Yves Gerey665174f2018-06-19 15:03:05 +0200147RTCDataChannelStats::RTCDataChannelStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -0700148 : RTCStats(std::move(id), timestamp_us),
149 label("label"),
150 protocol("protocol"),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200151 data_channel_identifier("dataChannelIdentifier"),
hbos2fa7c672016-10-24 04:00:05 -0700152 state("state"),
153 messages_sent("messagesSent"),
154 bytes_sent("bytesSent"),
155 messages_received("messagesReceived"),
Yves Gerey665174f2018-06-19 15:03:05 +0200156 bytes_received("bytesReceived") {}
hbos2fa7c672016-10-24 04:00:05 -0700157
Yves Gerey665174f2018-06-19 15:03:05 +0200158RTCDataChannelStats::RTCDataChannelStats(const RTCDataChannelStats& other)
hbos2fa7c672016-10-24 04:00:05 -0700159 : RTCStats(other.id(), other.timestamp_us()),
160 label(other.label),
161 protocol(other.protocol),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200162 data_channel_identifier(other.data_channel_identifier),
hbos2fa7c672016-10-24 04:00:05 -0700163 state(other.state),
164 messages_sent(other.messages_sent),
165 bytes_sent(other.bytes_sent),
166 messages_received(other.messages_received),
Yves Gerey665174f2018-06-19 15:03:05 +0200167 bytes_received(other.bytes_received) {}
hbos2fa7c672016-10-24 04:00:05 -0700168
Yves Gerey665174f2018-06-19 15:03:05 +0200169RTCDataChannelStats::~RTCDataChannelStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700170
Steve Antond6a5cbd2017-08-18 09:40:25 -0700171// clang-format off
hbosc47a0c32016-10-11 14:54:49 -0700172WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair",
173 &transport_id,
174 &local_candidate_id,
175 &remote_candidate_id,
176 &state,
177 &priority,
178 &nominated,
179 &writable,
180 &readable,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700181 &packets_sent,
182 &packets_received,
hbosc47a0c32016-10-11 14:54:49 -0700183 &bytes_sent,
184 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800185 &total_round_trip_time,
186 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700187 &available_outgoing_bitrate,
188 &available_incoming_bitrate,
189 &requests_received,
190 &requests_sent,
191 &responses_received,
192 &responses_sent,
193 &retransmissions_received,
194 &retransmissions_sent,
195 &consent_requests_received,
196 &consent_requests_sent,
197 &consent_responses_received,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700198 &consent_responses_sent,
199 &packets_discarded_on_send,
200 &bytes_discarded_on_send)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700201// clang-format on
hbosc47a0c32016-10-11 14:54:49 -0700202
Yves Gerey665174f2018-06-19 15:03:05 +0200203RTCIceCandidatePairStats::RTCIceCandidatePairStats(const std::string& id,
204 int64_t timestamp_us)
205 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {}
hbosc47a0c32016-10-11 14:54:49 -0700206
Yves Gerey665174f2018-06-19 15:03:05 +0200207RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string&& id,
208 int64_t timestamp_us)
hbosc47a0c32016-10-11 14:54:49 -0700209 : RTCStats(std::move(id), timestamp_us),
210 transport_id("transportId"),
211 local_candidate_id("localCandidateId"),
212 remote_candidate_id("remoteCandidateId"),
213 state("state"),
214 priority("priority"),
215 nominated("nominated"),
216 writable("writable"),
217 readable("readable"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700218 packets_sent("packetsSent"),
219 packets_received("packetsReceived"),
hbosc47a0c32016-10-11 14:54:49 -0700220 bytes_sent("bytesSent"),
221 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800222 total_round_trip_time("totalRoundTripTime"),
223 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700224 available_outgoing_bitrate("availableOutgoingBitrate"),
225 available_incoming_bitrate("availableIncomingBitrate"),
226 requests_received("requestsReceived"),
227 requests_sent("requestsSent"),
228 responses_received("responsesReceived"),
229 responses_sent("responsesSent"),
230 retransmissions_received("retransmissionsReceived"),
231 retransmissions_sent("retransmissionsSent"),
232 consent_requests_received("consentRequestsReceived"),
233 consent_requests_sent("consentRequestsSent"),
234 consent_responses_received("consentResponsesReceived"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700235 consent_responses_sent("consentResponsesSent"),
236 packets_discarded_on_send("packetsDiscardedOnSend"),
237 bytes_discarded_on_send("bytesDiscardedOnSend") {}
hbosc47a0c32016-10-11 14:54:49 -0700238
239RTCIceCandidatePairStats::RTCIceCandidatePairStats(
240 const RTCIceCandidatePairStats& other)
241 : RTCStats(other.id(), other.timestamp_us()),
242 transport_id(other.transport_id),
243 local_candidate_id(other.local_candidate_id),
244 remote_candidate_id(other.remote_candidate_id),
245 state(other.state),
246 priority(other.priority),
247 nominated(other.nominated),
248 writable(other.writable),
249 readable(other.readable),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700250 packets_sent(other.packets_sent),
251 packets_received(other.packets_received),
hbosc47a0c32016-10-11 14:54:49 -0700252 bytes_sent(other.bytes_sent),
253 bytes_received(other.bytes_received),
hbos3168c7a2016-12-15 06:17:08 -0800254 total_round_trip_time(other.total_round_trip_time),
255 current_round_trip_time(other.current_round_trip_time),
hbosc47a0c32016-10-11 14:54:49 -0700256 available_outgoing_bitrate(other.available_outgoing_bitrate),
257 available_incoming_bitrate(other.available_incoming_bitrate),
258 requests_received(other.requests_received),
259 requests_sent(other.requests_sent),
260 responses_received(other.responses_received),
261 responses_sent(other.responses_sent),
262 retransmissions_received(other.retransmissions_received),
263 retransmissions_sent(other.retransmissions_sent),
264 consent_requests_received(other.consent_requests_received),
265 consent_requests_sent(other.consent_requests_sent),
266 consent_responses_received(other.consent_responses_received),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700267 consent_responses_sent(other.consent_responses_sent),
268 packets_discarded_on_send(other.packets_discarded_on_send),
269 bytes_discarded_on_send(other.bytes_discarded_on_send) {}
hbosc47a0c32016-10-11 14:54:49 -0700270
Yves Gerey665174f2018-06-19 15:03:05 +0200271RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {}
hbosc47a0c32016-10-11 14:54:49 -0700272
Steve Antond6a5cbd2017-08-18 09:40:25 -0700273// clang-format off
Henrik Boström1df1bf82018-03-20 13:24:20 +0100274WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800275 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800276 &is_remote,
Gary Liu37e489c2017-11-21 10:49:36 -0800277 &network_type,
hbosab9f6e42016-10-07 02:18:47 -0700278 &ip,
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100279 &address,
hbosab9f6e42016-10-07 02:18:47 -0700280 &port,
281 &protocol,
Philipp Hancke95513752018-09-27 14:40:08 +0200282 &relay_protocol,
hbosab9f6e42016-10-07 02:18:47 -0700283 &candidate_type,
284 &priority,
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100285 &url,
286 &vpn,
287 &network_adapter_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700288// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700289
Yves Gerey665174f2018-06-19 15:03:05 +0200290RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id,
291 int64_t timestamp_us,
292 bool is_remote)
293 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {}
hbosab9f6e42016-10-07 02:18:47 -0700294
Gary Liu37e489c2017-11-21 10:49:36 -0800295RTCIceCandidateStats::RTCIceCandidateStats(std::string&& id,
296 int64_t timestamp_us,
297 bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700298 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800299 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800300 is_remote("isRemote", is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800301 network_type("networkType"),
hbosab9f6e42016-10-07 02:18:47 -0700302 ip("ip"),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100303 address("address"),
hbosab9f6e42016-10-07 02:18:47 -0700304 port("port"),
305 protocol("protocol"),
Philipp Hancke95513752018-09-27 14:40:08 +0200306 relay_protocol("relayProtocol"),
hbosab9f6e42016-10-07 02:18:47 -0700307 candidate_type("candidateType"),
308 priority("priority"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100309 url("url"),
310 vpn("vpn"),
311 network_adapter_type("networkAdapterType") {}
hbosab9f6e42016-10-07 02:18:47 -0700312
313RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
314 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800315 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800316 is_remote(other.is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800317 network_type(other.network_type),
hbosab9f6e42016-10-07 02:18:47 -0700318 ip(other.ip),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100319 address(other.address),
hbosab9f6e42016-10-07 02:18:47 -0700320 port(other.port),
321 protocol(other.protocol),
Philipp Hancke95513752018-09-27 14:40:08 +0200322 relay_protocol(other.relay_protocol),
hbosab9f6e42016-10-07 02:18:47 -0700323 candidate_type(other.candidate_type),
324 priority(other.priority),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100325 url(other.url),
326 vpn(other.vpn),
327 network_adapter_type(other.network_adapter_type) {}
hbosab9f6e42016-10-07 02:18:47 -0700328
Yves Gerey665174f2018-06-19 15:03:05 +0200329RTCIceCandidateStats::~RTCIceCandidateStats() {}
hbosab9f6e42016-10-07 02:18:47 -0700330
331const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
332
Yves Gerey665174f2018-06-19 15:03:05 +0200333RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(const std::string& id,
334 int64_t timestamp_us)
335 : RTCIceCandidateStats(id, timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700336
Yves Gerey665174f2018-06-19 15:03:05 +0200337RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string&& id,
338 int64_t timestamp_us)
339 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700340
Henrik Boström1df1bf82018-03-20 13:24:20 +0100341std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const {
342 return std::unique_ptr<RTCStats>(new RTCLocalIceCandidateStats(*this));
343}
344
hbosab9f6e42016-10-07 02:18:47 -0700345const char* RTCLocalIceCandidateStats::type() const {
346 return kType;
347}
348
349const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
350
Yves Gerey665174f2018-06-19 15:03:05 +0200351RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(const std::string& id,
352 int64_t timestamp_us)
353 : RTCIceCandidateStats(id, timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700354
Yves Gerey665174f2018-06-19 15:03:05 +0200355RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string&& id,
356 int64_t timestamp_us)
357 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700358
Henrik Boström1df1bf82018-03-20 13:24:20 +0100359std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const {
360 return std::unique_ptr<RTCStats>(new RTCRemoteIceCandidateStats(*this));
361}
362
hbosab9f6e42016-10-07 02:18:47 -0700363const char* RTCRemoteIceCandidateStats::type() const {
364 return kType;
365}
366
Steve Antond6a5cbd2017-08-18 09:40:25 -0700367// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800368WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
369 &stream_identifier,
Nico Weber22f99252019-02-20 10:13:16 -0500370 &track_ids)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700371// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800372
Yves Gerey665174f2018-06-19 15:03:05 +0200373RTCMediaStreamStats::RTCMediaStreamStats(const std::string& id,
374 int64_t timestamp_us)
375 : RTCMediaStreamStats(std::string(id), timestamp_us) {}
hbos09bc1282016-11-08 06:29:22 -0800376
Yves Gerey665174f2018-06-19 15:03:05 +0200377RTCMediaStreamStats::RTCMediaStreamStats(std::string&& id, int64_t timestamp_us)
hbos09bc1282016-11-08 06:29:22 -0800378 : RTCStats(std::move(id), timestamp_us),
379 stream_identifier("streamIdentifier"),
Yves Gerey665174f2018-06-19 15:03:05 +0200380 track_ids("trackIds") {}
hbos09bc1282016-11-08 06:29:22 -0800381
Yves Gerey665174f2018-06-19 15:03:05 +0200382RTCMediaStreamStats::RTCMediaStreamStats(const RTCMediaStreamStats& other)
hbos09bc1282016-11-08 06:29:22 -0800383 : RTCStats(other.id(), other.timestamp_us()),
384 stream_identifier(other.stream_identifier),
Yves Gerey665174f2018-06-19 15:03:05 +0200385 track_ids(other.track_ids) {}
hbos09bc1282016-11-08 06:29:22 -0800386
Yves Gerey665174f2018-06-19 15:03:05 +0200387RTCMediaStreamStats::~RTCMediaStreamStats() {}
hbos09bc1282016-11-08 06:29:22 -0800388
Steve Antond6a5cbd2017-08-18 09:40:25 -0700389// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800390WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
zsteine76bd3a2017-07-14 12:17:49 -0700391 &track_identifier,
Henrik Boström646fda02019-05-22 15:49:42 +0200392 &media_source_id,
zsteine76bd3a2017-07-14 12:17:49 -0700393 &remote_source,
394 &ended,
395 &detached,
396 &kind,
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200397 &jitter_buffer_delay,
Chen Xing0acffb52019-01-15 15:46:29 +0100398 &jitter_buffer_emitted_count,
zsteine76bd3a2017-07-14 12:17:49 -0700399 &frame_width,
400 &frame_height,
401 &frames_per_second,
402 &frames_sent,
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100403 &huge_frames_sent,
zsteine76bd3a2017-07-14 12:17:49 -0700404 &frames_received,
405 &frames_decoded,
406 &frames_dropped,
407 &frames_corrupted,
408 &partial_frames_lost,
409 &full_frames_lost,
410 &audio_level,
411 &total_audio_energy,
zsteine76bd3a2017-07-14 12:17:49 -0700412 &echo_return_loss,
Steve Anton2dbc69f2017-08-24 17:15:13 -0700413 &echo_return_loss_enhancement,
414 &total_samples_received,
415 &total_samples_duration,
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200416 &concealed_samples,
Henrik Boström21e99da2019-08-21 12:09:51 +0200417 &silent_concealed_samples,
Ruslan Burakov8af88962018-11-22 17:21:10 +0100418 &concealment_events,
Henrik Boström21e99da2019-08-21 12:09:51 +0200419 &inserted_samples_for_deceleration,
420 &removed_samples_for_acceleration,
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100421 &jitter_buffer_flushes,
Sergey Silkin02371062019-01-31 16:45:42 +0100422 &delayed_packet_outage_samples,
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100423 &relative_packet_arrival_delay,
Artem Titove618cc92020-03-11 11:18:54 +0100424 &jitter_buffer_target_delay,
Henrik Lundin44125fa2019-04-29 17:00:46 +0200425 &interruption_count,
426 &total_interruption_duration,
Sergey Silkin02371062019-01-31 16:45:42 +0100427 &freeze_count,
428 &pause_count,
429 &total_freezes_duration,
430 &total_pauses_duration,
431 &total_frames_duration,
Nico Weber22f99252019-02-20 10:13:16 -0500432 &sum_squared_frame_durations)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700433// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800434
Yves Gerey665174f2018-06-19 15:03:05 +0200435RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(const std::string& id,
436 int64_t timestamp_us,
437 const char* kind)
438 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {}
hbos09bc1282016-11-08 06:29:22 -0800439
zsteine76bd3a2017-07-14 12:17:49 -0700440RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(std::string&& id,
441 int64_t timestamp_us,
442 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800443 : RTCStats(std::move(id), timestamp_us),
444 track_identifier("trackIdentifier"),
Henrik Boström646fda02019-05-22 15:49:42 +0200445 media_source_id("mediaSourceId"),
hbos09bc1282016-11-08 06:29:22 -0800446 remote_source("remoteSource"),
447 ended("ended"),
448 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800449 kind("kind", kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200450 jitter_buffer_delay("jitterBufferDelay"),
Chen Xing0acffb52019-01-15 15:46:29 +0100451 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
hbos09bc1282016-11-08 06:29:22 -0800452 frame_width("frameWidth"),
453 frame_height("frameHeight"),
454 frames_per_second("framesPerSecond"),
455 frames_sent("framesSent"),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100456 huge_frames_sent("hugeFramesSent"),
hbos09bc1282016-11-08 06:29:22 -0800457 frames_received("framesReceived"),
458 frames_decoded("framesDecoded"),
459 frames_dropped("framesDropped"),
460 frames_corrupted("framesCorrupted"),
461 partial_frames_lost("partialFramesLost"),
462 full_frames_lost("fullFramesLost"),
463 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700464 total_audio_energy("totalAudioEnergy"),
hbos09bc1282016-11-08 06:29:22 -0800465 echo_return_loss("echoReturnLoss"),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700466 echo_return_loss_enhancement("echoReturnLossEnhancement"),
467 total_samples_received("totalSamplesReceived"),
468 total_samples_duration("totalSamplesDuration"),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200469 concealed_samples("concealedSamples"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200470 silent_concealed_samples("silentConcealedSamples"),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100471 concealment_events("concealmentEvents"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200472 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
473 removed_samples_for_acceleration("removedSamplesForAcceleration"),
Jakob Ivarsson758d9462019-03-19 15:38:49 +0100474 jitter_buffer_flushes(
475 "jitterBufferFlushes",
476 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
477 delayed_packet_outage_samples(
478 "delayedPacketOutageSamples",
479 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
480 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
481 relative_packet_arrival_delay(
482 "relativePacketArrivalDelay",
483 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
Artem Titove618cc92020-03-11 11:18:54 +0100484 jitter_buffer_target_delay("jitterBufferTargetDelay"),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200485 interruption_count("interruptionCount"),
486 total_interruption_duration("totalInterruptionDuration"),
Sergey Silkin02371062019-01-31 16:45:42 +0100487 freeze_count("freezeCount"),
488 pause_count("pauseCount"),
489 total_freezes_duration("totalFreezesDuration"),
490 total_pauses_duration("totalPausesDuration"),
491 total_frames_duration("totalFramesDuration"),
492 sum_squared_frame_durations("sumOfSquaredFramesDuration") {
hbos160e4a72017-01-17 02:53:23 -0800493 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
494 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800495}
496
497RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
498 const RTCMediaStreamTrackStats& other)
499 : RTCStats(other.id(), other.timestamp_us()),
500 track_identifier(other.track_identifier),
Henrik Boström646fda02019-05-22 15:49:42 +0200501 media_source_id(other.media_source_id),
hbos09bc1282016-11-08 06:29:22 -0800502 remote_source(other.remote_source),
503 ended(other.ended),
504 detached(other.detached),
hbos160e4a72017-01-17 02:53:23 -0800505 kind(other.kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200506 jitter_buffer_delay(other.jitter_buffer_delay),
Chen Xing0acffb52019-01-15 15:46:29 +0100507 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
hbos09bc1282016-11-08 06:29:22 -0800508 frame_width(other.frame_width),
509 frame_height(other.frame_height),
510 frames_per_second(other.frames_per_second),
511 frames_sent(other.frames_sent),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100512 huge_frames_sent(other.huge_frames_sent),
hbos09bc1282016-11-08 06:29:22 -0800513 frames_received(other.frames_received),
514 frames_decoded(other.frames_decoded),
515 frames_dropped(other.frames_dropped),
516 frames_corrupted(other.frames_corrupted),
517 partial_frames_lost(other.partial_frames_lost),
518 full_frames_lost(other.full_frames_lost),
519 audio_level(other.audio_level),
zsteine76bd3a2017-07-14 12:17:49 -0700520 total_audio_energy(other.total_audio_energy),
hbos09bc1282016-11-08 06:29:22 -0800521 echo_return_loss(other.echo_return_loss),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700522 echo_return_loss_enhancement(other.echo_return_loss_enhancement),
523 total_samples_received(other.total_samples_received),
524 total_samples_duration(other.total_samples_duration),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200525 concealed_samples(other.concealed_samples),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200526 silent_concealed_samples(other.silent_concealed_samples),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100527 concealment_events(other.concealment_events),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200528 inserted_samples_for_deceleration(
529 other.inserted_samples_for_deceleration),
530 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100531 jitter_buffer_flushes(other.jitter_buffer_flushes),
Sergey Silkin02371062019-01-31 16:45:42 +0100532 delayed_packet_outage_samples(other.delayed_packet_outage_samples),
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100533 relative_packet_arrival_delay(other.relative_packet_arrival_delay),
Artem Titove618cc92020-03-11 11:18:54 +0100534 jitter_buffer_target_delay(other.jitter_buffer_target_delay),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200535 interruption_count(other.interruption_count),
536 total_interruption_duration(other.total_interruption_duration),
Sergey Silkin02371062019-01-31 16:45:42 +0100537 freeze_count(other.freeze_count),
538 pause_count(other.pause_count),
539 total_freezes_duration(other.total_freezes_duration),
540 total_pauses_duration(other.total_pauses_duration),
541 total_frames_duration(other.total_frames_duration),
542 sum_squared_frame_durations(other.sum_squared_frame_durations) {}
hbos09bc1282016-11-08 06:29:22 -0800543
Yves Gerey665174f2018-06-19 15:03:05 +0200544RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {}
hbos09bc1282016-11-08 06:29:22 -0800545
Steve Antond6a5cbd2017-08-18 09:40:25 -0700546// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700547WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
548 &data_channels_opened,
Nico Weber22f99252019-02-20 10:13:16 -0500549 &data_channels_closed)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700550// clang-format on
hbosd565b732016-08-30 14:04:35 -0700551
Yves Gerey665174f2018-06-19 15:03:05 +0200552RTCPeerConnectionStats::RTCPeerConnectionStats(const std::string& id,
553 int64_t timestamp_us)
554 : RTCPeerConnectionStats(std::string(id), timestamp_us) {}
hbosd565b732016-08-30 14:04:35 -0700555
Yves Gerey665174f2018-06-19 15:03:05 +0200556RTCPeerConnectionStats::RTCPeerConnectionStats(std::string&& id,
557 int64_t timestamp_us)
hbos0e6758d2016-08-31 07:57:36 -0700558 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700559 data_channels_opened("dataChannelsOpened"),
Yves Gerey665174f2018-06-19 15:03:05 +0200560 data_channels_closed("dataChannelsClosed") {}
hbosd565b732016-08-30 14:04:35 -0700561
hbosfc5e0502016-10-06 02:06:10 -0700562RTCPeerConnectionStats::RTCPeerConnectionStats(
563 const RTCPeerConnectionStats& other)
564 : RTCStats(other.id(), other.timestamp_us()),
565 data_channels_opened(other.data_channels_opened),
Yves Gerey665174f2018-06-19 15:03:05 +0200566 data_channels_closed(other.data_channels_closed) {}
hbosfc5e0502016-10-06 02:06:10 -0700567
Yves Gerey665174f2018-06-19 15:03:05 +0200568RTCPeerConnectionStats::~RTCPeerConnectionStats() {}
hbosfc5e0502016-10-06 02:06:10 -0700569
Steve Antond6a5cbd2017-08-18 09:40:25 -0700570// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700571WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
572 &ssrc,
Philipp Hancke3bc01662018-08-28 14:55:03 +0200573 &kind,
hbosb0ae9202017-01-27 06:35:16 -0800574 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700575 &transport_id,
576 &codec_id,
Di Wufd1e9d12021-03-09 09:25:28 -0800577 &media_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700578// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700579
Yves Gerey665174f2018-06-19 15:03:05 +0200580RTCRTPStreamStats::RTCRTPStreamStats(const std::string& id,
581 int64_t timestamp_us)
582 : RTCRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700583
Yves Gerey665174f2018-06-19 15:03:05 +0200584RTCRTPStreamStats::RTCRTPStreamStats(std::string&& id, int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700585 : RTCStats(std::move(id), timestamp_us),
586 ssrc("ssrc"),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200587 kind("kind"),
hbosb0ae9202017-01-27 06:35:16 -0800588 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700589 transport_id("transportId"),
590 codec_id("codecId"),
Di Wufd1e9d12021-03-09 09:25:28 -0800591 media_type("mediaType") {}
hbos6ded1902016-11-01 01:50:46 -0700592
Yves Gerey665174f2018-06-19 15:03:05 +0200593RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other)
hbos6ded1902016-11-01 01:50:46 -0700594 : RTCStats(other.id(), other.timestamp_us()),
595 ssrc(other.ssrc),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200596 kind(other.kind),
hbosb0ae9202017-01-27 06:35:16 -0800597 track_id(other.track_id),
hbos6ded1902016-11-01 01:50:46 -0700598 transport_id(other.transport_id),
599 codec_id(other.codec_id),
Di Wufd1e9d12021-03-09 09:25:28 -0800600 media_type(other.media_type) {}
hbos6ded1902016-11-01 01:50:46 -0700601
Yves Gerey665174f2018-06-19 15:03:05 +0200602RTCRTPStreamStats::~RTCRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700603
Steve Antond6a5cbd2017-08-18 09:40:25 -0700604// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700605WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800606 RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp",
607 &jitter,
Minyue Li28a2c632021-07-07 15:53:38 +0200608 &packets_lost,
609 &packets_discarded)
Di Wufd1e9d12021-03-09 09:25:28 -0800610// clang-format on
611
612RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(const std::string&& id,
613 int64_t timestamp_us)
614 : RTCReceivedRtpStreamStats(std::string(id), timestamp_us) {}
615
616RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string&& id,
617 int64_t timestamp_us)
618 : RTCRTPStreamStats(std::move(id), timestamp_us),
619 jitter("jitter"),
Minyue Li28a2c632021-07-07 15:53:38 +0200620 packets_lost("packetsLost"),
621 packets_discarded("packetsDiscarded") {}
Di Wufd1e9d12021-03-09 09:25:28 -0800622
623RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(
624 const RTCReceivedRtpStreamStats& other)
625 : RTCRTPStreamStats(other),
626 jitter(other.jitter),
Minyue Li28a2c632021-07-07 15:53:38 +0200627 packets_lost(other.packets_lost),
628 packets_discarded(other.packets_discarded) {}
Di Wufd1e9d12021-03-09 09:25:28 -0800629
630RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {}
631
632// clang-format off
633WEBRTC_RTCSTATS_IMPL(
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100634 RTCSentRtpStreamStats, RTCRTPStreamStats, "sent-rtp",
635 &packets_sent,
636 &bytes_sent)
637// clang-format on
638
639RTCSentRtpStreamStats::RTCSentRtpStreamStats(const std::string&& id,
640 int64_t timestamp_us)
641 : RTCSentRtpStreamStats(std::string(id), timestamp_us) {}
642
643RTCSentRtpStreamStats::RTCSentRtpStreamStats(std::string&& id,
644 int64_t timestamp_us)
645 : RTCRTPStreamStats(std::move(id), timestamp_us),
646 packets_sent("packetsSent"),
647 bytes_sent("bytesSent") {}
648
649RTCSentRtpStreamStats::RTCSentRtpStreamStats(const RTCSentRtpStreamStats& other)
650 : RTCRTPStreamStats(other),
651 packets_sent(other.packets_sent),
652 bytes_sent(other.bytes_sent) {}
653
654RTCSentRtpStreamStats::~RTCSentRtpStreamStats() {}
655
656// clang-format off
657WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800658 RTCInboundRTPStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp",
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100659 &remote_id,
hboseeafe942016-11-01 03:00:17 -0700660 &packets_received,
Henrik Boström4a5dab02020-01-28 11:15:35 +0100661 &fec_packets_received,
662 &fec_packets_discarded,
hboseeafe942016-11-01 03:00:17 -0700663 &bytes_received,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200664 &header_bytes_received,
Henrik Boström01738c62019-04-15 17:32:00 +0200665 &last_packet_received_timestamp,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300666 &jitter_buffer_delay,
667 &jitter_buffer_emitted_count,
668 &total_samples_received,
669 &concealed_samples,
670 &silent_concealed_samples,
671 &concealment_events,
672 &inserted_samples_for_deceleration,
673 &removed_samples_for_acceleration,
674 &audio_level,
675 &total_audio_energy,
676 &total_samples_duration,
hbosa7a9be12017-03-01 01:02:45 -0800677 &round_trip_time,
hboseeafe942016-11-01 03:00:17 -0700678 &packets_repaired,
679 &burst_packets_lost,
680 &burst_packets_discarded,
681 &burst_loss_count,
682 &burst_discard_count,
683 &burst_loss_rate,
684 &burst_discard_rate,
685 &gap_loss_rate,
hbos6769c492017-01-02 08:35:13 -0800686 &gap_discard_rate,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200687 &frames_received,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300688 &frame_width,
689 &frame_height,
690 &frame_bit_depth,
691 &frames_per_second,
Henrik Boström2e069262019-04-09 13:59:31 +0200692 &frames_decoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200693 &key_frames_decoded,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300694 &frames_dropped,
Johannes Kronbfd343b2019-07-01 10:07:50 +0200695 &total_decode_time,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200696 &total_processing_delay,
Johannes Kron00376e12019-11-25 10:25:42 +0100697 &total_inter_frame_delay,
698 &total_squared_inter_frame_delay,
Henrik Boström6b430862019-08-16 13:09:51 +0200699 &content_type,
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200700 &estimated_playout_timestamp,
Di Wufd1e9d12021-03-09 09:25:28 -0800701 &decoder_implementation,
702 &fir_count,
703 &pli_count,
704 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700705 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700706// clang-format on
hboseeafe942016-11-01 03:00:17 -0700707
Yves Gerey665174f2018-06-19 15:03:05 +0200708RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
709 int64_t timestamp_us)
710 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {}
hboseeafe942016-11-01 03:00:17 -0700711
Yves Gerey665174f2018-06-19 15:03:05 +0200712RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
713 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800714 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100715 remote_id("remoteId"),
hboseeafe942016-11-01 03:00:17 -0700716 packets_received("packetsReceived"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200717 fec_packets_received("fecPacketsReceived"),
718 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700719 bytes_received("bytesReceived"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200720 header_bytes_received("headerBytesReceived"),
Henrik Boström01738c62019-04-15 17:32:00 +0200721 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300722 jitter_buffer_delay("jitterBufferDelay"),
723 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
724 total_samples_received("totalSamplesReceived"),
725 concealed_samples("concealedSamples"),
726 silent_concealed_samples("silentConcealedSamples"),
727 concealment_events("concealmentEvents"),
728 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
729 removed_samples_for_acceleration("removedSamplesForAcceleration"),
730 audio_level("audioLevel"),
731 total_audio_energy("totalAudioEnergy"),
732 total_samples_duration("totalSamplesDuration"),
hbosa7a9be12017-03-01 01:02:45 -0800733 round_trip_time("roundTripTime"),
hboseeafe942016-11-01 03:00:17 -0700734 packets_repaired("packetsRepaired"),
735 burst_packets_lost("burstPacketsLost"),
736 burst_packets_discarded("burstPacketsDiscarded"),
737 burst_loss_count("burstLossCount"),
738 burst_discard_count("burstDiscardCount"),
739 burst_loss_rate("burstLossRate"),
740 burst_discard_rate("burstDiscardRate"),
741 gap_loss_rate("gapLossRate"),
hbos6769c492017-01-02 08:35:13 -0800742 gap_discard_rate("gapDiscardRate"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200743 frames_received("framesReceived"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300744 frame_width("frameWidth"),
745 frame_height("frameHeight"),
746 frame_bit_depth("frameBitDepth"),
747 frames_per_second("framesPerSecond"),
Henrik Boström2e069262019-04-09 13:59:31 +0200748 frames_decoded("framesDecoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200749 key_frames_decoded("keyFramesDecoded"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300750 frames_dropped("framesDropped"),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200751 total_decode_time("totalDecodeTime"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200752 total_processing_delay("totalProcessingDelay"),
Johannes Kron00376e12019-11-25 10:25:42 +0100753 total_inter_frame_delay("totalInterFrameDelay"),
754 total_squared_inter_frame_delay("totalSquaredInterFrameDelay"),
Henrik Boström6b430862019-08-16 13:09:51 +0200755 content_type("contentType"),
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200756 estimated_playout_timestamp("estimatedPlayoutTimestamp"),
Di Wufd1e9d12021-03-09 09:25:28 -0800757 decoder_implementation("decoderImplementation"),
758 fir_count("firCount"),
759 pli_count("pliCount"),
760 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700761 qp_sum("qpSum") {}
hboseeafe942016-11-01 03:00:17 -0700762
763RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
764 const RTCInboundRTPStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800765 : RTCReceivedRtpStreamStats(other),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100766 remote_id(other.remote_id),
hboseeafe942016-11-01 03:00:17 -0700767 packets_received(other.packets_received),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200768 fec_packets_received(other.fec_packets_received),
769 fec_packets_discarded(other.fec_packets_discarded),
hboseeafe942016-11-01 03:00:17 -0700770 bytes_received(other.bytes_received),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200771 header_bytes_received(other.header_bytes_received),
Henrik Boström01738c62019-04-15 17:32:00 +0200772 last_packet_received_timestamp(other.last_packet_received_timestamp),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300773 jitter_buffer_delay(other.jitter_buffer_delay),
774 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
775 total_samples_received(other.total_samples_received),
776 concealed_samples(other.concealed_samples),
777 silent_concealed_samples(other.silent_concealed_samples),
778 concealment_events(other.concealment_events),
779 inserted_samples_for_deceleration(
780 other.inserted_samples_for_deceleration),
781 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
782 audio_level(other.audio_level),
783 total_audio_energy(other.total_audio_energy),
784 total_samples_duration(other.total_samples_duration),
hbosa7a9be12017-03-01 01:02:45 -0800785 round_trip_time(other.round_trip_time),
hboseeafe942016-11-01 03:00:17 -0700786 packets_repaired(other.packets_repaired),
787 burst_packets_lost(other.burst_packets_lost),
788 burst_packets_discarded(other.burst_packets_discarded),
789 burst_loss_count(other.burst_loss_count),
790 burst_discard_count(other.burst_discard_count),
791 burst_loss_rate(other.burst_loss_rate),
792 burst_discard_rate(other.burst_discard_rate),
793 gap_loss_rate(other.gap_loss_rate),
hbos6769c492017-01-02 08:35:13 -0800794 gap_discard_rate(other.gap_discard_rate),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200795 frames_received(other.frames_received),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300796 frame_width(other.frame_width),
797 frame_height(other.frame_height),
798 frame_bit_depth(other.frame_bit_depth),
799 frames_per_second(other.frames_per_second),
Henrik Boström2e069262019-04-09 13:59:31 +0200800 frames_decoded(other.frames_decoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200801 key_frames_decoded(other.key_frames_decoded),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300802 frames_dropped(other.frames_dropped),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200803 total_decode_time(other.total_decode_time),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200804 total_processing_delay(other.total_processing_delay),
Johannes Kron00376e12019-11-25 10:25:42 +0100805 total_inter_frame_delay(other.total_inter_frame_delay),
806 total_squared_inter_frame_delay(other.total_squared_inter_frame_delay),
Henrik Boström6b430862019-08-16 13:09:51 +0200807 content_type(other.content_type),
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200808 estimated_playout_timestamp(other.estimated_playout_timestamp),
Di Wufd1e9d12021-03-09 09:25:28 -0800809 decoder_implementation(other.decoder_implementation),
810 fir_count(other.fir_count),
811 pli_count(other.pli_count),
812 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700813 qp_sum(other.qp_sum) {}
hboseeafe942016-11-01 03:00:17 -0700814
Yves Gerey665174f2018-06-19 15:03:05 +0200815RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700816
Steve Antond6a5cbd2017-08-18 09:40:25 -0700817// clang-format off
hboseeafe942016-11-01 03:00:17 -0700818WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700819 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200820 &media_source_id,
Henrik Boström4f40fa52019-12-19 13:27:27 +0100821 &remote_id,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200822 &rid,
hbos6ded1902016-11-01 01:50:46 -0700823 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200824 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700825 &bytes_sent,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200826 &header_bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200827 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700828 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200829 &frames_encoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200830 &key_frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200831 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200832 &total_encoded_bytes_target,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200833 &frame_width,
834 &frame_height,
835 &frames_per_second,
836 &frames_sent,
837 &huge_frames_sent,
Henrik Boström9fe18342019-05-16 18:38:20 +0200838 &total_packet_send_delay,
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200839 &quality_limitation_reason,
Byoungchan Lee7d235352021-05-28 21:32:04 +0900840 &quality_limitation_durations,
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200841 &quality_limitation_resolution_changes,
Henrik Boström6b430862019-08-16 13:09:51 +0200842 &content_type,
Di Wufd1e9d12021-03-09 09:25:28 -0800843 &encoder_implementation,
844 &fir_count,
845 &pli_count,
846 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700847 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700848// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700849
Yves Gerey665174f2018-06-19 15:03:05 +0200850RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id,
851 int64_t timestamp_us)
852 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700853
Yves Gerey665174f2018-06-19 15:03:05 +0200854RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id,
855 int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700856 : RTCRTPStreamStats(std::move(id), timestamp_us),
Henrik Boström646fda02019-05-22 15:49:42 +0200857 media_source_id("mediaSourceId"),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100858 remote_id("remoteId"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200859 rid("rid"),
hbos6ded1902016-11-01 01:50:46 -0700860 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200861 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700862 bytes_sent("bytesSent"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200863 header_bytes_sent("headerBytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200864 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700865 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200866 frames_encoded("framesEncoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200867 key_frames_encoded("keyFramesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200868 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200869 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200870 frame_width("frameWidth"),
871 frame_height("frameHeight"),
872 frames_per_second("framesPerSecond"),
873 frames_sent("framesSent"),
874 huge_frames_sent("hugeFramesSent"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200875 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200876 quality_limitation_reason("qualityLimitationReason"),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900877 quality_limitation_durations("qualityLimitationDurations"),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200878 quality_limitation_resolution_changes(
879 "qualityLimitationResolutionChanges"),
Henrik Boström6b430862019-08-16 13:09:51 +0200880 content_type("contentType"),
Di Wufd1e9d12021-03-09 09:25:28 -0800881 encoder_implementation("encoderImplementation"),
882 fir_count("firCount"),
883 pli_count("pliCount"),
884 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700885 qp_sum("qpSum") {}
hbos6ded1902016-11-01 01:50:46 -0700886
887RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
888 const RTCOutboundRTPStreamStats& other)
889 : RTCRTPStreamStats(other),
Henrik Boström646fda02019-05-22 15:49:42 +0200890 media_source_id(other.media_source_id),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100891 remote_id(other.remote_id),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200892 rid(other.rid),
hbos6ded1902016-11-01 01:50:46 -0700893 packets_sent(other.packets_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200894 retransmitted_packets_sent(other.retransmitted_packets_sent),
hbos6ded1902016-11-01 01:50:46 -0700895 bytes_sent(other.bytes_sent),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200896 header_bytes_sent(other.header_bytes_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200897 retransmitted_bytes_sent(other.retransmitted_bytes_sent),
hbos6ded1902016-11-01 01:50:46 -0700898 target_bitrate(other.target_bitrate),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200899 frames_encoded(other.frames_encoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200900 key_frames_encoded(other.key_frames_encoded),
Henrik Boström2e069262019-04-09 13:59:31 +0200901 total_encode_time(other.total_encode_time),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200902 total_encoded_bytes_target(other.total_encoded_bytes_target),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200903 frame_width(other.frame_width),
904 frame_height(other.frame_height),
905 frames_per_second(other.frames_per_second),
906 frames_sent(other.frames_sent),
907 huge_frames_sent(other.huge_frames_sent),
Henrik Boström9fe18342019-05-16 18:38:20 +0200908 total_packet_send_delay(other.total_packet_send_delay),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200909 quality_limitation_reason(other.quality_limitation_reason),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900910 quality_limitation_durations(other.quality_limitation_durations),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200911 quality_limitation_resolution_changes(
912 other.quality_limitation_resolution_changes),
Henrik Boström6b430862019-08-16 13:09:51 +0200913 content_type(other.content_type),
Di Wufd1e9d12021-03-09 09:25:28 -0800914 encoder_implementation(other.encoder_implementation),
915 fir_count(other.fir_count),
916 pli_count(other.pli_count),
917 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700918 qp_sum(other.qp_sum) {}
hbos6ded1902016-11-01 01:50:46 -0700919
Yves Gerey665174f2018-06-19 15:03:05 +0200920RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700921
Steve Antond6a5cbd2017-08-18 09:40:25 -0700922// clang-format off
Henrik Boström883eefc2019-05-27 13:40:25 +0200923WEBRTC_RTCSTATS_IMPL(
Henrik Boström2f71b612021-03-23 15:18:55 +0100924 RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
925 "remote-inbound-rtp",
Henrik Boström883eefc2019-05-27 13:40:25 +0200926 &local_id,
Di Wu86f04ad2021-02-28 23:36:03 -0800927 &round_trip_time,
Di Wu88a51b22021-03-01 11:22:06 -0800928 &fraction_lost,
929 &total_round_trip_time,
930 &round_trip_time_measurements)
Henrik Boström883eefc2019-05-27 13:40:25 +0200931// clang-format on
932
933RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
934 const std::string& id,
935 int64_t timestamp_us)
936 : RTCRemoteInboundRtpStreamStats(std::string(id), timestamp_us) {}
937
938RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
939 std::string&& id,
940 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800941 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boström883eefc2019-05-27 13:40:25 +0200942 local_id("localId"),
Di Wu86f04ad2021-02-28 23:36:03 -0800943 round_trip_time("roundTripTime"),
Di Wu88a51b22021-03-01 11:22:06 -0800944 fraction_lost("fractionLost"),
945 total_round_trip_time("totalRoundTripTime"),
946 round_trip_time_measurements("roundTripTimeMeasurements") {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200947
948RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
949 const RTCRemoteInboundRtpStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800950 : RTCReceivedRtpStreamStats(other),
Henrik Boström883eefc2019-05-27 13:40:25 +0200951 local_id(other.local_id),
Di Wu86f04ad2021-02-28 23:36:03 -0800952 round_trip_time(other.round_trip_time),
Di Wu88a51b22021-03-01 11:22:06 -0800953 fraction_lost(other.fraction_lost),
954 total_round_trip_time(other.total_round_trip_time),
955 round_trip_time_measurements(other.round_trip_time_measurements) {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200956
957RTCRemoteInboundRtpStreamStats::~RTCRemoteInboundRtpStreamStats() {}
958
959// clang-format off
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100960WEBRTC_RTCSTATS_IMPL(
961 RTCRemoteOutboundRtpStreamStats, RTCSentRtpStreamStats,
962 "remote-outbound-rtp",
963 &local_id,
964 &remote_timestamp,
Ivo Creusen2562cf02021-09-03 14:51:22 +0000965 &reports_sent,
966 &round_trip_time,
967 &round_trip_time_measurements,
968 &total_round_trip_time)
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100969// clang-format on
970
971RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
972 const std::string& id,
973 int64_t timestamp_us)
974 : RTCRemoteOutboundRtpStreamStats(std::string(id), timestamp_us) {}
975
976RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
977 std::string&& id,
978 int64_t timestamp_us)
979 : RTCSentRtpStreamStats(std::move(id), timestamp_us),
980 local_id("localId"),
981 remote_timestamp("remoteTimestamp"),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000982 reports_sent("reportsSent"),
983 round_trip_time("roundTripTime"),
984 round_trip_time_measurements("roundTripTimeMeasurements"),
985 total_round_trip_time("totalRoundTripTime") {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100986
987RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
988 const RTCRemoteOutboundRtpStreamStats& other)
989 : RTCSentRtpStreamStats(other),
990 local_id(other.local_id),
991 remote_timestamp(other.remote_timestamp),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000992 reports_sent(other.reports_sent),
993 round_trip_time(other.round_trip_time),
994 round_trip_time_measurements(other.round_trip_time_measurements),
995 total_round_trip_time(other.total_round_trip_time) {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100996
997RTCRemoteOutboundRtpStreamStats::~RTCRemoteOutboundRtpStreamStats() {}
998
999// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +02001000WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
1001 &track_identifier,
1002 &kind)
1003// clang-format on
1004
1005RTCMediaSourceStats::RTCMediaSourceStats(const std::string& id,
1006 int64_t timestamp_us)
1007 : RTCMediaSourceStats(std::string(id), timestamp_us) {}
1008
1009RTCMediaSourceStats::RTCMediaSourceStats(std::string&& id, int64_t timestamp_us)
1010 : RTCStats(std::move(id), timestamp_us),
1011 track_identifier("trackIdentifier"),
1012 kind("kind") {}
1013
1014RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other)
1015 : RTCStats(other.id(), other.timestamp_us()),
1016 track_identifier(other.track_identifier),
1017 kind(other.kind) {}
1018
1019RTCMediaSourceStats::~RTCMediaSourceStats() {}
1020
1021// clang-format off
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001022WEBRTC_RTCSTATS_IMPL(RTCAudioSourceStats, RTCMediaSourceStats, "media-source",
1023 &audio_level,
1024 &total_audio_energy,
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001025 &total_samples_duration,
1026 &echo_return_loss,
1027 &echo_return_loss_enhancement)
Henrik Boström646fda02019-05-22 15:49:42 +02001028// clang-format on
1029
1030RTCAudioSourceStats::RTCAudioSourceStats(const std::string& id,
1031 int64_t timestamp_us)
1032 : RTCAudioSourceStats(std::string(id), timestamp_us) {}
1033
1034RTCAudioSourceStats::RTCAudioSourceStats(std::string&& id, int64_t timestamp_us)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001035 : RTCMediaSourceStats(std::move(id), timestamp_us),
1036 audio_level("audioLevel"),
1037 total_audio_energy("totalAudioEnergy"),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001038 total_samples_duration("totalSamplesDuration"),
1039 echo_return_loss("echoReturnLoss"),
1040 echo_return_loss_enhancement("echoReturnLossEnhancement") {}
Henrik Boström646fda02019-05-22 15:49:42 +02001041
1042RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001043 : RTCMediaSourceStats(other),
1044 audio_level(other.audio_level),
1045 total_audio_energy(other.total_audio_energy),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001046 total_samples_duration(other.total_samples_duration),
1047 echo_return_loss(other.echo_return_loss),
1048 echo_return_loss_enhancement(other.echo_return_loss_enhancement) {}
Henrik Boström646fda02019-05-22 15:49:42 +02001049
1050RTCAudioSourceStats::~RTCAudioSourceStats() {}
1051
1052// clang-format off
1053WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
1054 &width,
1055 &height,
1056 &frames,
1057 &frames_per_second)
1058// clang-format on
1059
1060RTCVideoSourceStats::RTCVideoSourceStats(const std::string& id,
1061 int64_t timestamp_us)
1062 : RTCVideoSourceStats(std::string(id), timestamp_us) {}
1063
1064RTCVideoSourceStats::RTCVideoSourceStats(std::string&& id, int64_t timestamp_us)
1065 : RTCMediaSourceStats(std::move(id), timestamp_us),
1066 width("width"),
1067 height("height"),
1068 frames("frames"),
1069 frames_per_second("framesPerSecond") {}
1070
1071RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other)
1072 : RTCMediaSourceStats(other),
1073 width(other.width),
1074 height(other.height),
1075 frames(other.frames),
1076 frames_per_second(other.frames_per_second) {}
1077
1078RTCVideoSourceStats::~RTCVideoSourceStats() {}
1079
1080// clang-format off
hbos2fa7c672016-10-24 04:00:05 -07001081WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
1082 &bytes_sent,
Artem Titovedacbd52020-07-06 16:06:37 +02001083 &packets_sent,
hbos2fa7c672016-10-24 04:00:05 -07001084 &bytes_received,
Artem Titovedacbd52020-07-06 16:06:37 +02001085 &packets_received,
hbos2fa7c672016-10-24 04:00:05 -07001086 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -08001087 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -07001088 &selected_candidate_pair_id,
1089 &local_certificate_id,
Jonas Oreland149dc722019-08-28 08:10:27 +02001090 &remote_certificate_id,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001091 &tls_version,
1092 &dtls_cipher,
Philipp Hancke69c1df22022-04-22 15:46:24 +02001093 &dtls_role,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001094 &srtp_cipher,
Jonas Oreland149dc722019-08-28 08:10:27 +02001095 &selected_candidate_pair_changes)
Steve Antond6a5cbd2017-08-18 09:40:25 -07001096// clang-format on
hbos2fa7c672016-10-24 04:00:05 -07001097
Yves Gerey665174f2018-06-19 15:03:05 +02001098RTCTransportStats::RTCTransportStats(const std::string& id,
1099 int64_t timestamp_us)
1100 : RTCTransportStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -07001101
Yves Gerey665174f2018-06-19 15:03:05 +02001102RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -07001103 : RTCStats(std::move(id), timestamp_us),
1104 bytes_sent("bytesSent"),
Artem Titovedacbd52020-07-06 16:06:37 +02001105 packets_sent("packetsSent"),
hbos2fa7c672016-10-24 04:00:05 -07001106 bytes_received("bytesReceived"),
Artem Titovedacbd52020-07-06 16:06:37 +02001107 packets_received("packetsReceived"),
hbos2fa7c672016-10-24 04:00:05 -07001108 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -08001109 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -07001110 selected_candidate_pair_id("selectedCandidatePairId"),
1111 local_certificate_id("localCertificateId"),
Jonas Oreland149dc722019-08-28 08:10:27 +02001112 remote_certificate_id("remoteCertificateId"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001113 tls_version("tlsVersion"),
1114 dtls_cipher("dtlsCipher"),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001115 dtls_role("dtlsRole"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001116 srtp_cipher("srtpCipher"),
Jonas Oreland149dc722019-08-28 08:10:27 +02001117 selected_candidate_pair_changes("selectedCandidatePairChanges") {}
hbos2fa7c672016-10-24 04:00:05 -07001118
Yves Gerey665174f2018-06-19 15:03:05 +02001119RTCTransportStats::RTCTransportStats(const RTCTransportStats& other)
hbos2fa7c672016-10-24 04:00:05 -07001120 : RTCStats(other.id(), other.timestamp_us()),
1121 bytes_sent(other.bytes_sent),
Artem Titovedacbd52020-07-06 16:06:37 +02001122 packets_sent(other.packets_sent),
hbos2fa7c672016-10-24 04:00:05 -07001123 bytes_received(other.bytes_received),
Artem Titovedacbd52020-07-06 16:06:37 +02001124 packets_received(other.packets_received),
hbos2fa7c672016-10-24 04:00:05 -07001125 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -08001126 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -07001127 selected_candidate_pair_id(other.selected_candidate_pair_id),
1128 local_certificate_id(other.local_certificate_id),
Jonas Oreland149dc722019-08-28 08:10:27 +02001129 remote_certificate_id(other.remote_certificate_id),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001130 tls_version(other.tls_version),
1131 dtls_cipher(other.dtls_cipher),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001132 dtls_role(other.dtls_role),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001133 srtp_cipher(other.srtp_cipher),
Jonas Oreland149dc722019-08-28 08:10:27 +02001134 selected_candidate_pair_changes(other.selected_candidate_pair_changes) {}
hbos2fa7c672016-10-24 04:00:05 -07001135
Yves Gerey665174f2018-06-19 15:03:05 +02001136RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -07001137
hbosd565b732016-08-30 14:04:35 -07001138} // namespace webrtc