blob: 6af724e55b88740ae4da9f55e78652eef3117d69 [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,
176 &bytes_sent,
177 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800178 &total_round_trip_time,
179 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700180 &available_outgoing_bitrate,
181 &available_incoming_bitrate,
182 &requests_received,
183 &requests_sent,
184 &responses_received,
185 &responses_sent,
186 &retransmissions_received,
187 &retransmissions_sent,
188 &consent_requests_received,
189 &consent_requests_sent,
190 &consent_responses_received,
Nico Weber22f99252019-02-20 10:13:16 -0500191 &consent_responses_sent)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700192// clang-format on
hbosc47a0c32016-10-11 14:54:49 -0700193
Yves Gerey665174f2018-06-19 15:03:05 +0200194RTCIceCandidatePairStats::RTCIceCandidatePairStats(const std::string& id,
195 int64_t timestamp_us)
196 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {}
hbosc47a0c32016-10-11 14:54:49 -0700197
Yves Gerey665174f2018-06-19 15:03:05 +0200198RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string&& id,
199 int64_t timestamp_us)
hbosc47a0c32016-10-11 14:54:49 -0700200 : RTCStats(std::move(id), timestamp_us),
201 transport_id("transportId"),
202 local_candidate_id("localCandidateId"),
203 remote_candidate_id("remoteCandidateId"),
204 state("state"),
205 priority("priority"),
206 nominated("nominated"),
207 writable("writable"),
208 readable("readable"),
209 bytes_sent("bytesSent"),
210 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800211 total_round_trip_time("totalRoundTripTime"),
212 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700213 available_outgoing_bitrate("availableOutgoingBitrate"),
214 available_incoming_bitrate("availableIncomingBitrate"),
215 requests_received("requestsReceived"),
216 requests_sent("requestsSent"),
217 responses_received("responsesReceived"),
218 responses_sent("responsesSent"),
219 retransmissions_received("retransmissionsReceived"),
220 retransmissions_sent("retransmissionsSent"),
221 consent_requests_received("consentRequestsReceived"),
222 consent_requests_sent("consentRequestsSent"),
223 consent_responses_received("consentResponsesReceived"),
Yves Gerey665174f2018-06-19 15:03:05 +0200224 consent_responses_sent("consentResponsesSent") {}
hbosc47a0c32016-10-11 14:54:49 -0700225
226RTCIceCandidatePairStats::RTCIceCandidatePairStats(
227 const RTCIceCandidatePairStats& other)
228 : RTCStats(other.id(), other.timestamp_us()),
229 transport_id(other.transport_id),
230 local_candidate_id(other.local_candidate_id),
231 remote_candidate_id(other.remote_candidate_id),
232 state(other.state),
233 priority(other.priority),
234 nominated(other.nominated),
235 writable(other.writable),
236 readable(other.readable),
237 bytes_sent(other.bytes_sent),
238 bytes_received(other.bytes_received),
hbos3168c7a2016-12-15 06:17:08 -0800239 total_round_trip_time(other.total_round_trip_time),
240 current_round_trip_time(other.current_round_trip_time),
hbosc47a0c32016-10-11 14:54:49 -0700241 available_outgoing_bitrate(other.available_outgoing_bitrate),
242 available_incoming_bitrate(other.available_incoming_bitrate),
243 requests_received(other.requests_received),
244 requests_sent(other.requests_sent),
245 responses_received(other.responses_received),
246 responses_sent(other.responses_sent),
247 retransmissions_received(other.retransmissions_received),
248 retransmissions_sent(other.retransmissions_sent),
249 consent_requests_received(other.consent_requests_received),
250 consent_requests_sent(other.consent_requests_sent),
251 consent_responses_received(other.consent_responses_received),
Yves Gerey665174f2018-06-19 15:03:05 +0200252 consent_responses_sent(other.consent_responses_sent) {}
hbosc47a0c32016-10-11 14:54:49 -0700253
Yves Gerey665174f2018-06-19 15:03:05 +0200254RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {}
hbosc47a0c32016-10-11 14:54:49 -0700255
Steve Antond6a5cbd2017-08-18 09:40:25 -0700256// clang-format off
Henrik Boström1df1bf82018-03-20 13:24:20 +0100257WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800258 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800259 &is_remote,
Gary Liu37e489c2017-11-21 10:49:36 -0800260 &network_type,
hbosab9f6e42016-10-07 02:18:47 -0700261 &ip,
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100262 &address,
hbosab9f6e42016-10-07 02:18:47 -0700263 &port,
264 &protocol,
Philipp Hancke95513752018-09-27 14:40:08 +0200265 &relay_protocol,
hbosab9f6e42016-10-07 02:18:47 -0700266 &candidate_type,
267 &priority,
Di Wuef036cd2021-03-19 08:24:41 -0700268 &url)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700269// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700270
Yves Gerey665174f2018-06-19 15:03:05 +0200271RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id,
272 int64_t timestamp_us,
273 bool is_remote)
274 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {}
hbosab9f6e42016-10-07 02:18:47 -0700275
Gary Liu37e489c2017-11-21 10:49:36 -0800276RTCIceCandidateStats::RTCIceCandidateStats(std::string&& id,
277 int64_t timestamp_us,
278 bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700279 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800280 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800281 is_remote("isRemote", is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800282 network_type("networkType"),
hbosab9f6e42016-10-07 02:18:47 -0700283 ip("ip"),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100284 address("address"),
hbosab9f6e42016-10-07 02:18:47 -0700285 port("port"),
286 protocol("protocol"),
Philipp Hancke95513752018-09-27 14:40:08 +0200287 relay_protocol("relayProtocol"),
hbosab9f6e42016-10-07 02:18:47 -0700288 candidate_type("candidateType"),
289 priority("priority"),
Di Wuef036cd2021-03-19 08:24:41 -0700290 url("url") {}
hbosab9f6e42016-10-07 02:18:47 -0700291
292RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
293 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800294 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800295 is_remote(other.is_remote),
Gary Liu37e489c2017-11-21 10:49:36 -0800296 network_type(other.network_type),
hbosab9f6e42016-10-07 02:18:47 -0700297 ip(other.ip),
Philipp Hanckea9ba4502021-03-22 13:22:54 +0100298 address(other.address),
hbosab9f6e42016-10-07 02:18:47 -0700299 port(other.port),
300 protocol(other.protocol),
Philipp Hancke95513752018-09-27 14:40:08 +0200301 relay_protocol(other.relay_protocol),
hbosab9f6e42016-10-07 02:18:47 -0700302 candidate_type(other.candidate_type),
303 priority(other.priority),
Di Wuef036cd2021-03-19 08:24:41 -0700304 url(other.url) {}
hbosab9f6e42016-10-07 02:18:47 -0700305
Yves Gerey665174f2018-06-19 15:03:05 +0200306RTCIceCandidateStats::~RTCIceCandidateStats() {}
hbosab9f6e42016-10-07 02:18:47 -0700307
308const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
309
Yves Gerey665174f2018-06-19 15:03:05 +0200310RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(const std::string& id,
311 int64_t timestamp_us)
312 : RTCIceCandidateStats(id, timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700313
Yves Gerey665174f2018-06-19 15:03:05 +0200314RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string&& id,
315 int64_t timestamp_us)
316 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {}
hbosab9f6e42016-10-07 02:18:47 -0700317
Henrik Boström1df1bf82018-03-20 13:24:20 +0100318std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const {
319 return std::unique_ptr<RTCStats>(new RTCLocalIceCandidateStats(*this));
320}
321
hbosab9f6e42016-10-07 02:18:47 -0700322const char* RTCLocalIceCandidateStats::type() const {
323 return kType;
324}
325
326const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
327
Yves Gerey665174f2018-06-19 15:03:05 +0200328RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(const std::string& id,
329 int64_t timestamp_us)
330 : RTCIceCandidateStats(id, timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700331
Yves Gerey665174f2018-06-19 15:03:05 +0200332RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string&& id,
333 int64_t timestamp_us)
334 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {}
hbosab9f6e42016-10-07 02:18:47 -0700335
Henrik Boström1df1bf82018-03-20 13:24:20 +0100336std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const {
337 return std::unique_ptr<RTCStats>(new RTCRemoteIceCandidateStats(*this));
338}
339
hbosab9f6e42016-10-07 02:18:47 -0700340const char* RTCRemoteIceCandidateStats::type() const {
341 return kType;
342}
343
Steve Antond6a5cbd2017-08-18 09:40:25 -0700344// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800345WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
346 &stream_identifier,
Nico Weber22f99252019-02-20 10:13:16 -0500347 &track_ids)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700348// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800349
Yves Gerey665174f2018-06-19 15:03:05 +0200350RTCMediaStreamStats::RTCMediaStreamStats(const std::string& id,
351 int64_t timestamp_us)
352 : RTCMediaStreamStats(std::string(id), timestamp_us) {}
hbos09bc1282016-11-08 06:29:22 -0800353
Yves Gerey665174f2018-06-19 15:03:05 +0200354RTCMediaStreamStats::RTCMediaStreamStats(std::string&& id, int64_t timestamp_us)
hbos09bc1282016-11-08 06:29:22 -0800355 : RTCStats(std::move(id), timestamp_us),
356 stream_identifier("streamIdentifier"),
Yves Gerey665174f2018-06-19 15:03:05 +0200357 track_ids("trackIds") {}
hbos09bc1282016-11-08 06:29:22 -0800358
Yves Gerey665174f2018-06-19 15:03:05 +0200359RTCMediaStreamStats::RTCMediaStreamStats(const RTCMediaStreamStats& other)
hbos09bc1282016-11-08 06:29:22 -0800360 : RTCStats(other.id(), other.timestamp_us()),
361 stream_identifier(other.stream_identifier),
Yves Gerey665174f2018-06-19 15:03:05 +0200362 track_ids(other.track_ids) {}
hbos09bc1282016-11-08 06:29:22 -0800363
Yves Gerey665174f2018-06-19 15:03:05 +0200364RTCMediaStreamStats::~RTCMediaStreamStats() {}
hbos09bc1282016-11-08 06:29:22 -0800365
Steve Antond6a5cbd2017-08-18 09:40:25 -0700366// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800367WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
zsteine76bd3a2017-07-14 12:17:49 -0700368 &track_identifier,
Henrik Boström646fda02019-05-22 15:49:42 +0200369 &media_source_id,
zsteine76bd3a2017-07-14 12:17:49 -0700370 &remote_source,
371 &ended,
372 &detached,
373 &kind,
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200374 &jitter_buffer_delay,
Chen Xing0acffb52019-01-15 15:46:29 +0100375 &jitter_buffer_emitted_count,
zsteine76bd3a2017-07-14 12:17:49 -0700376 &frame_width,
377 &frame_height,
378 &frames_per_second,
379 &frames_sent,
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100380 &huge_frames_sent,
zsteine76bd3a2017-07-14 12:17:49 -0700381 &frames_received,
382 &frames_decoded,
383 &frames_dropped,
384 &frames_corrupted,
385 &partial_frames_lost,
386 &full_frames_lost,
387 &audio_level,
388 &total_audio_energy,
zsteine76bd3a2017-07-14 12:17:49 -0700389 &echo_return_loss,
Steve Anton2dbc69f2017-08-24 17:15:13 -0700390 &echo_return_loss_enhancement,
391 &total_samples_received,
392 &total_samples_duration,
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200393 &concealed_samples,
Henrik Boström21e99da2019-08-21 12:09:51 +0200394 &silent_concealed_samples,
Ruslan Burakov8af88962018-11-22 17:21:10 +0100395 &concealment_events,
Henrik Boström21e99da2019-08-21 12:09:51 +0200396 &inserted_samples_for_deceleration,
397 &removed_samples_for_acceleration,
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100398 &jitter_buffer_flushes,
Sergey Silkin02371062019-01-31 16:45:42 +0100399 &delayed_packet_outage_samples,
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100400 &relative_packet_arrival_delay,
Artem Titove618cc92020-03-11 11:18:54 +0100401 &jitter_buffer_target_delay,
Henrik Lundin44125fa2019-04-29 17:00:46 +0200402 &interruption_count,
403 &total_interruption_duration,
Sergey Silkin02371062019-01-31 16:45:42 +0100404 &freeze_count,
405 &pause_count,
406 &total_freezes_duration,
407 &total_pauses_duration,
408 &total_frames_duration,
Nico Weber22f99252019-02-20 10:13:16 -0500409 &sum_squared_frame_durations)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700410// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800411
Yves Gerey665174f2018-06-19 15:03:05 +0200412RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(const std::string& id,
413 int64_t timestamp_us,
414 const char* kind)
415 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {}
hbos09bc1282016-11-08 06:29:22 -0800416
zsteine76bd3a2017-07-14 12:17:49 -0700417RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(std::string&& id,
418 int64_t timestamp_us,
419 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800420 : RTCStats(std::move(id), timestamp_us),
421 track_identifier("trackIdentifier"),
Henrik Boström646fda02019-05-22 15:49:42 +0200422 media_source_id("mediaSourceId"),
hbos09bc1282016-11-08 06:29:22 -0800423 remote_source("remoteSource"),
424 ended("ended"),
425 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800426 kind("kind", kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200427 jitter_buffer_delay("jitterBufferDelay"),
Chen Xing0acffb52019-01-15 15:46:29 +0100428 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
hbos09bc1282016-11-08 06:29:22 -0800429 frame_width("frameWidth"),
430 frame_height("frameHeight"),
431 frames_per_second("framesPerSecond"),
432 frames_sent("framesSent"),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100433 huge_frames_sent("hugeFramesSent"),
hbos09bc1282016-11-08 06:29:22 -0800434 frames_received("framesReceived"),
435 frames_decoded("framesDecoded"),
436 frames_dropped("framesDropped"),
437 frames_corrupted("framesCorrupted"),
438 partial_frames_lost("partialFramesLost"),
439 full_frames_lost("fullFramesLost"),
440 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700441 total_audio_energy("totalAudioEnergy"),
hbos09bc1282016-11-08 06:29:22 -0800442 echo_return_loss("echoReturnLoss"),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700443 echo_return_loss_enhancement("echoReturnLossEnhancement"),
444 total_samples_received("totalSamplesReceived"),
445 total_samples_duration("totalSamplesDuration"),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200446 concealed_samples("concealedSamples"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200447 silent_concealed_samples("silentConcealedSamples"),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100448 concealment_events("concealmentEvents"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200449 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
450 removed_samples_for_acceleration("removedSamplesForAcceleration"),
Jakob Ivarsson758d9462019-03-19 15:38:49 +0100451 jitter_buffer_flushes(
452 "jitterBufferFlushes",
453 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}),
454 delayed_packet_outage_samples(
455 "delayedPacketOutageSamples",
456 {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets,
457 NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
458 relative_packet_arrival_delay(
459 "relativePacketArrivalDelay",
460 {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}),
Artem Titove618cc92020-03-11 11:18:54 +0100461 jitter_buffer_target_delay("jitterBufferTargetDelay"),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200462 interruption_count("interruptionCount"),
463 total_interruption_duration("totalInterruptionDuration"),
Sergey Silkin02371062019-01-31 16:45:42 +0100464 freeze_count("freezeCount"),
465 pause_count("pauseCount"),
466 total_freezes_duration("totalFreezesDuration"),
467 total_pauses_duration("totalPausesDuration"),
468 total_frames_duration("totalFramesDuration"),
469 sum_squared_frame_durations("sumOfSquaredFramesDuration") {
hbos160e4a72017-01-17 02:53:23 -0800470 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
471 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800472}
473
474RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
475 const RTCMediaStreamTrackStats& other)
476 : RTCStats(other.id(), other.timestamp_us()),
477 track_identifier(other.track_identifier),
Henrik Boström646fda02019-05-22 15:49:42 +0200478 media_source_id(other.media_source_id),
hbos09bc1282016-11-08 06:29:22 -0800479 remote_source(other.remote_source),
480 ended(other.ended),
481 detached(other.detached),
hbos160e4a72017-01-17 02:53:23 -0800482 kind(other.kind),
Gustaf Ullbergb0a02072017-10-02 12:00:34 +0200483 jitter_buffer_delay(other.jitter_buffer_delay),
Chen Xing0acffb52019-01-15 15:46:29 +0100484 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
hbos09bc1282016-11-08 06:29:22 -0800485 frame_width(other.frame_width),
486 frame_height(other.frame_height),
487 frames_per_second(other.frames_per_second),
488 frames_sent(other.frames_sent),
Ilya Nikolaevskiy70473fc2018-02-28 16:35:03 +0100489 huge_frames_sent(other.huge_frames_sent),
hbos09bc1282016-11-08 06:29:22 -0800490 frames_received(other.frames_received),
491 frames_decoded(other.frames_decoded),
492 frames_dropped(other.frames_dropped),
493 frames_corrupted(other.frames_corrupted),
494 partial_frames_lost(other.partial_frames_lost),
495 full_frames_lost(other.full_frames_lost),
496 audio_level(other.audio_level),
zsteine76bd3a2017-07-14 12:17:49 -0700497 total_audio_energy(other.total_audio_energy),
hbos09bc1282016-11-08 06:29:22 -0800498 echo_return_loss(other.echo_return_loss),
Steve Anton2dbc69f2017-08-24 17:15:13 -0700499 echo_return_loss_enhancement(other.echo_return_loss_enhancement),
500 total_samples_received(other.total_samples_received),
501 total_samples_duration(other.total_samples_duration),
Gustaf Ullberg9a2e9062017-09-18 09:28:20 +0200502 concealed_samples(other.concealed_samples),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200503 silent_concealed_samples(other.silent_concealed_samples),
Ruslan Burakov8af88962018-11-22 17:21:10 +0100504 concealment_events(other.concealment_events),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200505 inserted_samples_for_deceleration(
506 other.inserted_samples_for_deceleration),
507 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
Jakob Ivarsson352ce5c2018-11-27 12:52:16 +0100508 jitter_buffer_flushes(other.jitter_buffer_flushes),
Sergey Silkin02371062019-01-31 16:45:42 +0100509 delayed_packet_outage_samples(other.delayed_packet_outage_samples),
Jakob Ivarsson232b3fd2019-03-06 09:18:40 +0100510 relative_packet_arrival_delay(other.relative_packet_arrival_delay),
Artem Titove618cc92020-03-11 11:18:54 +0100511 jitter_buffer_target_delay(other.jitter_buffer_target_delay),
Henrik Lundin44125fa2019-04-29 17:00:46 +0200512 interruption_count(other.interruption_count),
513 total_interruption_duration(other.total_interruption_duration),
Sergey Silkin02371062019-01-31 16:45:42 +0100514 freeze_count(other.freeze_count),
515 pause_count(other.pause_count),
516 total_freezes_duration(other.total_freezes_duration),
517 total_pauses_duration(other.total_pauses_duration),
518 total_frames_duration(other.total_frames_duration),
519 sum_squared_frame_durations(other.sum_squared_frame_durations) {}
hbos09bc1282016-11-08 06:29:22 -0800520
Yves Gerey665174f2018-06-19 15:03:05 +0200521RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {}
hbos09bc1282016-11-08 06:29:22 -0800522
Steve Antond6a5cbd2017-08-18 09:40:25 -0700523// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700524WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
525 &data_channels_opened,
Nico Weber22f99252019-02-20 10:13:16 -0500526 &data_channels_closed)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700527// clang-format on
hbosd565b732016-08-30 14:04:35 -0700528
Yves Gerey665174f2018-06-19 15:03:05 +0200529RTCPeerConnectionStats::RTCPeerConnectionStats(const std::string& id,
530 int64_t timestamp_us)
531 : RTCPeerConnectionStats(std::string(id), timestamp_us) {}
hbosd565b732016-08-30 14:04:35 -0700532
Yves Gerey665174f2018-06-19 15:03:05 +0200533RTCPeerConnectionStats::RTCPeerConnectionStats(std::string&& id,
534 int64_t timestamp_us)
hbos0e6758d2016-08-31 07:57:36 -0700535 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700536 data_channels_opened("dataChannelsOpened"),
Yves Gerey665174f2018-06-19 15:03:05 +0200537 data_channels_closed("dataChannelsClosed") {}
hbosd565b732016-08-30 14:04:35 -0700538
hbosfc5e0502016-10-06 02:06:10 -0700539RTCPeerConnectionStats::RTCPeerConnectionStats(
540 const RTCPeerConnectionStats& other)
541 : RTCStats(other.id(), other.timestamp_us()),
542 data_channels_opened(other.data_channels_opened),
Yves Gerey665174f2018-06-19 15:03:05 +0200543 data_channels_closed(other.data_channels_closed) {}
hbosfc5e0502016-10-06 02:06:10 -0700544
Yves Gerey665174f2018-06-19 15:03:05 +0200545RTCPeerConnectionStats::~RTCPeerConnectionStats() {}
hbosfc5e0502016-10-06 02:06:10 -0700546
Steve Antond6a5cbd2017-08-18 09:40:25 -0700547// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700548WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
549 &ssrc,
Philipp Hancke3bc01662018-08-28 14:55:03 +0200550 &kind,
hbosb0ae9202017-01-27 06:35:16 -0800551 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700552 &transport_id,
553 &codec_id,
Di Wufd1e9d12021-03-09 09:25:28 -0800554 &media_type)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700555// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700556
Yves Gerey665174f2018-06-19 15:03:05 +0200557RTCRTPStreamStats::RTCRTPStreamStats(const std::string& id,
558 int64_t timestamp_us)
559 : RTCRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700560
Yves Gerey665174f2018-06-19 15:03:05 +0200561RTCRTPStreamStats::RTCRTPStreamStats(std::string&& id, int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700562 : RTCStats(std::move(id), timestamp_us),
563 ssrc("ssrc"),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200564 kind("kind"),
hbosb0ae9202017-01-27 06:35:16 -0800565 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700566 transport_id("transportId"),
567 codec_id("codecId"),
Di Wufd1e9d12021-03-09 09:25:28 -0800568 media_type("mediaType") {}
hbos6ded1902016-11-01 01:50:46 -0700569
Yves Gerey665174f2018-06-19 15:03:05 +0200570RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other)
hbos6ded1902016-11-01 01:50:46 -0700571 : RTCStats(other.id(), other.timestamp_us()),
572 ssrc(other.ssrc),
Philipp Hancke3bc01662018-08-28 14:55:03 +0200573 kind(other.kind),
hbosb0ae9202017-01-27 06:35:16 -0800574 track_id(other.track_id),
hbos6ded1902016-11-01 01:50:46 -0700575 transport_id(other.transport_id),
576 codec_id(other.codec_id),
Di Wufd1e9d12021-03-09 09:25:28 -0800577 media_type(other.media_type) {}
hbos6ded1902016-11-01 01:50:46 -0700578
Yves Gerey665174f2018-06-19 15:03:05 +0200579RTCRTPStreamStats::~RTCRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700580
Steve Antond6a5cbd2017-08-18 09:40:25 -0700581// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700582WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800583 RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp",
584 &jitter,
Minyue Li28a2c632021-07-07 15:53:38 +0200585 &packets_lost,
586 &packets_discarded)
Di Wufd1e9d12021-03-09 09:25:28 -0800587// clang-format on
588
589RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(const std::string&& id,
590 int64_t timestamp_us)
591 : RTCReceivedRtpStreamStats(std::string(id), timestamp_us) {}
592
593RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string&& id,
594 int64_t timestamp_us)
595 : RTCRTPStreamStats(std::move(id), timestamp_us),
596 jitter("jitter"),
Minyue Li28a2c632021-07-07 15:53:38 +0200597 packets_lost("packetsLost"),
598 packets_discarded("packetsDiscarded") {}
Di Wufd1e9d12021-03-09 09:25:28 -0800599
600RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(
601 const RTCReceivedRtpStreamStats& other)
602 : RTCRTPStreamStats(other),
603 jitter(other.jitter),
Minyue Li28a2c632021-07-07 15:53:38 +0200604 packets_lost(other.packets_lost),
605 packets_discarded(other.packets_discarded) {}
Di Wufd1e9d12021-03-09 09:25:28 -0800606
607RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {}
608
609// clang-format off
610WEBRTC_RTCSTATS_IMPL(
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100611 RTCSentRtpStreamStats, RTCRTPStreamStats, "sent-rtp",
612 &packets_sent,
613 &bytes_sent)
614// clang-format on
615
616RTCSentRtpStreamStats::RTCSentRtpStreamStats(const std::string&& id,
617 int64_t timestamp_us)
618 : RTCSentRtpStreamStats(std::string(id), timestamp_us) {}
619
620RTCSentRtpStreamStats::RTCSentRtpStreamStats(std::string&& id,
621 int64_t timestamp_us)
622 : RTCRTPStreamStats(std::move(id), timestamp_us),
623 packets_sent("packetsSent"),
624 bytes_sent("bytesSent") {}
625
626RTCSentRtpStreamStats::RTCSentRtpStreamStats(const RTCSentRtpStreamStats& other)
627 : RTCRTPStreamStats(other),
628 packets_sent(other.packets_sent),
629 bytes_sent(other.bytes_sent) {}
630
631RTCSentRtpStreamStats::~RTCSentRtpStreamStats() {}
632
633// clang-format off
634WEBRTC_RTCSTATS_IMPL(
Di Wufd1e9d12021-03-09 09:25:28 -0800635 RTCInboundRTPStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp",
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100636 &remote_id,
hboseeafe942016-11-01 03:00:17 -0700637 &packets_received,
Henrik Boström4a5dab02020-01-28 11:15:35 +0100638 &fec_packets_received,
639 &fec_packets_discarded,
hboseeafe942016-11-01 03:00:17 -0700640 &bytes_received,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200641 &header_bytes_received,
Henrik Boström01738c62019-04-15 17:32:00 +0200642 &last_packet_received_timestamp,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300643 &jitter_buffer_delay,
644 &jitter_buffer_emitted_count,
645 &total_samples_received,
646 &concealed_samples,
647 &silent_concealed_samples,
648 &concealment_events,
649 &inserted_samples_for_deceleration,
650 &removed_samples_for_acceleration,
651 &audio_level,
652 &total_audio_energy,
653 &total_samples_duration,
654 &frames_received,
hbosa7a9be12017-03-01 01:02:45 -0800655 &round_trip_time,
hboseeafe942016-11-01 03:00:17 -0700656 &packets_repaired,
657 &burst_packets_lost,
658 &burst_packets_discarded,
659 &burst_loss_count,
660 &burst_discard_count,
661 &burst_loss_rate,
662 &burst_discard_rate,
663 &gap_loss_rate,
hbos6769c492017-01-02 08:35:13 -0800664 &gap_discard_rate,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300665 &frame_width,
666 &frame_height,
667 &frame_bit_depth,
668 &frames_per_second,
Henrik Boström2e069262019-04-09 13:59:31 +0200669 &frames_decoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200670 &key_frames_decoded,
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300671 &frames_dropped,
Johannes Kronbfd343b2019-07-01 10:07:50 +0200672 &total_decode_time,
Johannes Kron00376e12019-11-25 10:25:42 +0100673 &total_inter_frame_delay,
674 &total_squared_inter_frame_delay,
Henrik Boström6b430862019-08-16 13:09:51 +0200675 &content_type,
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200676 &estimated_playout_timestamp,
Di Wufd1e9d12021-03-09 09:25:28 -0800677 &decoder_implementation,
678 &fir_count,
679 &pli_count,
680 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700681 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700682// clang-format on
hboseeafe942016-11-01 03:00:17 -0700683
Yves Gerey665174f2018-06-19 15:03:05 +0200684RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id,
685 int64_t timestamp_us)
686 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {}
hboseeafe942016-11-01 03:00:17 -0700687
Yves Gerey665174f2018-06-19 15:03:05 +0200688RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
689 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800690 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100691 remote_id("remoteId"),
hboseeafe942016-11-01 03:00:17 -0700692 packets_received("packetsReceived"),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200693 fec_packets_received("fecPacketsReceived"),
694 fec_packets_discarded("fecPacketsDiscarded"),
hboseeafe942016-11-01 03:00:17 -0700695 bytes_received("bytesReceived"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200696 header_bytes_received("headerBytesReceived"),
Henrik Boström01738c62019-04-15 17:32:00 +0200697 last_packet_received_timestamp("lastPacketReceivedTimestamp"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300698 jitter_buffer_delay("jitterBufferDelay"),
699 jitter_buffer_emitted_count("jitterBufferEmittedCount"),
700 total_samples_received("totalSamplesReceived"),
701 concealed_samples("concealedSamples"),
702 silent_concealed_samples("silentConcealedSamples"),
703 concealment_events("concealmentEvents"),
704 inserted_samples_for_deceleration("insertedSamplesForDeceleration"),
705 removed_samples_for_acceleration("removedSamplesForAcceleration"),
706 audio_level("audioLevel"),
707 total_audio_energy("totalAudioEnergy"),
708 total_samples_duration("totalSamplesDuration"),
709 frames_received("framesReceived"),
hbosa7a9be12017-03-01 01:02:45 -0800710 round_trip_time("roundTripTime"),
hboseeafe942016-11-01 03:00:17 -0700711 packets_repaired("packetsRepaired"),
712 burst_packets_lost("burstPacketsLost"),
713 burst_packets_discarded("burstPacketsDiscarded"),
714 burst_loss_count("burstLossCount"),
715 burst_discard_count("burstDiscardCount"),
716 burst_loss_rate("burstLossRate"),
717 burst_discard_rate("burstDiscardRate"),
718 gap_loss_rate("gapLossRate"),
hbos6769c492017-01-02 08:35:13 -0800719 gap_discard_rate("gapDiscardRate"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300720 frame_width("frameWidth"),
721 frame_height("frameHeight"),
722 frame_bit_depth("frameBitDepth"),
723 frames_per_second("framesPerSecond"),
Henrik Boström2e069262019-04-09 13:59:31 +0200724 frames_decoded("framesDecoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200725 key_frames_decoded("keyFramesDecoded"),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300726 frames_dropped("framesDropped"),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200727 total_decode_time("totalDecodeTime"),
Johannes Kron00376e12019-11-25 10:25:42 +0100728 total_inter_frame_delay("totalInterFrameDelay"),
729 total_squared_inter_frame_delay("totalSquaredInterFrameDelay"),
Henrik Boström6b430862019-08-16 13:09:51 +0200730 content_type("contentType"),
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200731 estimated_playout_timestamp("estimatedPlayoutTimestamp"),
Di Wufd1e9d12021-03-09 09:25:28 -0800732 decoder_implementation("decoderImplementation"),
733 fir_count("firCount"),
734 pli_count("pliCount"),
735 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700736 qp_sum("qpSum") {}
hboseeafe942016-11-01 03:00:17 -0700737
738RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
739 const RTCInboundRTPStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800740 : RTCReceivedRtpStreamStats(other),
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100741 remote_id(other.remote_id),
hboseeafe942016-11-01 03:00:17 -0700742 packets_received(other.packets_received),
Ivo Creusen8d8ffdb2019-04-30 09:45:21 +0200743 fec_packets_received(other.fec_packets_received),
744 fec_packets_discarded(other.fec_packets_discarded),
hboseeafe942016-11-01 03:00:17 -0700745 bytes_received(other.bytes_received),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200746 header_bytes_received(other.header_bytes_received),
Henrik Boström01738c62019-04-15 17:32:00 +0200747 last_packet_received_timestamp(other.last_packet_received_timestamp),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300748 jitter_buffer_delay(other.jitter_buffer_delay),
749 jitter_buffer_emitted_count(other.jitter_buffer_emitted_count),
750 total_samples_received(other.total_samples_received),
751 concealed_samples(other.concealed_samples),
752 silent_concealed_samples(other.silent_concealed_samples),
753 concealment_events(other.concealment_events),
754 inserted_samples_for_deceleration(
755 other.inserted_samples_for_deceleration),
756 removed_samples_for_acceleration(other.removed_samples_for_acceleration),
757 audio_level(other.audio_level),
758 total_audio_energy(other.total_audio_energy),
759 total_samples_duration(other.total_samples_duration),
760 frames_received(other.frames_received),
hbosa7a9be12017-03-01 01:02:45 -0800761 round_trip_time(other.round_trip_time),
hboseeafe942016-11-01 03:00:17 -0700762 packets_repaired(other.packets_repaired),
763 burst_packets_lost(other.burst_packets_lost),
764 burst_packets_discarded(other.burst_packets_discarded),
765 burst_loss_count(other.burst_loss_count),
766 burst_discard_count(other.burst_discard_count),
767 burst_loss_rate(other.burst_loss_rate),
768 burst_discard_rate(other.burst_discard_rate),
769 gap_loss_rate(other.gap_loss_rate),
hbos6769c492017-01-02 08:35:13 -0800770 gap_discard_rate(other.gap_discard_rate),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300771 frame_width(other.frame_width),
772 frame_height(other.frame_height),
773 frame_bit_depth(other.frame_bit_depth),
774 frames_per_second(other.frames_per_second),
Henrik Boström2e069262019-04-09 13:59:31 +0200775 frames_decoded(other.frames_decoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200776 key_frames_decoded(other.key_frames_decoded),
Eldar Rello4e5bc9f2020-07-06 14:18:07 +0300777 frames_dropped(other.frames_dropped),
Johannes Kronbfd343b2019-07-01 10:07:50 +0200778 total_decode_time(other.total_decode_time),
Johannes Kron00376e12019-11-25 10:25:42 +0100779 total_inter_frame_delay(other.total_inter_frame_delay),
780 total_squared_inter_frame_delay(other.total_squared_inter_frame_delay),
Henrik Boström6b430862019-08-16 13:09:51 +0200781 content_type(other.content_type),
Åsa Perssonfcf79cc2019-10-22 15:23:44 +0200782 estimated_playout_timestamp(other.estimated_playout_timestamp),
Di Wufd1e9d12021-03-09 09:25:28 -0800783 decoder_implementation(other.decoder_implementation),
784 fir_count(other.fir_count),
785 pli_count(other.pli_count),
786 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700787 qp_sum(other.qp_sum) {}
hboseeafe942016-11-01 03:00:17 -0700788
Yves Gerey665174f2018-06-19 15:03:05 +0200789RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {}
hboseeafe942016-11-01 03:00:17 -0700790
Steve Antond6a5cbd2017-08-18 09:40:25 -0700791// clang-format off
hboseeafe942016-11-01 03:00:17 -0700792WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700793 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
Henrik Boström646fda02019-05-22 15:49:42 +0200794 &media_source_id,
Henrik Boström4f40fa52019-12-19 13:27:27 +0100795 &remote_id,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200796 &rid,
hbos6ded1902016-11-01 01:50:46 -0700797 &packets_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200798 &retransmitted_packets_sent,
hbos6ded1902016-11-01 01:50:46 -0700799 &bytes_sent,
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200800 &header_bytes_sent,
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200801 &retransmitted_bytes_sent,
hbos6ded1902016-11-01 01:50:46 -0700802 &target_bitrate,
Henrik Boströmf71362f2019-04-08 16:14:23 +0200803 &frames_encoded,
Rasmus Brandt2efae772019-06-27 14:29:34 +0200804 &key_frames_encoded,
Henrik Boström2e069262019-04-09 13:59:31 +0200805 &total_encode_time,
Henrik Boström23aff9b2019-05-20 15:15:38 +0200806 &total_encoded_bytes_target,
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200807 &frame_width,
808 &frame_height,
809 &frames_per_second,
810 &frames_sent,
811 &huge_frames_sent,
Henrik Boström9fe18342019-05-16 18:38:20 +0200812 &total_packet_send_delay,
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200813 &quality_limitation_reason,
Byoungchan Lee7d235352021-05-28 21:32:04 +0900814 &quality_limitation_durations,
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200815 &quality_limitation_resolution_changes,
Henrik Boström6b430862019-08-16 13:09:51 +0200816 &content_type,
Di Wufd1e9d12021-03-09 09:25:28 -0800817 &encoder_implementation,
818 &fir_count,
819 &pli_count,
820 &nack_count,
Di Wuef036cd2021-03-19 08:24:41 -0700821 &qp_sum)
Steve Antond6a5cbd2017-08-18 09:40:25 -0700822// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700823
Yves Gerey665174f2018-06-19 15:03:05 +0200824RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id,
825 int64_t timestamp_us)
826 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {}
hbos6ded1902016-11-01 01:50:46 -0700827
Yves Gerey665174f2018-06-19 15:03:05 +0200828RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id,
829 int64_t timestamp_us)
hbos6ded1902016-11-01 01:50:46 -0700830 : RTCRTPStreamStats(std::move(id), timestamp_us),
Henrik Boström646fda02019-05-22 15:49:42 +0200831 media_source_id("mediaSourceId"),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100832 remote_id("remoteId"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200833 rid("rid"),
hbos6ded1902016-11-01 01:50:46 -0700834 packets_sent("packetsSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200835 retransmitted_packets_sent("retransmittedPacketsSent"),
hbos6ded1902016-11-01 01:50:46 -0700836 bytes_sent("bytesSent"),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200837 header_bytes_sent("headerBytesSent"),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200838 retransmitted_bytes_sent("retransmittedBytesSent"),
hbos6ded1902016-11-01 01:50:46 -0700839 target_bitrate("targetBitrate"),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200840 frames_encoded("framesEncoded"),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200841 key_frames_encoded("keyFramesEncoded"),
Henrik Boström2e069262019-04-09 13:59:31 +0200842 total_encode_time("totalEncodeTime"),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200843 total_encoded_bytes_target("totalEncodedBytesTarget"),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200844 frame_width("frameWidth"),
845 frame_height("frameHeight"),
846 frames_per_second("framesPerSecond"),
847 frames_sent("framesSent"),
848 huge_frames_sent("hugeFramesSent"),
Henrik Boström9fe18342019-05-16 18:38:20 +0200849 total_packet_send_delay("totalPacketSendDelay"),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200850 quality_limitation_reason("qualityLimitationReason"),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900851 quality_limitation_durations("qualityLimitationDurations"),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200852 quality_limitation_resolution_changes(
853 "qualityLimitationResolutionChanges"),
Henrik Boström6b430862019-08-16 13:09:51 +0200854 content_type("contentType"),
Di Wufd1e9d12021-03-09 09:25:28 -0800855 encoder_implementation("encoderImplementation"),
856 fir_count("firCount"),
857 pli_count("pliCount"),
858 nack_count("nackCount"),
Di Wuef036cd2021-03-19 08:24:41 -0700859 qp_sum("qpSum") {}
hbos6ded1902016-11-01 01:50:46 -0700860
861RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
862 const RTCOutboundRTPStreamStats& other)
863 : RTCRTPStreamStats(other),
Henrik Boström646fda02019-05-22 15:49:42 +0200864 media_source_id(other.media_source_id),
Henrik Boström4f40fa52019-12-19 13:27:27 +0100865 remote_id(other.remote_id),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200866 rid(other.rid),
hbos6ded1902016-11-01 01:50:46 -0700867 packets_sent(other.packets_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200868 retransmitted_packets_sent(other.retransmitted_packets_sent),
hbos6ded1902016-11-01 01:50:46 -0700869 bytes_sent(other.bytes_sent),
Niels Möllerac0a4cb2019-10-09 15:01:33 +0200870 header_bytes_sent(other.header_bytes_sent),
Henrik Boströmcf96e0f2019-04-17 13:51:53 +0200871 retransmitted_bytes_sent(other.retransmitted_bytes_sent),
hbos6ded1902016-11-01 01:50:46 -0700872 target_bitrate(other.target_bitrate),
Henrik Boströmf71362f2019-04-08 16:14:23 +0200873 frames_encoded(other.frames_encoded),
Rasmus Brandt2efae772019-06-27 14:29:34 +0200874 key_frames_encoded(other.key_frames_encoded),
Henrik Boström2e069262019-04-09 13:59:31 +0200875 total_encode_time(other.total_encode_time),
Henrik Boström23aff9b2019-05-20 15:15:38 +0200876 total_encoded_bytes_target(other.total_encoded_bytes_target),
Henrik Boströma0ff50c2020-05-05 15:54:46 +0200877 frame_width(other.frame_width),
878 frame_height(other.frame_height),
879 frames_per_second(other.frames_per_second),
880 frames_sent(other.frames_sent),
881 huge_frames_sent(other.huge_frames_sent),
Henrik Boström9fe18342019-05-16 18:38:20 +0200882 total_packet_send_delay(other.total_packet_send_delay),
Henrik Boströmce33b6a2019-05-28 17:42:38 +0200883 quality_limitation_reason(other.quality_limitation_reason),
Byoungchan Lee7d235352021-05-28 21:32:04 +0900884 quality_limitation_durations(other.quality_limitation_durations),
Evan Shrubsolecc62b162019-09-09 11:26:45 +0200885 quality_limitation_resolution_changes(
886 other.quality_limitation_resolution_changes),
Henrik Boström6b430862019-08-16 13:09:51 +0200887 content_type(other.content_type),
Di Wufd1e9d12021-03-09 09:25:28 -0800888 encoder_implementation(other.encoder_implementation),
889 fir_count(other.fir_count),
890 pli_count(other.pli_count),
891 nack_count(other.nack_count),
Di Wuef036cd2021-03-19 08:24:41 -0700892 qp_sum(other.qp_sum) {}
hbos6ded1902016-11-01 01:50:46 -0700893
Yves Gerey665174f2018-06-19 15:03:05 +0200894RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {}
hbos6ded1902016-11-01 01:50:46 -0700895
Steve Antond6a5cbd2017-08-18 09:40:25 -0700896// clang-format off
Henrik Boström883eefc2019-05-27 13:40:25 +0200897WEBRTC_RTCSTATS_IMPL(
Henrik Boström2f71b612021-03-23 15:18:55 +0100898 RTCRemoteInboundRtpStreamStats, RTCReceivedRtpStreamStats,
899 "remote-inbound-rtp",
Henrik Boström883eefc2019-05-27 13:40:25 +0200900 &local_id,
Di Wu86f04ad2021-02-28 23:36:03 -0800901 &round_trip_time,
Di Wu88a51b22021-03-01 11:22:06 -0800902 &fraction_lost,
903 &total_round_trip_time,
904 &round_trip_time_measurements)
Henrik Boström883eefc2019-05-27 13:40:25 +0200905// clang-format on
906
907RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
908 const std::string& id,
909 int64_t timestamp_us)
910 : RTCRemoteInboundRtpStreamStats(std::string(id), timestamp_us) {}
911
912RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
913 std::string&& id,
914 int64_t timestamp_us)
Di Wufd1e9d12021-03-09 09:25:28 -0800915 : RTCReceivedRtpStreamStats(std::move(id), timestamp_us),
Henrik Boström883eefc2019-05-27 13:40:25 +0200916 local_id("localId"),
Di Wu86f04ad2021-02-28 23:36:03 -0800917 round_trip_time("roundTripTime"),
Di Wu88a51b22021-03-01 11:22:06 -0800918 fraction_lost("fractionLost"),
919 total_round_trip_time("totalRoundTripTime"),
920 round_trip_time_measurements("roundTripTimeMeasurements") {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200921
922RTCRemoteInboundRtpStreamStats::RTCRemoteInboundRtpStreamStats(
923 const RTCRemoteInboundRtpStreamStats& other)
Di Wufd1e9d12021-03-09 09:25:28 -0800924 : RTCReceivedRtpStreamStats(other),
Henrik Boström883eefc2019-05-27 13:40:25 +0200925 local_id(other.local_id),
Di Wu86f04ad2021-02-28 23:36:03 -0800926 round_trip_time(other.round_trip_time),
Di Wu88a51b22021-03-01 11:22:06 -0800927 fraction_lost(other.fraction_lost),
928 total_round_trip_time(other.total_round_trip_time),
929 round_trip_time_measurements(other.round_trip_time_measurements) {}
Henrik Boström883eefc2019-05-27 13:40:25 +0200930
931RTCRemoteInboundRtpStreamStats::~RTCRemoteInboundRtpStreamStats() {}
932
933// clang-format off
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100934WEBRTC_RTCSTATS_IMPL(
935 RTCRemoteOutboundRtpStreamStats, RTCSentRtpStreamStats,
936 "remote-outbound-rtp",
937 &local_id,
938 &remote_timestamp,
Björn Terelius2c41cba2021-09-01 16:03:26 +0000939 &reports_sent)
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100940// clang-format on
941
942RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
943 const std::string& id,
944 int64_t timestamp_us)
945 : RTCRemoteOutboundRtpStreamStats(std::string(id), timestamp_us) {}
946
947RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
948 std::string&& id,
949 int64_t timestamp_us)
950 : RTCSentRtpStreamStats(std::move(id), timestamp_us),
951 local_id("localId"),
952 remote_timestamp("remoteTimestamp"),
Björn Terelius2c41cba2021-09-01 16:03:26 +0000953 reports_sent("reportsSent") {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100954
955RTCRemoteOutboundRtpStreamStats::RTCRemoteOutboundRtpStreamStats(
956 const RTCRemoteOutboundRtpStreamStats& other)
957 : RTCSentRtpStreamStats(other),
958 local_id(other.local_id),
959 remote_timestamp(other.remote_timestamp),
Björn Terelius2c41cba2021-09-01 16:03:26 +0000960 reports_sent(other.reports_sent) {}
Alessio Bazzicaf7b1b952021-03-23 17:23:04 +0100961
962RTCRemoteOutboundRtpStreamStats::~RTCRemoteOutboundRtpStreamStats() {}
963
964// clang-format off
Henrik Boström646fda02019-05-22 15:49:42 +0200965WEBRTC_RTCSTATS_IMPL(RTCMediaSourceStats, RTCStats, "parent-media-source",
966 &track_identifier,
967 &kind)
968// clang-format on
969
970RTCMediaSourceStats::RTCMediaSourceStats(const std::string& id,
971 int64_t timestamp_us)
972 : RTCMediaSourceStats(std::string(id), timestamp_us) {}
973
974RTCMediaSourceStats::RTCMediaSourceStats(std::string&& id, int64_t timestamp_us)
975 : RTCStats(std::move(id), timestamp_us),
976 track_identifier("trackIdentifier"),
977 kind("kind") {}
978
979RTCMediaSourceStats::RTCMediaSourceStats(const RTCMediaSourceStats& other)
980 : RTCStats(other.id(), other.timestamp_us()),
981 track_identifier(other.track_identifier),
982 kind(other.kind) {}
983
984RTCMediaSourceStats::~RTCMediaSourceStats() {}
985
986// clang-format off
Henrik Boströmd2c336f2019-07-03 17:11:10 +0200987WEBRTC_RTCSTATS_IMPL(RTCAudioSourceStats, RTCMediaSourceStats, "media-source",
988 &audio_level,
989 &total_audio_energy,
Taylor Brandstetter64851c02021-06-24 13:32:50 -0700990 &total_samples_duration,
991 &echo_return_loss,
992 &echo_return_loss_enhancement)
Henrik Boström646fda02019-05-22 15:49:42 +0200993// clang-format on
994
995RTCAudioSourceStats::RTCAudioSourceStats(const std::string& id,
996 int64_t timestamp_us)
997 : RTCAudioSourceStats(std::string(id), timestamp_us) {}
998
999RTCAudioSourceStats::RTCAudioSourceStats(std::string&& id, int64_t timestamp_us)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001000 : RTCMediaSourceStats(std::move(id), timestamp_us),
1001 audio_level("audioLevel"),
1002 total_audio_energy("totalAudioEnergy"),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001003 total_samples_duration("totalSamplesDuration"),
1004 echo_return_loss("echoReturnLoss"),
1005 echo_return_loss_enhancement("echoReturnLossEnhancement") {}
Henrik Boström646fda02019-05-22 15:49:42 +02001006
1007RTCAudioSourceStats::RTCAudioSourceStats(const RTCAudioSourceStats& other)
Henrik Boströmd2c336f2019-07-03 17:11:10 +02001008 : RTCMediaSourceStats(other),
1009 audio_level(other.audio_level),
1010 total_audio_energy(other.total_audio_energy),
Taylor Brandstetter64851c02021-06-24 13:32:50 -07001011 total_samples_duration(other.total_samples_duration),
1012 echo_return_loss(other.echo_return_loss),
1013 echo_return_loss_enhancement(other.echo_return_loss_enhancement) {}
Henrik Boström646fda02019-05-22 15:49:42 +02001014
1015RTCAudioSourceStats::~RTCAudioSourceStats() {}
1016
1017// clang-format off
1018WEBRTC_RTCSTATS_IMPL(RTCVideoSourceStats, RTCMediaSourceStats, "media-source",
1019 &width,
1020 &height,
1021 &frames,
1022 &frames_per_second)
1023// clang-format on
1024
1025RTCVideoSourceStats::RTCVideoSourceStats(const std::string& id,
1026 int64_t timestamp_us)
1027 : RTCVideoSourceStats(std::string(id), timestamp_us) {}
1028
1029RTCVideoSourceStats::RTCVideoSourceStats(std::string&& id, int64_t timestamp_us)
1030 : RTCMediaSourceStats(std::move(id), timestamp_us),
1031 width("width"),
1032 height("height"),
1033 frames("frames"),
1034 frames_per_second("framesPerSecond") {}
1035
1036RTCVideoSourceStats::RTCVideoSourceStats(const RTCVideoSourceStats& other)
1037 : RTCMediaSourceStats(other),
1038 width(other.width),
1039 height(other.height),
1040 frames(other.frames),
1041 frames_per_second(other.frames_per_second) {}
1042
1043RTCVideoSourceStats::~RTCVideoSourceStats() {}
1044
1045// clang-format off
hbos2fa7c672016-10-24 04:00:05 -07001046WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
1047 &bytes_sent,
Artem Titovedacbd52020-07-06 16:06:37 +02001048 &packets_sent,
hbos2fa7c672016-10-24 04:00:05 -07001049 &bytes_received,
Artem Titovedacbd52020-07-06 16:06:37 +02001050 &packets_received,
hbos2fa7c672016-10-24 04:00:05 -07001051 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -08001052 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -07001053 &selected_candidate_pair_id,
1054 &local_certificate_id,
Jonas Oreland149dc722019-08-28 08:10:27 +02001055 &remote_certificate_id,
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001056 &tls_version,
1057 &dtls_cipher,
1058 &srtp_cipher,
Jonas Oreland149dc722019-08-28 08:10:27 +02001059 &selected_candidate_pair_changes)
Steve Antond6a5cbd2017-08-18 09:40:25 -07001060// clang-format on
hbos2fa7c672016-10-24 04:00:05 -07001061
Yves Gerey665174f2018-06-19 15:03:05 +02001062RTCTransportStats::RTCTransportStats(const std::string& id,
1063 int64_t timestamp_us)
1064 : RTCTransportStats(std::string(id), timestamp_us) {}
hbos2fa7c672016-10-24 04:00:05 -07001065
Yves Gerey665174f2018-06-19 15:03:05 +02001066RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us)
hbos2fa7c672016-10-24 04:00:05 -07001067 : RTCStats(std::move(id), timestamp_us),
1068 bytes_sent("bytesSent"),
Artem Titovedacbd52020-07-06 16:06:37 +02001069 packets_sent("packetsSent"),
hbos2fa7c672016-10-24 04:00:05 -07001070 bytes_received("bytesReceived"),
Artem Titovedacbd52020-07-06 16:06:37 +02001071 packets_received("packetsReceived"),
hbos2fa7c672016-10-24 04:00:05 -07001072 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -08001073 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -07001074 selected_candidate_pair_id("selectedCandidatePairId"),
1075 local_certificate_id("localCertificateId"),
Jonas Oreland149dc722019-08-28 08:10:27 +02001076 remote_certificate_id("remoteCertificateId"),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001077 tls_version("tlsVersion"),
1078 dtls_cipher("dtlsCipher"),
1079 srtp_cipher("srtpCipher"),
Jonas Oreland149dc722019-08-28 08:10:27 +02001080 selected_candidate_pair_changes("selectedCandidatePairChanges") {}
hbos2fa7c672016-10-24 04:00:05 -07001081
Yves Gerey665174f2018-06-19 15:03:05 +02001082RTCTransportStats::RTCTransportStats(const RTCTransportStats& other)
hbos2fa7c672016-10-24 04:00:05 -07001083 : RTCStats(other.id(), other.timestamp_us()),
1084 bytes_sent(other.bytes_sent),
Artem Titovedacbd52020-07-06 16:06:37 +02001085 packets_sent(other.packets_sent),
hbos2fa7c672016-10-24 04:00:05 -07001086 bytes_received(other.bytes_received),
Artem Titovedacbd52020-07-06 16:06:37 +02001087 packets_received(other.packets_received),
hbos2fa7c672016-10-24 04:00:05 -07001088 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -08001089 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -07001090 selected_candidate_pair_id(other.selected_candidate_pair_id),
1091 local_certificate_id(other.local_certificate_id),
Jonas Oreland149dc722019-08-28 08:10:27 +02001092 remote_certificate_id(other.remote_certificate_id),
Harald Alvestrand5cb78072019-10-28 09:51:17 +01001093 tls_version(other.tls_version),
1094 dtls_cipher(other.dtls_cipher),
1095 srtp_cipher(other.srtp_cipher),
Jonas Oreland149dc722019-08-28 08:10:27 +02001096 selected_candidate_pair_changes(other.selected_candidate_pair_changes) {}
hbos2fa7c672016-10-24 04:00:05 -07001097
Yves Gerey665174f2018-06-19 15:03:05 +02001098RTCTransportStats::~RTCTransportStats() {}
hbos2fa7c672016-10-24 04:00:05 -07001099
hbosd565b732016-08-30 14:04:35 -07001100} // namespace webrtc