blob: e3e2640533cb730fea0ee4882f0e31e7ab43145d [file] [log] [blame]
hbosd565b732016-08-30 14:04:35 -07001/*
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "api/stats/rtcstats_objects.h"
hbosd565b732016-08-30 14:04:35 -070012
Yves Gerey3e707812018-11-28 16:47:49 +010013#include <utility>
14
Jakob Ivarsson758d9462019-03-19 15:38:49 +010015#include "api/stats/rtc_stats.h"
Jonas Olssona4d87372019-07-05 19:08:33 +020016#include "rtc_base/checks.h"
Jakob Ivarsson758d9462019-03-19 15:38:49 +010017
hbosd565b732016-08-30 14:04:35 -070018namespace webrtc {
19
agrieve26622d32017-08-08 10:48:15 -070020const char* const RTCDataChannelState::kConnecting = "connecting";
21const char* const RTCDataChannelState::kOpen = "open";
22const char* const RTCDataChannelState::kClosing = "closing";
23const char* const RTCDataChannelState::kClosed = "closed";
hboscc555c52016-10-18 12:48:31 -070024
agrieve26622d32017-08-08 10:48:15 -070025const char* const RTCStatsIceCandidatePairState::kFrozen = "frozen";
26const char* const RTCStatsIceCandidatePairState::kWaiting = "waiting";
27const char* const RTCStatsIceCandidatePairState::kInProgress = "in-progress";
28const char* const RTCStatsIceCandidatePairState::kFailed = "failed";
29const char* const RTCStatsIceCandidatePairState::kSucceeded = "succeeded";
hbosc47a0c32016-10-11 14:54:49 -070030
31// Strings defined in https://tools.ietf.org/html/rfc5245.
agrieve26622d32017-08-08 10:48:15 -070032const char* const RTCIceCandidateType::kHost = "host";
33const char* const RTCIceCandidateType::kSrflx = "srflx";
34const char* const RTCIceCandidateType::kPrflx = "prflx";
35const char* const RTCIceCandidateType::kRelay = "relay";
hbosab9f6e42016-10-07 02:18:47 -070036
agrieve26622d32017-08-08 10:48:15 -070037const char* const RTCDtlsTransportState::kNew = "new";
38const char* const RTCDtlsTransportState::kConnecting = "connecting";
39const char* const RTCDtlsTransportState::kConnected = "connected";
40const char* const RTCDtlsTransportState::kClosed = "closed";
41const char* const RTCDtlsTransportState::kFailed = "failed";
hbos7064d592017-01-16 07:38:02 -080042
agrieve26622d32017-08-08 10:48:15 -070043const char* const RTCMediaStreamTrackKind::kAudio = "audio";
44const char* const RTCMediaStreamTrackKind::kVideo = "video";
hbos160e4a72017-01-17 02:53:23 -080045
Gary Liu37e489c2017-11-21 10:49:36 -080046// https://w3c.github.io/webrtc-stats/#dom-rtcnetworktype
47const char* const RTCNetworkType::kBluetooth = "bluetooth";
48const char* const RTCNetworkType::kCellular = "cellular";
49const char* const RTCNetworkType::kEthernet = "ethernet";
50const char* const RTCNetworkType::kWifi = "wifi";
51const char* const RTCNetworkType::kWimax = "wimax";
52const char* const RTCNetworkType::kVpn = "vpn";
53const char* const RTCNetworkType::kUnknown = "unknown";
54
Henrik Boströmce33b6a2019-05-28 17:42:38 +020055// https://w3c.github.io/webrtc-stats/#dom-rtcqualitylimitationreason
56const char* const RTCQualityLimitationReason::kNone = "none";
57const char* const RTCQualityLimitationReason::kCpu = "cpu";
58const char* const RTCQualityLimitationReason::kBandwidth = "bandwidth";
59const char* const RTCQualityLimitationReason::kOther = "other";
60
Henrik Boström2e069262019-04-09 13:59:31 +020061// https://webrtc.org/experiments/rtp-hdrext/video-content-type/
62const char* const RTCContentType::kUnspecified = "unspecified";
63const char* const RTCContentType::kScreenshare = "screenshare";
64
Philipp Hancke69c1df22022-04-22 15:46:24 +020065// https://w3c.github.io/webrtc-stats/#dom-rtcdtlsrole
66const char* const RTCDtlsRole::kUnknown = "unknown";
67const char* const RTCDtlsRole::kClient = "client";
68const char* const RTCDtlsRole::kServer = "server";
69
Philipp Hanckecc1b9b02022-05-04 18:58:26 +020070// https://www.w3.org/TR/webrtc/#rtcicerole
71const char* const RTCIceRole::kUnknown = "unknown";
72const char* const RTCIceRole::kControlled = "controlled";
73const char* const RTCIceRole::kControlling = "controlling";
74
Philipp Hancke1f491572022-05-09 17:43:31 +020075// https://www.w3.org/TR/webrtc/#dom-rtcicetransportstate
76const char* const RTCIceTransportState::kNew = "new";
77const char* const RTCIceTransportState::kChecking = "checking";
78const char* const RTCIceTransportState::kConnected = "connected";
79const char* const RTCIceTransportState::kCompleted = "completed";
80const char* const RTCIceTransportState::kDisconnected = "disconnected";
81const char* const RTCIceTransportState::kFailed = "failed";
82const char* const RTCIceTransportState::kClosed = "closed";
83
Steve Antond6a5cbd2017-08-18 09:40:25 -070084// clang-format off
hbos2fa7c672016-10-24 04:00:05 -070085WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate",
86 &fingerprint,
87 &fingerprint_algorithm,
88 &base64_certificate,
Nico Weber22f99252019-02-20 10:13:16 -050089 &issuer_certificate_id)
Steve Antond6a5cbd2017-08-18 09:40:25 -070090// clang-format on
hbos2fa7c672016-10-24 04:00:05 -070091
Yves Gerey665174f2018-06-19 15:03:05 +020092RTCCertificateStats::RTCCertificateStats(const std::string& id,
93 int64_t timestamp_us)
94 : RTCCertificateStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -070095
Yves Gerey665174f2018-06-19 15:03:05 +020096RTCCertificateStats::RTCCertificateStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -070097 : RTCStats(std::move(id), timestamp_us),
98 fingerprint("fingerprint"),
99 fingerprint_algorithm("fingerprintAlgorithm"),
100 base64_certificate("base64Certificate"),
Yves Gerey665174f2018-06-19 15:03:05 +0200101 issuer_certificate_id("issuerCertificateId") {}
hbos2fa7c672016-10-24 04:00:05 -0700102
Yves Gerey665174f2018-06-19 15:03:05 +0200103RTCCertificateStats::RTCCertificateStats(const RTCCertificateStats& other)
hbos2fa7c672016-10-24 04:00:05 -0700104 : RTCStats(other.id(), other.timestamp_us()),
105 fingerprint(other.fingerprint),
106 fingerprint_algorithm(other.fingerprint_algorithm),
107 base64_certificate(other.base64_certificate),
Yves Gerey665174f2018-06-19 15:03:05 +0200108 issuer_certificate_id(other.issuer_certificate_id) {}
hbos2fa7c672016-10-24 04:00:05 -0700109
Yves Gerey665174f2018-06-19 15:03:05 +0200110RTCCertificateStats::~RTCCertificateStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700111
Steve Antond6a5cbd2017-08-18 09:40:25 -0700112// clang-format off
hbos0adb8282016-11-23 02:32:06 -0800113WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec",
Philipp Hancke95157a02020-11-16 20:08:27 +0100114 &transport_id,
hbos0adb8282016-11-23 02:32:06 -0800115 &payload_type,
hbos13f54b22017-02-28 06:56:04 -0800116 &mime_type,
hbos0adb8282016-11-23 02:32:06 -0800117 &clock_rate,
118 &channels,
Henrik Boström6b430862019-08-16 13:09:51 +0200119 &sdp_fmtp_line)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700120// clang-format on
hbos0adb8282016-11-23 02:32:06 -0800121
Yves Gerey665174f2018-06-19 15:03:05 +0200122RTCCodecStats::RTCCodecStats(const std::string& id, int64_t timestamp_us)
123 : RTCCodecStats(std::string(id), timestamp_us) {}
hbos0adb8282016-11-23 02:32:06 -0800124
Yves Gerey665174f2018-06-19 15:03:05 +0200125RTCCodecStats::RTCCodecStats(std::string&& id, int64_t timestamp_us)
hbos0adb8282016-11-23 02:32:06 -0800126 : RTCStats(std::move(id), timestamp_us),
Philipp Hancke95157a02020-11-16 20:08:27 +0100127 transport_id("transportId"),
hbos0adb8282016-11-23 02:32:06 -0800128 payload_type("payloadType"),
hbos13f54b22017-02-28 06:56:04 -0800129 mime_type("mimeType"),
hbos0adb8282016-11-23 02:32:06 -0800130 clock_rate("clockRate"),
131 channels("channels"),
Henrik Boström6b430862019-08-16 13:09:51 +0200132 sdp_fmtp_line("sdpFmtpLine") {}
hbos0adb8282016-11-23 02:32:06 -0800133
Yves Gerey665174f2018-06-19 15:03:05 +0200134RTCCodecStats::RTCCodecStats(const RTCCodecStats& other)
hbos0adb8282016-11-23 02:32:06 -0800135 : RTCStats(other.id(), other.timestamp_us()),
Philipp Hancke95157a02020-11-16 20:08:27 +0100136 transport_id(other.transport_id),
hbos0adb8282016-11-23 02:32:06 -0800137 payload_type(other.payload_type),
hbos13f54b22017-02-28 06:56:04 -0800138 mime_type(other.mime_type),
hbos0adb8282016-11-23 02:32:06 -0800139 clock_rate(other.clock_rate),
140 channels(other.channels),
Henrik Boström6b430862019-08-16 13:09:51 +0200141 sdp_fmtp_line(other.sdp_fmtp_line) {}
hbos0adb8282016-11-23 02:32:06 -0800142
Yves Gerey665174f2018-06-19 15:03:05 +0200143RTCCodecStats::~RTCCodecStats() {}
hbos0adb8282016-11-23 02:32:06 -0800144
Steve Antond6a5cbd2017-08-18 09:40:25 -0700145// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700146WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel",
147 &label,
148 &protocol,
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200149 &data_channel_identifier,
hbos2fa7c672016-10-24 04:00:05 -0700150 &state,
151 &messages_sent,
152 &bytes_sent,
153 &messages_received,
Nico Weber22f99252019-02-20 10:13:16 -0500154 &bytes_received)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700155// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700156
Yves Gerey665174f2018-06-19 15:03:05 +0200157RTCDataChannelStats::RTCDataChannelStats(const std::string& id,
158 int64_t timestamp_us)
159 : RTCDataChannelStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -0700160
Yves Gerey665174f2018-06-19 15:03:05 +0200161RTCDataChannelStats::RTCDataChannelStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -0700162 : RTCStats(std::move(id), timestamp_us),
163 label("label"),
164 protocol("protocol"),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200165 data_channel_identifier("dataChannelIdentifier"),
hbos2fa7c672016-10-24 04:00:05 -0700166 state("state"),
167 messages_sent("messagesSent"),
168 bytes_sent("bytesSent"),
169 messages_received("messagesReceived"),
Yves Gerey665174f2018-06-19 15:03:05 +0200170 bytes_received("bytesReceived") {}
hbos2fa7c672016-10-24 04:00:05 -0700171
Yves Gerey665174f2018-06-19 15:03:05 +0200172RTCDataChannelStats::RTCDataChannelStats(const RTCDataChannelStats& other)
hbos2fa7c672016-10-24 04:00:05 -0700173 : RTCStats(other.id(), other.timestamp_us()),
174 label(other.label),
175 protocol(other.protocol),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200176 data_channel_identifier(other.data_channel_identifier),
hbos2fa7c672016-10-24 04:00:05 -0700177 state(other.state),
178 messages_sent(other.messages_sent),
179 bytes_sent(other.bytes_sent),
180 messages_received(other.messages_received),
Yves Gerey665174f2018-06-19 15:03:05 +0200181 bytes_received(other.bytes_received) {}
hbos2fa7c672016-10-24 04:00:05 -0700182
Yves Gerey665174f2018-06-19 15:03:05 +0200183RTCDataChannelStats::~RTCDataChannelStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700184
Steve Antond6a5cbd2017-08-18 09:40:25 -0700185// clang-format off
hbosc47a0c32016-10-11 14:54:49 -0700186WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair",
187 &transport_id,
188 &local_candidate_id,
189 &remote_candidate_id,
190 &state,
191 &priority,
192 &nominated,
193 &writable,
194 &readable,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700195 &packets_sent,
196 &packets_received,
hbosc47a0c32016-10-11 14:54:49 -0700197 &bytes_sent,
198 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800199 &total_round_trip_time,
200 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700201 &available_outgoing_bitrate,
202 &available_incoming_bitrate,
203 &requests_received,
204 &requests_sent,
205 &responses_received,
206 &responses_sent,
207 &retransmissions_received,
208 &retransmissions_sent,
209 &consent_requests_received,
210 &consent_requests_sent,
211 &consent_responses_received,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700212 &consent_responses_sent,
213 &packets_discarded_on_send,
214 &bytes_discarded_on_send)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700215// clang-format on
hbosc47a0c32016-10-11 14:54:49 -0700216
Yves Gerey665174f2018-06-19 15:03:05 +0200217RTCIceCandidatePairStats::RTCIceCandidatePairStats(const std::string& id,
218 int64_t timestamp_us)
219 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {}
hbosc47a0c32016-10-11 14:54:49 -0700220
Yves Gerey665174f2018-06-19 15:03:05 +0200221RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string&& id,
222 int64_t timestamp_us)
hbosc47a0c32016-10-11 14:54:49 -0700223 : RTCStats(std::move(id), timestamp_us),
224 transport_id("transportId"),
225 local_candidate_id("localCandidateId"),
226 remote_candidate_id("remoteCandidateId"),
227 state("state"),
228 priority("priority"),
229 nominated("nominated"),
230 writable("writable"),
231 readable("readable"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700232 packets_sent("packetsSent"),
233 packets_received("packetsReceived"),
hbosc47a0c32016-10-11 14:54:49 -0700234 bytes_sent("bytesSent"),
235 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800236 total_round_trip_time("totalRoundTripTime"),
237 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700238 available_outgoing_bitrate("availableOutgoingBitrate"),
239 available_incoming_bitrate("availableIncomingBitrate"),
240 requests_received("requestsReceived"),
241 requests_sent("requestsSent"),
242 responses_received("responsesReceived"),
243 responses_sent("responsesSent"),
244 retransmissions_received("retransmissionsReceived"),
245 retransmissions_sent("retransmissionsSent"),
246 consent_requests_received("consentRequestsReceived"),
247 consent_requests_sent("consentRequestsSent"),
248 consent_responses_received("consentResponsesReceived"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700249 consent_responses_sent("consentResponsesSent"),
250 packets_discarded_on_send("packetsDiscardedOnSend"),
251 bytes_discarded_on_send("bytesDiscardedOnSend") {}
hbosc47a0c32016-10-11 14:54:49 -0700252
253RTCIceCandidatePairStats::RTCIceCandidatePairStats(
254 const RTCIceCandidatePairStats& other)
255 : RTCStats(other.id(), other.timestamp_us()),
256 transport_id(other.transport_id),
257 local_candidate_id(other.local_candidate_id),
258 remote_candidate_id(other.remote_candidate_id),
259 state(other.state),
260 priority(other.priority),
261 nominated(other.nominated),
262 writable(other.writable),
263 readable(other.readable),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700264 packets_sent(other.packets_sent),
265 packets_received(other.packets_received),
hbosc47a0c32016-10-11 14:54:49 -0700266 bytes_sent(other.bytes_sent),
267 bytes_received(other.bytes_received),
hbos3168c7a2016-12-15 06:17:08 -0800268 total_round_trip_time(other.total_round_trip_time),
269 current_round_trip_time(other.current_round_trip_time),
hbosc47a0c32016-10-11 14:54:49 -0700270 available_outgoing_bitrate(other.available_outgoing_bitrate),
271 available_incoming_bitrate(other.available_incoming_bitrate),
272 requests_received(other.requests_received),
273 requests_sent(other.requests_sent),
274 responses_received(other.responses_received),
275 responses_sent(other.responses_sent),
276 retransmissions_received(other.retransmissions_received),
277 retransmissions_sent(other.retransmissions_sent),
278 consent_requests_received(other.consent_requests_received),
279 consent_requests_sent(other.consent_requests_sent),
280 consent_responses_received(other.consent_responses_received),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700281 consent_responses_sent(other.consent_responses_sent),
282 packets_discarded_on_send(other.packets_discarded_on_send),
283 bytes_discarded_on_send(other.bytes_discarded_on_send) {}
hbosc47a0c32016-10-11 14:54:49 -0700284
Yves Gerey665174f2018-06-19 15:03:05 +0200285RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {}
hbosc47a0c32016-10-11 14:54:49 -0700286
Steve Antond6a5cbd2017-08-18 09:40:25 -0700287// clang-format off
Henrik Boström1df1bf82018-03-20 13:24:20 +0100288WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800289 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800290 &is_remote,
Gary Liu37e489c2017-11-21 10:49:36 -0800291 &network_type,
hbosab9f6e42016-10-07 02:18:47 -0700292 &ip,
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100293 &address,
hbosab9f6e42016-10-07 02:18:47 -0700294 &port,
295 &protocol,
Philipp Hancke95513752018-09-27 14:40:08 +0200296 &relay_protocol,
hbosab9f6e42016-10-07 02:18:47 -0700297 &candidate_type,
298 &priority,
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100299 &url,
300 &vpn,
301 &network_adapter_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700302// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700303
Yves Gerey665174f2018-06-19 15:03:05 +0200304RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id,
305 int64_t timestamp_us,
306 bool is_remote)
307 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {}
hbosab9f6e42016-10-07 02:18:47 -0700308
Gary Liu37e489c2017-11-21 10:49:36 -0800309RTCIceCandidateStats::RTCIceCandidateStats(std::string&& id,
310 int64_t timestamp_us,
311 bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700312 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800313 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800314 is_remote("isRemote", is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800315 network_type("networkType"),
hbosab9f6e42016-10-07 02:18:47 -0700316 ip("ip"),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100317 address("address"),
hbosab9f6e42016-10-07 02:18:47 -0700318 port("port"),
319 protocol("protocol"),
Philipp Hancke95513752018-09-27 14:40:08 +0200320 relay_protocol("relayProtocol"),
hbosab9f6e42016-10-07 02:18:47 -0700321 candidate_type("candidateType"),
322 priority("priority"),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100323 url("url"),
324 vpn("vpn"),
325 network_adapter_type("networkAdapterType") {}
hbosab9f6e42016-10-07 02:18:47 -0700326
327RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
328 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800329 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800330 is_remote(other.is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800331 network_type(other.network_type),
hbosab9f6e42016-10-07 02:18:47 -0700332 ip(other.ip),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100333 address(other.address),
hbosab9f6e42016-10-07 02:18:47 -0700334 port(other.port),
335 protocol(other.protocol),
Philipp Hancke95513752018-09-27 14:40:08 +0200336 relay_protocol(other.relay_protocol),
hbosab9f6e42016-10-07 02:18:47 -0700337 candidate_type(other.candidate_type),
338 priority(other.priority),
Jonas Oreland0d13bbd2022-03-02 11:17:36 +0100339 url(other.url),
340 vpn(other.vpn),
341 network_adapter_type(other.network_adapter_type) {}
hbosab9f6e42016-10-07 02:18:47 -0700342
Yves Gerey665174f2018-06-19 15:03:05 +0200343RTCIceCandidateStats::~RTCIceCandidateStats() {}
hbosab9f6e42016-10-07 02:18:47 -0700344
345const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
346
Yves Gerey665174f2018-06-19 15:03:05 +0200347RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(const std::string& id,
348 int64_t timestamp_us)
349 : RTCIceCandidateStats(id, timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700350
Yves Gerey665174f2018-06-19 15:03:05 +0200351RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string&& id,
352 int64_t timestamp_us)
353 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700354
Henrik Boström1df1bf82018-03-20 13:24:20 +0100355std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const {
356 return std::unique_ptr<RTCStats>(new RTCLocalIceCandidateStats(*this));
357}
358
hbosab9f6e42016-10-07 02:18:47 -0700359const char* RTCLocalIceCandidateStats::type() const {
360 return kType;
361}
362
363const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
364
Yves Gerey665174f2018-06-19 15:03:05 +0200365RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(const std::string& id,
366 int64_t timestamp_us)
367 : RTCIceCandidateStats(id, timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700368
Yves Gerey665174f2018-06-19 15:03:05 +0200369RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string&& id,
370 int64_t timestamp_us)
371 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700372
Henrik Boström1df1bf82018-03-20 13:24:20 +0100373std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const {
374 return std::unique_ptr<RTCStats>(new RTCRemoteIceCandidateStats(*this));
375}
376
hbosab9f6e42016-10-07 02:18:47 -0700377const char* RTCRemoteIceCandidateStats::type() const {
378 return kType;
379}
380
Steve Antond6a5cbd2017-08-18 09:40:25 -0700381// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800382WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
383 &stream_identifier,
Nico Weber22f99252019-02-20 10:13:16 -0500384 &track_ids)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700385// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800386
Yves Gerey665174f2018-06-19 15:03:05 +0200387RTCMediaStreamStats::RTCMediaStreamStats(const std::string& id,
388 int64_t timestamp_us)
389 : RTCMediaStreamStats(std::string(id), timestamp_us) {}
hbos09bc1282016-11-08 06:29:22 -0800390
Yves Gerey665174f2018-06-19 15:03:05 +0200391RTCMediaStreamStats::RTCMediaStreamStats(std::string&& id, int64_t timestamp_us)
hbos09bc1282016-11-08 06:29:22 -0800392 : RTCStats(std::move(id), timestamp_us),
393 stream_identifier("streamIdentifier"),
Yves Gerey665174f2018-06-19 15:03:05 +0200394 track_ids("trackIds") {}
hbos09bc1282016-11-08 06:29:22 -0800395
Yves Gerey665174f2018-06-19 15:03:05 +0200396RTCMediaStreamStats::RTCMediaStreamStats(const RTCMediaStreamStats& other)
hbos09bc1282016-11-08 06:29:22 -0800397 : RTCStats(other.id(), other.timestamp_us()),
398 stream_identifier(other.stream_identifier),
Yves Gerey665174f2018-06-19 15:03:05 +0200399 track_ids(other.track_ids) {}
hbos09bc1282016-11-08 06:29:22 -0800400
Yves Gerey665174f2018-06-19 15:03:05 +0200401RTCMediaStreamStats::~RTCMediaStreamStats() {}
hbos09bc1282016-11-08 06:29:22 -0800402
Steve Antond6a5cbd2017-08-18 09:40:25 -0700403// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800404WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
zsteine76bd3a2017-07-14 12:17:49 -0700405 &track_identifier,
Henrik Boström646fda02019-05-22 15:49:42 +0200406 &media_source_id,
zsteine76bd3a2017-07-14 12:17:49 -0700407 &remote_source,
408 &ended,
409 &detached,
410 &kind,
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200411 &jitter_buffer_delay,
Chen Xing0acffb52019-01-15 15:46:29 +0100412 &jitter_buffer_emitted_count,
zsteine76bd3a2017-07-14 12:17:49 -0700413 &frame_width,
414 &frame_height,
415 &frames_per_second,
416 &frames_sent,
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100417 &huge_frames_sent,
zsteine76bd3a2017-07-14 12:17:49 -0700418 &frames_received,
419 &frames_decoded,
420 &frames_dropped,
421 &frames_corrupted,
422 &partial_frames_lost,
423 &full_frames_lost,
424 &audio_level,
425 &total_audio_energy,
zsteine76bd3a2017-07-14 12:17:49 -0700426 &echo_return_loss,
Steve Anton2dbc69f2017-08-24 17:15:13 -0700427 &echo_return_loss_enhancement,
428 &total_samples_received,
429 &total_samples_duration,
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200430 &concealed_samples,
Henrik Boström21e99da2019-08-21 12:09:51 +0200431 &silent_concealed_samples,
Ruslan Burakov8af88962018-11-22 17:21:10 +0100432 &concealment_events,
Henrik Boström21e99da2019-08-21 12:09:51 +0200433 &inserted_samples_for_deceleration,
434 &removed_samples_for_acceleration,
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100435 &jitter_buffer_flushes,
Sergey Silkin02371062019-01-31 16:45:42 +0100436 &delayed_packet_outage_samples,
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100437 &relative_packet_arrival_delay,
Artem Titove618cc92020-03-11 11:18:54 +0100438 &jitter_buffer_target_delay,
Henrik Lundin44125fa2019-04-29 17:00:46 +0200439 &interruption_count,
440 &total_interruption_duration,
Sergey Silkin02371062019-01-31 16:45:42 +0100441 &freeze_count,
442 &pause_count,
443 &total_freezes_duration,
444 &total_pauses_duration,
445 &total_frames_duration,
Nico Weber22f99252019-02-20 10:13:16 -0500446 &sum_squared_frame_durations)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700447// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800448
Yves Gerey665174f2018-06-19 15:03:05 +0200449RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(const std::string& id,
450 int64_t timestamp_us,
451 const char* kind)
452 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {}
hbos09bc1282016-11-08 06:29:22 -0800453
zsteine76bd3a2017-07-14 12:17:49 -0700454RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(std::string&& id,
455 int64_t timestamp_us,
456 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800457 : RTCStats(std::move(id), timestamp_us),
458 track_identifier("trackIdentifier"),
Henrik Boström646fda02019-05-22 15:49:42 +0200459 media_source_id("mediaSourceId"),
hbos09bc1282016-11-08 06:29:22 -0800460 remote_source("remoteSource"),
461 ended("ended"),
462 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800463 kind("kind", kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200464 jitter_buffer_delay("jitterBufferDelay"),
Chen Xing0acffb52019-01-15 15:46:29 +0100465 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
hbos09bc1282016-11-08 06:29:22 -0800466 frame_width("frameWidth"),
467 frame_height("frameHeight"),
468 frames_per_second("framesPerSecond"),
469 frames_sent("framesSent"),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100470 huge_frames_sent("hugeFramesSent"),
hbos09bc1282016-11-08 06:29:22 -0800471 frames_received("framesReceived"),
472 frames_decoded("framesDecoded"),
473 frames_dropped("framesDropped"),
474 frames_corrupted("framesCorrupted"),
475 partial_frames_lost("partialFramesLost"),
476 full_frames_lost("fullFramesLost"),
477 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700478 total_audio_energy("totalAudioEnergy"),
hbos09bc1282016-11-08 06:29:22 -0800479 echo_return_loss("echoReturnLoss"),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700480 echo_return_loss_enhancement("echoReturnLossEnhancement"),
481 total_samples_received("totalSamplesReceived"),
482 total_samples_duration("totalSamplesDuration"),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200483 concealed_samples("concealedSamples"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200484 silent_concealed_samples("silentConcealedSamples"),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100485 concealment_events("concealmentEvents"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200486 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
487 removed_samples_for_acceleration("removedSamplesForAcceleration"),
Jakob Ivarsson758d9462019-03-19 15:38:49 +0100488 jitter_buffer_flushes(
489 "jitterBufferFlushes",
490 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
491 delayed_packet_outage_samples(
492 "delayedPacketOutageSamples",
493 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
494 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
495 relative_packet_arrival_delay(
496 "relativePacketArrivalDelay",
497 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
Artem Titove618cc92020-03-11 11:18:54 +0100498 jitter_buffer_target_delay("jitterBufferTargetDelay"),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200499 interruption_count("interruptionCount"),
500 total_interruption_duration("totalInterruptionDuration"),
Sergey Silkin02371062019-01-31 16:45:42 +0100501 freeze_count("freezeCount"),
502 pause_count("pauseCount"),
503 total_freezes_duration("totalFreezesDuration"),
504 total_pauses_duration("totalPausesDuration"),
505 total_frames_duration("totalFramesDuration"),
506 sum_squared_frame_durations("sumOfSquaredFramesDuration") {
hbos160e4a72017-01-17 02:53:23 -0800507 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
508 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800509}
510
511RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
512 const RTCMediaStreamTrackStats& other)
513 : RTCStats(other.id(), other.timestamp_us()),
514 track_identifier(other.track_identifier),
Henrik Boström646fda02019-05-22 15:49:42 +0200515 media_source_id(other.media_source_id),
hbos09bc1282016-11-08 06:29:22 -0800516 remote_source(other.remote_source),
517 ended(other.ended),
518 detached(other.detached),
hbos160e4a72017-01-17 02:53:23 -0800519 kind(other.kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200520 jitter_buffer_delay(other.jitter_buffer_delay),
Chen Xing0acffb52019-01-15 15:46:29 +0100521 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
hbos09bc1282016-11-08 06:29:22 -0800522 frame_width(other.frame_width),
523 frame_height(other.frame_height),
524 frames_per_second(other.frames_per_second),
525 frames_sent(other.frames_sent),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100526 huge_frames_sent(other.huge_frames_sent),
hbos09bc1282016-11-08 06:29:22 -0800527 frames_received(other.frames_received),
528 frames_decoded(other.frames_decoded),
529 frames_dropped(other.frames_dropped),
530 frames_corrupted(other.frames_corrupted),
531 partial_frames_lost(other.partial_frames_lost),
532 full_frames_lost(other.full_frames_lost),
533 audio_level(other.audio_level),
zsteine76bd3a2017-07-14 12:17:49 -0700534 total_audio_energy(other.total_audio_energy),
hbos09bc1282016-11-08 06:29:22 -0800535 echo_return_loss(other.echo_return_loss),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700536 echo_return_loss_enhancement(other.echo_return_loss_enhancement),
537 total_samples_received(other.total_samples_received),
538 total_samples_duration(other.total_samples_duration),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200539 concealed_samples(other.concealed_samples),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200540 silent_concealed_samples(other.silent_concealed_samples),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100541 concealment_events(other.concealment_events),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200542 inserted_samples_for_deceleration(
543 other.inserted_samples_for_deceleration),
544 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100545 jitter_buffer_flushes(other.jitter_buffer_flushes),
Sergey Silkin02371062019-01-31 16:45:42 +0100546 delayed_packet_outage_samples(other.delayed_packet_outage_samples),
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100547 relative_packet_arrival_delay(other.relative_packet_arrival_delay),
Artem Titove618cc92020-03-11 11:18:54 +0100548 jitter_buffer_target_delay(other.jitter_buffer_target_delay),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200549 interruption_count(other.interruption_count),
550 total_interruption_duration(other.total_interruption_duration),
Sergey Silkin02371062019-01-31 16:45:42 +0100551 freeze_count(other.freeze_count),
552 pause_count(other.pause_count),
553 total_freezes_duration(other.total_freezes_duration),
554 total_pauses_duration(other.total_pauses_duration),
555 total_frames_duration(other.total_frames_duration),
556 sum_squared_frame_durations(other.sum_squared_frame_durations) {}
hbos09bc1282016-11-08 06:29:22 -0800557
Yves Gerey665174f2018-06-19 15:03:05 +0200558RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {}
hbos09bc1282016-11-08 06:29:22 -0800559
Steve Antond6a5cbd2017-08-18 09:40:25 -0700560// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700561WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
562 &data_channels_opened,
Nico Weber22f99252019-02-20 10:13:16 -0500563 &data_channels_closed)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700564// clang-format on
hbosd565b732016-08-30 14:04:35 -0700565
Yves Gerey665174f2018-06-19 15:03:05 +0200566RTCPeerConnectionStats::RTCPeerConnectionStats(const std::string& id,
567 int64_t timestamp_us)
568 : RTCPeerConnectionStats(std::string(id), timestamp_us) {}
hbosd565b732016-08-30 14:04:35 -0700569
Yves Gerey665174f2018-06-19 15:03:05 +0200570RTCPeerConnectionStats::RTCPeerConnectionStats(std::string&& id,
571 int64_t timestamp_us)
hbos0e6758d2016-08-31 07:57:36 -0700572 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700573 data_channels_opened("dataChannelsOpened"),
Yves Gerey665174f2018-06-19 15:03:05 +0200574 data_channels_closed("dataChannelsClosed") {}
hbosd565b732016-08-30 14:04:35 -0700575
hbosfc5e0502016-10-06 02:06:10 -0700576RTCPeerConnectionStats::RTCPeerConnectionStats(
577 const RTCPeerConnectionStats& other)
578 : RTCStats(other.id(), other.timestamp_us()),
579 data_channels_opened(other.data_channels_opened),
Yves Gerey665174f2018-06-19 15:03:05 +0200580 data_channels_closed(other.data_channels_closed) {}
hbosfc5e0502016-10-06 02:06:10 -0700581
Yves Gerey665174f2018-06-19 15:03:05 +0200582RTCPeerConnectionStats::~RTCPeerConnectionStats() {}
hbosfc5e0502016-10-06 02:06:10 -0700583
Steve Antond6a5cbd2017-08-18 09:40:25 -0700584// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700585WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
586 &ssrc,
Philipp Hancke3bc01662018-08-28 14:55:03 +0200587 &kind,
hbosb0ae9202017-01-27 06:35:16 -0800588 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700589 &transport_id,
590 &codec_id,
Di Wufd1e9d12021-03-09 09:25:28 -0800591 &media_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700592// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700593
Yves Gerey665174f2018-06-19 15:03:05 +0200594RTCRTPStreamStats::RTCRTPStreamStats(const std::string& id,
595 int64_t timestamp_us)
596 : RTCRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700597
Yves Gerey665174f2018-06-19 15:03:05 +0200598RTCRTPStreamStats::RTCRTPStreamStats(std::string&& id, int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700599 : RTCStats(std::move(id), timestamp_us),
600 ssrc("ssrc"),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200601 kind("kind"),
hbosb0ae9202017-01-27 06:35:16 -0800602 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700603 transport_id("transportId"),
604 codec_id("codecId"),
Di Wufd1e9d12021-03-09 09:25:28 -0800605 media_type("mediaType") {}
hbos6ded1902016-11-01 01:50:46 -0700606
Yves Gerey665174f2018-06-19 15:03:05 +0200607RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other)
hbos6ded1902016-11-01 01:50:46 -0700608 : RTCStats(other.id(), other.timestamp_us()),
609 ssrc(other.ssrc),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200610 kind(other.kind),
hbosb0ae9202017-01-27 06:35:16 -0800611 track_id(other.track_id),
hbos6ded1902016-11-01 01:50:46 -0700612 transport_id(other.transport_id),
613 codec_id(other.codec_id),
Di Wufd1e9d12021-03-09 09:25:28 -0800614 media_type(other.media_type) {}
hbos6ded1902016-11-01 01:50:46 -0700615
Yves Gerey665174f2018-06-19 15:03:05 +0200616RTCRTPStreamStats::~RTCRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700617
Steve Antond6a5cbd2017-08-18 09:40:25 -0700618// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700619WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800620 RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp",
621 &jitter,
Minyue Li28a2c632021-07-07 15:53:38 +0200622 &packets_lost,
623 &packets_discarded)
Di Wufd1e9d12021-03-09 09:25:28 -0800624// clang-format on
625
626RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(const std::string&& id,
627 int64_t timestamp_us)
628 : RTCReceivedRtpStreamStats(std::string(id), timestamp_us) {}
629
630RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string&& id,
631 int64_t timestamp_us)
632 : RTCRTPStreamStats(std::move(id), timestamp_us),
633 jitter("jitter"),
Minyue Li28a2c632021-07-07 15:53:38 +0200634 packets_lost("packetsLost"),
635 packets_discarded("packetsDiscarded") {}
Di Wufd1e9d12021-03-09 09:25:28 -0800636
637RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(
638 const RTCReceivedRtpStreamStats& other)
639 : RTCRTPStreamStats(other),
640 jitter(other.jitter),
Minyue Li28a2c632021-07-07 15:53:38 +0200641 packets_lost(other.packets_lost),
642 packets_discarded(other.packets_discarded) {}
Di Wufd1e9d12021-03-09 09:25:28 -0800643
644RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {}
645
646// clang-format off
647WEBRTC_RTCSTATS_IMPL(
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100648 RTCSentRtpStreamStats, RTCRTPStreamStats, "sent-rtp",
649 &packets_sent,
650 &bytes_sent)
651// clang-format on
652
653RTCSentRtpStreamStats::RTCSentRtpStreamStats(const std::string&& id,
654 int64_t timestamp_us)
655 : RTCSentRtpStreamStats(std::string(id), timestamp_us) {}
656
657RTCSentRtpStreamStats::RTCSentRtpStreamStats(std::string&& id,
658 int64_t timestamp_us)
659 : RTCRTPStreamStats(std::move(id), timestamp_us),
660 packets_sent("packetsSent"),
661 bytes_sent("bytesSent") {}
662
663RTCSentRtpStreamStats::RTCSentRtpStreamStats(const RTCSentRtpStreamStats& other)
664 : RTCRTPStreamStats(other),
665 packets_sent(other.packets_sent),
666 bytes_sent(other.bytes_sent) {}
667
668RTCSentRtpStreamStats::~RTCSentRtpStreamStats() {}
669
670// clang-format off
671WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800672 RTCInboundRTPStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp",
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100673 &remote_id,
hboseeafe942016-11-01 03:00:17 -0700674 &packets_received,
Henrik Boström4a5dab02020-01-28 11:15:35 +0100675 &fec_packets_received,
676 &fec_packets_discarded,
hboseeafe942016-11-01 03:00:17 -0700677 &bytes_received,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200678 &header_bytes_received,
Henrik Boström01738c62019-04-15 17:32:00 +0200679 &last_packet_received_timestamp,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300680 &jitter_buffer_delay,
681 &jitter_buffer_emitted_count,
682 &total_samples_received,
683 &concealed_samples,
684 &silent_concealed_samples,
685 &concealment_events,
686 &inserted_samples_for_deceleration,
687 &removed_samples_for_acceleration,
688 &audio_level,
689 &total_audio_energy,
690 &total_samples_duration,
hbosa7a9be12017-03-01 01:02:45 -0800691 &round_trip_time,
hboseeafe942016-11-01 03:00:17 -0700692 &packets_repaired,
693 &burst_packets_lost,
694 &burst_packets_discarded,
695 &burst_loss_count,
696 &burst_discard_count,
697 &burst_loss_rate,
698 &burst_discard_rate,
699 &gap_loss_rate,
hbos6769c492017-01-02 08:35:13 -0800700 &gap_discard_rate,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200701 &frames_received,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300702 &frame_width,
703 &frame_height,
704 &frame_bit_depth,
705 &frames_per_second,
Henrik Boström2e069262019-04-09 13:59:31 +0200706 &frames_decoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200707 &key_frames_decoded,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300708 &frames_dropped,
Johannes Kronbfd343b2019-07-01 10:07:50 +0200709 &total_decode_time,
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200710 &total_processing_delay,
Johannes Kron00376e12019-11-25 10:25:42 +0100711 &total_inter_frame_delay,
712 &total_squared_inter_frame_delay,
Henrik Boström6b430862019-08-16 13:09:51 +0200713 &content_type,
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200714 &estimated_playout_timestamp,
Di Wufd1e9d12021-03-09 09:25:28 -0800715 &decoder_implementation,
716 &fir_count,
717 &pli_count,
718 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700719 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700720// clang-format on
hboseeafe942016-11-01 03:00:17 -0700721
Yves Gerey665174f2018-06-19 15:03:05 +0200722RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
723 int64_t timestamp_us)
724 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {}
hboseeafe942016-11-01 03:00:17 -0700725
Yves Gerey665174f2018-06-19 15:03:05 +0200726RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
727 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800728 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100729 remote_id("remoteId"),
hboseeafe942016-11-01 03:00:17 -0700730 packets_received("packetsReceived"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200731 fec_packets_received("fecPacketsReceived"),
732 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700733 bytes_received("bytesReceived"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200734 header_bytes_received("headerBytesReceived"),
Henrik Boström01738c62019-04-15 17:32:00 +0200735 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300736 jitter_buffer_delay("jitterBufferDelay"),
737 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
738 total_samples_received("totalSamplesReceived"),
739 concealed_samples("concealedSamples"),
740 silent_concealed_samples("silentConcealedSamples"),
741 concealment_events("concealmentEvents"),
742 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
743 removed_samples_for_acceleration("removedSamplesForAcceleration"),
744 audio_level("audioLevel"),
745 total_audio_energy("totalAudioEnergy"),
746 total_samples_duration("totalSamplesDuration"),
hbosa7a9be12017-03-01 01:02:45 -0800747 round_trip_time("roundTripTime"),
hboseeafe942016-11-01 03:00:17 -0700748 packets_repaired("packetsRepaired"),
749 burst_packets_lost("burstPacketsLost"),
750 burst_packets_discarded("burstPacketsDiscarded"),
751 burst_loss_count("burstLossCount"),
752 burst_discard_count("burstDiscardCount"),
753 burst_loss_rate("burstLossRate"),
754 burst_discard_rate("burstDiscardRate"),
755 gap_loss_rate("gapLossRate"),
hbos6769c492017-01-02 08:35:13 -0800756 gap_discard_rate("gapDiscardRate"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200757 frames_received("framesReceived"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300758 frame_width("frameWidth"),
759 frame_height("frameHeight"),
760 frame_bit_depth("frameBitDepth"),
761 frames_per_second("framesPerSecond"),
Henrik Boström2e069262019-04-09 13:59:31 +0200762 frames_decoded("framesDecoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200763 key_frames_decoded("keyFramesDecoded"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300764 frames_dropped("framesDropped"),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200765 total_decode_time("totalDecodeTime"),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200766 total_processing_delay("totalProcessingDelay"),
Johannes Kron00376e12019-11-25 10:25:42 +0100767 total_inter_frame_delay("totalInterFrameDelay"),
768 total_squared_inter_frame_delay("totalSquaredInterFrameDelay"),
Henrik Boström6b430862019-08-16 13:09:51 +0200769 content_type("contentType"),
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200770 estimated_playout_timestamp("estimatedPlayoutTimestamp"),
Di Wufd1e9d12021-03-09 09:25:28 -0800771 decoder_implementation("decoderImplementation"),
772 fir_count("firCount"),
773 pli_count("pliCount"),
774 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700775 qp_sum("qpSum") {}
hboseeafe942016-11-01 03:00:17 -0700776
777RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
778 const RTCInboundRTPStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800779 : RTCReceivedRtpStreamStats(other),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100780 remote_id(other.remote_id),
hboseeafe942016-11-01 03:00:17 -0700781 packets_received(other.packets_received),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200782 fec_packets_received(other.fec_packets_received),
783 fec_packets_discarded(other.fec_packets_discarded),
hboseeafe942016-11-01 03:00:17 -0700784 bytes_received(other.bytes_received),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200785 header_bytes_received(other.header_bytes_received),
Henrik Boström01738c62019-04-15 17:32:00 +0200786 last_packet_received_timestamp(other.last_packet_received_timestamp),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300787 jitter_buffer_delay(other.jitter_buffer_delay),
788 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
789 total_samples_received(other.total_samples_received),
790 concealed_samples(other.concealed_samples),
791 silent_concealed_samples(other.silent_concealed_samples),
792 concealment_events(other.concealment_events),
793 inserted_samples_for_deceleration(
794 other.inserted_samples_for_deceleration),
795 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
796 audio_level(other.audio_level),
797 total_audio_energy(other.total_audio_energy),
798 total_samples_duration(other.total_samples_duration),
hbosa7a9be12017-03-01 01:02:45 -0800799 round_trip_time(other.round_trip_time),
hboseeafe942016-11-01 03:00:17 -0700800 packets_repaired(other.packets_repaired),
801 burst_packets_lost(other.burst_packets_lost),
802 burst_packets_discarded(other.burst_packets_discarded),
803 burst_loss_count(other.burst_loss_count),
804 burst_discard_count(other.burst_discard_count),
805 burst_loss_rate(other.burst_loss_rate),
806 burst_discard_rate(other.burst_discard_rate),
807 gap_loss_rate(other.gap_loss_rate),
hbos6769c492017-01-02 08:35:13 -0800808 gap_discard_rate(other.gap_discard_rate),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200809 frames_received(other.frames_received),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300810 frame_width(other.frame_width),
811 frame_height(other.frame_height),
812 frame_bit_depth(other.frame_bit_depth),
813 frames_per_second(other.frames_per_second),
Henrik Boström2e069262019-04-09 13:59:31 +0200814 frames_decoded(other.frames_decoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200815 key_frames_decoded(other.key_frames_decoded),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300816 frames_dropped(other.frames_dropped),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200817 total_decode_time(other.total_decode_time),
Philipp Hanckea16a6a62022-04-25 12:21:30 +0200818 total_processing_delay(other.total_processing_delay),
Johannes Kron00376e12019-11-25 10:25:42 +0100819 total_inter_frame_delay(other.total_inter_frame_delay),
820 total_squared_inter_frame_delay(other.total_squared_inter_frame_delay),
Henrik Boström6b430862019-08-16 13:09:51 +0200821 content_type(other.content_type),
Ă…sa Perssonfcf79cc2019-10-22 15:23:44 +0200822 estimated_playout_timestamp(other.estimated_playout_timestamp),
Di Wufd1e9d12021-03-09 09:25:28 -0800823 decoder_implementation(other.decoder_implementation),
824 fir_count(other.fir_count),
825 pli_count(other.pli_count),
826 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700827 qp_sum(other.qp_sum) {}
hboseeafe942016-11-01 03:00:17 -0700828
Yves Gerey665174f2018-06-19 15:03:05 +0200829RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700830
Steve Antond6a5cbd2017-08-18 09:40:25 -0700831// clang-format off
hboseeafe942016-11-01 03:00:17 -0700832WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700833 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200834 &media_source_id,
Henrik Boström4f40fa52019-12-19 13:27:27 +0100835 &remote_id,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200836 &rid,
hbos6ded1902016-11-01 01:50:46 -0700837 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200838 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700839 &bytes_sent,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200840 &header_bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200841 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700842 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200843 &frames_encoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200844 &key_frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200845 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200846 &total_encoded_bytes_target,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200847 &frame_width,
848 &frame_height,
849 &frames_per_second,
850 &frames_sent,
851 &huge_frames_sent,
Henrik Boström9fe18342019-05-16 18:38:20 +0200852 &total_packet_send_delay,
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200853 &quality_limitation_reason,
Byoungchan Lee7d235352021-05-28 21:32:04 +0900854 &quality_limitation_durations,
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200855 &quality_limitation_resolution_changes,
Henrik Boström6b430862019-08-16 13:09:51 +0200856 &content_type,
Di Wufd1e9d12021-03-09 09:25:28 -0800857 &encoder_implementation,
858 &fir_count,
859 &pli_count,
860 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700861 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700862// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700863
Yves Gerey665174f2018-06-19 15:03:05 +0200864RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id,
865 int64_t timestamp_us)
866 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700867
Yves Gerey665174f2018-06-19 15:03:05 +0200868RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id,
869 int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700870 : RTCRTPStreamStats(std::move(id), timestamp_us),
Henrik Boström646fda02019-05-22 15:49:42 +0200871 media_source_id("mediaSourceId"),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100872 remote_id("remoteId"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200873 rid("rid"),
hbos6ded1902016-11-01 01:50:46 -0700874 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200875 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700876 bytes_sent("bytesSent"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200877 header_bytes_sent("headerBytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200878 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700879 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200880 frames_encoded("framesEncoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200881 key_frames_encoded("keyFramesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200882 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200883 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200884 frame_width("frameWidth"),
885 frame_height("frameHeight"),
886 frames_per_second("framesPerSecond"),
887 frames_sent("framesSent"),
888 huge_frames_sent("hugeFramesSent"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200889 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200890 quality_limitation_reason("qualityLimitationReason"),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900891 quality_limitation_durations("qualityLimitationDurations"),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200892 quality_limitation_resolution_changes(
893 "qualityLimitationResolutionChanges"),
Henrik Boström6b430862019-08-16 13:09:51 +0200894 content_type("contentType"),
Di Wufd1e9d12021-03-09 09:25:28 -0800895 encoder_implementation("encoderImplementation"),
896 fir_count("firCount"),
897 pli_count("pliCount"),
898 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700899 qp_sum("qpSum") {}
hbos6ded1902016-11-01 01:50:46 -0700900
901RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
902 const RTCOutboundRTPStreamStats& other)
903 : RTCRTPStreamStats(other),
Henrik Boström646fda02019-05-22 15:49:42 +0200904 media_source_id(other.media_source_id),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100905 remote_id(other.remote_id),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200906 rid(other.rid),
hbos6ded1902016-11-01 01:50:46 -0700907 packets_sent(other.packets_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200908 retransmitted_packets_sent(other.retransmitted_packets_sent),
hbos6ded1902016-11-01 01:50:46 -0700909 bytes_sent(other.bytes_sent),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200910 header_bytes_sent(other.header_bytes_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200911 retransmitted_bytes_sent(other.retransmitted_bytes_sent),
hbos6ded1902016-11-01 01:50:46 -0700912 target_bitrate(other.target_bitrate),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200913 frames_encoded(other.frames_encoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200914 key_frames_encoded(other.key_frames_encoded),
Henrik Boström2e069262019-04-09 13:59:31 +0200915 total_encode_time(other.total_encode_time),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200916 total_encoded_bytes_target(other.total_encoded_bytes_target),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200917 frame_width(other.frame_width),
918 frame_height(other.frame_height),
919 frames_per_second(other.frames_per_second),
920 frames_sent(other.frames_sent),
921 huge_frames_sent(other.huge_frames_sent),
Henrik Boström9fe18342019-05-16 18:38:20 +0200922 total_packet_send_delay(other.total_packet_send_delay),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200923 quality_limitation_reason(other.quality_limitation_reason),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900924 quality_limitation_durations(other.quality_limitation_durations),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200925 quality_limitation_resolution_changes(
926 other.quality_limitation_resolution_changes),
Henrik Boström6b430862019-08-16 13:09:51 +0200927 content_type(other.content_type),
Di Wufd1e9d12021-03-09 09:25:28 -0800928 encoder_implementation(other.encoder_implementation),
929 fir_count(other.fir_count),
930 pli_count(other.pli_count),
931 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700932 qp_sum(other.qp_sum) {}
hbos6ded1902016-11-01 01:50:46 -0700933
Yves Gerey665174f2018-06-19 15:03:05 +0200934RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700935
Steve Antond6a5cbd2017-08-18 09:40:25 -0700936// clang-format off
Henrik Boström883eefc2019-05-27 13:40:25 +0200937WEBRTC_RTCSTATS_IMPL(
Henrik Boström2f71b612021-03-23 15:18:55 +0100938 RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
939 "remote-inbound-rtp",
Henrik Boström883eefc2019-05-27 13:40:25 +0200940 &local_id,
Di Wu86f04ad2021-02-28 23:36:03 -0800941 &round_trip_time,
Di Wu88a51b22021-03-01 11:22:06 -0800942 &fraction_lost,
943 &total_round_trip_time,
944 &round_trip_time_measurements)
Henrik Boström883eefc2019-05-27 13:40:25 +0200945// clang-format on
946
947RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
948 const std::string& id,
949 int64_t timestamp_us)
950 : RTCRemoteInboundRtpStreamStats(std::string(id), timestamp_us) {}
951
952RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
953 std::string&& id,
954 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800955 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boström883eefc2019-05-27 13:40:25 +0200956 local_id("localId"),
Di Wu86f04ad2021-02-28 23:36:03 -0800957 round_trip_time("roundTripTime"),
Di Wu88a51b22021-03-01 11:22:06 -0800958 fraction_lost("fractionLost"),
959 total_round_trip_time("totalRoundTripTime"),
960 round_trip_time_measurements("roundTripTimeMeasurements") {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200961
962RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
963 const RTCRemoteInboundRtpStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800964 : RTCReceivedRtpStreamStats(other),
Henrik Boström883eefc2019-05-27 13:40:25 +0200965 local_id(other.local_id),
Di Wu86f04ad2021-02-28 23:36:03 -0800966 round_trip_time(other.round_trip_time),
Di Wu88a51b22021-03-01 11:22:06 -0800967 fraction_lost(other.fraction_lost),
968 total_round_trip_time(other.total_round_trip_time),
969 round_trip_time_measurements(other.round_trip_time_measurements) {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200970
971RTCRemoteInboundRtpStreamStats::~RTCRemoteInboundRtpStreamStats() {}
972
973// clang-format off
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100974WEBRTC_RTCSTATS_IMPL(
975 RTCRemoteOutboundRtpStreamStats, RTCSentRtpStreamStats,
976 "remote-outbound-rtp",
977 &local_id,
978 &remote_timestamp,
Ivo Creusen2562cf02021-09-03 14:51:22 +0000979 &reports_sent,
980 &round_trip_time,
981 &round_trip_time_measurements,
982 &total_round_trip_time)
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100983// clang-format on
984
985RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
986 const std::string& id,
987 int64_t timestamp_us)
988 : RTCRemoteOutboundRtpStreamStats(std::string(id), timestamp_us) {}
989
990RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
991 std::string&& id,
992 int64_t timestamp_us)
993 : RTCSentRtpStreamStats(std::move(id), timestamp_us),
994 local_id("localId"),
995 remote_timestamp("remoteTimestamp"),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000996 reports_sent("reportsSent"),
997 round_trip_time("roundTripTime"),
998 round_trip_time_measurements("roundTripTimeMeasurements"),
999 total_round_trip_time("totalRoundTripTime") {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +01001000
1001RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
1002 const RTCRemoteOutboundRtpStreamStats& other)
1003 : RTCSentRtpStreamStats(other),
1004 local_id(other.local_id),
1005 remote_timestamp(other.remote_timestamp),
Ivo Creusen2562cf02021-09-03 14:51:22 +00001006 reports_sent(other.reports_sent),
1007 round_trip_time(other.round_trip_time),
1008 round_trip_time_measurements(other.round_trip_time_measurements),
1009 total_round_trip_time(other.total_round_trip_time) {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +01001010
1011RTCRemoteOutboundRtpStreamStats::~RTCRemoteOutboundRtpStreamStats() {}
1012
1013// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +02001014WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
1015 &track_identifier,
1016 &kind)
1017// clang-format on
1018
1019RTCMediaSourceStats::RTCMediaSourceStats(const std::string& id,
1020 int64_t timestamp_us)
1021 : RTCMediaSourceStats(std::string(id), timestamp_us) {}
1022
1023RTCMediaSourceStats::RTCMediaSourceStats(std::string&& id, int64_t timestamp_us)
1024 : RTCStats(std::move(id), timestamp_us),
1025 track_identifier("trackIdentifier"),
1026 kind("kind") {}
1027
1028RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other)
1029 : RTCStats(other.id(), other.timestamp_us()),
1030 track_identifier(other.track_identifier),
1031 kind(other.kind) {}
1032
1033RTCMediaSourceStats::~RTCMediaSourceStats() {}
1034
1035// clang-format off
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001036WEBRTC_RTCSTATS_IMPL(RTCAudioSourceStats, RTCMediaSourceStats, "media-source",
1037 &audio_level,
1038 &total_audio_energy,
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001039 &total_samples_duration,
1040 &echo_return_loss,
1041 &echo_return_loss_enhancement)
Henrik Boström646fda02019-05-22 15:49:42 +02001042// clang-format on
1043
1044RTCAudioSourceStats::RTCAudioSourceStats(const std::string& id,
1045 int64_t timestamp_us)
1046 : RTCAudioSourceStats(std::string(id), timestamp_us) {}
1047
1048RTCAudioSourceStats::RTCAudioSourceStats(std::string&& id, int64_t timestamp_us)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001049 : RTCMediaSourceStats(std::move(id), timestamp_us),
1050 audio_level("audioLevel"),
1051 total_audio_energy("totalAudioEnergy"),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001052 total_samples_duration("totalSamplesDuration"),
1053 echo_return_loss("echoReturnLoss"),
1054 echo_return_loss_enhancement("echoReturnLossEnhancement") {}
Henrik Boström646fda02019-05-22 15:49:42 +02001055
1056RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001057 : RTCMediaSourceStats(other),
1058 audio_level(other.audio_level),
1059 total_audio_energy(other.total_audio_energy),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001060 total_samples_duration(other.total_samples_duration),
1061 echo_return_loss(other.echo_return_loss),
1062 echo_return_loss_enhancement(other.echo_return_loss_enhancement) {}
Henrik Boström646fda02019-05-22 15:49:42 +02001063
1064RTCAudioSourceStats::~RTCAudioSourceStats() {}
1065
1066// clang-format off
1067WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
1068 &width,
1069 &height,
1070 &frames,
1071 &frames_per_second)
1072// clang-format on
1073
1074RTCVideoSourceStats::RTCVideoSourceStats(const std::string& id,
1075 int64_t timestamp_us)
1076 : RTCVideoSourceStats(std::string(id), timestamp_us) {}
1077
1078RTCVideoSourceStats::RTCVideoSourceStats(std::string&& id, int64_t timestamp_us)
1079 : RTCMediaSourceStats(std::move(id), timestamp_us),
1080 width("width"),
1081 height("height"),
1082 frames("frames"),
1083 frames_per_second("framesPerSecond") {}
1084
1085RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other)
1086 : RTCMediaSourceStats(other),
1087 width(other.width),
1088 height(other.height),
1089 frames(other.frames),
1090 frames_per_second(other.frames_per_second) {}
1091
1092RTCVideoSourceStats::~RTCVideoSourceStats() {}
1093
1094// clang-format off
hbos2fa7c672016-10-24 04:00:05 -07001095WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
1096 &bytes_sent,
Artem Titovedacbd52020-07-06 16:06:37 +02001097 &packets_sent,
hbos2fa7c672016-10-24 04:00:05 -07001098 &bytes_received,
Artem Titovedacbd52020-07-06 16:06:37 +02001099 &packets_received,
hbos2fa7c672016-10-24 04:00:05 -07001100 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -08001101 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -07001102 &selected_candidate_pair_id,
1103 &local_certificate_id,
Jonas Oreland149dc722019-08-28 08:10:27 +02001104 &remote_certificate_id,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001105 &tls_version,
1106 &dtls_cipher,
Philipp Hancke69c1df22022-04-22 15:46:24 +02001107 &dtls_role,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001108 &srtp_cipher,
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001109 &selected_candidate_pair_changes,
Philipp Hancke95b1a342022-05-05 07:53:54 +02001110 &ice_role,
Philipp Hancke1f491572022-05-09 17:43:31 +02001111 &ice_local_username_fragment,
1112 &ice_state)
Steve Antond6a5cbd2017-08-18 09:40:25 -07001113// clang-format on
hbos2fa7c672016-10-24 04:00:05 -07001114
Yves Gerey665174f2018-06-19 15:03:05 +02001115RTCTransportStats::RTCTransportStats(const std::string& id,
1116 int64_t timestamp_us)
1117 : RTCTransportStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -07001118
Yves Gerey665174f2018-06-19 15:03:05 +02001119RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -07001120 : RTCStats(std::move(id), timestamp_us),
1121 bytes_sent("bytesSent"),
Artem Titovedacbd52020-07-06 16:06:37 +02001122 packets_sent("packetsSent"),
hbos2fa7c672016-10-24 04:00:05 -07001123 bytes_received("bytesReceived"),
Artem Titovedacbd52020-07-06 16:06:37 +02001124 packets_received("packetsReceived"),
hbos2fa7c672016-10-24 04:00:05 -07001125 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -08001126 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -07001127 selected_candidate_pair_id("selectedCandidatePairId"),
1128 local_certificate_id("localCertificateId"),
Jonas Oreland149dc722019-08-28 08:10:27 +02001129 remote_certificate_id("remoteCertificateId"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001130 tls_version("tlsVersion"),
1131 dtls_cipher("dtlsCipher"),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001132 dtls_role("dtlsRole"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001133 srtp_cipher("srtpCipher"),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001134 selected_candidate_pair_changes("selectedCandidatePairChanges"),
Philipp Hancke95b1a342022-05-05 07:53:54 +02001135 ice_role("iceRole"),
Philipp Hancke1f491572022-05-09 17:43:31 +02001136 ice_local_username_fragment("iceLocalUsernameFragment"),
1137 ice_state("iceState") {}
hbos2fa7c672016-10-24 04:00:05 -07001138
Yves Gerey665174f2018-06-19 15:03:05 +02001139RTCTransportStats::RTCTransportStats(const RTCTransportStats& other)
hbos2fa7c672016-10-24 04:00:05 -07001140 : RTCStats(other.id(), other.timestamp_us()),
1141 bytes_sent(other.bytes_sent),
Artem Titovedacbd52020-07-06 16:06:37 +02001142 packets_sent(other.packets_sent),
hbos2fa7c672016-10-24 04:00:05 -07001143 bytes_received(other.bytes_received),
Artem Titovedacbd52020-07-06 16:06:37 +02001144 packets_received(other.packets_received),
hbos2fa7c672016-10-24 04:00:05 -07001145 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -08001146 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -07001147 selected_candidate_pair_id(other.selected_candidate_pair_id),
1148 local_certificate_id(other.local_certificate_id),
Jonas Oreland149dc722019-08-28 08:10:27 +02001149 remote_certificate_id(other.remote_certificate_id),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001150 tls_version(other.tls_version),
1151 dtls_cipher(other.dtls_cipher),
Philipp Hancke69c1df22022-04-22 15:46:24 +02001152 dtls_role(other.dtls_role),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001153 srtp_cipher(other.srtp_cipher),
Philipp Hanckecc1b9b02022-05-04 18:58:26 +02001154 selected_candidate_pair_changes(other.selected_candidate_pair_changes),
Philipp Hancke95b1a342022-05-05 07:53:54 +02001155 ice_role(other.ice_role),
Philipp Hancke1f491572022-05-09 17:43:31 +02001156 ice_local_username_fragment(other.ice_local_username_fragment),
1157 ice_state(other.ice_state) {}
hbos2fa7c672016-10-24 04:00:05 -07001158
Yves Gerey665174f2018-06-19 15:03:05 +02001159RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -07001160
hbosd565b732016-08-30 14:04:35 -07001161} // namespace webrtc