blob: af87e717405c12f945de1c0afb4cc014b6c1ae4f [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
hbos160e4a72017-01-17 02:53:23 -080038const char* RTCMediaStreamTrackKind::kAudio = "audio";
39const char* RTCMediaStreamTrackKind::kVideo = "video";
40
hbos2fa7c672016-10-24 04:00:05 -070041WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate",
42 &fingerprint,
43 &fingerprint_algorithm,
44 &base64_certificate,
45 &issuer_certificate_id);
46
47RTCCertificateStats::RTCCertificateStats(
48 const std::string& id, int64_t timestamp_us)
49 : RTCCertificateStats(std::string(id), timestamp_us) {
50}
51
52RTCCertificateStats::RTCCertificateStats(
53 std::string&& id, int64_t timestamp_us)
54 : RTCStats(std::move(id), timestamp_us),
55 fingerprint("fingerprint"),
56 fingerprint_algorithm("fingerprintAlgorithm"),
57 base64_certificate("base64Certificate"),
58 issuer_certificate_id("issuerCertificateId") {
59}
60
61RTCCertificateStats::RTCCertificateStats(
62 const RTCCertificateStats& other)
63 : RTCStats(other.id(), other.timestamp_us()),
64 fingerprint(other.fingerprint),
65 fingerprint_algorithm(other.fingerprint_algorithm),
66 base64_certificate(other.base64_certificate),
67 issuer_certificate_id(other.issuer_certificate_id) {
68}
69
70RTCCertificateStats::~RTCCertificateStats() {
71}
72
hbos0adb8282016-11-23 02:32:06 -080073WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec",
74 &payload_type,
75 &codec,
76 &clock_rate,
77 &channels,
78 &parameters,
79 &implementation);
80
81RTCCodecStats::RTCCodecStats(
82 const std::string& id, int64_t timestamp_us)
83 : RTCCodecStats(std::string(id), timestamp_us) {
84}
85
86RTCCodecStats::RTCCodecStats(
87 std::string&& id, int64_t timestamp_us)
88 : RTCStats(std::move(id), timestamp_us),
89 payload_type("payloadType"),
90 codec("codec"),
91 clock_rate("clockRate"),
92 channels("channels"),
93 parameters("parameters"),
94 implementation("implementation") {
95}
96
97RTCCodecStats::RTCCodecStats(
98 const RTCCodecStats& other)
99 : RTCStats(other.id(), other.timestamp_us()),
100 payload_type(other.payload_type),
101 codec(other.codec),
102 clock_rate(other.clock_rate),
103 channels(other.channels),
104 parameters(other.parameters),
105 implementation(other.implementation) {
106}
107
108RTCCodecStats::~RTCCodecStats() {
109}
110
hbos2fa7c672016-10-24 04:00:05 -0700111WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel",
112 &label,
113 &protocol,
114 &datachannelid,
115 &state,
116 &messages_sent,
117 &bytes_sent,
118 &messages_received,
119 &bytes_received);
120
121RTCDataChannelStats::RTCDataChannelStats(
122 const std::string& id, int64_t timestamp_us)
123 : RTCDataChannelStats(std::string(id), timestamp_us) {
124}
125
126RTCDataChannelStats::RTCDataChannelStats(
127 std::string&& id, int64_t timestamp_us)
128 : RTCStats(std::move(id), timestamp_us),
129 label("label"),
130 protocol("protocol"),
131 datachannelid("datachannelid"),
132 state("state"),
133 messages_sent("messagesSent"),
134 bytes_sent("bytesSent"),
135 messages_received("messagesReceived"),
136 bytes_received("bytesReceived") {
137}
138
139RTCDataChannelStats::RTCDataChannelStats(
140 const RTCDataChannelStats& other)
141 : RTCStats(other.id(), other.timestamp_us()),
142 label(other.label),
143 protocol(other.protocol),
144 datachannelid(other.datachannelid),
145 state(other.state),
146 messages_sent(other.messages_sent),
147 bytes_sent(other.bytes_sent),
148 messages_received(other.messages_received),
149 bytes_received(other.bytes_received) {
150}
151
152RTCDataChannelStats::~RTCDataChannelStats() {
153}
154
hbosc47a0c32016-10-11 14:54:49 -0700155WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair",
156 &transport_id,
157 &local_candidate_id,
158 &remote_candidate_id,
159 &state,
160 &priority,
161 &nominated,
162 &writable,
163 &readable,
164 &bytes_sent,
165 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800166 &total_round_trip_time,
167 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700168 &available_outgoing_bitrate,
169 &available_incoming_bitrate,
170 &requests_received,
171 &requests_sent,
172 &responses_received,
173 &responses_sent,
174 &retransmissions_received,
175 &retransmissions_sent,
176 &consent_requests_received,
177 &consent_requests_sent,
178 &consent_responses_received,
179 &consent_responses_sent);
180
181RTCIceCandidatePairStats::RTCIceCandidatePairStats(
182 const std::string& id, int64_t timestamp_us)
183 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {
184}
185
186RTCIceCandidatePairStats::RTCIceCandidatePairStats(
187 std::string&& id, int64_t timestamp_us)
188 : RTCStats(std::move(id), timestamp_us),
189 transport_id("transportId"),
190 local_candidate_id("localCandidateId"),
191 remote_candidate_id("remoteCandidateId"),
192 state("state"),
193 priority("priority"),
194 nominated("nominated"),
195 writable("writable"),
196 readable("readable"),
197 bytes_sent("bytesSent"),
198 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800199 total_round_trip_time("totalRoundTripTime"),
200 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700201 available_outgoing_bitrate("availableOutgoingBitrate"),
202 available_incoming_bitrate("availableIncomingBitrate"),
203 requests_received("requestsReceived"),
204 requests_sent("requestsSent"),
205 responses_received("responsesReceived"),
206 responses_sent("responsesSent"),
207 retransmissions_received("retransmissionsReceived"),
208 retransmissions_sent("retransmissionsSent"),
209 consent_requests_received("consentRequestsReceived"),
210 consent_requests_sent("consentRequestsSent"),
211 consent_responses_received("consentResponsesReceived"),
212 consent_responses_sent("consentResponsesSent") {
213}
214
215RTCIceCandidatePairStats::RTCIceCandidatePairStats(
216 const RTCIceCandidatePairStats& other)
217 : RTCStats(other.id(), other.timestamp_us()),
218 transport_id(other.transport_id),
219 local_candidate_id(other.local_candidate_id),
220 remote_candidate_id(other.remote_candidate_id),
221 state(other.state),
222 priority(other.priority),
223 nominated(other.nominated),
224 writable(other.writable),
225 readable(other.readable),
226 bytes_sent(other.bytes_sent),
227 bytes_received(other.bytes_received),
hbos3168c7a2016-12-15 06:17:08 -0800228 total_round_trip_time(other.total_round_trip_time),
229 current_round_trip_time(other.current_round_trip_time),
hbosc47a0c32016-10-11 14:54:49 -0700230 available_outgoing_bitrate(other.available_outgoing_bitrate),
231 available_incoming_bitrate(other.available_incoming_bitrate),
232 requests_received(other.requests_received),
233 requests_sent(other.requests_sent),
234 responses_received(other.responses_received),
235 responses_sent(other.responses_sent),
236 retransmissions_received(other.retransmissions_received),
237 retransmissions_sent(other.retransmissions_sent),
238 consent_requests_received(other.consent_requests_received),
239 consent_requests_sent(other.consent_requests_sent),
240 consent_responses_received(other.consent_responses_received),
241 consent_responses_sent(other.consent_responses_sent) {
242}
243
244RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {
245}
246
hbosab9f6e42016-10-07 02:18:47 -0700247WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800248 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800249 &is_remote,
hbosab9f6e42016-10-07 02:18:47 -0700250 &ip,
251 &port,
252 &protocol,
253 &candidate_type,
254 &priority,
hbosd17a5a72017-01-02 08:09:59 -0800255 &url,
256 &deleted);
hbosab9f6e42016-10-07 02:18:47 -0700257
258RTCIceCandidateStats::RTCIceCandidateStats(
hbosc3a2b7f2017-01-02 04:46:15 -0800259 const std::string& id, int64_t timestamp_us, bool is_remote)
260 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {
hbosab9f6e42016-10-07 02:18:47 -0700261}
262
263RTCIceCandidateStats::RTCIceCandidateStats(
hbosc3a2b7f2017-01-02 04:46:15 -0800264 std::string&& id, int64_t timestamp_us, bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700265 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800266 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800267 is_remote("isRemote", is_remote),
hbosab9f6e42016-10-07 02:18:47 -0700268 ip("ip"),
269 port("port"),
270 protocol("protocol"),
271 candidate_type("candidateType"),
272 priority("priority"),
hbosd17a5a72017-01-02 08:09:59 -0800273 url("url"),
274 deleted("deleted", false) {
hbosab9f6e42016-10-07 02:18:47 -0700275}
276
277RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
278 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800279 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800280 is_remote(other.is_remote),
hbosab9f6e42016-10-07 02:18:47 -0700281 ip(other.ip),
282 port(other.port),
283 protocol(other.protocol),
284 candidate_type(other.candidate_type),
285 priority(other.priority),
hbosd17a5a72017-01-02 08:09:59 -0800286 url(other.url),
287 deleted(other.deleted) {
hbosab9f6e42016-10-07 02:18:47 -0700288}
289
290RTCIceCandidateStats::~RTCIceCandidateStats() {
291}
292
293const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
294
295RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(
296 const std::string& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800297 : RTCIceCandidateStats(id, timestamp_us, false) {
hbosab9f6e42016-10-07 02:18:47 -0700298}
299
300RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(
301 std::string&& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800302 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {
hbosab9f6e42016-10-07 02:18:47 -0700303}
304
305const char* RTCLocalIceCandidateStats::type() const {
306 return kType;
307}
308
309const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
310
311RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(
312 const std::string& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800313 : RTCIceCandidateStats(id, timestamp_us, true) {
hbosab9f6e42016-10-07 02:18:47 -0700314}
315
316RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(
317 std::string&& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800318 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {
hbosab9f6e42016-10-07 02:18:47 -0700319}
320
321const char* RTCRemoteIceCandidateStats::type() const {
322 return kType;
323}
324
hbos09bc1282016-11-08 06:29:22 -0800325WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
326 &stream_identifier,
327 &track_ids);
328
329RTCMediaStreamStats::RTCMediaStreamStats(
330 const std::string& id, int64_t timestamp_us)
331 : RTCMediaStreamStats(std::string(id), timestamp_us) {
332}
333
334RTCMediaStreamStats::RTCMediaStreamStats(
335 std::string&& id, int64_t timestamp_us)
336 : RTCStats(std::move(id), timestamp_us),
337 stream_identifier("streamIdentifier"),
338 track_ids("trackIds") {
339}
340
341RTCMediaStreamStats::RTCMediaStreamStats(
342 const RTCMediaStreamStats& other)
343 : RTCStats(other.id(), other.timestamp_us()),
344 stream_identifier(other.stream_identifier),
345 track_ids(other.track_ids) {
346}
347
348RTCMediaStreamStats::~RTCMediaStreamStats() {
349}
350
351WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
352 &track_identifier,
353 &remote_source,
354 &ended,
355 &detached,
hbos160e4a72017-01-17 02:53:23 -0800356 &kind,
hbos09bc1282016-11-08 06:29:22 -0800357 &frame_width,
358 &frame_height,
359 &frames_per_second,
360 &frames_sent,
361 &frames_received,
362 &frames_decoded,
363 &frames_dropped,
364 &frames_corrupted,
365 &partial_frames_lost,
366 &full_frames_lost,
367 &audio_level,
368 &echo_return_loss,
369 &echo_return_loss_enhancement);
370
371RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
hbos160e4a72017-01-17 02:53:23 -0800372 const std::string& id, int64_t timestamp_us, const char* kind)
373 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {
hbos09bc1282016-11-08 06:29:22 -0800374}
375
376RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
hbos160e4a72017-01-17 02:53:23 -0800377 std::string&& id, int64_t timestamp_us, const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800378 : RTCStats(std::move(id), timestamp_us),
379 track_identifier("trackIdentifier"),
380 remote_source("remoteSource"),
381 ended("ended"),
382 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800383 kind("kind", kind),
hbos09bc1282016-11-08 06:29:22 -0800384 frame_width("frameWidth"),
385 frame_height("frameHeight"),
386 frames_per_second("framesPerSecond"),
387 frames_sent("framesSent"),
388 frames_received("framesReceived"),
389 frames_decoded("framesDecoded"),
390 frames_dropped("framesDropped"),
391 frames_corrupted("framesCorrupted"),
392 partial_frames_lost("partialFramesLost"),
393 full_frames_lost("fullFramesLost"),
394 audio_level("audioLevel"),
395 echo_return_loss("echoReturnLoss"),
396 echo_return_loss_enhancement("echoReturnLossEnhancement") {
hbos160e4a72017-01-17 02:53:23 -0800397 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
398 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800399}
400
401RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
402 const RTCMediaStreamTrackStats& other)
403 : RTCStats(other.id(), other.timestamp_us()),
404 track_identifier(other.track_identifier),
405 remote_source(other.remote_source),
406 ended(other.ended),
407 detached(other.detached),
hbos160e4a72017-01-17 02:53:23 -0800408 kind(other.kind),
hbos09bc1282016-11-08 06:29:22 -0800409 frame_width(other.frame_width),
410 frame_height(other.frame_height),
411 frames_per_second(other.frames_per_second),
412 frames_sent(other.frames_sent),
413 frames_received(other.frames_received),
414 frames_decoded(other.frames_decoded),
415 frames_dropped(other.frames_dropped),
416 frames_corrupted(other.frames_corrupted),
417 partial_frames_lost(other.partial_frames_lost),
418 full_frames_lost(other.full_frames_lost),
419 audio_level(other.audio_level),
420 echo_return_loss(other.echo_return_loss),
421 echo_return_loss_enhancement(other.echo_return_loss_enhancement) {
422}
423
424RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {
425}
426
hbosfc5e0502016-10-06 02:06:10 -0700427WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
428 &data_channels_opened,
429 &data_channels_closed);
hbosd565b732016-08-30 14:04:35 -0700430
431RTCPeerConnectionStats::RTCPeerConnectionStats(
hbos0e6758d2016-08-31 07:57:36 -0700432 const std::string& id, int64_t timestamp_us)
433 : RTCPeerConnectionStats(std::string(id), timestamp_us) {
hbosd565b732016-08-30 14:04:35 -0700434}
435
436RTCPeerConnectionStats::RTCPeerConnectionStats(
hbos0e6758d2016-08-31 07:57:36 -0700437 std::string&& id, int64_t timestamp_us)
438 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700439 data_channels_opened("dataChannelsOpened"),
440 data_channels_closed("dataChannelsClosed") {
441}
442
hbosfc5e0502016-10-06 02:06:10 -0700443RTCPeerConnectionStats::RTCPeerConnectionStats(
444 const RTCPeerConnectionStats& other)
445 : RTCStats(other.id(), other.timestamp_us()),
446 data_channels_opened(other.data_channels_opened),
447 data_channels_closed(other.data_channels_closed) {
448}
449
450RTCPeerConnectionStats::~RTCPeerConnectionStats() {
451}
452
hbos6ded1902016-11-01 01:50:46 -0700453WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
454 &ssrc,
455 &associate_stats_id,
456 &is_remote,
457 &media_type,
458 &media_track_id,
459 &transport_id,
460 &codec_id,
461 &fir_count,
462 &pli_count,
463 &nack_count,
hbos6769c492017-01-02 08:35:13 -0800464 &sli_count,
465 &qp_sum);
hbos6ded1902016-11-01 01:50:46 -0700466
467RTCRTPStreamStats::RTCRTPStreamStats(
468 const std::string& id, int64_t timestamp_us)
469 : RTCRTPStreamStats(std::string(id), timestamp_us) {
470}
471
472RTCRTPStreamStats::RTCRTPStreamStats(
473 std::string&& id, int64_t timestamp_us)
474 : RTCStats(std::move(id), timestamp_us),
475 ssrc("ssrc"),
476 associate_stats_id("associateStatsId"),
477 is_remote("isRemote", false),
478 media_type("mediaType"),
479 media_track_id("mediaTrackId"),
480 transport_id("transportId"),
481 codec_id("codecId"),
482 fir_count("firCount"),
483 pli_count("pliCount"),
484 nack_count("nackCount"),
hbos6769c492017-01-02 08:35:13 -0800485 sli_count("sliCount"),
486 qp_sum("qpSum") {
hbos6ded1902016-11-01 01:50:46 -0700487}
488
489RTCRTPStreamStats::RTCRTPStreamStats(
490 const RTCRTPStreamStats& other)
491 : RTCStats(other.id(), other.timestamp_us()),
492 ssrc(other.ssrc),
493 associate_stats_id(other.associate_stats_id),
494 is_remote(other.is_remote),
495 media_type(other.media_type),
496 media_track_id(other.media_track_id),
497 transport_id(other.transport_id),
498 codec_id(other.codec_id),
499 fir_count(other.fir_count),
500 pli_count(other.pli_count),
501 nack_count(other.nack_count),
hbos6769c492017-01-02 08:35:13 -0800502 sli_count(other.sli_count),
503 qp_sum(other.qp_sum) {
hbos6ded1902016-11-01 01:50:46 -0700504}
505
506RTCRTPStreamStats::~RTCRTPStreamStats() {
507}
508
509WEBRTC_RTCSTATS_IMPL(
hboseeafe942016-11-01 03:00:17 -0700510 RTCInboundRTPStreamStats, RTCRTPStreamStats, "inbound-rtp",
511 &packets_received,
512 &bytes_received,
513 &packets_lost,
514 &jitter,
515 &fraction_lost,
516 &packets_discarded,
517 &packets_repaired,
518 &burst_packets_lost,
519 &burst_packets_discarded,
520 &burst_loss_count,
521 &burst_discard_count,
522 &burst_loss_rate,
523 &burst_discard_rate,
524 &gap_loss_rate,
hbos6769c492017-01-02 08:35:13 -0800525 &gap_discard_rate,
526 &frames_decoded);
hboseeafe942016-11-01 03:00:17 -0700527
528RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
529 const std::string& id, int64_t timestamp_us)
530 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {
531}
532
533RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
534 std::string&& id, int64_t timestamp_us)
535 : RTCRTPStreamStats(std::move(id), timestamp_us),
536 packets_received("packetsReceived"),
537 bytes_received("bytesReceived"),
538 packets_lost("packetsLost"),
539 jitter("jitter"),
540 fraction_lost("fractionLost"),
541 packets_discarded("packetsDiscarded"),
542 packets_repaired("packetsRepaired"),
543 burst_packets_lost("burstPacketsLost"),
544 burst_packets_discarded("burstPacketsDiscarded"),
545 burst_loss_count("burstLossCount"),
546 burst_discard_count("burstDiscardCount"),
547 burst_loss_rate("burstLossRate"),
548 burst_discard_rate("burstDiscardRate"),
549 gap_loss_rate("gapLossRate"),
hbos6769c492017-01-02 08:35:13 -0800550 gap_discard_rate("gapDiscardRate"),
551 frames_decoded("framesDecoded") {
hboseeafe942016-11-01 03:00:17 -0700552}
553
554RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
555 const RTCInboundRTPStreamStats& other)
556 : RTCRTPStreamStats(other),
557 packets_received(other.packets_received),
558 bytes_received(other.bytes_received),
559 packets_lost(other.packets_lost),
560 jitter(other.jitter),
561 fraction_lost(other.fraction_lost),
562 packets_discarded(other.packets_discarded),
563 packets_repaired(other.packets_repaired),
564 burst_packets_lost(other.burst_packets_lost),
565 burst_packets_discarded(other.burst_packets_discarded),
566 burst_loss_count(other.burst_loss_count),
567 burst_discard_count(other.burst_discard_count),
568 burst_loss_rate(other.burst_loss_rate),
569 burst_discard_rate(other.burst_discard_rate),
570 gap_loss_rate(other.gap_loss_rate),
hbos6769c492017-01-02 08:35:13 -0800571 gap_discard_rate(other.gap_discard_rate),
572 frames_decoded(other.frames_decoded) {
hboseeafe942016-11-01 03:00:17 -0700573}
574
575RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {
576}
577
578WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700579 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
580 &packets_sent,
581 &bytes_sent,
582 &target_bitrate,
hbos6769c492017-01-02 08:35:13 -0800583 &round_trip_time,
584 &frames_encoded);
hbos6ded1902016-11-01 01:50:46 -0700585
586RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
587 const std::string& id, int64_t timestamp_us)
588 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {
589}
590
591RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
592 std::string&& id, int64_t timestamp_us)
593 : RTCRTPStreamStats(std::move(id), timestamp_us),
594 packets_sent("packetsSent"),
595 bytes_sent("bytesSent"),
596 target_bitrate("targetBitrate"),
hbos6769c492017-01-02 08:35:13 -0800597 round_trip_time("roundTripTime"),
598 frames_encoded("framesEncoded") {
hbos6ded1902016-11-01 01:50:46 -0700599}
600
601RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
602 const RTCOutboundRTPStreamStats& other)
603 : RTCRTPStreamStats(other),
604 packets_sent(other.packets_sent),
605 bytes_sent(other.bytes_sent),
606 target_bitrate(other.target_bitrate),
hbos6769c492017-01-02 08:35:13 -0800607 round_trip_time(other.round_trip_time),
608 frames_encoded(other.frames_encoded) {
hbos6ded1902016-11-01 01:50:46 -0700609}
610
611RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {
612}
613
hbos2fa7c672016-10-24 04:00:05 -0700614WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
615 &bytes_sent,
616 &bytes_received,
617 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -0800618 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -0700619 &selected_candidate_pair_id,
620 &local_certificate_id,
621 &remote_certificate_id);
622
623RTCTransportStats::RTCTransportStats(
624 const std::string& id, int64_t timestamp_us)
625 : RTCTransportStats(std::string(id), timestamp_us) {
626}
627
628RTCTransportStats::RTCTransportStats(
629 std::string&& id, int64_t timestamp_us)
630 : RTCStats(std::move(id), timestamp_us),
631 bytes_sent("bytesSent"),
632 bytes_received("bytesReceived"),
633 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -0800634 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -0700635 selected_candidate_pair_id("selectedCandidatePairId"),
636 local_certificate_id("localCertificateId"),
637 remote_certificate_id("remoteCertificateId") {
638}
639
640RTCTransportStats::RTCTransportStats(
641 const RTCTransportStats& other)
642 : RTCStats(other.id(), other.timestamp_us()),
643 bytes_sent(other.bytes_sent),
644 bytes_received(other.bytes_received),
645 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -0800646 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -0700647 selected_candidate_pair_id(other.selected_candidate_pair_id),
648 local_certificate_id(other.local_certificate_id),
649 remote_certificate_id(other.remote_certificate_id) {
650}
651
652RTCTransportStats::~RTCTransportStats() {
653}
654
hbosd565b732016-08-30 14:04:35 -0700655} // namespace webrtc