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