blob: 961d17c7eb64bdd2aefad7ca8d4b1531c6e5ab78 [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
Steve Antond6a5cbd2017-08-18 09:40:25 -070065// clang-format off
hbos2fa7c672016-10-24 04:00:05 -070066WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate",
67 &fingerprint,
68 &fingerprint_algorithm,
69 &base64_certificate,
Nico Weber22f99252019-02-20 10:13:16 -050070 &issuer_certificate_id)
Steve Antond6a5cbd2017-08-18 09:40:25 -070071// clang-format on
hbos2fa7c672016-10-24 04:00:05 -070072
Yves Gerey665174f2018-06-19 15:03:05 +020073RTCCertificateStats::RTCCertificateStats(const std::string& id,
74 int64_t timestamp_us)
75 : RTCCertificateStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -070076
Yves Gerey665174f2018-06-19 15:03:05 +020077RTCCertificateStats::RTCCertificateStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -070078 : RTCStats(std::move(id), timestamp_us),
79 fingerprint("fingerprint"),
80 fingerprint_algorithm("fingerprintAlgorithm"),
81 base64_certificate("base64Certificate"),
Yves Gerey665174f2018-06-19 15:03:05 +020082 issuer_certificate_id("issuerCertificateId") {}
hbos2fa7c672016-10-24 04:00:05 -070083
Yves Gerey665174f2018-06-19 15:03:05 +020084RTCCertificateStats::RTCCertificateStats(const RTCCertificateStats& other)
hbos2fa7c672016-10-24 04:00:05 -070085 : RTCStats(other.id(), other.timestamp_us()),
86 fingerprint(other.fingerprint),
87 fingerprint_algorithm(other.fingerprint_algorithm),
88 base64_certificate(other.base64_certificate),
Yves Gerey665174f2018-06-19 15:03:05 +020089 issuer_certificate_id(other.issuer_certificate_id) {}
hbos2fa7c672016-10-24 04:00:05 -070090
Yves Gerey665174f2018-06-19 15:03:05 +020091RTCCertificateStats::~RTCCertificateStats() {}
hbos2fa7c672016-10-24 04:00:05 -070092
Steve Antond6a5cbd2017-08-18 09:40:25 -070093// clang-format off
hbos0adb8282016-11-23 02:32:06 -080094WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec",
Philipp Hancke95157a02020-11-16 20:08:27 +010095 &transport_id,
hbos0adb8282016-11-23 02:32:06 -080096 &payload_type,
hbos13f54b22017-02-28 06:56:04 -080097 &mime_type,
hbos0adb8282016-11-23 02:32:06 -080098 &clock_rate,
99 &channels,
Henrik Boström6b430862019-08-16 13:09:51 +0200100 &sdp_fmtp_line)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700101// clang-format on
hbos0adb8282016-11-23 02:32:06 -0800102
Yves Gerey665174f2018-06-19 15:03:05 +0200103RTCCodecStats::RTCCodecStats(const std::string& id, int64_t timestamp_us)
104 : RTCCodecStats(std::string(id), timestamp_us) {}
hbos0adb8282016-11-23 02:32:06 -0800105
Yves Gerey665174f2018-06-19 15:03:05 +0200106RTCCodecStats::RTCCodecStats(std::string&& id, int64_t timestamp_us)
hbos0adb8282016-11-23 02:32:06 -0800107 : RTCStats(std::move(id), timestamp_us),
Philipp Hancke95157a02020-11-16 20:08:27 +0100108 transport_id("transportId"),
hbos0adb8282016-11-23 02:32:06 -0800109 payload_type("payloadType"),
hbos13f54b22017-02-28 06:56:04 -0800110 mime_type("mimeType"),
hbos0adb8282016-11-23 02:32:06 -0800111 clock_rate("clockRate"),
112 channels("channels"),
Henrik Boström6b430862019-08-16 13:09:51 +0200113 sdp_fmtp_line("sdpFmtpLine") {}
hbos0adb8282016-11-23 02:32:06 -0800114
Yves Gerey665174f2018-06-19 15:03:05 +0200115RTCCodecStats::RTCCodecStats(const RTCCodecStats& other)
hbos0adb8282016-11-23 02:32:06 -0800116 : RTCStats(other.id(), other.timestamp_us()),
Philipp Hancke95157a02020-11-16 20:08:27 +0100117 transport_id(other.transport_id),
hbos0adb8282016-11-23 02:32:06 -0800118 payload_type(other.payload_type),
hbos13f54b22017-02-28 06:56:04 -0800119 mime_type(other.mime_type),
hbos0adb8282016-11-23 02:32:06 -0800120 clock_rate(other.clock_rate),
121 channels(other.channels),
Henrik Boström6b430862019-08-16 13:09:51 +0200122 sdp_fmtp_line(other.sdp_fmtp_line) {}
hbos0adb8282016-11-23 02:32:06 -0800123
Yves Gerey665174f2018-06-19 15:03:05 +0200124RTCCodecStats::~RTCCodecStats() {}
hbos0adb8282016-11-23 02:32:06 -0800125
Steve Antond6a5cbd2017-08-18 09:40:25 -0700126// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700127WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel",
128 &label,
129 &protocol,
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200130 &data_channel_identifier,
hbos2fa7c672016-10-24 04:00:05 -0700131 &state,
132 &messages_sent,
133 &bytes_sent,
134 &messages_received,
Nico Weber22f99252019-02-20 10:13:16 -0500135 &bytes_received)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700136// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700137
Yves Gerey665174f2018-06-19 15:03:05 +0200138RTCDataChannelStats::RTCDataChannelStats(const std::string& id,
139 int64_t timestamp_us)
140 : RTCDataChannelStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -0700141
Yves Gerey665174f2018-06-19 15:03:05 +0200142RTCDataChannelStats::RTCDataChannelStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -0700143 : RTCStats(std::move(id), timestamp_us),
144 label("label"),
145 protocol("protocol"),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200146 data_channel_identifier("dataChannelIdentifier"),
hbos2fa7c672016-10-24 04:00:05 -0700147 state("state"),
148 messages_sent("messagesSent"),
149 bytes_sent("bytesSent"),
150 messages_received("messagesReceived"),
Yves Gerey665174f2018-06-19 15:03:05 +0200151 bytes_received("bytesReceived") {}
hbos2fa7c672016-10-24 04:00:05 -0700152
Yves Gerey665174f2018-06-19 15:03:05 +0200153RTCDataChannelStats::RTCDataChannelStats(const RTCDataChannelStats& other)
hbos2fa7c672016-10-24 04:00:05 -0700154 : RTCStats(other.id(), other.timestamp_us()),
155 label(other.label),
156 protocol(other.protocol),
Harald Alvestrand10ef8472020-06-05 15:38:51 +0200157 data_channel_identifier(other.data_channel_identifier),
hbos2fa7c672016-10-24 04:00:05 -0700158 state(other.state),
159 messages_sent(other.messages_sent),
160 bytes_sent(other.bytes_sent),
161 messages_received(other.messages_received),
Yves Gerey665174f2018-06-19 15:03:05 +0200162 bytes_received(other.bytes_received) {}
hbos2fa7c672016-10-24 04:00:05 -0700163
Yves Gerey665174f2018-06-19 15:03:05 +0200164RTCDataChannelStats::~RTCDataChannelStats() {}
hbos2fa7c672016-10-24 04:00:05 -0700165
Steve Antond6a5cbd2017-08-18 09:40:25 -0700166// clang-format off
hbosc47a0c32016-10-11 14:54:49 -0700167WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair",
168 &transport_id,
169 &local_candidate_id,
170 &remote_candidate_id,
171 &state,
172 &priority,
173 &nominated,
174 &writable,
175 &readable,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700176 &packets_sent,
177 &packets_received,
hbosc47a0c32016-10-11 14:54:49 -0700178 &bytes_sent,
179 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800180 &total_round_trip_time,
181 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700182 &available_outgoing_bitrate,
183 &available_incoming_bitrate,
184 &requests_received,
185 &requests_sent,
186 &responses_received,
187 &responses_sent,
188 &retransmissions_received,
189 &retransmissions_sent,
190 &consent_requests_received,
191 &consent_requests_sent,
192 &consent_responses_received,
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700193 &consent_responses_sent,
194 &packets_discarded_on_send,
195 &bytes_discarded_on_send)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700196// clang-format on
hbosc47a0c32016-10-11 14:54:49 -0700197
Yves Gerey665174f2018-06-19 15:03:05 +0200198RTCIceCandidatePairStats::RTCIceCandidatePairStats(const std::string& id,
199 int64_t timestamp_us)
200 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {}
hbosc47a0c32016-10-11 14:54:49 -0700201
Yves Gerey665174f2018-06-19 15:03:05 +0200202RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string&& id,
203 int64_t timestamp_us)
hbosc47a0c32016-10-11 14:54:49 -0700204 : RTCStats(std::move(id), timestamp_us),
205 transport_id("transportId"),
206 local_candidate_id("localCandidateId"),
207 remote_candidate_id("remoteCandidateId"),
208 state("state"),
209 priority("priority"),
210 nominated("nominated"),
211 writable("writable"),
212 readable("readable"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700213 packets_sent("packetsSent"),
214 packets_received("packetsReceived"),
hbosc47a0c32016-10-11 14:54:49 -0700215 bytes_sent("bytesSent"),
216 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800217 total_round_trip_time("totalRoundTripTime"),
218 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700219 available_outgoing_bitrate("availableOutgoingBitrate"),
220 available_incoming_bitrate("availableIncomingBitrate"),
221 requests_received("requestsReceived"),
222 requests_sent("requestsSent"),
223 responses_received("responsesReceived"),
224 responses_sent("responsesSent"),
225 retransmissions_received("retransmissionsReceived"),
226 retransmissions_sent("retransmissionsSent"),
227 consent_requests_received("consentRequestsReceived"),
228 consent_requests_sent("consentRequestsSent"),
229 consent_responses_received("consentResponsesReceived"),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700230 consent_responses_sent("consentResponsesSent"),
231 packets_discarded_on_send("packetsDiscardedOnSend"),
232 bytes_discarded_on_send("bytesDiscardedOnSend") {}
hbosc47a0c32016-10-11 14:54:49 -0700233
234RTCIceCandidatePairStats::RTCIceCandidatePairStats(
235 const RTCIceCandidatePairStats& other)
236 : RTCStats(other.id(), other.timestamp_us()),
237 transport_id(other.transport_id),
238 local_candidate_id(other.local_candidate_id),
239 remote_candidate_id(other.remote_candidate_id),
240 state(other.state),
241 priority(other.priority),
242 nominated(other.nominated),
243 writable(other.writable),
244 readable(other.readable),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700245 packets_sent(other.packets_sent),
246 packets_received(other.packets_received),
hbosc47a0c32016-10-11 14:54:49 -0700247 bytes_sent(other.bytes_sent),
248 bytes_received(other.bytes_received),
hbos3168c7a2016-12-15 06:17:08 -0800249 total_round_trip_time(other.total_round_trip_time),
250 current_round_trip_time(other.current_round_trip_time),
hbosc47a0c32016-10-11 14:54:49 -0700251 available_outgoing_bitrate(other.available_outgoing_bitrate),
252 available_incoming_bitrate(other.available_incoming_bitrate),
253 requests_received(other.requests_received),
254 requests_sent(other.requests_sent),
255 responses_received(other.responses_received),
256 responses_sent(other.responses_sent),
257 retransmissions_received(other.retransmissions_received),
258 retransmissions_sent(other.retransmissions_sent),
259 consent_requests_received(other.consent_requests_received),
260 consent_requests_sent(other.consent_requests_sent),
261 consent_responses_received(other.consent_responses_received),
Taylor Brandstetter79326ea2021-09-28 15:09:53 -0700262 consent_responses_sent(other.consent_responses_sent),
263 packets_discarded_on_send(other.packets_discarded_on_send),
264 bytes_discarded_on_send(other.bytes_discarded_on_send) {}
hbosc47a0c32016-10-11 14:54:49 -0700265
Yves Gerey665174f2018-06-19 15:03:05 +0200266RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {}
hbosc47a0c32016-10-11 14:54:49 -0700267
Steve Antond6a5cbd2017-08-18 09:40:25 -0700268// clang-format off
Henrik Boström1df1bf82018-03-20 13:24:20 +0100269WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800270 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800271 &is_remote,
Gary Liu37e489c2017-11-21 10:49:36 -0800272 &network_type,
hbosab9f6e42016-10-07 02:18:47 -0700273 &ip,
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100274 &address,
hbosab9f6e42016-10-07 02:18:47 -0700275 &port,
276 &protocol,
Philipp Hancke95513752018-09-27 14:40:08 +0200277 &relay_protocol,
hbosab9f6e42016-10-07 02:18:47 -0700278 &candidate_type,
279 &priority,
Di Wuef036cd2021-03-19 08:24:41 -0700280 &url)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700281// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700282
Yves Gerey665174f2018-06-19 15:03:05 +0200283RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id,
284 int64_t timestamp_us,
285 bool is_remote)
286 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {}
hbosab9f6e42016-10-07 02:18:47 -0700287
Gary Liu37e489c2017-11-21 10:49:36 -0800288RTCIceCandidateStats::RTCIceCandidateStats(std::string&& id,
289 int64_t timestamp_us,
290 bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700291 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800292 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800293 is_remote("isRemote", is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800294 network_type("networkType"),
hbosab9f6e42016-10-07 02:18:47 -0700295 ip("ip"),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100296 address("address"),
hbosab9f6e42016-10-07 02:18:47 -0700297 port("port"),
298 protocol("protocol"),
Philipp Hancke95513752018-09-27 14:40:08 +0200299 relay_protocol("relayProtocol"),
hbosab9f6e42016-10-07 02:18:47 -0700300 candidate_type("candidateType"),
301 priority("priority"),
Di Wuef036cd2021-03-19 08:24:41 -0700302 url("url") {}
hbosab9f6e42016-10-07 02:18:47 -0700303
304RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
305 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800306 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800307 is_remote(other.is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800308 network_type(other.network_type),
hbosab9f6e42016-10-07 02:18:47 -0700309 ip(other.ip),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100310 address(other.address),
hbosab9f6e42016-10-07 02:18:47 -0700311 port(other.port),
312 protocol(other.protocol),
Philipp Hancke95513752018-09-27 14:40:08 +0200313 relay_protocol(other.relay_protocol),
hbosab9f6e42016-10-07 02:18:47 -0700314 candidate_type(other.candidate_type),
315 priority(other.priority),
Di Wuef036cd2021-03-19 08:24:41 -0700316 url(other.url) {}
hbosab9f6e42016-10-07 02:18:47 -0700317
Yves Gerey665174f2018-06-19 15:03:05 +0200318RTCIceCandidateStats::~RTCIceCandidateStats() {}
hbosab9f6e42016-10-07 02:18:47 -0700319
320const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
321
Yves Gerey665174f2018-06-19 15:03:05 +0200322RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(const std::string& id,
323 int64_t timestamp_us)
324 : RTCIceCandidateStats(id, timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700325
Yves Gerey665174f2018-06-19 15:03:05 +0200326RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string&& id,
327 int64_t timestamp_us)
328 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700329
Henrik Boström1df1bf82018-03-20 13:24:20 +0100330std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const {
331 return std::unique_ptr<RTCStats>(new RTCLocalIceCandidateStats(*this));
332}
333
hbosab9f6e42016-10-07 02:18:47 -0700334const char* RTCLocalIceCandidateStats::type() const {
335 return kType;
336}
337
338const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
339
Yves Gerey665174f2018-06-19 15:03:05 +0200340RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(const std::string& id,
341 int64_t timestamp_us)
342 : RTCIceCandidateStats(id, timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700343
Yves Gerey665174f2018-06-19 15:03:05 +0200344RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string&& id,
345 int64_t timestamp_us)
346 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700347
Henrik Boström1df1bf82018-03-20 13:24:20 +0100348std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const {
349 return std::unique_ptr<RTCStats>(new RTCRemoteIceCandidateStats(*this));
350}
351
hbosab9f6e42016-10-07 02:18:47 -0700352const char* RTCRemoteIceCandidateStats::type() const {
353 return kType;
354}
355
Steve Antond6a5cbd2017-08-18 09:40:25 -0700356// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800357WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
358 &stream_identifier,
Nico Weber22f99252019-02-20 10:13:16 -0500359 &track_ids)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700360// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800361
Yves Gerey665174f2018-06-19 15:03:05 +0200362RTCMediaStreamStats::RTCMediaStreamStats(const std::string& id,
363 int64_t timestamp_us)
364 : RTCMediaStreamStats(std::string(id), timestamp_us) {}
hbos09bc1282016-11-08 06:29:22 -0800365
Yves Gerey665174f2018-06-19 15:03:05 +0200366RTCMediaStreamStats::RTCMediaStreamStats(std::string&& id, int64_t timestamp_us)
hbos09bc1282016-11-08 06:29:22 -0800367 : RTCStats(std::move(id), timestamp_us),
368 stream_identifier("streamIdentifier"),
Yves Gerey665174f2018-06-19 15:03:05 +0200369 track_ids("trackIds") {}
hbos09bc1282016-11-08 06:29:22 -0800370
Yves Gerey665174f2018-06-19 15:03:05 +0200371RTCMediaStreamStats::RTCMediaStreamStats(const RTCMediaStreamStats& other)
hbos09bc1282016-11-08 06:29:22 -0800372 : RTCStats(other.id(), other.timestamp_us()),
373 stream_identifier(other.stream_identifier),
Yves Gerey665174f2018-06-19 15:03:05 +0200374 track_ids(other.track_ids) {}
hbos09bc1282016-11-08 06:29:22 -0800375
Yves Gerey665174f2018-06-19 15:03:05 +0200376RTCMediaStreamStats::~RTCMediaStreamStats() {}
hbos09bc1282016-11-08 06:29:22 -0800377
Steve Antond6a5cbd2017-08-18 09:40:25 -0700378// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800379WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
zsteine76bd3a2017-07-14 12:17:49 -0700380 &track_identifier,
Henrik Boström646fda02019-05-22 15:49:42 +0200381 &media_source_id,
zsteine76bd3a2017-07-14 12:17:49 -0700382 &remote_source,
383 &ended,
384 &detached,
385 &kind,
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200386 &jitter_buffer_delay,
Chen Xing0acffb52019-01-15 15:46:29 +0100387 &jitter_buffer_emitted_count,
zsteine76bd3a2017-07-14 12:17:49 -0700388 &frame_width,
389 &frame_height,
390 &frames_per_second,
391 &frames_sent,
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100392 &huge_frames_sent,
zsteine76bd3a2017-07-14 12:17:49 -0700393 &frames_received,
394 &frames_decoded,
395 &frames_dropped,
396 &frames_corrupted,
397 &partial_frames_lost,
398 &full_frames_lost,
399 &audio_level,
400 &total_audio_energy,
zsteine76bd3a2017-07-14 12:17:49 -0700401 &echo_return_loss,
Steve Anton2dbc69f2017-08-24 17:15:13 -0700402 &echo_return_loss_enhancement,
403 &total_samples_received,
404 &total_samples_duration,
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200405 &concealed_samples,
Henrik Boström21e99da2019-08-21 12:09:51 +0200406 &silent_concealed_samples,
Ruslan Burakov8af88962018-11-22 17:21:10 +0100407 &concealment_events,
Henrik Boström21e99da2019-08-21 12:09:51 +0200408 &inserted_samples_for_deceleration,
409 &removed_samples_for_acceleration,
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100410 &jitter_buffer_flushes,
Sergey Silkin02371062019-01-31 16:45:42 +0100411 &delayed_packet_outage_samples,
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100412 &relative_packet_arrival_delay,
Artem Titove618cc92020-03-11 11:18:54 +0100413 &jitter_buffer_target_delay,
Henrik Lundin44125fa2019-04-29 17:00:46 +0200414 &interruption_count,
415 &total_interruption_duration,
Sergey Silkin02371062019-01-31 16:45:42 +0100416 &freeze_count,
417 &pause_count,
418 &total_freezes_duration,
419 &total_pauses_duration,
420 &total_frames_duration,
Nico Weber22f99252019-02-20 10:13:16 -0500421 &sum_squared_frame_durations)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700422// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800423
Yves Gerey665174f2018-06-19 15:03:05 +0200424RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(const std::string& id,
425 int64_t timestamp_us,
426 const char* kind)
427 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {}
hbos09bc1282016-11-08 06:29:22 -0800428
zsteine76bd3a2017-07-14 12:17:49 -0700429RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(std::string&& id,
430 int64_t timestamp_us,
431 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800432 : RTCStats(std::move(id), timestamp_us),
433 track_identifier("trackIdentifier"),
Henrik Boström646fda02019-05-22 15:49:42 +0200434 media_source_id("mediaSourceId"),
hbos09bc1282016-11-08 06:29:22 -0800435 remote_source("remoteSource"),
436 ended("ended"),
437 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800438 kind("kind", kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200439 jitter_buffer_delay("jitterBufferDelay"),
Chen Xing0acffb52019-01-15 15:46:29 +0100440 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
hbos09bc1282016-11-08 06:29:22 -0800441 frame_width("frameWidth"),
442 frame_height("frameHeight"),
443 frames_per_second("framesPerSecond"),
444 frames_sent("framesSent"),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100445 huge_frames_sent("hugeFramesSent"),
hbos09bc1282016-11-08 06:29:22 -0800446 frames_received("framesReceived"),
447 frames_decoded("framesDecoded"),
448 frames_dropped("framesDropped"),
449 frames_corrupted("framesCorrupted"),
450 partial_frames_lost("partialFramesLost"),
451 full_frames_lost("fullFramesLost"),
452 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700453 total_audio_energy("totalAudioEnergy"),
hbos09bc1282016-11-08 06:29:22 -0800454 echo_return_loss("echoReturnLoss"),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700455 echo_return_loss_enhancement("echoReturnLossEnhancement"),
456 total_samples_received("totalSamplesReceived"),
457 total_samples_duration("totalSamplesDuration"),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200458 concealed_samples("concealedSamples"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200459 silent_concealed_samples("silentConcealedSamples"),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100460 concealment_events("concealmentEvents"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200461 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
462 removed_samples_for_acceleration("removedSamplesForAcceleration"),
Jakob Ivarsson758d9462019-03-19 15:38:49 +0100463 jitter_buffer_flushes(
464 "jitterBufferFlushes",
465 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
466 delayed_packet_outage_samples(
467 "delayedPacketOutageSamples",
468 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
469 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
470 relative_packet_arrival_delay(
471 "relativePacketArrivalDelay",
472 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
Artem Titove618cc92020-03-11 11:18:54 +0100473 jitter_buffer_target_delay("jitterBufferTargetDelay"),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200474 interruption_count("interruptionCount"),
475 total_interruption_duration("totalInterruptionDuration"),
Sergey Silkin02371062019-01-31 16:45:42 +0100476 freeze_count("freezeCount"),
477 pause_count("pauseCount"),
478 total_freezes_duration("totalFreezesDuration"),
479 total_pauses_duration("totalPausesDuration"),
480 total_frames_duration("totalFramesDuration"),
481 sum_squared_frame_durations("sumOfSquaredFramesDuration") {
hbos160e4a72017-01-17 02:53:23 -0800482 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
483 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800484}
485
486RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
487 const RTCMediaStreamTrackStats& other)
488 : RTCStats(other.id(), other.timestamp_us()),
489 track_identifier(other.track_identifier),
Henrik Boström646fda02019-05-22 15:49:42 +0200490 media_source_id(other.media_source_id),
hbos09bc1282016-11-08 06:29:22 -0800491 remote_source(other.remote_source),
492 ended(other.ended),
493 detached(other.detached),
hbos160e4a72017-01-17 02:53:23 -0800494 kind(other.kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200495 jitter_buffer_delay(other.jitter_buffer_delay),
Chen Xing0acffb52019-01-15 15:46:29 +0100496 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
hbos09bc1282016-11-08 06:29:22 -0800497 frame_width(other.frame_width),
498 frame_height(other.frame_height),
499 frames_per_second(other.frames_per_second),
500 frames_sent(other.frames_sent),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100501 huge_frames_sent(other.huge_frames_sent),
hbos09bc1282016-11-08 06:29:22 -0800502 frames_received(other.frames_received),
503 frames_decoded(other.frames_decoded),
504 frames_dropped(other.frames_dropped),
505 frames_corrupted(other.frames_corrupted),
506 partial_frames_lost(other.partial_frames_lost),
507 full_frames_lost(other.full_frames_lost),
508 audio_level(other.audio_level),
zsteine76bd3a2017-07-14 12:17:49 -0700509 total_audio_energy(other.total_audio_energy),
hbos09bc1282016-11-08 06:29:22 -0800510 echo_return_loss(other.echo_return_loss),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700511 echo_return_loss_enhancement(other.echo_return_loss_enhancement),
512 total_samples_received(other.total_samples_received),
513 total_samples_duration(other.total_samples_duration),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200514 concealed_samples(other.concealed_samples),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200515 silent_concealed_samples(other.silent_concealed_samples),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100516 concealment_events(other.concealment_events),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200517 inserted_samples_for_deceleration(
518 other.inserted_samples_for_deceleration),
519 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100520 jitter_buffer_flushes(other.jitter_buffer_flushes),
Sergey Silkin02371062019-01-31 16:45:42 +0100521 delayed_packet_outage_samples(other.delayed_packet_outage_samples),
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100522 relative_packet_arrival_delay(other.relative_packet_arrival_delay),
Artem Titove618cc92020-03-11 11:18:54 +0100523 jitter_buffer_target_delay(other.jitter_buffer_target_delay),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200524 interruption_count(other.interruption_count),
525 total_interruption_duration(other.total_interruption_duration),
Sergey Silkin02371062019-01-31 16:45:42 +0100526 freeze_count(other.freeze_count),
527 pause_count(other.pause_count),
528 total_freezes_duration(other.total_freezes_duration),
529 total_pauses_duration(other.total_pauses_duration),
530 total_frames_duration(other.total_frames_duration),
531 sum_squared_frame_durations(other.sum_squared_frame_durations) {}
hbos09bc1282016-11-08 06:29:22 -0800532
Yves Gerey665174f2018-06-19 15:03:05 +0200533RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {}
hbos09bc1282016-11-08 06:29:22 -0800534
Steve Antond6a5cbd2017-08-18 09:40:25 -0700535// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700536WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
537 &data_channels_opened,
Nico Weber22f99252019-02-20 10:13:16 -0500538 &data_channels_closed)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700539// clang-format on
hbosd565b732016-08-30 14:04:35 -0700540
Yves Gerey665174f2018-06-19 15:03:05 +0200541RTCPeerConnectionStats::RTCPeerConnectionStats(const std::string& id,
542 int64_t timestamp_us)
543 : RTCPeerConnectionStats(std::string(id), timestamp_us) {}
hbosd565b732016-08-30 14:04:35 -0700544
Yves Gerey665174f2018-06-19 15:03:05 +0200545RTCPeerConnectionStats::RTCPeerConnectionStats(std::string&& id,
546 int64_t timestamp_us)
hbos0e6758d2016-08-31 07:57:36 -0700547 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700548 data_channels_opened("dataChannelsOpened"),
Yves Gerey665174f2018-06-19 15:03:05 +0200549 data_channels_closed("dataChannelsClosed") {}
hbosd565b732016-08-30 14:04:35 -0700550
hbosfc5e0502016-10-06 02:06:10 -0700551RTCPeerConnectionStats::RTCPeerConnectionStats(
552 const RTCPeerConnectionStats& other)
553 : RTCStats(other.id(), other.timestamp_us()),
554 data_channels_opened(other.data_channels_opened),
Yves Gerey665174f2018-06-19 15:03:05 +0200555 data_channels_closed(other.data_channels_closed) {}
hbosfc5e0502016-10-06 02:06:10 -0700556
Yves Gerey665174f2018-06-19 15:03:05 +0200557RTCPeerConnectionStats::~RTCPeerConnectionStats() {}
hbosfc5e0502016-10-06 02:06:10 -0700558
Steve Antond6a5cbd2017-08-18 09:40:25 -0700559// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700560WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
561 &ssrc,
Philipp Hancke3bc01662018-08-28 14:55:03 +0200562 &kind,
hbosb0ae9202017-01-27 06:35:16 -0800563 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700564 &transport_id,
565 &codec_id,
Di Wufd1e9d12021-03-09 09:25:28 -0800566 &media_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700567// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700568
Yves Gerey665174f2018-06-19 15:03:05 +0200569RTCRTPStreamStats::RTCRTPStreamStats(const std::string& id,
570 int64_t timestamp_us)
571 : RTCRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700572
Yves Gerey665174f2018-06-19 15:03:05 +0200573RTCRTPStreamStats::RTCRTPStreamStats(std::string&& id, int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700574 : RTCStats(std::move(id), timestamp_us),
575 ssrc("ssrc"),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200576 kind("kind"),
hbosb0ae9202017-01-27 06:35:16 -0800577 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700578 transport_id("transportId"),
579 codec_id("codecId"),
Di Wufd1e9d12021-03-09 09:25:28 -0800580 media_type("mediaType") {}
hbos6ded1902016-11-01 01:50:46 -0700581
Yves Gerey665174f2018-06-19 15:03:05 +0200582RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other)
hbos6ded1902016-11-01 01:50:46 -0700583 : RTCStats(other.id(), other.timestamp_us()),
584 ssrc(other.ssrc),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200585 kind(other.kind),
hbosb0ae9202017-01-27 06:35:16 -0800586 track_id(other.track_id),
hbos6ded1902016-11-01 01:50:46 -0700587 transport_id(other.transport_id),
588 codec_id(other.codec_id),
Di Wufd1e9d12021-03-09 09:25:28 -0800589 media_type(other.media_type) {}
hbos6ded1902016-11-01 01:50:46 -0700590
Yves Gerey665174f2018-06-19 15:03:05 +0200591RTCRTPStreamStats::~RTCRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700592
Steve Antond6a5cbd2017-08-18 09:40:25 -0700593// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700594WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800595 RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp",
596 &jitter,
Minyue Li28a2c632021-07-07 15:53:38 +0200597 &packets_lost,
598 &packets_discarded)
Di Wufd1e9d12021-03-09 09:25:28 -0800599// clang-format on
600
601RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(const std::string&& id,
602 int64_t timestamp_us)
603 : RTCReceivedRtpStreamStats(std::string(id), timestamp_us) {}
604
605RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string&& id,
606 int64_t timestamp_us)
607 : RTCRTPStreamStats(std::move(id), timestamp_us),
608 jitter("jitter"),
Minyue Li28a2c632021-07-07 15:53:38 +0200609 packets_lost("packetsLost"),
610 packets_discarded("packetsDiscarded") {}
Di Wufd1e9d12021-03-09 09:25:28 -0800611
612RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(
613 const RTCReceivedRtpStreamStats& other)
614 : RTCRTPStreamStats(other),
615 jitter(other.jitter),
Minyue Li28a2c632021-07-07 15:53:38 +0200616 packets_lost(other.packets_lost),
617 packets_discarded(other.packets_discarded) {}
Di Wufd1e9d12021-03-09 09:25:28 -0800618
619RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {}
620
621// clang-format off
622WEBRTC_RTCSTATS_IMPL(
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100623 RTCSentRtpStreamStats, RTCRTPStreamStats, "sent-rtp",
624 &packets_sent,
625 &bytes_sent)
626// clang-format on
627
628RTCSentRtpStreamStats::RTCSentRtpStreamStats(const std::string&& id,
629 int64_t timestamp_us)
630 : RTCSentRtpStreamStats(std::string(id), timestamp_us) {}
631
632RTCSentRtpStreamStats::RTCSentRtpStreamStats(std::string&& id,
633 int64_t timestamp_us)
634 : RTCRTPStreamStats(std::move(id), timestamp_us),
635 packets_sent("packetsSent"),
636 bytes_sent("bytesSent") {}
637
638RTCSentRtpStreamStats::RTCSentRtpStreamStats(const RTCSentRtpStreamStats& other)
639 : RTCRTPStreamStats(other),
640 packets_sent(other.packets_sent),
641 bytes_sent(other.bytes_sent) {}
642
643RTCSentRtpStreamStats::~RTCSentRtpStreamStats() {}
644
645// clang-format off
646WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800647 RTCInboundRTPStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp",
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100648 &remote_id,
hboseeafe942016-11-01 03:00:17 -0700649 &packets_received,
Henrik Boström4a5dab02020-01-28 11:15:35 +0100650 &fec_packets_received,
651 &fec_packets_discarded,
hboseeafe942016-11-01 03:00:17 -0700652 &bytes_received,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200653 &header_bytes_received,
Henrik Boström01738c62019-04-15 17:32:00 +0200654 &last_packet_received_timestamp,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300655 &jitter_buffer_delay,
656 &jitter_buffer_emitted_count,
657 &total_samples_received,
658 &concealed_samples,
659 &silent_concealed_samples,
660 &concealment_events,
661 &inserted_samples_for_deceleration,
662 &removed_samples_for_acceleration,
663 &audio_level,
664 &total_audio_energy,
665 &total_samples_duration,
666 &frames_received,
hbosa7a9be12017-03-01 01:02:45 -0800667 &round_trip_time,
hboseeafe942016-11-01 03:00:17 -0700668 &packets_repaired,
669 &burst_packets_lost,
670 &burst_packets_discarded,
671 &burst_loss_count,
672 &burst_discard_count,
673 &burst_loss_rate,
674 &burst_discard_rate,
675 &gap_loss_rate,
hbos6769c492017-01-02 08:35:13 -0800676 &gap_discard_rate,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300677 &frame_width,
678 &frame_height,
679 &frame_bit_depth,
680 &frames_per_second,
Henrik Boström2e069262019-04-09 13:59:31 +0200681 &frames_decoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200682 &key_frames_decoded,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300683 &frames_dropped,
Johannes Kronbfd343b2019-07-01 10:07:50 +0200684 &total_decode_time,
Johannes Kron00376e12019-11-25 10:25:42 +0100685 &total_inter_frame_delay,
686 &total_squared_inter_frame_delay,
Henrik Boström6b430862019-08-16 13:09:51 +0200687 &content_type,
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200688 &estimated_playout_timestamp,
Di Wufd1e9d12021-03-09 09:25:28 -0800689 &decoder_implementation,
690 &fir_count,
691 &pli_count,
692 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700693 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700694// clang-format on
hboseeafe942016-11-01 03:00:17 -0700695
Yves Gerey665174f2018-06-19 15:03:05 +0200696RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
697 int64_t timestamp_us)
698 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {}
hboseeafe942016-11-01 03:00:17 -0700699
Yves Gerey665174f2018-06-19 15:03:05 +0200700RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
701 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800702 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100703 remote_id("remoteId"),
hboseeafe942016-11-01 03:00:17 -0700704 packets_received("packetsReceived"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200705 fec_packets_received("fecPacketsReceived"),
706 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700707 bytes_received("bytesReceived"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200708 header_bytes_received("headerBytesReceived"),
Henrik Boström01738c62019-04-15 17:32:00 +0200709 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300710 jitter_buffer_delay("jitterBufferDelay"),
711 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
712 total_samples_received("totalSamplesReceived"),
713 concealed_samples("concealedSamples"),
714 silent_concealed_samples("silentConcealedSamples"),
715 concealment_events("concealmentEvents"),
716 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
717 removed_samples_for_acceleration("removedSamplesForAcceleration"),
718 audio_level("audioLevel"),
719 total_audio_energy("totalAudioEnergy"),
720 total_samples_duration("totalSamplesDuration"),
721 frames_received("framesReceived"),
hbosa7a9be12017-03-01 01:02:45 -0800722 round_trip_time("roundTripTime"),
hboseeafe942016-11-01 03:00:17 -0700723 packets_repaired("packetsRepaired"),
724 burst_packets_lost("burstPacketsLost"),
725 burst_packets_discarded("burstPacketsDiscarded"),
726 burst_loss_count("burstLossCount"),
727 burst_discard_count("burstDiscardCount"),
728 burst_loss_rate("burstLossRate"),
729 burst_discard_rate("burstDiscardRate"),
730 gap_loss_rate("gapLossRate"),
hbos6769c492017-01-02 08:35:13 -0800731 gap_discard_rate("gapDiscardRate"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300732 frame_width("frameWidth"),
733 frame_height("frameHeight"),
734 frame_bit_depth("frameBitDepth"),
735 frames_per_second("framesPerSecond"),
Henrik Boström2e069262019-04-09 13:59:31 +0200736 frames_decoded("framesDecoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200737 key_frames_decoded("keyFramesDecoded"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300738 frames_dropped("framesDropped"),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200739 total_decode_time("totalDecodeTime"),
Johannes Kron00376e12019-11-25 10:25:42 +0100740 total_inter_frame_delay("totalInterFrameDelay"),
741 total_squared_inter_frame_delay("totalSquaredInterFrameDelay"),
Henrik Boström6b430862019-08-16 13:09:51 +0200742 content_type("contentType"),
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200743 estimated_playout_timestamp("estimatedPlayoutTimestamp"),
Di Wufd1e9d12021-03-09 09:25:28 -0800744 decoder_implementation("decoderImplementation"),
745 fir_count("firCount"),
746 pli_count("pliCount"),
747 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700748 qp_sum("qpSum") {}
hboseeafe942016-11-01 03:00:17 -0700749
750RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
751 const RTCInboundRTPStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800752 : RTCReceivedRtpStreamStats(other),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100753 remote_id(other.remote_id),
hboseeafe942016-11-01 03:00:17 -0700754 packets_received(other.packets_received),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200755 fec_packets_received(other.fec_packets_received),
756 fec_packets_discarded(other.fec_packets_discarded),
hboseeafe942016-11-01 03:00:17 -0700757 bytes_received(other.bytes_received),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200758 header_bytes_received(other.header_bytes_received),
Henrik Boström01738c62019-04-15 17:32:00 +0200759 last_packet_received_timestamp(other.last_packet_received_timestamp),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300760 jitter_buffer_delay(other.jitter_buffer_delay),
761 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
762 total_samples_received(other.total_samples_received),
763 concealed_samples(other.concealed_samples),
764 silent_concealed_samples(other.silent_concealed_samples),
765 concealment_events(other.concealment_events),
766 inserted_samples_for_deceleration(
767 other.inserted_samples_for_deceleration),
768 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
769 audio_level(other.audio_level),
770 total_audio_energy(other.total_audio_energy),
771 total_samples_duration(other.total_samples_duration),
772 frames_received(other.frames_received),
hbosa7a9be12017-03-01 01:02:45 -0800773 round_trip_time(other.round_trip_time),
hboseeafe942016-11-01 03:00:17 -0700774 packets_repaired(other.packets_repaired),
775 burst_packets_lost(other.burst_packets_lost),
776 burst_packets_discarded(other.burst_packets_discarded),
777 burst_loss_count(other.burst_loss_count),
778 burst_discard_count(other.burst_discard_count),
779 burst_loss_rate(other.burst_loss_rate),
780 burst_discard_rate(other.burst_discard_rate),
781 gap_loss_rate(other.gap_loss_rate),
hbos6769c492017-01-02 08:35:13 -0800782 gap_discard_rate(other.gap_discard_rate),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300783 frame_width(other.frame_width),
784 frame_height(other.frame_height),
785 frame_bit_depth(other.frame_bit_depth),
786 frames_per_second(other.frames_per_second),
Henrik Boström2e069262019-04-09 13:59:31 +0200787 frames_decoded(other.frames_decoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200788 key_frames_decoded(other.key_frames_decoded),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300789 frames_dropped(other.frames_dropped),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200790 total_decode_time(other.total_decode_time),
Johannes Kron00376e12019-11-25 10:25:42 +0100791 total_inter_frame_delay(other.total_inter_frame_delay),
792 total_squared_inter_frame_delay(other.total_squared_inter_frame_delay),
Henrik Boström6b430862019-08-16 13:09:51 +0200793 content_type(other.content_type),
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200794 estimated_playout_timestamp(other.estimated_playout_timestamp),
Di Wufd1e9d12021-03-09 09:25:28 -0800795 decoder_implementation(other.decoder_implementation),
796 fir_count(other.fir_count),
797 pli_count(other.pli_count),
798 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700799 qp_sum(other.qp_sum) {}
hboseeafe942016-11-01 03:00:17 -0700800
Yves Gerey665174f2018-06-19 15:03:05 +0200801RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700802
Steve Antond6a5cbd2017-08-18 09:40:25 -0700803// clang-format off
hboseeafe942016-11-01 03:00:17 -0700804WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700805 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200806 &media_source_id,
Henrik Boström4f40fa52019-12-19 13:27:27 +0100807 &remote_id,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200808 &rid,
hbos6ded1902016-11-01 01:50:46 -0700809 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200810 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700811 &bytes_sent,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200812 &header_bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200813 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700814 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200815 &frames_encoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200816 &key_frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200817 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200818 &total_encoded_bytes_target,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200819 &frame_width,
820 &frame_height,
821 &frames_per_second,
822 &frames_sent,
823 &huge_frames_sent,
Henrik Boström9fe18342019-05-16 18:38:20 +0200824 &total_packet_send_delay,
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200825 &quality_limitation_reason,
Byoungchan Lee7d235352021-05-28 21:32:04 +0900826 &quality_limitation_durations,
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200827 &quality_limitation_resolution_changes,
Henrik Boström6b430862019-08-16 13:09:51 +0200828 &content_type,
Di Wufd1e9d12021-03-09 09:25:28 -0800829 &encoder_implementation,
830 &fir_count,
831 &pli_count,
832 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700833 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700834// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700835
Yves Gerey665174f2018-06-19 15:03:05 +0200836RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id,
837 int64_t timestamp_us)
838 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700839
Yves Gerey665174f2018-06-19 15:03:05 +0200840RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id,
841 int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700842 : RTCRTPStreamStats(std::move(id), timestamp_us),
Henrik Boström646fda02019-05-22 15:49:42 +0200843 media_source_id("mediaSourceId"),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100844 remote_id("remoteId"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200845 rid("rid"),
hbos6ded1902016-11-01 01:50:46 -0700846 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200847 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700848 bytes_sent("bytesSent"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200849 header_bytes_sent("headerBytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200850 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700851 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200852 frames_encoded("framesEncoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200853 key_frames_encoded("keyFramesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200854 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200855 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200856 frame_width("frameWidth"),
857 frame_height("frameHeight"),
858 frames_per_second("framesPerSecond"),
859 frames_sent("framesSent"),
860 huge_frames_sent("hugeFramesSent"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200861 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200862 quality_limitation_reason("qualityLimitationReason"),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900863 quality_limitation_durations("qualityLimitationDurations"),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200864 quality_limitation_resolution_changes(
865 "qualityLimitationResolutionChanges"),
Henrik Boström6b430862019-08-16 13:09:51 +0200866 content_type("contentType"),
Di Wufd1e9d12021-03-09 09:25:28 -0800867 encoder_implementation("encoderImplementation"),
868 fir_count("firCount"),
869 pli_count("pliCount"),
870 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700871 qp_sum("qpSum") {}
hbos6ded1902016-11-01 01:50:46 -0700872
873RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
874 const RTCOutboundRTPStreamStats& other)
875 : RTCRTPStreamStats(other),
Henrik Boström646fda02019-05-22 15:49:42 +0200876 media_source_id(other.media_source_id),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100877 remote_id(other.remote_id),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200878 rid(other.rid),
hbos6ded1902016-11-01 01:50:46 -0700879 packets_sent(other.packets_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200880 retransmitted_packets_sent(other.retransmitted_packets_sent),
hbos6ded1902016-11-01 01:50:46 -0700881 bytes_sent(other.bytes_sent),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200882 header_bytes_sent(other.header_bytes_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200883 retransmitted_bytes_sent(other.retransmitted_bytes_sent),
hbos6ded1902016-11-01 01:50:46 -0700884 target_bitrate(other.target_bitrate),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200885 frames_encoded(other.frames_encoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200886 key_frames_encoded(other.key_frames_encoded),
Henrik Boström2e069262019-04-09 13:59:31 +0200887 total_encode_time(other.total_encode_time),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200888 total_encoded_bytes_target(other.total_encoded_bytes_target),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200889 frame_width(other.frame_width),
890 frame_height(other.frame_height),
891 frames_per_second(other.frames_per_second),
892 frames_sent(other.frames_sent),
893 huge_frames_sent(other.huge_frames_sent),
Henrik Boström9fe18342019-05-16 18:38:20 +0200894 total_packet_send_delay(other.total_packet_send_delay),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200895 quality_limitation_reason(other.quality_limitation_reason),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900896 quality_limitation_durations(other.quality_limitation_durations),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200897 quality_limitation_resolution_changes(
898 other.quality_limitation_resolution_changes),
Henrik Boström6b430862019-08-16 13:09:51 +0200899 content_type(other.content_type),
Di Wufd1e9d12021-03-09 09:25:28 -0800900 encoder_implementation(other.encoder_implementation),
901 fir_count(other.fir_count),
902 pli_count(other.pli_count),
903 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700904 qp_sum(other.qp_sum) {}
hbos6ded1902016-11-01 01:50:46 -0700905
Yves Gerey665174f2018-06-19 15:03:05 +0200906RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700907
Steve Antond6a5cbd2017-08-18 09:40:25 -0700908// clang-format off
Henrik Boström883eefc2019-05-27 13:40:25 +0200909WEBRTC_RTCSTATS_IMPL(
Henrik Boström2f71b612021-03-23 15:18:55 +0100910 RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
911 "remote-inbound-rtp",
Henrik Boström883eefc2019-05-27 13:40:25 +0200912 &local_id,
Di Wu86f04ad2021-02-28 23:36:03 -0800913 &round_trip_time,
Di Wu88a51b22021-03-01 11:22:06 -0800914 &fraction_lost,
915 &total_round_trip_time,
916 &round_trip_time_measurements)
Henrik Boström883eefc2019-05-27 13:40:25 +0200917// clang-format on
918
919RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
920 const std::string& id,
921 int64_t timestamp_us)
922 : RTCRemoteInboundRtpStreamStats(std::string(id), timestamp_us) {}
923
924RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
925 std::string&& id,
926 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800927 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boström883eefc2019-05-27 13:40:25 +0200928 local_id("localId"),
Di Wu86f04ad2021-02-28 23:36:03 -0800929 round_trip_time("roundTripTime"),
Di Wu88a51b22021-03-01 11:22:06 -0800930 fraction_lost("fractionLost"),
931 total_round_trip_time("totalRoundTripTime"),
932 round_trip_time_measurements("roundTripTimeMeasurements") {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200933
934RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
935 const RTCRemoteInboundRtpStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800936 : RTCReceivedRtpStreamStats(other),
Henrik Boström883eefc2019-05-27 13:40:25 +0200937 local_id(other.local_id),
Di Wu86f04ad2021-02-28 23:36:03 -0800938 round_trip_time(other.round_trip_time),
Di Wu88a51b22021-03-01 11:22:06 -0800939 fraction_lost(other.fraction_lost),
940 total_round_trip_time(other.total_round_trip_time),
941 round_trip_time_measurements(other.round_trip_time_measurements) {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200942
943RTCRemoteInboundRtpStreamStats::~RTCRemoteInboundRtpStreamStats() {}
944
945// clang-format off
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100946WEBRTC_RTCSTATS_IMPL(
947 RTCRemoteOutboundRtpStreamStats, RTCSentRtpStreamStats,
948 "remote-outbound-rtp",
949 &local_id,
950 &remote_timestamp,
Ivo Creusen2562cf02021-09-03 14:51:22 +0000951 &reports_sent,
952 &round_trip_time,
953 &round_trip_time_measurements,
954 &total_round_trip_time)
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100955// clang-format on
956
957RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
958 const std::string& id,
959 int64_t timestamp_us)
960 : RTCRemoteOutboundRtpStreamStats(std::string(id), timestamp_us) {}
961
962RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
963 std::string&& id,
964 int64_t timestamp_us)
965 : RTCSentRtpStreamStats(std::move(id), timestamp_us),
966 local_id("localId"),
967 remote_timestamp("remoteTimestamp"),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000968 reports_sent("reportsSent"),
969 round_trip_time("roundTripTime"),
970 round_trip_time_measurements("roundTripTimeMeasurements"),
971 total_round_trip_time("totalRoundTripTime") {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100972
973RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
974 const RTCRemoteOutboundRtpStreamStats& other)
975 : RTCSentRtpStreamStats(other),
976 local_id(other.local_id),
977 remote_timestamp(other.remote_timestamp),
Ivo Creusen2562cf02021-09-03 14:51:22 +0000978 reports_sent(other.reports_sent),
979 round_trip_time(other.round_trip_time),
980 round_trip_time_measurements(other.round_trip_time_measurements),
981 total_round_trip_time(other.total_round_trip_time) {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100982
983RTCRemoteOutboundRtpStreamStats::~RTCRemoteOutboundRtpStreamStats() {}
984
985// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +0200986WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
987 &track_identifier,
988 &kind)
989// clang-format on
990
991RTCMediaSourceStats::RTCMediaSourceStats(const std::string& id,
992 int64_t timestamp_us)
993 : RTCMediaSourceStats(std::string(id), timestamp_us) {}
994
995RTCMediaSourceStats::RTCMediaSourceStats(std::string&& id, int64_t timestamp_us)
996 : RTCStats(std::move(id), timestamp_us),
997 track_identifier("trackIdentifier"),
998 kind("kind") {}
999
1000RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other)
1001 : RTCStats(other.id(), other.timestamp_us()),
1002 track_identifier(other.track_identifier),
1003 kind(other.kind) {}
1004
1005RTCMediaSourceStats::~RTCMediaSourceStats() {}
1006
1007// clang-format off
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001008WEBRTC_RTCSTATS_IMPL(RTCAudioSourceStats, RTCMediaSourceStats, "media-source",
1009 &audio_level,
1010 &total_audio_energy,
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001011 &total_samples_duration,
1012 &echo_return_loss,
1013 &echo_return_loss_enhancement)
Henrik Boström646fda02019-05-22 15:49:42 +02001014// clang-format on
1015
1016RTCAudioSourceStats::RTCAudioSourceStats(const std::string& id,
1017 int64_t timestamp_us)
1018 : RTCAudioSourceStats(std::string(id), timestamp_us) {}
1019
1020RTCAudioSourceStats::RTCAudioSourceStats(std::string&& id, int64_t timestamp_us)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001021 : RTCMediaSourceStats(std::move(id), timestamp_us),
1022 audio_level("audioLevel"),
1023 total_audio_energy("totalAudioEnergy"),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001024 total_samples_duration("totalSamplesDuration"),
1025 echo_return_loss("echoReturnLoss"),
1026 echo_return_loss_enhancement("echoReturnLossEnhancement") {}
Henrik Boström646fda02019-05-22 15:49:42 +02001027
1028RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001029 : RTCMediaSourceStats(other),
1030 audio_level(other.audio_level),
1031 total_audio_energy(other.total_audio_energy),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001032 total_samples_duration(other.total_samples_duration),
1033 echo_return_loss(other.echo_return_loss),
1034 echo_return_loss_enhancement(other.echo_return_loss_enhancement) {}
Henrik Boström646fda02019-05-22 15:49:42 +02001035
1036RTCAudioSourceStats::~RTCAudioSourceStats() {}
1037
1038// clang-format off
1039WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
1040 &width,
1041 &height,
1042 &frames,
1043 &frames_per_second)
1044// clang-format on
1045
1046RTCVideoSourceStats::RTCVideoSourceStats(const std::string& id,
1047 int64_t timestamp_us)
1048 : RTCVideoSourceStats(std::string(id), timestamp_us) {}
1049
1050RTCVideoSourceStats::RTCVideoSourceStats(std::string&& id, int64_t timestamp_us)
1051 : RTCMediaSourceStats(std::move(id), timestamp_us),
1052 width("width"),
1053 height("height"),
1054 frames("frames"),
1055 frames_per_second("framesPerSecond") {}
1056
1057RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other)
1058 : RTCMediaSourceStats(other),
1059 width(other.width),
1060 height(other.height),
1061 frames(other.frames),
1062 frames_per_second(other.frames_per_second) {}
1063
1064RTCVideoSourceStats::~RTCVideoSourceStats() {}
1065
1066// clang-format off
hbos2fa7c672016-10-24 04:00:05 -07001067WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
1068 &bytes_sent,
Artem Titovedacbd52020-07-06 16:06:37 +02001069 &packets_sent,
hbos2fa7c672016-10-24 04:00:05 -07001070 &bytes_received,
Artem Titovedacbd52020-07-06 16:06:37 +02001071 &packets_received,
hbos2fa7c672016-10-24 04:00:05 -07001072 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -08001073 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -07001074 &selected_candidate_pair_id,
1075 &local_certificate_id,
Jonas Oreland149dc722019-08-28 08:10:27 +02001076 &remote_certificate_id,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001077 &tls_version,
1078 &dtls_cipher,
1079 &srtp_cipher,
Jonas Oreland149dc722019-08-28 08:10:27 +02001080 &selected_candidate_pair_changes)
Steve Antond6a5cbd2017-08-18 09:40:25 -07001081// clang-format on
hbos2fa7c672016-10-24 04:00:05 -07001082
Yves Gerey665174f2018-06-19 15:03:05 +02001083RTCTransportStats::RTCTransportStats(const std::string& id,
1084 int64_t timestamp_us)
1085 : RTCTransportStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -07001086
Yves Gerey665174f2018-06-19 15:03:05 +02001087RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -07001088 : RTCStats(std::move(id), timestamp_us),
1089 bytes_sent("bytesSent"),
Artem Titovedacbd52020-07-06 16:06:37 +02001090 packets_sent("packetsSent"),
hbos2fa7c672016-10-24 04:00:05 -07001091 bytes_received("bytesReceived"),
Artem Titovedacbd52020-07-06 16:06:37 +02001092 packets_received("packetsReceived"),
hbos2fa7c672016-10-24 04:00:05 -07001093 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -08001094 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -07001095 selected_candidate_pair_id("selectedCandidatePairId"),
1096 local_certificate_id("localCertificateId"),
Jonas Oreland149dc722019-08-28 08:10:27 +02001097 remote_certificate_id("remoteCertificateId"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001098 tls_version("tlsVersion"),
1099 dtls_cipher("dtlsCipher"),
1100 srtp_cipher("srtpCipher"),
Jonas Oreland149dc722019-08-28 08:10:27 +02001101 selected_candidate_pair_changes("selectedCandidatePairChanges") {}
hbos2fa7c672016-10-24 04:00:05 -07001102
Yves Gerey665174f2018-06-19 15:03:05 +02001103RTCTransportStats::RTCTransportStats(const RTCTransportStats& other)
hbos2fa7c672016-10-24 04:00:05 -07001104 : RTCStats(other.id(), other.timestamp_us()),
1105 bytes_sent(other.bytes_sent),
Artem Titovedacbd52020-07-06 16:06:37 +02001106 packets_sent(other.packets_sent),
hbos2fa7c672016-10-24 04:00:05 -07001107 bytes_received(other.bytes_received),
Artem Titovedacbd52020-07-06 16:06:37 +02001108 packets_received(other.packets_received),
hbos2fa7c672016-10-24 04:00:05 -07001109 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -08001110 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -07001111 selected_candidate_pair_id(other.selected_candidate_pair_id),
1112 local_certificate_id(other.local_certificate_id),
Jonas Oreland149dc722019-08-28 08:10:27 +02001113 remote_certificate_id(other.remote_certificate_id),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001114 tls_version(other.tls_version),
1115 dtls_cipher(other.dtls_cipher),
1116 srtp_cipher(other.srtp_cipher),
Jonas Oreland149dc722019-08-28 08:10:27 +02001117 selected_candidate_pair_changes(other.selected_candidate_pair_changes) {}
hbos2fa7c672016-10-24 04:00:05 -07001118
Yves Gerey665174f2018-06-19 15:03:05 +02001119RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -07001120
hbosd565b732016-08-30 14:04:35 -07001121} // namespace webrtc