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