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