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