hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 1 | /* |
| 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 Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #include "api/stats/rtcstats_objects.h" |
hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 12 | |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 13 | #include <utility> |
| 14 | |
| 15 | #include "rtc_base/checks.h" |
| 16 | |
Jakob Ivarsson | 758d946 | 2019-03-19 15:38:49 +0100 | [diff] [blame] | 17 | #include "api/stats/rtc_stats.h" |
| 18 | |
hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 19 | namespace webrtc { |
| 20 | |
agrieve | 26622d3 | 2017-08-08 10:48:15 -0700 | [diff] [blame] | 21 | const char* const RTCDataChannelState::kConnecting = "connecting"; |
| 22 | const char* const RTCDataChannelState::kOpen = "open"; |
| 23 | const char* const RTCDataChannelState::kClosing = "closing"; |
| 24 | const char* const RTCDataChannelState::kClosed = "closed"; |
hbos | cc555c5 | 2016-10-18 12:48:31 -0700 | [diff] [blame] | 25 | |
agrieve | 26622d3 | 2017-08-08 10:48:15 -0700 | [diff] [blame] | 26 | const char* const RTCStatsIceCandidatePairState::kFrozen = "frozen"; |
| 27 | const char* const RTCStatsIceCandidatePairState::kWaiting = "waiting"; |
| 28 | const char* const RTCStatsIceCandidatePairState::kInProgress = "in-progress"; |
| 29 | const char* const RTCStatsIceCandidatePairState::kFailed = "failed"; |
| 30 | const char* const RTCStatsIceCandidatePairState::kSucceeded = "succeeded"; |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 31 | |
| 32 | // Strings defined in https://tools.ietf.org/html/rfc5245. |
agrieve | 26622d3 | 2017-08-08 10:48:15 -0700 | [diff] [blame] | 33 | const char* const RTCIceCandidateType::kHost = "host"; |
| 34 | const char* const RTCIceCandidateType::kSrflx = "srflx"; |
| 35 | const char* const RTCIceCandidateType::kPrflx = "prflx"; |
| 36 | const char* const RTCIceCandidateType::kRelay = "relay"; |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 37 | |
agrieve | 26622d3 | 2017-08-08 10:48:15 -0700 | [diff] [blame] | 38 | const char* const RTCDtlsTransportState::kNew = "new"; |
| 39 | const char* const RTCDtlsTransportState::kConnecting = "connecting"; |
| 40 | const char* const RTCDtlsTransportState::kConnected = "connected"; |
| 41 | const char* const RTCDtlsTransportState::kClosed = "closed"; |
| 42 | const char* const RTCDtlsTransportState::kFailed = "failed"; |
hbos | 7064d59 | 2017-01-16 07:38:02 -0800 | [diff] [blame] | 43 | |
agrieve | 26622d3 | 2017-08-08 10:48:15 -0700 | [diff] [blame] | 44 | const char* const RTCMediaStreamTrackKind::kAudio = "audio"; |
| 45 | const char* const RTCMediaStreamTrackKind::kVideo = "video"; |
hbos | 160e4a7 | 2017-01-17 02:53:23 -0800 | [diff] [blame] | 46 | |
Gary Liu | 37e489c | 2017-11-21 10:49:36 -0800 | [diff] [blame] | 47 | // https://w3c.github.io/webrtc-stats/#dom-rtcnetworktype |
| 48 | const char* const RTCNetworkType::kBluetooth = "bluetooth"; |
| 49 | const char* const RTCNetworkType::kCellular = "cellular"; |
| 50 | const char* const RTCNetworkType::kEthernet = "ethernet"; |
| 51 | const char* const RTCNetworkType::kWifi = "wifi"; |
| 52 | const char* const RTCNetworkType::kWimax = "wimax"; |
| 53 | const char* const RTCNetworkType::kVpn = "vpn"; |
| 54 | const char* const RTCNetworkType::kUnknown = "unknown"; |
| 55 | |
Henrik Boström | 2e06926 | 2019-04-09 13:59:31 +0200 | [diff] [blame] | 56 | // https://webrtc.org/experiments/rtp-hdrext/video-content-type/ |
| 57 | const char* const RTCContentType::kUnspecified = "unspecified"; |
| 58 | const char* const RTCContentType::kScreenshare = "screenshare"; |
| 59 | |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 60 | // clang-format off |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 61 | WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate", |
| 62 | &fingerprint, |
| 63 | &fingerprint_algorithm, |
| 64 | &base64_certificate, |
Nico Weber | 22f9925 | 2019-02-20 10:13:16 -0500 | [diff] [blame] | 65 | &issuer_certificate_id) |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 66 | // clang-format on |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 67 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 68 | RTCCertificateStats::RTCCertificateStats(const std::string& id, |
| 69 | int64_t timestamp_us) |
| 70 | : RTCCertificateStats(std::string(id), timestamp_us) {} |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 71 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 72 | RTCCertificateStats::RTCCertificateStats(std::string&& id, int64_t timestamp_us) |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 73 | : RTCStats(std::move(id), timestamp_us), |
| 74 | fingerprint("fingerprint"), |
| 75 | fingerprint_algorithm("fingerprintAlgorithm"), |
| 76 | base64_certificate("base64Certificate"), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 77 | issuer_certificate_id("issuerCertificateId") {} |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 78 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 79 | RTCCertificateStats::RTCCertificateStats(const RTCCertificateStats& other) |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 80 | : RTCStats(other.id(), other.timestamp_us()), |
| 81 | fingerprint(other.fingerprint), |
| 82 | fingerprint_algorithm(other.fingerprint_algorithm), |
| 83 | base64_certificate(other.base64_certificate), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 84 | issuer_certificate_id(other.issuer_certificate_id) {} |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 85 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 86 | RTCCertificateStats::~RTCCertificateStats() {} |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 87 | |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 88 | // clang-format off |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 89 | WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec", |
| 90 | &payload_type, |
hbos | 13f54b2 | 2017-02-28 06:56:04 -0800 | [diff] [blame] | 91 | &mime_type, |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 92 | &clock_rate, |
| 93 | &channels, |
hbos | 13f54b2 | 2017-02-28 06:56:04 -0800 | [diff] [blame] | 94 | &sdp_fmtp_line, |
Nico Weber | 22f9925 | 2019-02-20 10:13:16 -0500 | [diff] [blame] | 95 | &implementation) |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 96 | // clang-format on |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 97 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 98 | RTCCodecStats::RTCCodecStats(const std::string& id, int64_t timestamp_us) |
| 99 | : RTCCodecStats(std::string(id), timestamp_us) {} |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 100 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 101 | RTCCodecStats::RTCCodecStats(std::string&& id, int64_t timestamp_us) |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 102 | : RTCStats(std::move(id), timestamp_us), |
| 103 | payload_type("payloadType"), |
hbos | 13f54b2 | 2017-02-28 06:56:04 -0800 | [diff] [blame] | 104 | mime_type("mimeType"), |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 105 | clock_rate("clockRate"), |
| 106 | channels("channels"), |
hbos | 13f54b2 | 2017-02-28 06:56:04 -0800 | [diff] [blame] | 107 | sdp_fmtp_line("sdpFmtpLine"), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 108 | implementation("implementation") {} |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 109 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 110 | RTCCodecStats::RTCCodecStats(const RTCCodecStats& other) |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 111 | : RTCStats(other.id(), other.timestamp_us()), |
| 112 | payload_type(other.payload_type), |
hbos | 13f54b2 | 2017-02-28 06:56:04 -0800 | [diff] [blame] | 113 | mime_type(other.mime_type), |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 114 | clock_rate(other.clock_rate), |
| 115 | channels(other.channels), |
hbos | 13f54b2 | 2017-02-28 06:56:04 -0800 | [diff] [blame] | 116 | sdp_fmtp_line(other.sdp_fmtp_line), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 117 | implementation(other.implementation) {} |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 118 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 119 | RTCCodecStats::~RTCCodecStats() {} |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 120 | |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 121 | // clang-format off |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 122 | WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel", |
| 123 | &label, |
| 124 | &protocol, |
| 125 | &datachannelid, |
| 126 | &state, |
| 127 | &messages_sent, |
| 128 | &bytes_sent, |
| 129 | &messages_received, |
Nico Weber | 22f9925 | 2019-02-20 10:13:16 -0500 | [diff] [blame] | 130 | &bytes_received) |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 131 | // clang-format on |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 132 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 133 | RTCDataChannelStats::RTCDataChannelStats(const std::string& id, |
| 134 | int64_t timestamp_us) |
| 135 | : RTCDataChannelStats(std::string(id), timestamp_us) {} |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 136 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 137 | RTCDataChannelStats::RTCDataChannelStats(std::string&& id, int64_t timestamp_us) |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 138 | : RTCStats(std::move(id), timestamp_us), |
| 139 | label("label"), |
| 140 | protocol("protocol"), |
| 141 | datachannelid("datachannelid"), |
| 142 | state("state"), |
| 143 | messages_sent("messagesSent"), |
| 144 | bytes_sent("bytesSent"), |
| 145 | messages_received("messagesReceived"), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 146 | bytes_received("bytesReceived") {} |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 147 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 148 | RTCDataChannelStats::RTCDataChannelStats(const RTCDataChannelStats& other) |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 149 | : RTCStats(other.id(), other.timestamp_us()), |
| 150 | label(other.label), |
| 151 | protocol(other.protocol), |
| 152 | datachannelid(other.datachannelid), |
| 153 | state(other.state), |
| 154 | messages_sent(other.messages_sent), |
| 155 | bytes_sent(other.bytes_sent), |
| 156 | messages_received(other.messages_received), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 157 | bytes_received(other.bytes_received) {} |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 158 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 159 | RTCDataChannelStats::~RTCDataChannelStats() {} |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 160 | |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 161 | // clang-format off |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 162 | WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair", |
| 163 | &transport_id, |
| 164 | &local_candidate_id, |
| 165 | &remote_candidate_id, |
| 166 | &state, |
| 167 | &priority, |
| 168 | &nominated, |
| 169 | &writable, |
| 170 | &readable, |
| 171 | &bytes_sent, |
| 172 | &bytes_received, |
hbos | 3168c7a | 2016-12-15 06:17:08 -0800 | [diff] [blame] | 173 | &total_round_trip_time, |
| 174 | ¤t_round_trip_time, |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 175 | &available_outgoing_bitrate, |
| 176 | &available_incoming_bitrate, |
| 177 | &requests_received, |
| 178 | &requests_sent, |
| 179 | &responses_received, |
| 180 | &responses_sent, |
| 181 | &retransmissions_received, |
| 182 | &retransmissions_sent, |
| 183 | &consent_requests_received, |
| 184 | &consent_requests_sent, |
| 185 | &consent_responses_received, |
Nico Weber | 22f9925 | 2019-02-20 10:13:16 -0500 | [diff] [blame] | 186 | &consent_responses_sent) |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 187 | // clang-format on |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 188 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 189 | RTCIceCandidatePairStats::RTCIceCandidatePairStats(const std::string& id, |
| 190 | int64_t timestamp_us) |
| 191 | : RTCIceCandidatePairStats(std::string(id), timestamp_us) {} |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 192 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 193 | RTCIceCandidatePairStats::RTCIceCandidatePairStats(std::string&& id, |
| 194 | int64_t timestamp_us) |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 195 | : RTCStats(std::move(id), timestamp_us), |
| 196 | transport_id("transportId"), |
| 197 | local_candidate_id("localCandidateId"), |
| 198 | remote_candidate_id("remoteCandidateId"), |
| 199 | state("state"), |
| 200 | priority("priority"), |
| 201 | nominated("nominated"), |
| 202 | writable("writable"), |
| 203 | readable("readable"), |
| 204 | bytes_sent("bytesSent"), |
| 205 | bytes_received("bytesReceived"), |
hbos | 3168c7a | 2016-12-15 06:17:08 -0800 | [diff] [blame] | 206 | total_round_trip_time("totalRoundTripTime"), |
| 207 | current_round_trip_time("currentRoundTripTime"), |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 208 | available_outgoing_bitrate("availableOutgoingBitrate"), |
| 209 | available_incoming_bitrate("availableIncomingBitrate"), |
| 210 | requests_received("requestsReceived"), |
| 211 | requests_sent("requestsSent"), |
| 212 | responses_received("responsesReceived"), |
| 213 | responses_sent("responsesSent"), |
| 214 | retransmissions_received("retransmissionsReceived"), |
| 215 | retransmissions_sent("retransmissionsSent"), |
| 216 | consent_requests_received("consentRequestsReceived"), |
| 217 | consent_requests_sent("consentRequestsSent"), |
| 218 | consent_responses_received("consentResponsesReceived"), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 219 | consent_responses_sent("consentResponsesSent") {} |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 220 | |
| 221 | RTCIceCandidatePairStats::RTCIceCandidatePairStats( |
| 222 | const RTCIceCandidatePairStats& other) |
| 223 | : RTCStats(other.id(), other.timestamp_us()), |
| 224 | transport_id(other.transport_id), |
| 225 | local_candidate_id(other.local_candidate_id), |
| 226 | remote_candidate_id(other.remote_candidate_id), |
| 227 | state(other.state), |
| 228 | priority(other.priority), |
| 229 | nominated(other.nominated), |
| 230 | writable(other.writable), |
| 231 | readable(other.readable), |
| 232 | bytes_sent(other.bytes_sent), |
| 233 | bytes_received(other.bytes_received), |
hbos | 3168c7a | 2016-12-15 06:17:08 -0800 | [diff] [blame] | 234 | total_round_trip_time(other.total_round_trip_time), |
| 235 | current_round_trip_time(other.current_round_trip_time), |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 236 | available_outgoing_bitrate(other.available_outgoing_bitrate), |
| 237 | available_incoming_bitrate(other.available_incoming_bitrate), |
| 238 | requests_received(other.requests_received), |
| 239 | requests_sent(other.requests_sent), |
| 240 | responses_received(other.responses_received), |
| 241 | responses_sent(other.responses_sent), |
| 242 | retransmissions_received(other.retransmissions_received), |
| 243 | retransmissions_sent(other.retransmissions_sent), |
| 244 | consent_requests_received(other.consent_requests_received), |
| 245 | consent_requests_sent(other.consent_requests_sent), |
| 246 | consent_responses_received(other.consent_responses_received), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 247 | consent_responses_sent(other.consent_responses_sent) {} |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 248 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 249 | RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {} |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 250 | |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 251 | // clang-format off |
Henrik Boström | 1df1bf8 | 2018-03-20 13:24:20 +0100 | [diff] [blame] | 252 | WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "abstract-ice-candidate", |
hbos | b4e426e | 2017-01-02 09:59:31 -0800 | [diff] [blame] | 253 | &transport_id, |
hbos | c3a2b7f | 2017-01-02 04:46:15 -0800 | [diff] [blame] | 254 | &is_remote, |
Gary Liu | 37e489c | 2017-11-21 10:49:36 -0800 | [diff] [blame] | 255 | &network_type, |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 256 | &ip, |
| 257 | &port, |
| 258 | &protocol, |
Philipp Hancke | 9551375 | 2018-09-27 14:40:08 +0200 | [diff] [blame] | 259 | &relay_protocol, |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 260 | &candidate_type, |
| 261 | &priority, |
hbos | d17a5a7 | 2017-01-02 08:09:59 -0800 | [diff] [blame] | 262 | &url, |
Nico Weber | 22f9925 | 2019-02-20 10:13:16 -0500 | [diff] [blame] | 263 | &deleted) |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 264 | // clang-format on |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 265 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 266 | RTCIceCandidateStats::RTCIceCandidateStats(const std::string& id, |
| 267 | int64_t timestamp_us, |
| 268 | bool is_remote) |
| 269 | : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {} |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 270 | |
Gary Liu | 37e489c | 2017-11-21 10:49:36 -0800 | [diff] [blame] | 271 | RTCIceCandidateStats::RTCIceCandidateStats(std::string&& id, |
| 272 | int64_t timestamp_us, |
| 273 | bool is_remote) |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 274 | : RTCStats(std::move(id), timestamp_us), |
hbos | b4e426e | 2017-01-02 09:59:31 -0800 | [diff] [blame] | 275 | transport_id("transportId"), |
hbos | c3a2b7f | 2017-01-02 04:46:15 -0800 | [diff] [blame] | 276 | is_remote("isRemote", is_remote), |
Gary Liu | 37e489c | 2017-11-21 10:49:36 -0800 | [diff] [blame] | 277 | network_type("networkType"), |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 278 | ip("ip"), |
| 279 | port("port"), |
| 280 | protocol("protocol"), |
Philipp Hancke | 9551375 | 2018-09-27 14:40:08 +0200 | [diff] [blame] | 281 | relay_protocol("relayProtocol"), |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 282 | candidate_type("candidateType"), |
| 283 | priority("priority"), |
hbos | d17a5a7 | 2017-01-02 08:09:59 -0800 | [diff] [blame] | 284 | url("url"), |
Gary Liu | 37e489c | 2017-11-21 10:49:36 -0800 | [diff] [blame] | 285 | deleted("deleted", false) {} |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 286 | |
| 287 | RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other) |
| 288 | : RTCStats(other.id(), other.timestamp_us()), |
hbos | b4e426e | 2017-01-02 09:59:31 -0800 | [diff] [blame] | 289 | transport_id(other.transport_id), |
hbos | c3a2b7f | 2017-01-02 04:46:15 -0800 | [diff] [blame] | 290 | is_remote(other.is_remote), |
Gary Liu | 37e489c | 2017-11-21 10:49:36 -0800 | [diff] [blame] | 291 | network_type(other.network_type), |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 292 | ip(other.ip), |
| 293 | port(other.port), |
| 294 | protocol(other.protocol), |
Philipp Hancke | 9551375 | 2018-09-27 14:40:08 +0200 | [diff] [blame] | 295 | relay_protocol(other.relay_protocol), |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 296 | candidate_type(other.candidate_type), |
| 297 | priority(other.priority), |
hbos | d17a5a7 | 2017-01-02 08:09:59 -0800 | [diff] [blame] | 298 | url(other.url), |
Gary Liu | 37e489c | 2017-11-21 10:49:36 -0800 | [diff] [blame] | 299 | deleted(other.deleted) {} |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 300 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 301 | RTCIceCandidateStats::~RTCIceCandidateStats() {} |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 302 | |
| 303 | const char RTCLocalIceCandidateStats::kType[] = "local-candidate"; |
| 304 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 305 | RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(const std::string& id, |
| 306 | int64_t timestamp_us) |
| 307 | : RTCIceCandidateStats(id, timestamp_us, false) {} |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 308 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 309 | RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(std::string&& id, |
| 310 | int64_t timestamp_us) |
| 311 | : RTCIceCandidateStats(std::move(id), timestamp_us, false) {} |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 312 | |
Henrik Boström | 1df1bf8 | 2018-03-20 13:24:20 +0100 | [diff] [blame] | 313 | std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const { |
| 314 | return std::unique_ptr<RTCStats>(new RTCLocalIceCandidateStats(*this)); |
| 315 | } |
| 316 | |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 317 | const char* RTCLocalIceCandidateStats::type() const { |
| 318 | return kType; |
| 319 | } |
| 320 | |
| 321 | const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate"; |
| 322 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 323 | RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(const std::string& id, |
| 324 | int64_t timestamp_us) |
| 325 | : RTCIceCandidateStats(id, timestamp_us, true) {} |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 326 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 327 | RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(std::string&& id, |
| 328 | int64_t timestamp_us) |
| 329 | : RTCIceCandidateStats(std::move(id), timestamp_us, true) {} |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 330 | |
Henrik Boström | 1df1bf8 | 2018-03-20 13:24:20 +0100 | [diff] [blame] | 331 | std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const { |
| 332 | return std::unique_ptr<RTCStats>(new RTCRemoteIceCandidateStats(*this)); |
| 333 | } |
| 334 | |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 335 | const char* RTCRemoteIceCandidateStats::type() const { |
| 336 | return kType; |
| 337 | } |
| 338 | |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 339 | // clang-format off |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 340 | WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream", |
| 341 | &stream_identifier, |
Nico Weber | 22f9925 | 2019-02-20 10:13:16 -0500 | [diff] [blame] | 342 | &track_ids) |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 343 | // clang-format on |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 344 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 345 | RTCMediaStreamStats::RTCMediaStreamStats(const std::string& id, |
| 346 | int64_t timestamp_us) |
| 347 | : RTCMediaStreamStats(std::string(id), timestamp_us) {} |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 348 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 349 | RTCMediaStreamStats::RTCMediaStreamStats(std::string&& id, int64_t timestamp_us) |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 350 | : RTCStats(std::move(id), timestamp_us), |
| 351 | stream_identifier("streamIdentifier"), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 352 | track_ids("trackIds") {} |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 353 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 354 | RTCMediaStreamStats::RTCMediaStreamStats(const RTCMediaStreamStats& other) |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 355 | : RTCStats(other.id(), other.timestamp_us()), |
| 356 | stream_identifier(other.stream_identifier), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 357 | track_ids(other.track_ids) {} |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 358 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 359 | RTCMediaStreamStats::~RTCMediaStreamStats() {} |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 360 | |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 361 | // clang-format off |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 362 | WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track", |
zstein | e76bd3a | 2017-07-14 12:17:49 -0700 | [diff] [blame] | 363 | &track_identifier, |
| 364 | &remote_source, |
| 365 | &ended, |
| 366 | &detached, |
| 367 | &kind, |
Gustaf Ullberg | b0a0207 | 2017-10-02 12:00:34 +0200 | [diff] [blame] | 368 | &jitter_buffer_delay, |
Chen Xing | 0acffb5 | 2019-01-15 15:46:29 +0100 | [diff] [blame] | 369 | &jitter_buffer_emitted_count, |
zstein | e76bd3a | 2017-07-14 12:17:49 -0700 | [diff] [blame] | 370 | &frame_width, |
| 371 | &frame_height, |
| 372 | &frames_per_second, |
| 373 | &frames_sent, |
Ilya Nikolaevskiy | 70473fc | 2018-02-28 16:35:03 +0100 | [diff] [blame] | 374 | &huge_frames_sent, |
zstein | e76bd3a | 2017-07-14 12:17:49 -0700 | [diff] [blame] | 375 | &frames_received, |
| 376 | &frames_decoded, |
| 377 | &frames_dropped, |
| 378 | &frames_corrupted, |
| 379 | &partial_frames_lost, |
| 380 | &full_frames_lost, |
| 381 | &audio_level, |
| 382 | &total_audio_energy, |
zstein | e76bd3a | 2017-07-14 12:17:49 -0700 | [diff] [blame] | 383 | &echo_return_loss, |
Steve Anton | 2dbc69f | 2017-08-24 17:15:13 -0700 | [diff] [blame] | 384 | &echo_return_loss_enhancement, |
| 385 | &total_samples_received, |
| 386 | &total_samples_duration, |
Gustaf Ullberg | 9a2e906 | 2017-09-18 09:28:20 +0200 | [diff] [blame] | 387 | &concealed_samples, |
Ruslan Burakov | 8af8896 | 2018-11-22 17:21:10 +0100 | [diff] [blame] | 388 | &concealment_events, |
Jakob Ivarsson | 352ce5c | 2018-11-27 12:52:16 +0100 | [diff] [blame] | 389 | &jitter_buffer_flushes, |
Sergey Silkin | 0237106 | 2019-01-31 16:45:42 +0100 | [diff] [blame] | 390 | &delayed_packet_outage_samples, |
Jakob Ivarsson | 232b3fd | 2019-03-06 09:18:40 +0100 | [diff] [blame] | 391 | &relative_packet_arrival_delay, |
Sergey Silkin | 0237106 | 2019-01-31 16:45:42 +0100 | [diff] [blame] | 392 | &freeze_count, |
| 393 | &pause_count, |
| 394 | &total_freezes_duration, |
| 395 | &total_pauses_duration, |
| 396 | &total_frames_duration, |
Nico Weber | 22f9925 | 2019-02-20 10:13:16 -0500 | [diff] [blame] | 397 | &sum_squared_frame_durations) |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 398 | // clang-format on |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 399 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 400 | RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(const std::string& id, |
| 401 | int64_t timestamp_us, |
| 402 | const char* kind) |
| 403 | : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {} |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 404 | |
zstein | e76bd3a | 2017-07-14 12:17:49 -0700 | [diff] [blame] | 405 | RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(std::string&& id, |
| 406 | int64_t timestamp_us, |
| 407 | const char* kind) |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 408 | : RTCStats(std::move(id), timestamp_us), |
| 409 | track_identifier("trackIdentifier"), |
| 410 | remote_source("remoteSource"), |
| 411 | ended("ended"), |
| 412 | detached("detached"), |
hbos | 160e4a7 | 2017-01-17 02:53:23 -0800 | [diff] [blame] | 413 | kind("kind", kind), |
Gustaf Ullberg | b0a0207 | 2017-10-02 12:00:34 +0200 | [diff] [blame] | 414 | jitter_buffer_delay("jitterBufferDelay"), |
Chen Xing | 0acffb5 | 2019-01-15 15:46:29 +0100 | [diff] [blame] | 415 | jitter_buffer_emitted_count("jitterBufferEmittedCount"), |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 416 | frame_width("frameWidth"), |
| 417 | frame_height("frameHeight"), |
| 418 | frames_per_second("framesPerSecond"), |
| 419 | frames_sent("framesSent"), |
Ilya Nikolaevskiy | 70473fc | 2018-02-28 16:35:03 +0100 | [diff] [blame] | 420 | huge_frames_sent("hugeFramesSent"), |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 421 | frames_received("framesReceived"), |
| 422 | frames_decoded("framesDecoded"), |
| 423 | frames_dropped("framesDropped"), |
| 424 | frames_corrupted("framesCorrupted"), |
| 425 | partial_frames_lost("partialFramesLost"), |
| 426 | full_frames_lost("fullFramesLost"), |
| 427 | audio_level("audioLevel"), |
zstein | e76bd3a | 2017-07-14 12:17:49 -0700 | [diff] [blame] | 428 | total_audio_energy("totalAudioEnergy"), |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 429 | echo_return_loss("echoReturnLoss"), |
Steve Anton | 2dbc69f | 2017-08-24 17:15:13 -0700 | [diff] [blame] | 430 | echo_return_loss_enhancement("echoReturnLossEnhancement"), |
| 431 | total_samples_received("totalSamplesReceived"), |
| 432 | total_samples_duration("totalSamplesDuration"), |
Gustaf Ullberg | 9a2e906 | 2017-09-18 09:28:20 +0200 | [diff] [blame] | 433 | concealed_samples("concealedSamples"), |
Ruslan Burakov | 8af8896 | 2018-11-22 17:21:10 +0100 | [diff] [blame] | 434 | concealment_events("concealmentEvents"), |
Jakob Ivarsson | 758d946 | 2019-03-19 15:38:49 +0100 | [diff] [blame] | 435 | jitter_buffer_flushes( |
| 436 | "jitterBufferFlushes", |
| 437 | {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets}), |
| 438 | delayed_packet_outage_samples( |
| 439 | "delayedPacketOutageSamples", |
| 440 | {NonStandardGroupId::kRtcAudioJitterBufferMaxPackets, |
| 441 | NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}), |
| 442 | relative_packet_arrival_delay( |
| 443 | "relativePacketArrivalDelay", |
| 444 | {NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay}), |
Sergey Silkin | 0237106 | 2019-01-31 16:45:42 +0100 | [diff] [blame] | 445 | freeze_count("freezeCount"), |
| 446 | pause_count("pauseCount"), |
| 447 | total_freezes_duration("totalFreezesDuration"), |
| 448 | total_pauses_duration("totalPausesDuration"), |
| 449 | total_frames_duration("totalFramesDuration"), |
| 450 | sum_squared_frame_durations("sumOfSquaredFramesDuration") { |
hbos | 160e4a7 | 2017-01-17 02:53:23 -0800 | [diff] [blame] | 451 | RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio || |
| 452 | kind == RTCMediaStreamTrackKind::kVideo); |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 453 | } |
| 454 | |
| 455 | RTCMediaStreamTrackStats::RTCMediaStreamTrackStats( |
| 456 | const RTCMediaStreamTrackStats& other) |
| 457 | : RTCStats(other.id(), other.timestamp_us()), |
| 458 | track_identifier(other.track_identifier), |
| 459 | remote_source(other.remote_source), |
| 460 | ended(other.ended), |
| 461 | detached(other.detached), |
hbos | 160e4a7 | 2017-01-17 02:53:23 -0800 | [diff] [blame] | 462 | kind(other.kind), |
Gustaf Ullberg | b0a0207 | 2017-10-02 12:00:34 +0200 | [diff] [blame] | 463 | jitter_buffer_delay(other.jitter_buffer_delay), |
Chen Xing | 0acffb5 | 2019-01-15 15:46:29 +0100 | [diff] [blame] | 464 | jitter_buffer_emitted_count(other.jitter_buffer_emitted_count), |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 465 | frame_width(other.frame_width), |
| 466 | frame_height(other.frame_height), |
| 467 | frames_per_second(other.frames_per_second), |
| 468 | frames_sent(other.frames_sent), |
Ilya Nikolaevskiy | 70473fc | 2018-02-28 16:35:03 +0100 | [diff] [blame] | 469 | huge_frames_sent(other.huge_frames_sent), |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 470 | frames_received(other.frames_received), |
| 471 | frames_decoded(other.frames_decoded), |
| 472 | frames_dropped(other.frames_dropped), |
| 473 | frames_corrupted(other.frames_corrupted), |
| 474 | partial_frames_lost(other.partial_frames_lost), |
| 475 | full_frames_lost(other.full_frames_lost), |
| 476 | audio_level(other.audio_level), |
zstein | e76bd3a | 2017-07-14 12:17:49 -0700 | [diff] [blame] | 477 | total_audio_energy(other.total_audio_energy), |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 478 | echo_return_loss(other.echo_return_loss), |
Steve Anton | 2dbc69f | 2017-08-24 17:15:13 -0700 | [diff] [blame] | 479 | echo_return_loss_enhancement(other.echo_return_loss_enhancement), |
| 480 | total_samples_received(other.total_samples_received), |
| 481 | total_samples_duration(other.total_samples_duration), |
Gustaf Ullberg | 9a2e906 | 2017-09-18 09:28:20 +0200 | [diff] [blame] | 482 | concealed_samples(other.concealed_samples), |
Ruslan Burakov | 8af8896 | 2018-11-22 17:21:10 +0100 | [diff] [blame] | 483 | concealment_events(other.concealment_events), |
Jakob Ivarsson | 352ce5c | 2018-11-27 12:52:16 +0100 | [diff] [blame] | 484 | jitter_buffer_flushes(other.jitter_buffer_flushes), |
Sergey Silkin | 0237106 | 2019-01-31 16:45:42 +0100 | [diff] [blame] | 485 | delayed_packet_outage_samples(other.delayed_packet_outage_samples), |
Jakob Ivarsson | 232b3fd | 2019-03-06 09:18:40 +0100 | [diff] [blame] | 486 | relative_packet_arrival_delay(other.relative_packet_arrival_delay), |
Sergey Silkin | 0237106 | 2019-01-31 16:45:42 +0100 | [diff] [blame] | 487 | freeze_count(other.freeze_count), |
| 488 | pause_count(other.pause_count), |
| 489 | total_freezes_duration(other.total_freezes_duration), |
| 490 | total_pauses_duration(other.total_pauses_duration), |
| 491 | total_frames_duration(other.total_frames_duration), |
| 492 | sum_squared_frame_durations(other.sum_squared_frame_durations) {} |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 493 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 494 | RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {} |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 495 | |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 496 | // clang-format off |
hbos | fc5e050 | 2016-10-06 02:06:10 -0700 | [diff] [blame] | 497 | WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection", |
| 498 | &data_channels_opened, |
Nico Weber | 22f9925 | 2019-02-20 10:13:16 -0500 | [diff] [blame] | 499 | &data_channels_closed) |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 500 | // clang-format on |
hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 501 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 502 | RTCPeerConnectionStats::RTCPeerConnectionStats(const std::string& id, |
| 503 | int64_t timestamp_us) |
| 504 | : RTCPeerConnectionStats(std::string(id), timestamp_us) {} |
hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 505 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 506 | RTCPeerConnectionStats::RTCPeerConnectionStats(std::string&& id, |
| 507 | int64_t timestamp_us) |
hbos | 0e6758d | 2016-08-31 07:57:36 -0700 | [diff] [blame] | 508 | : RTCStats(std::move(id), timestamp_us), |
hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 509 | data_channels_opened("dataChannelsOpened"), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 510 | data_channels_closed("dataChannelsClosed") {} |
hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 511 | |
hbos | fc5e050 | 2016-10-06 02:06:10 -0700 | [diff] [blame] | 512 | RTCPeerConnectionStats::RTCPeerConnectionStats( |
| 513 | const RTCPeerConnectionStats& other) |
| 514 | : RTCStats(other.id(), other.timestamp_us()), |
| 515 | data_channels_opened(other.data_channels_opened), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 516 | data_channels_closed(other.data_channels_closed) {} |
hbos | fc5e050 | 2016-10-06 02:06:10 -0700 | [diff] [blame] | 517 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 518 | RTCPeerConnectionStats::~RTCPeerConnectionStats() {} |
hbos | fc5e050 | 2016-10-06 02:06:10 -0700 | [diff] [blame] | 519 | |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 520 | // clang-format off |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 521 | WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp", |
| 522 | &ssrc, |
| 523 | &associate_stats_id, |
| 524 | &is_remote, |
| 525 | &media_type, |
Philipp Hancke | 3bc0166 | 2018-08-28 14:55:03 +0200 | [diff] [blame] | 526 | &kind, |
hbos | b0ae920 | 2017-01-27 06:35:16 -0800 | [diff] [blame] | 527 | &track_id, |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 528 | &transport_id, |
| 529 | &codec_id, |
| 530 | &fir_count, |
| 531 | &pli_count, |
| 532 | &nack_count, |
hbos | 6769c49 | 2017-01-02 08:35:13 -0800 | [diff] [blame] | 533 | &sli_count, |
Nico Weber | 22f9925 | 2019-02-20 10:13:16 -0500 | [diff] [blame] | 534 | &qp_sum) |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 535 | // clang-format on |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 536 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 537 | RTCRTPStreamStats::RTCRTPStreamStats(const std::string& id, |
| 538 | int64_t timestamp_us) |
| 539 | : RTCRTPStreamStats(std::string(id), timestamp_us) {} |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 540 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 541 | RTCRTPStreamStats::RTCRTPStreamStats(std::string&& id, int64_t timestamp_us) |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 542 | : RTCStats(std::move(id), timestamp_us), |
| 543 | ssrc("ssrc"), |
| 544 | associate_stats_id("associateStatsId"), |
| 545 | is_remote("isRemote", false), |
| 546 | media_type("mediaType"), |
Philipp Hancke | 3bc0166 | 2018-08-28 14:55:03 +0200 | [diff] [blame] | 547 | kind("kind"), |
hbos | b0ae920 | 2017-01-27 06:35:16 -0800 | [diff] [blame] | 548 | track_id("trackId"), |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 549 | transport_id("transportId"), |
| 550 | codec_id("codecId"), |
| 551 | fir_count("firCount"), |
| 552 | pli_count("pliCount"), |
| 553 | nack_count("nackCount"), |
hbos | 6769c49 | 2017-01-02 08:35:13 -0800 | [diff] [blame] | 554 | sli_count("sliCount"), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 555 | qp_sum("qpSum") {} |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 556 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 557 | RTCRTPStreamStats::RTCRTPStreamStats(const RTCRTPStreamStats& other) |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 558 | : RTCStats(other.id(), other.timestamp_us()), |
| 559 | ssrc(other.ssrc), |
| 560 | associate_stats_id(other.associate_stats_id), |
| 561 | is_remote(other.is_remote), |
| 562 | media_type(other.media_type), |
Philipp Hancke | 3bc0166 | 2018-08-28 14:55:03 +0200 | [diff] [blame] | 563 | kind(other.kind), |
hbos | b0ae920 | 2017-01-27 06:35:16 -0800 | [diff] [blame] | 564 | track_id(other.track_id), |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 565 | transport_id(other.transport_id), |
| 566 | codec_id(other.codec_id), |
| 567 | fir_count(other.fir_count), |
| 568 | pli_count(other.pli_count), |
| 569 | nack_count(other.nack_count), |
hbos | 6769c49 | 2017-01-02 08:35:13 -0800 | [diff] [blame] | 570 | sli_count(other.sli_count), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 571 | qp_sum(other.qp_sum) {} |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 572 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 573 | RTCRTPStreamStats::~RTCRTPStreamStats() {} |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 574 | |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 575 | // clang-format off |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 576 | WEBRTC_RTCSTATS_IMPL( |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 577 | RTCInboundRTPStreamStats, RTCRTPStreamStats, "inbound-rtp", |
| 578 | &packets_received, |
| 579 | &bytes_received, |
| 580 | &packets_lost, |
Henrik Boström | 01738c6 | 2019-04-15 17:32:00 +0200 | [diff] [blame] | 581 | &last_packet_received_timestamp, |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 582 | &jitter, |
| 583 | &fraction_lost, |
hbos | a7a9be1 | 2017-03-01 01:02:45 -0800 | [diff] [blame] | 584 | &round_trip_time, |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 585 | &packets_discarded, |
| 586 | &packets_repaired, |
| 587 | &burst_packets_lost, |
| 588 | &burst_packets_discarded, |
| 589 | &burst_loss_count, |
| 590 | &burst_discard_count, |
| 591 | &burst_loss_rate, |
| 592 | &burst_discard_rate, |
| 593 | &gap_loss_rate, |
hbos | 6769c49 | 2017-01-02 08:35:13 -0800 | [diff] [blame] | 594 | &gap_discard_rate, |
Henrik Boström | 2e06926 | 2019-04-09 13:59:31 +0200 | [diff] [blame] | 595 | &frames_decoded, |
| 596 | &content_type) |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 597 | // clang-format on |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 598 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 599 | RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(const std::string& id, |
| 600 | int64_t timestamp_us) |
| 601 | : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {} |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 602 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 603 | RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id, |
| 604 | int64_t timestamp_us) |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 605 | : RTCRTPStreamStats(std::move(id), timestamp_us), |
| 606 | packets_received("packetsReceived"), |
| 607 | bytes_received("bytesReceived"), |
| 608 | packets_lost("packetsLost"), |
Henrik Boström | 01738c6 | 2019-04-15 17:32:00 +0200 | [diff] [blame] | 609 | last_packet_received_timestamp("lastPacketReceivedTimestamp"), |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 610 | jitter("jitter"), |
| 611 | fraction_lost("fractionLost"), |
hbos | a7a9be1 | 2017-03-01 01:02:45 -0800 | [diff] [blame] | 612 | round_trip_time("roundTripTime"), |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 613 | packets_discarded("packetsDiscarded"), |
| 614 | packets_repaired("packetsRepaired"), |
| 615 | burst_packets_lost("burstPacketsLost"), |
| 616 | burst_packets_discarded("burstPacketsDiscarded"), |
| 617 | burst_loss_count("burstLossCount"), |
| 618 | burst_discard_count("burstDiscardCount"), |
| 619 | burst_loss_rate("burstLossRate"), |
| 620 | burst_discard_rate("burstDiscardRate"), |
| 621 | gap_loss_rate("gapLossRate"), |
hbos | 6769c49 | 2017-01-02 08:35:13 -0800 | [diff] [blame] | 622 | gap_discard_rate("gapDiscardRate"), |
Henrik Boström | 2e06926 | 2019-04-09 13:59:31 +0200 | [diff] [blame] | 623 | frames_decoded("framesDecoded"), |
| 624 | content_type("contentType") {} |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 625 | |
| 626 | RTCInboundRTPStreamStats::RTCInboundRTPStreamStats( |
| 627 | const RTCInboundRTPStreamStats& other) |
| 628 | : RTCRTPStreamStats(other), |
| 629 | packets_received(other.packets_received), |
| 630 | bytes_received(other.bytes_received), |
| 631 | packets_lost(other.packets_lost), |
Henrik Boström | 01738c6 | 2019-04-15 17:32:00 +0200 | [diff] [blame] | 632 | last_packet_received_timestamp(other.last_packet_received_timestamp), |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 633 | jitter(other.jitter), |
| 634 | fraction_lost(other.fraction_lost), |
hbos | a7a9be1 | 2017-03-01 01:02:45 -0800 | [diff] [blame] | 635 | round_trip_time(other.round_trip_time), |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 636 | packets_discarded(other.packets_discarded), |
| 637 | packets_repaired(other.packets_repaired), |
| 638 | burst_packets_lost(other.burst_packets_lost), |
| 639 | burst_packets_discarded(other.burst_packets_discarded), |
| 640 | burst_loss_count(other.burst_loss_count), |
| 641 | burst_discard_count(other.burst_discard_count), |
| 642 | burst_loss_rate(other.burst_loss_rate), |
| 643 | burst_discard_rate(other.burst_discard_rate), |
| 644 | gap_loss_rate(other.gap_loss_rate), |
hbos | 6769c49 | 2017-01-02 08:35:13 -0800 | [diff] [blame] | 645 | gap_discard_rate(other.gap_discard_rate), |
Henrik Boström | 2e06926 | 2019-04-09 13:59:31 +0200 | [diff] [blame] | 646 | frames_decoded(other.frames_decoded), |
| 647 | content_type(other.content_type) {} |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 648 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 649 | RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {} |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 650 | |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 651 | // clang-format off |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 652 | WEBRTC_RTCSTATS_IMPL( |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 653 | RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp", |
| 654 | &packets_sent, |
Henrik Boström | cf96e0f | 2019-04-17 13:51:53 +0200 | [diff] [blame] | 655 | &retransmitted_packets_sent, |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 656 | &bytes_sent, |
Henrik Boström | cf96e0f | 2019-04-17 13:51:53 +0200 | [diff] [blame] | 657 | &retransmitted_bytes_sent, |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 658 | &target_bitrate, |
Henrik Boström | f71362f | 2019-04-08 16:14:23 +0200 | [diff] [blame] | 659 | &frames_encoded, |
Henrik Boström | 2e06926 | 2019-04-09 13:59:31 +0200 | [diff] [blame] | 660 | &total_encode_time, |
| 661 | &content_type) |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 662 | // clang-format on |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 663 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 664 | RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(const std::string& id, |
| 665 | int64_t timestamp_us) |
| 666 | : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {} |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 667 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 668 | RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string&& id, |
| 669 | int64_t timestamp_us) |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 670 | : RTCRTPStreamStats(std::move(id), timestamp_us), |
| 671 | packets_sent("packetsSent"), |
Henrik Boström | cf96e0f | 2019-04-17 13:51:53 +0200 | [diff] [blame] | 672 | retransmitted_packets_sent("retransmittedPacketsSent"), |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 673 | bytes_sent("bytesSent"), |
Henrik Boström | cf96e0f | 2019-04-17 13:51:53 +0200 | [diff] [blame] | 674 | retransmitted_bytes_sent("retransmittedBytesSent"), |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 675 | target_bitrate("targetBitrate"), |
Henrik Boström | f71362f | 2019-04-08 16:14:23 +0200 | [diff] [blame] | 676 | frames_encoded("framesEncoded"), |
Henrik Boström | 2e06926 | 2019-04-09 13:59:31 +0200 | [diff] [blame] | 677 | total_encode_time("totalEncodeTime"), |
| 678 | content_type("contentType") {} |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 679 | |
| 680 | RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats( |
| 681 | const RTCOutboundRTPStreamStats& other) |
| 682 | : RTCRTPStreamStats(other), |
| 683 | packets_sent(other.packets_sent), |
Henrik Boström | cf96e0f | 2019-04-17 13:51:53 +0200 | [diff] [blame] | 684 | retransmitted_packets_sent(other.retransmitted_packets_sent), |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 685 | bytes_sent(other.bytes_sent), |
Henrik Boström | cf96e0f | 2019-04-17 13:51:53 +0200 | [diff] [blame] | 686 | retransmitted_bytes_sent(other.retransmitted_bytes_sent), |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 687 | target_bitrate(other.target_bitrate), |
Henrik Boström | f71362f | 2019-04-08 16:14:23 +0200 | [diff] [blame] | 688 | frames_encoded(other.frames_encoded), |
Henrik Boström | 2e06926 | 2019-04-09 13:59:31 +0200 | [diff] [blame] | 689 | total_encode_time(other.total_encode_time), |
| 690 | content_type(other.content_type) {} |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 691 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 692 | RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {} |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 693 | |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 694 | // clang-format off |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 695 | WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport", |
| 696 | &bytes_sent, |
| 697 | &bytes_received, |
| 698 | &rtcp_transport_stats_id, |
hbos | 7064d59 | 2017-01-16 07:38:02 -0800 | [diff] [blame] | 699 | &dtls_state, |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 700 | &selected_candidate_pair_id, |
| 701 | &local_certificate_id, |
Nico Weber | 22f9925 | 2019-02-20 10:13:16 -0500 | [diff] [blame] | 702 | &remote_certificate_id) |
Steve Anton | d6a5cbd | 2017-08-18 09:40:25 -0700 | [diff] [blame] | 703 | // clang-format on |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 704 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 705 | RTCTransportStats::RTCTransportStats(const std::string& id, |
| 706 | int64_t timestamp_us) |
| 707 | : RTCTransportStats(std::string(id), timestamp_us) {} |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 708 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 709 | RTCTransportStats::RTCTransportStats(std::string&& id, int64_t timestamp_us) |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 710 | : RTCStats(std::move(id), timestamp_us), |
| 711 | bytes_sent("bytesSent"), |
| 712 | bytes_received("bytesReceived"), |
| 713 | rtcp_transport_stats_id("rtcpTransportStatsId"), |
hbos | 7064d59 | 2017-01-16 07:38:02 -0800 | [diff] [blame] | 714 | dtls_state("dtlsState"), |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 715 | selected_candidate_pair_id("selectedCandidatePairId"), |
| 716 | local_certificate_id("localCertificateId"), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 717 | remote_certificate_id("remoteCertificateId") {} |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 718 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 719 | RTCTransportStats::RTCTransportStats(const RTCTransportStats& other) |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 720 | : RTCStats(other.id(), other.timestamp_us()), |
| 721 | bytes_sent(other.bytes_sent), |
| 722 | bytes_received(other.bytes_received), |
| 723 | rtcp_transport_stats_id(other.rtcp_transport_stats_id), |
hbos | 7064d59 | 2017-01-16 07:38:02 -0800 | [diff] [blame] | 724 | dtls_state(other.dtls_state), |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 725 | selected_candidate_pair_id(other.selected_candidate_pair_id), |
| 726 | local_certificate_id(other.local_certificate_id), |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 727 | remote_certificate_id(other.remote_certificate_id) {} |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 728 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 729 | RTCTransportStats::~RTCTransportStats() {} |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 730 | |
hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 731 | } // namespace webrtc |