blob: 59183ad60b6f930b00f2ecda4390ad07f974cb88 [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
hbos2fa7c672016-10-24 04:00:05 -070032WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate",
33 &fingerprint,
34 &fingerprint_algorithm,
35 &base64_certificate,
36 &issuer_certificate_id);
37
38RTCCertificateStats::RTCCertificateStats(
39 const std::string& id, int64_t timestamp_us)
40 : RTCCertificateStats(std::string(id), timestamp_us) {
41}
42
43RTCCertificateStats::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
52RTCCertificateStats::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
61RTCCertificateStats::~RTCCertificateStats() {
62}
63
hbos0adb8282016-11-23 02:32:06 -080064WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec",
65 &payload_type,
66 &codec,
67 &clock_rate,
68 &channels,
69 &parameters,
70 &implementation);
71
72RTCCodecStats::RTCCodecStats(
73 const std::string& id, int64_t timestamp_us)
74 : RTCCodecStats(std::string(id), timestamp_us) {
75}
76
77RTCCodecStats::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
88RTCCodecStats::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
99RTCCodecStats::~RTCCodecStats() {
100}
101
hbos2fa7c672016-10-24 04:00:05 -0700102WEBRTC_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
112RTCDataChannelStats::RTCDataChannelStats(
113 const std::string& id, int64_t timestamp_us)
114 : RTCDataChannelStats(std::string(id), timestamp_us) {
115}
116
117RTCDataChannelStats::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
130RTCDataChannelStats::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
143RTCDataChannelStats::~RTCDataChannelStats() {
144}
145
hbosc47a0c32016-10-11 14:54:49 -0700146WEBRTC_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,
hbos3168c7a2016-12-15 06:17:08 -0800157 &total_round_trip_time,
158 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700159 &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
172RTCIceCandidatePairStats::RTCIceCandidatePairStats(
173 const std::string& id, int64_t timestamp_us)
174 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {
175}
176
177RTCIceCandidatePairStats::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"),
hbos3168c7a2016-12-15 06:17:08 -0800190 total_round_trip_time("totalRoundTripTime"),
191 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700192 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
206RTCIceCandidatePairStats::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),
hbos3168c7a2016-12-15 06:17:08 -0800219 total_round_trip_time(other.total_round_trip_time),
220 current_round_trip_time(other.current_round_trip_time),
hbosc47a0c32016-10-11 14:54:49 -0700221 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
235RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {
236}
237
hbosab9f6e42016-10-07 02:18:47 -0700238WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800239 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800240 &is_remote,
hbosab9f6e42016-10-07 02:18:47 -0700241 &ip,
242 &port,
243 &protocol,
244 &candidate_type,
245 &priority,
hbosd17a5a72017-01-02 08:09:59 -0800246 &url,
247 &deleted);
hbosab9f6e42016-10-07 02:18:47 -0700248
249RTCIceCandidateStats::RTCIceCandidateStats(
hbosc3a2b7f2017-01-02 04:46:15 -0800250 const std::string& id, int64_t timestamp_us, bool is_remote)
251 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {
hbosab9f6e42016-10-07 02:18:47 -0700252}
253
254RTCIceCandidateStats::RTCIceCandidateStats(
hbosc3a2b7f2017-01-02 04:46:15 -0800255 std::string&& id, int64_t timestamp_us, bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700256 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800257 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800258 is_remote("isRemote", is_remote),
hbosab9f6e42016-10-07 02:18:47 -0700259 ip("ip"),
260 port("port"),
261 protocol("protocol"),
262 candidate_type("candidateType"),
263 priority("priority"),
hbosd17a5a72017-01-02 08:09:59 -0800264 url("url"),
265 deleted("deleted", false) {
hbosab9f6e42016-10-07 02:18:47 -0700266}
267
268RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
269 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800270 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800271 is_remote(other.is_remote),
hbosab9f6e42016-10-07 02:18:47 -0700272 ip(other.ip),
273 port(other.port),
274 protocol(other.protocol),
275 candidate_type(other.candidate_type),
276 priority(other.priority),
hbosd17a5a72017-01-02 08:09:59 -0800277 url(other.url),
278 deleted(other.deleted) {
hbosab9f6e42016-10-07 02:18:47 -0700279}
280
281RTCIceCandidateStats::~RTCIceCandidateStats() {
282}
283
284const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
285
286RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(
287 const std::string& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800288 : RTCIceCandidateStats(id, timestamp_us, false) {
hbosab9f6e42016-10-07 02:18:47 -0700289}
290
291RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(
292 std::string&& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800293 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {
hbosab9f6e42016-10-07 02:18:47 -0700294}
295
296const char* RTCLocalIceCandidateStats::type() const {
297 return kType;
298}
299
300const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
301
302RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(
303 const std::string& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800304 : RTCIceCandidateStats(id, timestamp_us, true) {
hbosab9f6e42016-10-07 02:18:47 -0700305}
306
307RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(
308 std::string&& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800309 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {
hbosab9f6e42016-10-07 02:18:47 -0700310}
311
312const char* RTCRemoteIceCandidateStats::type() const {
313 return kType;
314}
315
hbos09bc1282016-11-08 06:29:22 -0800316WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
317 &stream_identifier,
318 &track_ids);
319
320RTCMediaStreamStats::RTCMediaStreamStats(
321 const std::string& id, int64_t timestamp_us)
322 : RTCMediaStreamStats(std::string(id), timestamp_us) {
323}
324
325RTCMediaStreamStats::RTCMediaStreamStats(
326 std::string&& id, int64_t timestamp_us)
327 : RTCStats(std::move(id), timestamp_us),
328 stream_identifier("streamIdentifier"),
329 track_ids("trackIds") {
330}
331
332RTCMediaStreamStats::RTCMediaStreamStats(
333 const RTCMediaStreamStats& other)
334 : RTCStats(other.id(), other.timestamp_us()),
335 stream_identifier(other.stream_identifier),
336 track_ids(other.track_ids) {
337}
338
339RTCMediaStreamStats::~RTCMediaStreamStats() {
340}
341
342WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
343 &track_identifier,
344 &remote_source,
345 &ended,
346 &detached,
hbos09bc1282016-11-08 06:29:22 -0800347 &frame_width,
348 &frame_height,
349 &frames_per_second,
350 &frames_sent,
351 &frames_received,
352 &frames_decoded,
353 &frames_dropped,
354 &frames_corrupted,
355 &partial_frames_lost,
356 &full_frames_lost,
357 &audio_level,
358 &echo_return_loss,
359 &echo_return_loss_enhancement);
360
361RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
362 const std::string& id, int64_t timestamp_us)
363 : RTCMediaStreamTrackStats(std::string(id), timestamp_us) {
364}
365
366RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
367 std::string&& id, int64_t timestamp_us)
368 : RTCStats(std::move(id), timestamp_us),
369 track_identifier("trackIdentifier"),
370 remote_source("remoteSource"),
371 ended("ended"),
372 detached("detached"),
hbos09bc1282016-11-08 06:29:22 -0800373 frame_width("frameWidth"),
374 frame_height("frameHeight"),
375 frames_per_second("framesPerSecond"),
376 frames_sent("framesSent"),
377 frames_received("framesReceived"),
378 frames_decoded("framesDecoded"),
379 frames_dropped("framesDropped"),
380 frames_corrupted("framesCorrupted"),
381 partial_frames_lost("partialFramesLost"),
382 full_frames_lost("fullFramesLost"),
383 audio_level("audioLevel"),
384 echo_return_loss("echoReturnLoss"),
385 echo_return_loss_enhancement("echoReturnLossEnhancement") {
386}
387
388RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
389 const RTCMediaStreamTrackStats& other)
390 : RTCStats(other.id(), other.timestamp_us()),
391 track_identifier(other.track_identifier),
392 remote_source(other.remote_source),
393 ended(other.ended),
394 detached(other.detached),
hbos09bc1282016-11-08 06:29:22 -0800395 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
410RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {
411}
412
hbosfc5e0502016-10-06 02:06:10 -0700413WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
414 &data_channels_opened,
415 &data_channels_closed);
hbosd565b732016-08-30 14:04:35 -0700416
417RTCPeerConnectionStats::RTCPeerConnectionStats(
hbos0e6758d2016-08-31 07:57:36 -0700418 const std::string& id, int64_t timestamp_us)
419 : RTCPeerConnectionStats(std::string(id), timestamp_us) {
hbosd565b732016-08-30 14:04:35 -0700420}
421
422RTCPeerConnectionStats::RTCPeerConnectionStats(
hbos0e6758d2016-08-31 07:57:36 -0700423 std::string&& id, int64_t timestamp_us)
424 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700425 data_channels_opened("dataChannelsOpened"),
426 data_channels_closed("dataChannelsClosed") {
427}
428
hbosfc5e0502016-10-06 02:06:10 -0700429RTCPeerConnectionStats::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
436RTCPeerConnectionStats::~RTCPeerConnectionStats() {
437}
438
hbos6ded1902016-11-01 01:50:46 -0700439WEBRTC_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,
hbos6769c492017-01-02 08:35:13 -0800450 &sli_count,
451 &qp_sum);
hbos6ded1902016-11-01 01:50:46 -0700452
453RTCRTPStreamStats::RTCRTPStreamStats(
454 const std::string& id, int64_t timestamp_us)
455 : RTCRTPStreamStats(std::string(id), timestamp_us) {
456}
457
458RTCRTPStreamStats::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"),
hbos6769c492017-01-02 08:35:13 -0800471 sli_count("sliCount"),
472 qp_sum("qpSum") {
hbos6ded1902016-11-01 01:50:46 -0700473}
474
475RTCRTPStreamStats::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),
hbos6769c492017-01-02 08:35:13 -0800488 sli_count(other.sli_count),
489 qp_sum(other.qp_sum) {
hbos6ded1902016-11-01 01:50:46 -0700490}
491
492RTCRTPStreamStats::~RTCRTPStreamStats() {
493}
494
495WEBRTC_RTCSTATS_IMPL(
hboseeafe942016-11-01 03:00:17 -0700496 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,
hbos6769c492017-01-02 08:35:13 -0800511 &gap_discard_rate,
512 &frames_decoded);
hboseeafe942016-11-01 03:00:17 -0700513
514RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
515 const std::string& id, int64_t timestamp_us)
516 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {
517}
518
519RTCInboundRTPStreamStats::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"),
hbos6769c492017-01-02 08:35:13 -0800536 gap_discard_rate("gapDiscardRate"),
537 frames_decoded("framesDecoded") {
hboseeafe942016-11-01 03:00:17 -0700538}
539
540RTCInboundRTPStreamStats::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),
hbos6769c492017-01-02 08:35:13 -0800557 gap_discard_rate(other.gap_discard_rate),
558 frames_decoded(other.frames_decoded) {
hboseeafe942016-11-01 03:00:17 -0700559}
560
561RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {
562}
563
564WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700565 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
566 &packets_sent,
567 &bytes_sent,
568 &target_bitrate,
hbos6769c492017-01-02 08:35:13 -0800569 &round_trip_time,
570 &frames_encoded);
hbos6ded1902016-11-01 01:50:46 -0700571
572RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
573 const std::string& id, int64_t timestamp_us)
574 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {
575}
576
577RTCOutboundRTPStreamStats::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"),
hbos6769c492017-01-02 08:35:13 -0800583 round_trip_time("roundTripTime"),
584 frames_encoded("framesEncoded") {
hbos6ded1902016-11-01 01:50:46 -0700585}
586
587RTCOutboundRTPStreamStats::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),
hbos6769c492017-01-02 08:35:13 -0800593 round_trip_time(other.round_trip_time),
594 frames_encoded(other.frames_encoded) {
hbos6ded1902016-11-01 01:50:46 -0700595}
596
597RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {
598}
599
hbos2fa7c672016-10-24 04:00:05 -0700600WEBRTC_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
609RTCTransportStats::RTCTransportStats(
610 const std::string& id, int64_t timestamp_us)
611 : RTCTransportStats(std::string(id), timestamp_us) {
612}
613
614RTCTransportStats::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
626RTCTransportStats::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
638RTCTransportStats::~RTCTransportStats() {
639}
640
hbosd565b732016-08-30 14:04:35 -0700641} // namespace webrtc