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