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