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