blob: 1b9d12a75b54fd40f54c580a3e551eb6fe2ef111 [file] [log] [blame]
hbosd565b732016-08-30 14:04:35 -07001/*
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
hbos74e1a4f2016-09-15 23:33:01 -070011#include "webrtc/api/stats/rtcstats_objects.h"
hbosd565b732016-08-30 14:04:35 -070012
13namespace webrtc {
14
hboscc555c52016-10-18 12:48:31 -070015const char* RTCDataChannelState::kConnecting = "connecting";
16const char* RTCDataChannelState::kOpen = "open";
17const char* RTCDataChannelState::kClosing = "closing";
18const char* RTCDataChannelState::kClosed = "closed";
19
hbosc47a0c32016-10-11 14:54:49 -070020const char* RTCStatsIceCandidatePairState::kFrozen = "frozen";
21const char* RTCStatsIceCandidatePairState::kWaiting = "waiting";
hbos06495bc2017-01-02 08:08:18 -080022const char* RTCStatsIceCandidatePairState::kInProgress = "in-progress";
hbosc47a0c32016-10-11 14:54:49 -070023const char* RTCStatsIceCandidatePairState::kFailed = "failed";
24const char* RTCStatsIceCandidatePairState::kSucceeded = "succeeded";
hbosc47a0c32016-10-11 14:54:49 -070025
26// Strings defined in https://tools.ietf.org/html/rfc5245.
hbosab9f6e42016-10-07 02:18:47 -070027const char* RTCIceCandidateType::kHost = "host";
28const char* RTCIceCandidateType::kSrflx = "srflx";
29const char* RTCIceCandidateType::kPrflx = "prflx";
30const char* RTCIceCandidateType::kRelay = "relay";
31
hbos7064d592017-01-16 07:38:02 -080032const char* RTCDtlsTransportState::kNew = "new";
33const char* RTCDtlsTransportState::kConnecting = "connecting";
34const char* RTCDtlsTransportState::kConnected = "connected";
35const char* RTCDtlsTransportState::kClosed = "closed";
36const char* RTCDtlsTransportState::kFailed = "failed";
37
hbos2fa7c672016-10-24 04:00:05 -070038WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate",
39 &fingerprint,
40 &fingerprint_algorithm,
41 &base64_certificate,
42 &issuer_certificate_id);
43
44RTCCertificateStats::RTCCertificateStats(
45 const std::string& id, int64_t timestamp_us)
46 : RTCCertificateStats(std::string(id), timestamp_us) {
47}
48
49RTCCertificateStats::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
58RTCCertificateStats::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
67RTCCertificateStats::~RTCCertificateStats() {
68}
69
hbos0adb8282016-11-23 02:32:06 -080070WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec",
71 &payload_type,
72 &codec,
73 &clock_rate,
74 &channels,
75 &parameters,
76 &implementation);
77
78RTCCodecStats::RTCCodecStats(
79 const std::string& id, int64_t timestamp_us)
80 : RTCCodecStats(std::string(id), timestamp_us) {
81}
82
83RTCCodecStats::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
94RTCCodecStats::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
105RTCCodecStats::~RTCCodecStats() {
106}
107
hbos2fa7c672016-10-24 04:00:05 -0700108WEBRTC_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
118RTCDataChannelStats::RTCDataChannelStats(
119 const std::string& id, int64_t timestamp_us)
120 : RTCDataChannelStats(std::string(id), timestamp_us) {
121}
122
123RTCDataChannelStats::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
136RTCDataChannelStats::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
149RTCDataChannelStats::~RTCDataChannelStats() {
150}
151
hbosc47a0c32016-10-11 14:54:49 -0700152WEBRTC_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,
hbos3168c7a2016-12-15 06:17:08 -0800163 &total_round_trip_time,
164 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700165 &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
178RTCIceCandidatePairStats::RTCIceCandidatePairStats(
179 const std::string& id, int64_t timestamp_us)
180 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {
181}
182
183RTCIceCandidatePairStats::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"),
hbos3168c7a2016-12-15 06:17:08 -0800196 total_round_trip_time("totalRoundTripTime"),
197 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700198 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
212RTCIceCandidatePairStats::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),
hbos3168c7a2016-12-15 06:17:08 -0800225 total_round_trip_time(other.total_round_trip_time),
226 current_round_trip_time(other.current_round_trip_time),
hbosc47a0c32016-10-11 14:54:49 -0700227 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
241RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {
242}
243
hbosab9f6e42016-10-07 02:18:47 -0700244WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800245 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800246 &is_remote,
hbosab9f6e42016-10-07 02:18:47 -0700247 &ip,
248 &port,
249 &protocol,
250 &candidate_type,
251 &priority,
hbosd17a5a72017-01-02 08:09:59 -0800252 &url,
253 &deleted);
hbosab9f6e42016-10-07 02:18:47 -0700254
255RTCIceCandidateStats::RTCIceCandidateStats(
hbosc3a2b7f2017-01-02 04:46:15 -0800256 const std::string& id, int64_t timestamp_us, bool is_remote)
257 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {
hbosab9f6e42016-10-07 02:18:47 -0700258}
259
260RTCIceCandidateStats::RTCIceCandidateStats(
hbosc3a2b7f2017-01-02 04:46:15 -0800261 std::string&& id, int64_t timestamp_us, bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700262 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800263 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800264 is_remote("isRemote", is_remote),
hbosab9f6e42016-10-07 02:18:47 -0700265 ip("ip"),
266 port("port"),
267 protocol("protocol"),
268 candidate_type("candidateType"),
269 priority("priority"),
hbosd17a5a72017-01-02 08:09:59 -0800270 url("url"),
271 deleted("deleted", false) {
hbosab9f6e42016-10-07 02:18:47 -0700272}
273
274RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
275 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800276 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800277 is_remote(other.is_remote),
hbosab9f6e42016-10-07 02:18:47 -0700278 ip(other.ip),
279 port(other.port),
280 protocol(other.protocol),
281 candidate_type(other.candidate_type),
282 priority(other.priority),
hbosd17a5a72017-01-02 08:09:59 -0800283 url(other.url),
284 deleted(other.deleted) {
hbosab9f6e42016-10-07 02:18:47 -0700285}
286
287RTCIceCandidateStats::~RTCIceCandidateStats() {
288}
289
290const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
291
292RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(
293 const std::string& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800294 : RTCIceCandidateStats(id, timestamp_us, false) {
hbosab9f6e42016-10-07 02:18:47 -0700295}
296
297RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(
298 std::string&& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800299 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {
hbosab9f6e42016-10-07 02:18:47 -0700300}
301
302const char* RTCLocalIceCandidateStats::type() const {
303 return kType;
304}
305
306const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
307
308RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(
309 const std::string& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800310 : RTCIceCandidateStats(id, timestamp_us, true) {
hbosab9f6e42016-10-07 02:18:47 -0700311}
312
313RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(
314 std::string&& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800315 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {
hbosab9f6e42016-10-07 02:18:47 -0700316}
317
318const char* RTCRemoteIceCandidateStats::type() const {
319 return kType;
320}
321
hbos09bc1282016-11-08 06:29:22 -0800322WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
323 &stream_identifier,
324 &track_ids);
325
326RTCMediaStreamStats::RTCMediaStreamStats(
327 const std::string& id, int64_t timestamp_us)
328 : RTCMediaStreamStats(std::string(id), timestamp_us) {
329}
330
331RTCMediaStreamStats::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
338RTCMediaStreamStats::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
345RTCMediaStreamStats::~RTCMediaStreamStats() {
346}
347
348WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
349 &track_identifier,
350 &remote_source,
351 &ended,
352 &detached,
hbos09bc1282016-11-08 06:29:22 -0800353 &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
367RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
368 const std::string& id, int64_t timestamp_us)
369 : RTCMediaStreamTrackStats(std::string(id), timestamp_us) {
370}
371
372RTCMediaStreamTrackStats::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"),
hbos09bc1282016-11-08 06:29:22 -0800379 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
394RTCMediaStreamTrackStats::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),
hbos09bc1282016-11-08 06:29:22 -0800401 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
416RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {
417}
418
hbosfc5e0502016-10-06 02:06:10 -0700419WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
420 &data_channels_opened,
421 &data_channels_closed);
hbosd565b732016-08-30 14:04:35 -0700422
423RTCPeerConnectionStats::RTCPeerConnectionStats(
hbos0e6758d2016-08-31 07:57:36 -0700424 const std::string& id, int64_t timestamp_us)
425 : RTCPeerConnectionStats(std::string(id), timestamp_us) {
hbosd565b732016-08-30 14:04:35 -0700426}
427
428RTCPeerConnectionStats::RTCPeerConnectionStats(
hbos0e6758d2016-08-31 07:57:36 -0700429 std::string&& id, int64_t timestamp_us)
430 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700431 data_channels_opened("dataChannelsOpened"),
432 data_channels_closed("dataChannelsClosed") {
433}
434
hbosfc5e0502016-10-06 02:06:10 -0700435RTCPeerConnectionStats::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
442RTCPeerConnectionStats::~RTCPeerConnectionStats() {
443}
444
hbos6ded1902016-11-01 01:50:46 -0700445WEBRTC_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,
hbos6769c492017-01-02 08:35:13 -0800456 &sli_count,
457 &qp_sum);
hbos6ded1902016-11-01 01:50:46 -0700458
459RTCRTPStreamStats::RTCRTPStreamStats(
460 const std::string& id, int64_t timestamp_us)
461 : RTCRTPStreamStats(std::string(id), timestamp_us) {
462}
463
464RTCRTPStreamStats::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"),
hbos6769c492017-01-02 08:35:13 -0800477 sli_count("sliCount"),
478 qp_sum("qpSum") {
hbos6ded1902016-11-01 01:50:46 -0700479}
480
481RTCRTPStreamStats::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),
hbos6769c492017-01-02 08:35:13 -0800494 sli_count(other.sli_count),
495 qp_sum(other.qp_sum) {
hbos6ded1902016-11-01 01:50:46 -0700496}
497
498RTCRTPStreamStats::~RTCRTPStreamStats() {
499}
500
501WEBRTC_RTCSTATS_IMPL(
hboseeafe942016-11-01 03:00:17 -0700502 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,
hbos6769c492017-01-02 08:35:13 -0800517 &gap_discard_rate,
518 &frames_decoded);
hboseeafe942016-11-01 03:00:17 -0700519
520RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
521 const std::string& id, int64_t timestamp_us)
522 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {
523}
524
525RTCInboundRTPStreamStats::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"),
hbos6769c492017-01-02 08:35:13 -0800542 gap_discard_rate("gapDiscardRate"),
543 frames_decoded("framesDecoded") {
hboseeafe942016-11-01 03:00:17 -0700544}
545
546RTCInboundRTPStreamStats::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),
hbos6769c492017-01-02 08:35:13 -0800563 gap_discard_rate(other.gap_discard_rate),
564 frames_decoded(other.frames_decoded) {
hboseeafe942016-11-01 03:00:17 -0700565}
566
567RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {
568}
569
570WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700571 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
572 &packets_sent,
573 &bytes_sent,
574 &target_bitrate,
hbos6769c492017-01-02 08:35:13 -0800575 &round_trip_time,
576 &frames_encoded);
hbos6ded1902016-11-01 01:50:46 -0700577
578RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
579 const std::string& id, int64_t timestamp_us)
580 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {
581}
582
583RTCOutboundRTPStreamStats::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"),
hbos6769c492017-01-02 08:35:13 -0800589 round_trip_time("roundTripTime"),
590 frames_encoded("framesEncoded") {
hbos6ded1902016-11-01 01:50:46 -0700591}
592
593RTCOutboundRTPStreamStats::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),
hbos6769c492017-01-02 08:35:13 -0800599 round_trip_time(other.round_trip_time),
600 frames_encoded(other.frames_encoded) {
hbos6ded1902016-11-01 01:50:46 -0700601}
602
603RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {
604}
605
hbos2fa7c672016-10-24 04:00:05 -0700606WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
607 &bytes_sent,
608 &bytes_received,
609 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -0800610 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -0700611 &selected_candidate_pair_id,
612 &local_certificate_id,
613 &remote_certificate_id);
614
615RTCTransportStats::RTCTransportStats(
616 const std::string& id, int64_t timestamp_us)
617 : RTCTransportStats(std::string(id), timestamp_us) {
618}
619
620RTCTransportStats::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"),
hbos7064d592017-01-16 07:38:02 -0800626 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -0700627 selected_candidate_pair_id("selectedCandidatePairId"),
628 local_certificate_id("localCertificateId"),
629 remote_certificate_id("remoteCertificateId") {
630}
631
632RTCTransportStats::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),
hbos7064d592017-01-16 07:38:02 -0800638 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -0700639 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
644RTCTransportStats::~RTCTransportStats() {
645}
646
hbosd565b732016-08-30 14:04:35 -0700647} // namespace webrtc