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