blob: 19e94b3c96062df9357e55ce2d4ce2f30ae48f41 [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
agrieve26622d32017-08-08 10:48:15 -070015const char* const RTCDataChannelState::kConnecting = "connecting";
16const char* const RTCDataChannelState::kOpen = "open";
17const char* const RTCDataChannelState::kClosing = "closing";
18const char* const RTCDataChannelState::kClosed = "closed";
hboscc555c52016-10-18 12:48:31 -070019
agrieve26622d32017-08-08 10:48:15 -070020const char* const RTCStatsIceCandidatePairState::kFrozen = "frozen";
21const char* const RTCStatsIceCandidatePairState::kWaiting = "waiting";
22const char* const RTCStatsIceCandidatePairState::kInProgress = "in-progress";
23const char* const RTCStatsIceCandidatePairState::kFailed = "failed";
24const char* const RTCStatsIceCandidatePairState::kSucceeded = "succeeded";
hbosc47a0c32016-10-11 14:54:49 -070025
26// Strings defined in https://tools.ietf.org/html/rfc5245.
agrieve26622d32017-08-08 10:48:15 -070027const char* const RTCIceCandidateType::kHost = "host";
28const char* const RTCIceCandidateType::kSrflx = "srflx";
29const char* const RTCIceCandidateType::kPrflx = "prflx";
30const char* const RTCIceCandidateType::kRelay = "relay";
hbosab9f6e42016-10-07 02:18:47 -070031
agrieve26622d32017-08-08 10:48:15 -070032const char* const RTCDtlsTransportState::kNew = "new";
33const char* const RTCDtlsTransportState::kConnecting = "connecting";
34const char* const RTCDtlsTransportState::kConnected = "connected";
35const char* const RTCDtlsTransportState::kClosed = "closed";
36const char* const RTCDtlsTransportState::kFailed = "failed";
hbos7064d592017-01-16 07:38:02 -080037
agrieve26622d32017-08-08 10:48:15 -070038const char* const RTCMediaStreamTrackKind::kAudio = "audio";
39const char* const RTCMediaStreamTrackKind::kVideo = "video";
hbos160e4a72017-01-17 02:53:23 -080040
Steve Antond6a5cbd2017-08-18 09:40:25 -070041// clang-format off
hbos2fa7c672016-10-24 04:00:05 -070042WEBRTC_RTCSTATS_IMPL(RTCCertificateStats, RTCStats, "certificate",
43 &fingerprint,
44 &fingerprint_algorithm,
45 &base64_certificate,
46 &issuer_certificate_id);
Steve Antond6a5cbd2017-08-18 09:40:25 -070047// clang-format on
hbos2fa7c672016-10-24 04:00:05 -070048
49RTCCertificateStats::RTCCertificateStats(
50 const std::string& id, int64_t timestamp_us)
51 : RTCCertificateStats(std::string(id), timestamp_us) {
52}
53
54RTCCertificateStats::RTCCertificateStats(
55 std::string&& id, int64_t timestamp_us)
56 : RTCStats(std::move(id), timestamp_us),
57 fingerprint("fingerprint"),
58 fingerprint_algorithm("fingerprintAlgorithm"),
59 base64_certificate("base64Certificate"),
60 issuer_certificate_id("issuerCertificateId") {
61}
62
63RTCCertificateStats::RTCCertificateStats(
64 const RTCCertificateStats& other)
65 : RTCStats(other.id(), other.timestamp_us()),
66 fingerprint(other.fingerprint),
67 fingerprint_algorithm(other.fingerprint_algorithm),
68 base64_certificate(other.base64_certificate),
69 issuer_certificate_id(other.issuer_certificate_id) {
70}
71
72RTCCertificateStats::~RTCCertificateStats() {
73}
74
Steve Antond6a5cbd2017-08-18 09:40:25 -070075// clang-format off
hbos0adb8282016-11-23 02:32:06 -080076WEBRTC_RTCSTATS_IMPL(RTCCodecStats, RTCStats, "codec",
77 &payload_type,
hbos13f54b22017-02-28 06:56:04 -080078 &mime_type,
hbos0adb8282016-11-23 02:32:06 -080079 &clock_rate,
80 &channels,
hbos13f54b22017-02-28 06:56:04 -080081 &sdp_fmtp_line,
hbos0adb8282016-11-23 02:32:06 -080082 &implementation);
Steve Antond6a5cbd2017-08-18 09:40:25 -070083// clang-format on
hbos0adb8282016-11-23 02:32:06 -080084
85RTCCodecStats::RTCCodecStats(
86 const std::string& id, int64_t timestamp_us)
87 : RTCCodecStats(std::string(id), timestamp_us) {
88}
89
90RTCCodecStats::RTCCodecStats(
91 std::string&& id, int64_t timestamp_us)
92 : RTCStats(std::move(id), timestamp_us),
93 payload_type("payloadType"),
hbos13f54b22017-02-28 06:56:04 -080094 mime_type("mimeType"),
hbos0adb8282016-11-23 02:32:06 -080095 clock_rate("clockRate"),
96 channels("channels"),
hbos13f54b22017-02-28 06:56:04 -080097 sdp_fmtp_line("sdpFmtpLine"),
hbos0adb8282016-11-23 02:32:06 -080098 implementation("implementation") {
99}
100
101RTCCodecStats::RTCCodecStats(
102 const RTCCodecStats& other)
103 : RTCStats(other.id(), other.timestamp_us()),
104 payload_type(other.payload_type),
hbos13f54b22017-02-28 06:56:04 -0800105 mime_type(other.mime_type),
hbos0adb8282016-11-23 02:32:06 -0800106 clock_rate(other.clock_rate),
107 channels(other.channels),
hbos13f54b22017-02-28 06:56:04 -0800108 sdp_fmtp_line(other.sdp_fmtp_line),
hbos0adb8282016-11-23 02:32:06 -0800109 implementation(other.implementation) {
110}
111
112RTCCodecStats::~RTCCodecStats() {
113}
114
Steve Antond6a5cbd2017-08-18 09:40:25 -0700115// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700116WEBRTC_RTCSTATS_IMPL(RTCDataChannelStats, RTCStats, "data-channel",
117 &label,
118 &protocol,
119 &datachannelid,
120 &state,
121 &messages_sent,
122 &bytes_sent,
123 &messages_received,
124 &bytes_received);
Steve Antond6a5cbd2017-08-18 09:40:25 -0700125// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700126
127RTCDataChannelStats::RTCDataChannelStats(
128 const std::string& id, int64_t timestamp_us)
129 : RTCDataChannelStats(std::string(id), timestamp_us) {
130}
131
132RTCDataChannelStats::RTCDataChannelStats(
133 std::string&& id, int64_t timestamp_us)
134 : RTCStats(std::move(id), timestamp_us),
135 label("label"),
136 protocol("protocol"),
137 datachannelid("datachannelid"),
138 state("state"),
139 messages_sent("messagesSent"),
140 bytes_sent("bytesSent"),
141 messages_received("messagesReceived"),
142 bytes_received("bytesReceived") {
143}
144
145RTCDataChannelStats::RTCDataChannelStats(
146 const RTCDataChannelStats& other)
147 : RTCStats(other.id(), other.timestamp_us()),
148 label(other.label),
149 protocol(other.protocol),
150 datachannelid(other.datachannelid),
151 state(other.state),
152 messages_sent(other.messages_sent),
153 bytes_sent(other.bytes_sent),
154 messages_received(other.messages_received),
155 bytes_received(other.bytes_received) {
156}
157
158RTCDataChannelStats::~RTCDataChannelStats() {
159}
160
Steve Antond6a5cbd2017-08-18 09:40:25 -0700161// clang-format off
hbosc47a0c32016-10-11 14:54:49 -0700162WEBRTC_RTCSTATS_IMPL(RTCIceCandidatePairStats, RTCStats, "candidate-pair",
163 &transport_id,
164 &local_candidate_id,
165 &remote_candidate_id,
166 &state,
167 &priority,
168 &nominated,
169 &writable,
170 &readable,
171 &bytes_sent,
172 &bytes_received,
hbos3168c7a2016-12-15 06:17:08 -0800173 &total_round_trip_time,
174 &current_round_trip_time,
hbosc47a0c32016-10-11 14:54:49 -0700175 &available_outgoing_bitrate,
176 &available_incoming_bitrate,
177 &requests_received,
178 &requests_sent,
179 &responses_received,
180 &responses_sent,
181 &retransmissions_received,
182 &retransmissions_sent,
183 &consent_requests_received,
184 &consent_requests_sent,
185 &consent_responses_received,
186 &consent_responses_sent);
Steve Antond6a5cbd2017-08-18 09:40:25 -0700187// clang-format on
hbosc47a0c32016-10-11 14:54:49 -0700188
189RTCIceCandidatePairStats::RTCIceCandidatePairStats(
190 const std::string& id, int64_t timestamp_us)
191 : RTCIceCandidatePairStats(std::string(id), timestamp_us) {
192}
193
194RTCIceCandidatePairStats::RTCIceCandidatePairStats(
195 std::string&& id, int64_t timestamp_us)
196 : RTCStats(std::move(id), timestamp_us),
197 transport_id("transportId"),
198 local_candidate_id("localCandidateId"),
199 remote_candidate_id("remoteCandidateId"),
200 state("state"),
201 priority("priority"),
202 nominated("nominated"),
203 writable("writable"),
204 readable("readable"),
205 bytes_sent("bytesSent"),
206 bytes_received("bytesReceived"),
hbos3168c7a2016-12-15 06:17:08 -0800207 total_round_trip_time("totalRoundTripTime"),
208 current_round_trip_time("currentRoundTripTime"),
hbosc47a0c32016-10-11 14:54:49 -0700209 available_outgoing_bitrate("availableOutgoingBitrate"),
210 available_incoming_bitrate("availableIncomingBitrate"),
211 requests_received("requestsReceived"),
212 requests_sent("requestsSent"),
213 responses_received("responsesReceived"),
214 responses_sent("responsesSent"),
215 retransmissions_received("retransmissionsReceived"),
216 retransmissions_sent("retransmissionsSent"),
217 consent_requests_received("consentRequestsReceived"),
218 consent_requests_sent("consentRequestsSent"),
219 consent_responses_received("consentResponsesReceived"),
220 consent_responses_sent("consentResponsesSent") {
221}
222
223RTCIceCandidatePairStats::RTCIceCandidatePairStats(
224 const RTCIceCandidatePairStats& other)
225 : RTCStats(other.id(), other.timestamp_us()),
226 transport_id(other.transport_id),
227 local_candidate_id(other.local_candidate_id),
228 remote_candidate_id(other.remote_candidate_id),
229 state(other.state),
230 priority(other.priority),
231 nominated(other.nominated),
232 writable(other.writable),
233 readable(other.readable),
234 bytes_sent(other.bytes_sent),
235 bytes_received(other.bytes_received),
hbos3168c7a2016-12-15 06:17:08 -0800236 total_round_trip_time(other.total_round_trip_time),
237 current_round_trip_time(other.current_round_trip_time),
hbosc47a0c32016-10-11 14:54:49 -0700238 available_outgoing_bitrate(other.available_outgoing_bitrate),
239 available_incoming_bitrate(other.available_incoming_bitrate),
240 requests_received(other.requests_received),
241 requests_sent(other.requests_sent),
242 responses_received(other.responses_received),
243 responses_sent(other.responses_sent),
244 retransmissions_received(other.retransmissions_received),
245 retransmissions_sent(other.retransmissions_sent),
246 consent_requests_received(other.consent_requests_received),
247 consent_requests_sent(other.consent_requests_sent),
248 consent_responses_received(other.consent_responses_received),
249 consent_responses_sent(other.consent_responses_sent) {
250}
251
252RTCIceCandidatePairStats::~RTCIceCandidatePairStats() {
253}
254
Steve Antond6a5cbd2017-08-18 09:40:25 -0700255// clang-format off
hbosab9f6e42016-10-07 02:18:47 -0700256WEBRTC_RTCSTATS_IMPL(RTCIceCandidateStats, RTCStats, "ice-candidate",
hbosb4e426e2017-01-02 09:59:31 -0800257 &transport_id,
hbosc3a2b7f2017-01-02 04:46:15 -0800258 &is_remote,
hbosab9f6e42016-10-07 02:18:47 -0700259 &ip,
260 &port,
261 &protocol,
262 &candidate_type,
263 &priority,
hbosd17a5a72017-01-02 08:09:59 -0800264 &url,
265 &deleted);
Steve Antond6a5cbd2017-08-18 09:40:25 -0700266// clang-format on
hbosab9f6e42016-10-07 02:18:47 -0700267
268RTCIceCandidateStats::RTCIceCandidateStats(
hbosc3a2b7f2017-01-02 04:46:15 -0800269 const std::string& id, int64_t timestamp_us, bool is_remote)
270 : RTCIceCandidateStats(std::string(id), timestamp_us, is_remote) {
hbosab9f6e42016-10-07 02:18:47 -0700271}
272
273RTCIceCandidateStats::RTCIceCandidateStats(
hbosc3a2b7f2017-01-02 04:46:15 -0800274 std::string&& id, int64_t timestamp_us, bool is_remote)
hbosab9f6e42016-10-07 02:18:47 -0700275 : RTCStats(std::move(id), timestamp_us),
hbosb4e426e2017-01-02 09:59:31 -0800276 transport_id("transportId"),
hbosc3a2b7f2017-01-02 04:46:15 -0800277 is_remote("isRemote", is_remote),
hbosab9f6e42016-10-07 02:18:47 -0700278 ip("ip"),
279 port("port"),
280 protocol("protocol"),
281 candidate_type("candidateType"),
282 priority("priority"),
hbosd17a5a72017-01-02 08:09:59 -0800283 url("url"),
284 deleted("deleted", false) {
hbosab9f6e42016-10-07 02:18:47 -0700285}
286
287RTCIceCandidateStats::RTCIceCandidateStats(const RTCIceCandidateStats& other)
288 : RTCStats(other.id(), other.timestamp_us()),
hbosb4e426e2017-01-02 09:59:31 -0800289 transport_id(other.transport_id),
hbosc3a2b7f2017-01-02 04:46:15 -0800290 is_remote(other.is_remote),
hbosab9f6e42016-10-07 02:18:47 -0700291 ip(other.ip),
292 port(other.port),
293 protocol(other.protocol),
294 candidate_type(other.candidate_type),
295 priority(other.priority),
hbosd17a5a72017-01-02 08:09:59 -0800296 url(other.url),
297 deleted(other.deleted) {
hbosab9f6e42016-10-07 02:18:47 -0700298}
299
300RTCIceCandidateStats::~RTCIceCandidateStats() {
301}
302
303const char RTCLocalIceCandidateStats::kType[] = "local-candidate";
304
305RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(
306 const std::string& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800307 : RTCIceCandidateStats(id, timestamp_us, false) {
hbosab9f6e42016-10-07 02:18:47 -0700308}
309
310RTCLocalIceCandidateStats::RTCLocalIceCandidateStats(
311 std::string&& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800312 : RTCIceCandidateStats(std::move(id), timestamp_us, false) {
hbosab9f6e42016-10-07 02:18:47 -0700313}
314
315const char* RTCLocalIceCandidateStats::type() const {
316 return kType;
317}
318
319const char RTCRemoteIceCandidateStats::kType[] = "remote-candidate";
320
321RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(
322 const std::string& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800323 : RTCIceCandidateStats(id, timestamp_us, true) {
hbosab9f6e42016-10-07 02:18:47 -0700324}
325
326RTCRemoteIceCandidateStats::RTCRemoteIceCandidateStats(
327 std::string&& id, int64_t timestamp_us)
hbosc3a2b7f2017-01-02 04:46:15 -0800328 : RTCIceCandidateStats(std::move(id), timestamp_us, true) {
hbosab9f6e42016-10-07 02:18:47 -0700329}
330
331const char* RTCRemoteIceCandidateStats::type() const {
332 return kType;
333}
334
Steve Antond6a5cbd2017-08-18 09:40:25 -0700335// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800336WEBRTC_RTCSTATS_IMPL(RTCMediaStreamStats, RTCStats, "stream",
337 &stream_identifier,
338 &track_ids);
Steve Antond6a5cbd2017-08-18 09:40:25 -0700339// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800340
341RTCMediaStreamStats::RTCMediaStreamStats(
342 const std::string& id, int64_t timestamp_us)
343 : RTCMediaStreamStats(std::string(id), timestamp_us) {
344}
345
346RTCMediaStreamStats::RTCMediaStreamStats(
347 std::string&& id, int64_t timestamp_us)
348 : RTCStats(std::move(id), timestamp_us),
349 stream_identifier("streamIdentifier"),
350 track_ids("trackIds") {
351}
352
353RTCMediaStreamStats::RTCMediaStreamStats(
354 const RTCMediaStreamStats& other)
355 : RTCStats(other.id(), other.timestamp_us()),
356 stream_identifier(other.stream_identifier),
357 track_ids(other.track_ids) {
358}
359
360RTCMediaStreamStats::~RTCMediaStreamStats() {
361}
362
Steve Antond6a5cbd2017-08-18 09:40:25 -0700363// clang-format off
hbos09bc1282016-11-08 06:29:22 -0800364WEBRTC_RTCSTATS_IMPL(RTCMediaStreamTrackStats, RTCStats, "track",
zsteine76bd3a2017-07-14 12:17:49 -0700365 &track_identifier,
366 &remote_source,
367 &ended,
368 &detached,
369 &kind,
370 &frame_width,
371 &frame_height,
372 &frames_per_second,
373 &frames_sent,
374 &frames_received,
375 &frames_decoded,
376 &frames_dropped,
377 &frames_corrupted,
378 &partial_frames_lost,
379 &full_frames_lost,
380 &audio_level,
381 &total_audio_energy,
382 &total_samples_duration,
383 &echo_return_loss,
384 &echo_return_loss_enhancement);
Steve Antond6a5cbd2017-08-18 09:40:25 -0700385// clang-format on
hbos09bc1282016-11-08 06:29:22 -0800386
387RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
hbos160e4a72017-01-17 02:53:23 -0800388 const std::string& id, int64_t timestamp_us, const char* kind)
389 : RTCMediaStreamTrackStats(std::string(id), timestamp_us, kind) {
hbos09bc1282016-11-08 06:29:22 -0800390}
391
zsteine76bd3a2017-07-14 12:17:49 -0700392RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(std::string&& id,
393 int64_t timestamp_us,
394 const char* kind)
hbos09bc1282016-11-08 06:29:22 -0800395 : RTCStats(std::move(id), timestamp_us),
396 track_identifier("trackIdentifier"),
397 remote_source("remoteSource"),
398 ended("ended"),
399 detached("detached"),
hbos160e4a72017-01-17 02:53:23 -0800400 kind("kind", kind),
hbos09bc1282016-11-08 06:29:22 -0800401 frame_width("frameWidth"),
402 frame_height("frameHeight"),
403 frames_per_second("framesPerSecond"),
404 frames_sent("framesSent"),
405 frames_received("framesReceived"),
406 frames_decoded("framesDecoded"),
407 frames_dropped("framesDropped"),
408 frames_corrupted("framesCorrupted"),
409 partial_frames_lost("partialFramesLost"),
410 full_frames_lost("fullFramesLost"),
411 audio_level("audioLevel"),
zsteine76bd3a2017-07-14 12:17:49 -0700412 total_audio_energy("totalAudioEnergy"),
413 total_samples_duration("totalSamplesDuration"),
hbos09bc1282016-11-08 06:29:22 -0800414 echo_return_loss("echoReturnLoss"),
415 echo_return_loss_enhancement("echoReturnLossEnhancement") {
hbos160e4a72017-01-17 02:53:23 -0800416 RTC_DCHECK(kind == RTCMediaStreamTrackKind::kAudio ||
417 kind == RTCMediaStreamTrackKind::kVideo);
hbos09bc1282016-11-08 06:29:22 -0800418}
419
420RTCMediaStreamTrackStats::RTCMediaStreamTrackStats(
421 const RTCMediaStreamTrackStats& other)
422 : RTCStats(other.id(), other.timestamp_us()),
423 track_identifier(other.track_identifier),
424 remote_source(other.remote_source),
425 ended(other.ended),
426 detached(other.detached),
hbos160e4a72017-01-17 02:53:23 -0800427 kind(other.kind),
hbos09bc1282016-11-08 06:29:22 -0800428 frame_width(other.frame_width),
429 frame_height(other.frame_height),
430 frames_per_second(other.frames_per_second),
431 frames_sent(other.frames_sent),
432 frames_received(other.frames_received),
433 frames_decoded(other.frames_decoded),
434 frames_dropped(other.frames_dropped),
435 frames_corrupted(other.frames_corrupted),
436 partial_frames_lost(other.partial_frames_lost),
437 full_frames_lost(other.full_frames_lost),
438 audio_level(other.audio_level),
zsteine76bd3a2017-07-14 12:17:49 -0700439 total_audio_energy(other.total_audio_energy),
440 total_samples_duration(other.total_samples_duration),
hbos09bc1282016-11-08 06:29:22 -0800441 echo_return_loss(other.echo_return_loss),
zsteine76bd3a2017-07-14 12:17:49 -0700442 echo_return_loss_enhancement(other.echo_return_loss_enhancement) {}
hbos09bc1282016-11-08 06:29:22 -0800443
444RTCMediaStreamTrackStats::~RTCMediaStreamTrackStats() {
445}
446
Steve Antond6a5cbd2017-08-18 09:40:25 -0700447// clang-format off
hbosfc5e0502016-10-06 02:06:10 -0700448WEBRTC_RTCSTATS_IMPL(RTCPeerConnectionStats, RTCStats, "peer-connection",
449 &data_channels_opened,
450 &data_channels_closed);
Steve Antond6a5cbd2017-08-18 09:40:25 -0700451// clang-format on
hbosd565b732016-08-30 14:04:35 -0700452
453RTCPeerConnectionStats::RTCPeerConnectionStats(
hbos0e6758d2016-08-31 07:57:36 -0700454 const std::string& id, int64_t timestamp_us)
455 : RTCPeerConnectionStats(std::string(id), timestamp_us) {
hbosd565b732016-08-30 14:04:35 -0700456}
457
458RTCPeerConnectionStats::RTCPeerConnectionStats(
hbos0e6758d2016-08-31 07:57:36 -0700459 std::string&& id, int64_t timestamp_us)
460 : RTCStats(std::move(id), timestamp_us),
hbosd565b732016-08-30 14:04:35 -0700461 data_channels_opened("dataChannelsOpened"),
462 data_channels_closed("dataChannelsClosed") {
463}
464
hbosfc5e0502016-10-06 02:06:10 -0700465RTCPeerConnectionStats::RTCPeerConnectionStats(
466 const RTCPeerConnectionStats& other)
467 : RTCStats(other.id(), other.timestamp_us()),
468 data_channels_opened(other.data_channels_opened),
469 data_channels_closed(other.data_channels_closed) {
470}
471
472RTCPeerConnectionStats::~RTCPeerConnectionStats() {
473}
474
Steve Antond6a5cbd2017-08-18 09:40:25 -0700475// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700476WEBRTC_RTCSTATS_IMPL(RTCRTPStreamStats, RTCStats, "rtp",
477 &ssrc,
478 &associate_stats_id,
479 &is_remote,
480 &media_type,
hbosb0ae9202017-01-27 06:35:16 -0800481 &track_id,
hbos6ded1902016-11-01 01:50:46 -0700482 &transport_id,
483 &codec_id,
484 &fir_count,
485 &pli_count,
486 &nack_count,
hbos6769c492017-01-02 08:35:13 -0800487 &sli_count,
488 &qp_sum);
Steve Antond6a5cbd2017-08-18 09:40:25 -0700489// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700490
491RTCRTPStreamStats::RTCRTPStreamStats(
492 const std::string& id, int64_t timestamp_us)
493 : RTCRTPStreamStats(std::string(id), timestamp_us) {
494}
495
496RTCRTPStreamStats::RTCRTPStreamStats(
497 std::string&& id, int64_t timestamp_us)
498 : RTCStats(std::move(id), timestamp_us),
499 ssrc("ssrc"),
500 associate_stats_id("associateStatsId"),
501 is_remote("isRemote", false),
502 media_type("mediaType"),
hbosb0ae9202017-01-27 06:35:16 -0800503 track_id("trackId"),
hbos6ded1902016-11-01 01:50:46 -0700504 transport_id("transportId"),
505 codec_id("codecId"),
506 fir_count("firCount"),
507 pli_count("pliCount"),
508 nack_count("nackCount"),
hbos6769c492017-01-02 08:35:13 -0800509 sli_count("sliCount"),
510 qp_sum("qpSum") {
hbos6ded1902016-11-01 01:50:46 -0700511}
512
513RTCRTPStreamStats::RTCRTPStreamStats(
514 const RTCRTPStreamStats& other)
515 : RTCStats(other.id(), other.timestamp_us()),
516 ssrc(other.ssrc),
517 associate_stats_id(other.associate_stats_id),
518 is_remote(other.is_remote),
519 media_type(other.media_type),
hbosb0ae9202017-01-27 06:35:16 -0800520 track_id(other.track_id),
hbos6ded1902016-11-01 01:50:46 -0700521 transport_id(other.transport_id),
522 codec_id(other.codec_id),
523 fir_count(other.fir_count),
524 pli_count(other.pli_count),
525 nack_count(other.nack_count),
hbos6769c492017-01-02 08:35:13 -0800526 sli_count(other.sli_count),
527 qp_sum(other.qp_sum) {
hbos6ded1902016-11-01 01:50:46 -0700528}
529
530RTCRTPStreamStats::~RTCRTPStreamStats() {
531}
532
Steve Antond6a5cbd2017-08-18 09:40:25 -0700533// clang-format off
hbos6ded1902016-11-01 01:50:46 -0700534WEBRTC_RTCSTATS_IMPL(
hboseeafe942016-11-01 03:00:17 -0700535 RTCInboundRTPStreamStats, RTCRTPStreamStats, "inbound-rtp",
536 &packets_received,
537 &bytes_received,
538 &packets_lost,
539 &jitter,
540 &fraction_lost,
hbosa7a9be12017-03-01 01:02:45 -0800541 &round_trip_time,
hboseeafe942016-11-01 03:00:17 -0700542 &packets_discarded,
543 &packets_repaired,
544 &burst_packets_lost,
545 &burst_packets_discarded,
546 &burst_loss_count,
547 &burst_discard_count,
548 &burst_loss_rate,
549 &burst_discard_rate,
550 &gap_loss_rate,
hbos6769c492017-01-02 08:35:13 -0800551 &gap_discard_rate,
552 &frames_decoded);
Steve Antond6a5cbd2017-08-18 09:40:25 -0700553// clang-format on
hboseeafe942016-11-01 03:00:17 -0700554
555RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
556 const std::string& id, int64_t timestamp_us)
557 : RTCInboundRTPStreamStats(std::string(id), timestamp_us) {
558}
559
560RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
561 std::string&& id, int64_t timestamp_us)
562 : RTCRTPStreamStats(std::move(id), timestamp_us),
563 packets_received("packetsReceived"),
564 bytes_received("bytesReceived"),
565 packets_lost("packetsLost"),
566 jitter("jitter"),
567 fraction_lost("fractionLost"),
hbosa7a9be12017-03-01 01:02:45 -0800568 round_trip_time("roundTripTime"),
hboseeafe942016-11-01 03:00:17 -0700569 packets_discarded("packetsDiscarded"),
570 packets_repaired("packetsRepaired"),
571 burst_packets_lost("burstPacketsLost"),
572 burst_packets_discarded("burstPacketsDiscarded"),
573 burst_loss_count("burstLossCount"),
574 burst_discard_count("burstDiscardCount"),
575 burst_loss_rate("burstLossRate"),
576 burst_discard_rate("burstDiscardRate"),
577 gap_loss_rate("gapLossRate"),
hbos6769c492017-01-02 08:35:13 -0800578 gap_discard_rate("gapDiscardRate"),
579 frames_decoded("framesDecoded") {
hboseeafe942016-11-01 03:00:17 -0700580}
581
582RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
583 const RTCInboundRTPStreamStats& other)
584 : RTCRTPStreamStats(other),
585 packets_received(other.packets_received),
586 bytes_received(other.bytes_received),
587 packets_lost(other.packets_lost),
588 jitter(other.jitter),
589 fraction_lost(other.fraction_lost),
hbosa7a9be12017-03-01 01:02:45 -0800590 round_trip_time(other.round_trip_time),
hboseeafe942016-11-01 03:00:17 -0700591 packets_discarded(other.packets_discarded),
592 packets_repaired(other.packets_repaired),
593 burst_packets_lost(other.burst_packets_lost),
594 burst_packets_discarded(other.burst_packets_discarded),
595 burst_loss_count(other.burst_loss_count),
596 burst_discard_count(other.burst_discard_count),
597 burst_loss_rate(other.burst_loss_rate),
598 burst_discard_rate(other.burst_discard_rate),
599 gap_loss_rate(other.gap_loss_rate),
hbos6769c492017-01-02 08:35:13 -0800600 gap_discard_rate(other.gap_discard_rate),
601 frames_decoded(other.frames_decoded) {
hboseeafe942016-11-01 03:00:17 -0700602}
603
604RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {
605}
606
Steve Antond6a5cbd2017-08-18 09:40:25 -0700607// clang-format off
hboseeafe942016-11-01 03:00:17 -0700608WEBRTC_RTCSTATS_IMPL(
hbos6ded1902016-11-01 01:50:46 -0700609 RTCOutboundRTPStreamStats, RTCRTPStreamStats, "outbound-rtp",
610 &packets_sent,
611 &bytes_sent,
612 &target_bitrate,
hbos6769c492017-01-02 08:35:13 -0800613 &frames_encoded);
Steve Antond6a5cbd2017-08-18 09:40:25 -0700614// clang-format on
hbos6ded1902016-11-01 01:50:46 -0700615
616RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
617 const std::string& id, int64_t timestamp_us)
618 : RTCOutboundRTPStreamStats(std::string(id), timestamp_us) {
619}
620
621RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
622 std::string&& id, int64_t timestamp_us)
623 : RTCRTPStreamStats(std::move(id), timestamp_us),
624 packets_sent("packetsSent"),
625 bytes_sent("bytesSent"),
626 target_bitrate("targetBitrate"),
hbos6769c492017-01-02 08:35:13 -0800627 frames_encoded("framesEncoded") {
hbos6ded1902016-11-01 01:50:46 -0700628}
629
630RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(
631 const RTCOutboundRTPStreamStats& other)
632 : RTCRTPStreamStats(other),
633 packets_sent(other.packets_sent),
634 bytes_sent(other.bytes_sent),
635 target_bitrate(other.target_bitrate),
hbos6769c492017-01-02 08:35:13 -0800636 frames_encoded(other.frames_encoded) {
hbos6ded1902016-11-01 01:50:46 -0700637}
638
639RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {
640}
641
Steve Antond6a5cbd2017-08-18 09:40:25 -0700642// clang-format off
hbos2fa7c672016-10-24 04:00:05 -0700643WEBRTC_RTCSTATS_IMPL(RTCTransportStats, RTCStats, "transport",
644 &bytes_sent,
645 &bytes_received,
646 &rtcp_transport_stats_id,
hbos7064d592017-01-16 07:38:02 -0800647 &dtls_state,
hbos2fa7c672016-10-24 04:00:05 -0700648 &selected_candidate_pair_id,
649 &local_certificate_id,
650 &remote_certificate_id);
Steve Antond6a5cbd2017-08-18 09:40:25 -0700651// clang-format on
hbos2fa7c672016-10-24 04:00:05 -0700652
653RTCTransportStats::RTCTransportStats(
654 const std::string& id, int64_t timestamp_us)
655 : RTCTransportStats(std::string(id), timestamp_us) {
656}
657
658RTCTransportStats::RTCTransportStats(
659 std::string&& id, int64_t timestamp_us)
660 : RTCStats(std::move(id), timestamp_us),
661 bytes_sent("bytesSent"),
662 bytes_received("bytesReceived"),
663 rtcp_transport_stats_id("rtcpTransportStatsId"),
hbos7064d592017-01-16 07:38:02 -0800664 dtls_state("dtlsState"),
hbos2fa7c672016-10-24 04:00:05 -0700665 selected_candidate_pair_id("selectedCandidatePairId"),
666 local_certificate_id("localCertificateId"),
667 remote_certificate_id("remoteCertificateId") {
668}
669
670RTCTransportStats::RTCTransportStats(
671 const RTCTransportStats& other)
672 : RTCStats(other.id(), other.timestamp_us()),
673 bytes_sent(other.bytes_sent),
674 bytes_received(other.bytes_received),
675 rtcp_transport_stats_id(other.rtcp_transport_stats_id),
hbos7064d592017-01-16 07:38:02 -0800676 dtls_state(other.dtls_state),
hbos2fa7c672016-10-24 04:00:05 -0700677 selected_candidate_pair_id(other.selected_candidate_pair_id),
678 local_certificate_id(other.local_certificate_id),
679 remote_certificate_id(other.remote_certificate_id) {
680}
681
682RTCTransportStats::~RTCTransportStats() {
683}
684
hbosd565b732016-08-30 14:04:35 -0700685} // namespace webrtc