blob: bd8e9cd30c65b5ec072224cdd8af808d00a9b5cb [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,
hbos13f54b22017-02-28 06:56:04 -080075 &mime_type,
hbos0adb8282016-11-23 02:32:06 -080076 &clock_rate,
77 &channels,
hbos13f54b22017-02-28 06:56:04 -080078 &sdp_fmtp_line,
hbos0adb8282016-11-23 02:32:06 -080079 &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"),
hbos13f54b22017-02-28 06:56:04 -080090 mime_type("mimeType"),
hbos0adb8282016-11-23 02:32:06 -080091 clock_rate("clockRate"),
92 channels("channels"),
hbos13f54b22017-02-28 06:56:04 -080093 sdp_fmtp_line("sdpFmtpLine"),
hbos0adb8282016-11-23 02:32:06 -080094 implementation("implementation") {
95}
96
97RTCCodecStats::RTCCodecStats(
98 const RTCCodecStats& other)
99 : RTCStats(other.id(), other.timestamp_us()),
100 payload_type(other.payload_type),
hbos13f54b22017-02-28 06:56:04 -0800101 mime_type(other.mime_type),
hbos0adb8282016-11-23 02:32:06 -0800102 clock_rate(other.clock_rate),
103 channels(other.channels),
hbos13f54b22017-02-28 06:56:04 -0800104 sdp_fmtp_line(other.sdp_fmtp_line),
hbos0adb8282016-11-23 02:32:06 -0800105 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",
zsteine76bd3a2017-07-14 12:17:49 -0700352 &track_identifier,
353 &remote_source,
354 &ended,
355 &detached,
356 &kind,
357 &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 &total_audio_energy,
369 &total_samples_duration,
370 &echo_return_loss,
371 &echo_return_loss_enhancement);
hbos09bc1282016-11-08 06:29:22 -0800372
373RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
hbos160e4a72017-01-17 02:53:23 -0800374 const std::string& id, int64_t timestamp_us, const char* kind)
375 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {
hbos09bc1282016-11-08 06:29:22 -0800376}
377
zsteine76bd3a2017-07-14 12:17:49 -0700378RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(std::string&& id,
379 int64_t timestamp_us,
380 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800381 : RTCStats(std::move(id), timestamp_us),
382 track_identifier("trackIdentifier"),
383 remote_source("remoteSource"),
384 ended("ended"),
385 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800386 kind("kind", kind),
hbos09bc1282016-11-08 06:29:22 -0800387 frame_width("frameWidth"),
388 frame_height("frameHeight"),
389 frames_per_second("framesPerSecond"),
390 frames_sent("framesSent"),
391 frames_received("framesReceived"),
392 frames_decoded("framesDecoded"),
393 frames_dropped("framesDropped"),
394 frames_corrupted("framesCorrupted"),
395 partial_frames_lost("partialFramesLost"),
396 full_frames_lost("fullFramesLost"),
397 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700398 total_audio_energy("totalAudioEnergy"),
399 total_samples_duration("totalSamplesDuration"),
hbos09bc1282016-11-08 06:29:22 -0800400 echo_return_loss("echoReturnLoss"),
401 echo_return_loss_enhancement("echoReturnLossEnhancement") {
hbos160e4a72017-01-17 02:53:23 -0800402 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
403 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800404}
405
406RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
407 const RTCMediaStreamTrackStats& other)
408 : RTCStats(other.id(), other.timestamp_us()),
409 track_identifier(other.track_identifier),
410 remote_source(other.remote_source),
411 ended(other.ended),
412 detached(other.detached),
hbos160e4a72017-01-17 02:53:23 -0800413 kind(other.kind),
hbos09bc1282016-11-08 06:29:22 -0800414 frame_width(other.frame_width),
415 frame_height(other.frame_height),
416 frames_per_second(other.frames_per_second),
417 frames_sent(other.frames_sent),
418 frames_received(other.frames_received),
419 frames_decoded(other.frames_decoded),
420 frames_dropped(other.frames_dropped),
421 frames_corrupted(other.frames_corrupted),
422 partial_frames_lost(other.partial_frames_lost),
423 full_frames_lost(other.full_frames_lost),
424 audio_level(other.audio_level),
zsteine76bd3a2017-07-14 12:17:49 -0700425 total_audio_energy(other.total_audio_energy),
426 total_samples_duration(other.total_samples_duration),
hbos09bc1282016-11-08 06:29:22 -0800427 echo_return_loss(other.echo_return_loss),
zsteine76bd3a2017-07-14 12:17:49 -0700428 echo_return_loss_enhancement(other.echo_return_loss_enhancement) {}
hbos09bc1282016-11-08 06:29:22 -0800429
430RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {
431}
432
hbosfc5e0502016-10-06 02:06:10 -0700433WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
434 &data_channels_opened,
435 &data_channels_closed);
hbosd565b732016-08-30 14:04:35 -0700436
437RTCPeerConnectionStats::RTCPeerConnectionStats(
hbos0e6758d2016-08-31 07:57:36 -0700438 const std::string& id, int64_t timestamp_us)
439 : RTCPeerConnectionStats(std::string(id), timestamp_us) {
hbosd565b732016-08-30 14:04:35 -0700440}
441
442RTCPeerConnectionStats::RTCPeerConnectionStats(
hbos0e6758d2016-08-31 07:57:36 -0700443 std::string&& id, int64_t timestamp_us)
444 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700445 data_channels_opened("dataChannelsOpened"),
446 data_channels_closed("dataChannelsClosed") {
447}
448
hbosfc5e0502016-10-06 02:06:10 -0700449RTCPeerConnectionStats::RTCPeerConnectionStats(
450 const RTCPeerConnectionStats& other)
451 : RTCStats(other.id(), other.timestamp_us()),
452 data_channels_opened(other.data_channels_opened),
453 data_channels_closed(other.data_channels_closed) {
454}
455
456RTCPeerConnectionStats::~RTCPeerConnectionStats() {
457}
458
hbos6ded1902016-11-01 01:50:46 -0700459WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
460 &ssrc,
461 &associate_stats_id,
462 &is_remote,
463 &media_type,
hbosb0ae9202017-01-27 06:35:16 -0800464 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700465 &transport_id,
466 &codec_id,
467 &fir_count,
468 &pli_count,
469 &nack_count,
hbos6769c492017-01-02 08:35:13 -0800470 &sli_count,
471 &qp_sum);
hbos6ded1902016-11-01 01:50:46 -0700472
473RTCRTPStreamStats::RTCRTPStreamStats(
474 const std::string& id, int64_t timestamp_us)
475 : RTCRTPStreamStats(std::string(id), timestamp_us) {
476}
477
478RTCRTPStreamStats::RTCRTPStreamStats(
479 std::string&& id, int64_t timestamp_us)
480 : RTCStats(std::move(id), timestamp_us),
481 ssrc("ssrc"),
482 associate_stats_id("associateStatsId"),
483 is_remote("isRemote", false),
484 media_type("mediaType"),
hbosb0ae9202017-01-27 06:35:16 -0800485 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700486 transport_id("transportId"),
487 codec_id("codecId"),
488 fir_count("firCount"),
489 pli_count("pliCount"),
490 nack_count("nackCount"),
hbos6769c492017-01-02 08:35:13 -0800491 sli_count("sliCount"),
492 qp_sum("qpSum") {
hbos6ded1902016-11-01 01:50:46 -0700493}
494
495RTCRTPStreamStats::RTCRTPStreamStats(
496 const RTCRTPStreamStats& other)
497 : RTCStats(other.id(), other.timestamp_us()),
498 ssrc(other.ssrc),
499 associate_stats_id(other.associate_stats_id),
500 is_remote(other.is_remote),
501 media_type(other.media_type),
hbosb0ae9202017-01-27 06:35:16 -0800502 track_id(other.track_id),
hbos6ded1902016-11-01 01:50:46 -0700503 transport_id(other.transport_id),
504 codec_id(other.codec_id),
505 fir_count(other.fir_count),
506 pli_count(other.pli_count),
507 nack_count(other.nack_count),
hbos6769c492017-01-02 08:35:13 -0800508 sli_count(other.sli_count),
509 qp_sum(other.qp_sum) {
hbos6ded1902016-11-01 01:50:46 -0700510}
511
512RTCRTPStreamStats::~RTCRTPStreamStats() {
513}
514
515WEBRTC_RTCSTATS_IMPL(
hboseeafe942016-11-01 03:00:17 -0700516 RTCInboundRTPStreamStats, RTCRTPStreamStats, "inbound-rtp",
517 &packets_received,
518 &bytes_received,
519 &packets_lost,
520 &jitter,
521 &fraction_lost,
hbosa7a9be12017-03-01 01:02:45 -0800522 &round_trip_time,
hboseeafe942016-11-01 03:00:17 -0700523 &packets_discarded,
524 &packets_repaired,
525 &burst_packets_lost,
526 &burst_packets_discarded,
527 &burst_loss_count,
528 &burst_discard_count,
529 &burst_loss_rate,
530 &burst_discard_rate,
531 &gap_loss_rate,
hbos6769c492017-01-02 08:35:13 -0800532 &gap_discard_rate,
533 &frames_decoded);
hboseeafe942016-11-01 03:00:17 -0700534
535RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
536 const std::string& id, int64_t timestamp_us)
537 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {
538}
539
540RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
541 std::string&& id, int64_t timestamp_us)
542 : RTCRTPStreamStats(std::move(id), timestamp_us),
543 packets_received("packetsReceived"),
544 bytes_received("bytesReceived"),
545 packets_lost("packetsLost"),
546 jitter("jitter"),
547 fraction_lost("fractionLost"),
hbosa7a9be12017-03-01 01:02:45 -0800548 round_trip_time("roundTripTime"),
hboseeafe942016-11-01 03:00:17 -0700549 packets_discarded("packetsDiscarded"),
550 packets_repaired("packetsRepaired"),
551 burst_packets_lost("burstPacketsLost"),
552 burst_packets_discarded("burstPacketsDiscarded"),
553 burst_loss_count("burstLossCount"),
554 burst_discard_count("burstDiscardCount"),
555 burst_loss_rate("burstLossRate"),
556 burst_discard_rate("burstDiscardRate"),
557 gap_loss_rate("gapLossRate"),
hbos6769c492017-01-02 08:35:13 -0800558 gap_discard_rate("gapDiscardRate"),
559 frames_decoded("framesDecoded") {
hboseeafe942016-11-01 03:00:17 -0700560}
561
562RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
563 const RTCInboundRTPStreamStats& other)
564 : RTCRTPStreamStats(other),
565 packets_received(other.packets_received),
566 bytes_received(other.bytes_received),
567 packets_lost(other.packets_lost),
568 jitter(other.jitter),
569 fraction_lost(other.fraction_lost),
hbosa7a9be12017-03-01 01:02:45 -0800570 round_trip_time(other.round_trip_time),
hboseeafe942016-11-01 03:00:17 -0700571 packets_discarded(other.packets_discarded),
572 packets_repaired(other.packets_repaired),
573 burst_packets_lost(other.burst_packets_lost),
574 burst_packets_discarded(other.burst_packets_discarded),
575 burst_loss_count(other.burst_loss_count),
576 burst_discard_count(other.burst_discard_count),
577 burst_loss_rate(other.burst_loss_rate),
578 burst_discard_rate(other.burst_discard_rate),
579 gap_loss_rate(other.gap_loss_rate),
hbos6769c492017-01-02 08:35:13 -0800580 gap_discard_rate(other.gap_discard_rate),
581 frames_decoded(other.frames_decoded) {
hboseeafe942016-11-01 03:00:17 -0700582}
583
584RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {
585}
586
587WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700588 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
589 &packets_sent,
590 &bytes_sent,
591 &target_bitrate,
hbos6769c492017-01-02 08:35:13 -0800592 &frames_encoded);
hbos6ded1902016-11-01 01:50:46 -0700593
594RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
595 const std::string& id, int64_t timestamp_us)
596 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {
597}
598
599RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
600 std::string&& id, int64_t timestamp_us)
601 : RTCRTPStreamStats(std::move(id), timestamp_us),
602 packets_sent("packetsSent"),
603 bytes_sent("bytesSent"),
604 target_bitrate("targetBitrate"),
hbos6769c492017-01-02 08:35:13 -0800605 frames_encoded("framesEncoded") {
hbos6ded1902016-11-01 01:50:46 -0700606}
607
608RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
609 const RTCOutboundRTPStreamStats& other)
610 : RTCRTPStreamStats(other),
611 packets_sent(other.packets_sent),
612 bytes_sent(other.bytes_sent),
613 target_bitrate(other.target_bitrate),
hbos6769c492017-01-02 08:35:13 -0800614 frames_encoded(other.frames_encoded) {
hbos6ded1902016-11-01 01:50:46 -0700615}
616
617RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {
618}
619
hbos2fa7c672016-10-24 04:00:05 -0700620WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
621 &bytes_sent,
622 &bytes_received,
623 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -0800624 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -0700625 &selected_candidate_pair_id,
626 &local_certificate_id,
627 &remote_certificate_id);
628
629RTCTransportStats::RTCTransportStats(
630 const std::string& id, int64_t timestamp_us)
631 : RTCTransportStats(std::string(id), timestamp_us) {
632}
633
634RTCTransportStats::RTCTransportStats(
635 std::string&& id, int64_t timestamp_us)
636 : RTCStats(std::move(id), timestamp_us),
637 bytes_sent("bytesSent"),
638 bytes_received("bytesReceived"),
639 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -0800640 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -0700641 selected_candidate_pair_id("selectedCandidatePairId"),
642 local_certificate_id("localCertificateId"),
643 remote_certificate_id("remoteCertificateId") {
644}
645
646RTCTransportStats::RTCTransportStats(
647 const RTCTransportStats& other)
648 : RTCStats(other.id(), other.timestamp_us()),
649 bytes_sent(other.bytes_sent),
650 bytes_received(other.bytes_received),
651 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -0800652 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -0700653 selected_candidate_pair_id(other.selected_candidate_pair_id),
654 local_certificate_id(other.local_certificate_id),
655 remote_certificate_id(other.remote_certificate_id) {
656}
657
658RTCTransportStats::~RTCTransportStats() {
659}
660
hbosd565b732016-08-30 14:04:35 -0700661} // namespace webrtc