blob: e8b0170ad3038e48a813a70c4ee671cd36360565 [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#ifndef WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_
12#define WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_
hbosd565b732016-08-30 14:04:35 -070013
14#include <string>
15
hbos74e1a4f2016-09-15 23:33:01 -070016#include "webrtc/api/stats/rtcstats.h"
hbosd565b732016-08-30 14:04:35 -070017
18namespace webrtc {
19
hboscc555c52016-10-18 12:48:31 -070020// https://w3c.github.io/webrtc-pc/#idl-def-rtcdatachannelstate
21struct RTCDataChannelState {
22 static const char* kConnecting;
23 static const char* kOpen;
24 static const char* kClosing;
25 static const char* kClosed;
26};
27
hbosc47a0c32016-10-11 14:54:49 -070028// https://w3c.github.io/webrtc-stats/#dom-rtcstatsicecandidatepairstate
29struct RTCStatsIceCandidatePairState {
30 static const char* kFrozen;
31 static const char* kWaiting;
32 static const char* kInProgress;
33 static const char* kFailed;
34 static const char* kSucceeded;
hbosc47a0c32016-10-11 14:54:49 -070035};
36
hboscc555c52016-10-18 12:48:31 -070037// https://w3c.github.io/webrtc-pc/#rtcicecandidatetype-enum
hbosab9f6e42016-10-07 02:18:47 -070038struct RTCIceCandidateType {
39 static const char* kHost;
40 static const char* kSrflx;
41 static const char* kPrflx;
42 static const char* kRelay;
43};
44
hbos7064d592017-01-16 07:38:02 -080045// https://w3c.github.io/webrtc-pc/#idl-def-rtcdtlstransportstate
46struct RTCDtlsTransportState {
47 static const char* kNew;
48 static const char* kConnecting;
49 static const char* kConnected;
50 static const char* kClosed;
51 static const char* kFailed;
52};
53
hbos160e4a72017-01-17 02:53:23 -080054// |RTCMediaStreamTrackStats::kind| is not an enum in the spec but the only
55// valid values are "audio" and "video".
56// https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats-kind
57struct RTCMediaStreamTrackKind {
58 static const char* kAudio;
59 static const char* kVideo;
60};
61
hbos2fa7c672016-10-24 04:00:05 -070062// https://w3c.github.io/webrtc-stats/#certificatestats-dict*
63class RTCCertificateStats final : public RTCStats {
64 public:
65 WEBRTC_RTCSTATS_DECL();
66
67 RTCCertificateStats(const std::string& id, int64_t timestamp_us);
68 RTCCertificateStats(std::string&& id, int64_t timestamp_us);
69 RTCCertificateStats(const RTCCertificateStats& other);
70 ~RTCCertificateStats() override;
71
72 RTCStatsMember<std::string> fingerprint;
73 RTCStatsMember<std::string> fingerprint_algorithm;
74 RTCStatsMember<std::string> base64_certificate;
75 RTCStatsMember<std::string> issuer_certificate_id;
76};
77
hbos0adb8282016-11-23 02:32:06 -080078// https://w3c.github.io/webrtc-stats/#codec-dict*
79// Tracking bug crbug.com/659117
80// TODO(hbos): The present codec ID assignment is not sufficient to support
81// Unified Plan or unbundled connections in all cases. crbug.com/659117
82class RTCCodecStats final : public RTCStats {
83 public:
84 WEBRTC_RTCSTATS_DECL();
85
86 RTCCodecStats(const std::string& id, int64_t timestamp_us);
87 RTCCodecStats(std::string&& id, int64_t timestamp_us);
88 RTCCodecStats(const RTCCodecStats& other);
89 ~RTCCodecStats() override;
90
91 RTCStatsMember<uint32_t> payload_type;
92 RTCStatsMember<std::string> codec;
93 RTCStatsMember<uint32_t> clock_rate;
94 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659117
95 RTCStatsMember<uint32_t> channels;
96 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659117
97 RTCStatsMember<std::string> parameters;
98 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659117
99 RTCStatsMember<std::string> implementation;
100};
101
hbos2fa7c672016-10-24 04:00:05 -0700102// https://w3c.github.io/webrtc-stats/#dcstats-dict*
103class RTCDataChannelStats final : public RTCStats {
104 public:
105 WEBRTC_RTCSTATS_DECL();
106
107 RTCDataChannelStats(const std::string& id, int64_t timestamp_us);
108 RTCDataChannelStats(std::string&& id, int64_t timestamp_us);
109 RTCDataChannelStats(const RTCDataChannelStats& other);
110 ~RTCDataChannelStats() override;
111
112 RTCStatsMember<std::string> label;
113 RTCStatsMember<std::string> protocol;
114 RTCStatsMember<int32_t> datachannelid;
115 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDataChannelState>"?
116 RTCStatsMember<std::string> state;
117 RTCStatsMember<uint32_t> messages_sent;
118 RTCStatsMember<uint64_t> bytes_sent;
119 RTCStatsMember<uint32_t> messages_received;
120 RTCStatsMember<uint64_t> bytes_received;
121};
122
123// https://w3c.github.io/webrtc-stats/#candidatepair-dict*
hbos0adb8282016-11-23 02:32:06 -0800124// TODO(hbos): Tracking bug crbug.com/633550
hbos6ded1902016-11-01 01:50:46 -0700125class RTCIceCandidatePairStats final : public RTCStats {
hbosc47a0c32016-10-11 14:54:49 -0700126 public:
127 WEBRTC_RTCSTATS_DECL();
128
129 RTCIceCandidatePairStats(const std::string& id, int64_t timestamp_us);
130 RTCIceCandidatePairStats(std::string&& id, int64_t timestamp_us);
131 RTCIceCandidatePairStats(const RTCIceCandidatePairStats& other);
132 ~RTCIceCandidatePairStats() override;
133
134 RTCStatsMember<std::string> transport_id;
135 RTCStatsMember<std::string> local_candidate_id;
136 RTCStatsMember<std::string> remote_candidate_id;
137 // TODO(hbos): Support enum types?
138 // "RTCStatsMember<RTCStatsIceCandidatePairState>"?
139 RTCStatsMember<std::string> state;
140 RTCStatsMember<uint64_t> priority;
hbos5d79a7c2016-10-24 09:27:10 -0700141 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700142 RTCStatsMember<bool> nominated;
hbos5d79a7c2016-10-24 09:27:10 -0700143 // TODO(hbos): Collected by |RTCStatsCollector| but different than the spec.
144 // crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700145 RTCStatsMember<bool> writable;
hbos5d79a7c2016-10-24 09:27:10 -0700146 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700147 RTCStatsMember<bool> readable;
148 RTCStatsMember<uint64_t> bytes_sent;
149 RTCStatsMember<uint64_t> bytes_received;
hbos5d79a7c2016-10-24 09:27:10 -0700150 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbos3168c7a2016-12-15 06:17:08 -0800151 RTCStatsMember<double> total_round_trip_time;
hbos5d79a7c2016-10-24 09:27:10 -0700152 // TODO(hbos): Collected by |RTCStatsCollector| but different than the spec.
153 // crbug.com/633550
hbos3168c7a2016-12-15 06:17:08 -0800154 RTCStatsMember<double> current_round_trip_time;
hbos5d79a7c2016-10-24 09:27:10 -0700155 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700156 RTCStatsMember<double> available_outgoing_bitrate;
hbos5d79a7c2016-10-24 09:27:10 -0700157 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700158 RTCStatsMember<double> available_incoming_bitrate;
159 RTCStatsMember<uint64_t> requests_received;
160 RTCStatsMember<uint64_t> requests_sent;
161 RTCStatsMember<uint64_t> responses_received;
162 RTCStatsMember<uint64_t> responses_sent;
hbos5d79a7c2016-10-24 09:27:10 -0700163 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700164 RTCStatsMember<uint64_t> retransmissions_received;
hbos5d79a7c2016-10-24 09:27:10 -0700165 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700166 RTCStatsMember<uint64_t> retransmissions_sent;
hbos5d79a7c2016-10-24 09:27:10 -0700167 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700168 RTCStatsMember<uint64_t> consent_requests_received;
169 RTCStatsMember<uint64_t> consent_requests_sent;
hbos5d79a7c2016-10-24 09:27:10 -0700170 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700171 RTCStatsMember<uint64_t> consent_responses_received;
hbos5d79a7c2016-10-24 09:27:10 -0700172 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700173 RTCStatsMember<uint64_t> consent_responses_sent;
174};
175
hbosab9f6e42016-10-07 02:18:47 -0700176// https://w3c.github.io/webrtc-stats/#icecandidate-dict*
hbos5d79a7c2016-10-24 09:27:10 -0700177// TODO(hbos): |RTCStatsCollector| only collects candidates that are part of
178// ice candidate pairs, but there could be candidates not paired with anything.
179// crbug.com/632723
hbosab9f6e42016-10-07 02:18:47 -0700180class RTCIceCandidateStats : public RTCStats {
181 public:
182 WEBRTC_RTCSTATS_DECL();
183
184 RTCIceCandidateStats(const RTCIceCandidateStats& other);
185 ~RTCIceCandidateStats() override;
186
hbosb4e426e2017-01-02 09:59:31 -0800187 RTCStatsMember<std::string> transport_id;
hbosc3a2b7f2017-01-02 04:46:15 -0800188 RTCStatsMember<bool> is_remote;
hbosab9f6e42016-10-07 02:18:47 -0700189 RTCStatsMember<std::string> ip;
190 RTCStatsMember<int32_t> port;
191 RTCStatsMember<std::string> protocol;
192 // TODO(hbos): Support enum types? "RTCStatsMember<RTCIceCandidateType>"?
193 RTCStatsMember<std::string> candidate_type;
194 RTCStatsMember<int32_t> priority;
hbos5d79a7c2016-10-24 09:27:10 -0700195 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/632723
hbosab9f6e42016-10-07 02:18:47 -0700196 RTCStatsMember<std::string> url;
hbosd17a5a72017-01-02 08:09:59 -0800197 // TODO(hbos): |deleted = true| case is not supported by |RTCStatsCollector|.
198 // crbug.com/632723
199 RTCStatsMember<bool> deleted; // = false
hbosab9f6e42016-10-07 02:18:47 -0700200
201 protected:
hbosc3a2b7f2017-01-02 04:46:15 -0800202 RTCIceCandidateStats(
203 const std::string& id, int64_t timestamp_us, bool is_remote);
204 RTCIceCandidateStats(std::string&& id, int64_t timestamp_us, bool is_remote);
hbosab9f6e42016-10-07 02:18:47 -0700205};
206
207// In the spec both local and remote varieties are of type RTCIceCandidateStats.
208// But here we define them as subclasses of |RTCIceCandidateStats| because the
209// |kType| need to be different ("RTCStatsType type") in the local/remote case.
210// https://w3c.github.io/webrtc-stats/#rtcstatstype-str*
211class RTCLocalIceCandidateStats final : public RTCIceCandidateStats {
212 public:
213 static const char kType[];
214 RTCLocalIceCandidateStats(const std::string& id, int64_t timestamp_us);
215 RTCLocalIceCandidateStats(std::string&& id, int64_t timestamp_us);
216 const char* type() const override;
217};
218
219class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats {
220 public:
221 static const char kType[];
222 RTCRemoteIceCandidateStats(const std::string& id, int64_t timestamp_us);
223 RTCRemoteIceCandidateStats(std::string&& id, int64_t timestamp_us);
224 const char* type() const override;
225};
226
hbos09bc1282016-11-08 06:29:22 -0800227// https://w3c.github.io/webrtc-stats/#msstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800228// TODO(hbos): Tracking bug crbug.com/660827
hbos09bc1282016-11-08 06:29:22 -0800229class RTCMediaStreamStats final : public RTCStats {
230 public:
231 WEBRTC_RTCSTATS_DECL();
232
233 RTCMediaStreamStats(const std::string& id, int64_t timestamp_us);
234 RTCMediaStreamStats(std::string&& id, int64_t timestamp_us);
235 RTCMediaStreamStats(const RTCMediaStreamStats& other);
236 ~RTCMediaStreamStats() override;
237
238 RTCStatsMember<std::string> stream_identifier;
239 RTCStatsMember<std::vector<std::string>> track_ids;
240};
241
242// https://w3c.github.io/webrtc-stats/#mststats-dict*
hbos0adb8282016-11-23 02:32:06 -0800243// TODO(hbos): Tracking bug crbug.com/659137
hbos09bc1282016-11-08 06:29:22 -0800244class RTCMediaStreamTrackStats final : public RTCStats {
245 public:
246 WEBRTC_RTCSTATS_DECL();
247
hbos160e4a72017-01-17 02:53:23 -0800248 RTCMediaStreamTrackStats(const std::string& id, int64_t timestamp_us,
249 const char* kind);
250 RTCMediaStreamTrackStats(std::string&& id, int64_t timestamp_us,
251 const char* kind);
hbos09bc1282016-11-08 06:29:22 -0800252 RTCMediaStreamTrackStats(const RTCMediaStreamTrackStats& other);
253 ~RTCMediaStreamTrackStats() override;
254
255 RTCStatsMember<std::string> track_identifier;
256 RTCStatsMember<bool> remote_source;
257 RTCStatsMember<bool> ended;
258 // TODO(hbos): |RTCStatsCollector| does not return stats for detached tracks.
259 // crbug.com/659137
260 RTCStatsMember<bool> detached;
hbos160e4a72017-01-17 02:53:23 -0800261 // See |RTCMediaStreamTrackKind| for valid values.
262 RTCStatsMember<std::string> kind;
hbos09bc1282016-11-08 06:29:22 -0800263 // Video-only members
264 RTCStatsMember<uint32_t> frame_width;
265 RTCStatsMember<uint32_t> frame_height;
266 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
267 RTCStatsMember<double> frames_per_second;
268 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
269 RTCStatsMember<uint32_t> frames_sent;
hbos09bc1282016-11-08 06:29:22 -0800270 RTCStatsMember<uint32_t> frames_received;
271 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
272 RTCStatsMember<uint32_t> frames_decoded;
273 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
274 RTCStatsMember<uint32_t> frames_dropped;
275 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
276 RTCStatsMember<uint32_t> frames_corrupted;
277 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
278 RTCStatsMember<uint32_t> partial_frames_lost;
279 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
280 RTCStatsMember<uint32_t> full_frames_lost;
281 // Audio-only members
282 RTCStatsMember<double> audio_level;
283 RTCStatsMember<double> echo_return_loss;
284 RTCStatsMember<double> echo_return_loss_enhancement;
285};
286
hbos6ab97ce2016-10-03 14:16:56 -0700287// https://w3c.github.io/webrtc-stats/#pcstats-dict*
hbosab9f6e42016-10-07 02:18:47 -0700288class RTCPeerConnectionStats final : public RTCStats {
hbosd565b732016-08-30 14:04:35 -0700289 public:
hbosfc5e0502016-10-06 02:06:10 -0700290 WEBRTC_RTCSTATS_DECL();
291
hbos0e6758d2016-08-31 07:57:36 -0700292 RTCPeerConnectionStats(const std::string& id, int64_t timestamp_us);
293 RTCPeerConnectionStats(std::string&& id, int64_t timestamp_us);
hbosfc5e0502016-10-06 02:06:10 -0700294 RTCPeerConnectionStats(const RTCPeerConnectionStats& other);
295 ~RTCPeerConnectionStats() override;
hbosd565b732016-08-30 14:04:35 -0700296
297 RTCStatsMember<uint32_t> data_channels_opened;
298 RTCStatsMember<uint32_t> data_channels_closed;
299};
300
hbos6ded1902016-11-01 01:50:46 -0700301// https://w3c.github.io/webrtc-stats/#streamstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800302// TODO(hbos): Tracking bug crbug.com/657854
hbos6ded1902016-11-01 01:50:46 -0700303class RTCRTPStreamStats : public RTCStats {
304 public:
305 WEBRTC_RTCSTATS_DECL();
306
307 RTCRTPStreamStats(const RTCRTPStreamStats& other);
308 ~RTCRTPStreamStats() override;
309
310 RTCStatsMember<std::string> ssrc;
311 // TODO(hbos): When the remote case is supported |RTCStatsCollector| needs to
312 // set this. crbug.com/657855, 657856
313 RTCStatsMember<std::string> associate_stats_id;
314 // TODO(hbos): Remote case not supported by |RTCStatsCollector|.
315 // crbug.com/657855, 657856
316 RTCStatsMember<bool> is_remote; // = false
317 RTCStatsMember<std::string> media_type;
hbos6ded1902016-11-01 01:50:46 -0700318 RTCStatsMember<std::string> media_track_id;
319 RTCStatsMember<std::string> transport_id;
hbos6ded1902016-11-01 01:50:46 -0700320 RTCStatsMember<std::string> codec_id;
321 // FIR and PLI counts are only defined for |media_type == "video"|.
322 RTCStatsMember<uint32_t> fir_count;
323 RTCStatsMember<uint32_t> pli_count;
324 // TODO(hbos): NACK count should be collected by |RTCStatsCollector| for both
325 // audio and video but is only defined in the "video" case. crbug.com/657856
326 RTCStatsMember<uint32_t> nack_count;
327 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657854
328 // SLI count is only defined for |media_type == "video"|.
329 RTCStatsMember<uint32_t> sli_count;
hbos6769c492017-01-02 08:35:13 -0800330 // TODO(hbos): Only collected for the outbound case, should also be collected
331 // for inbound case by |RTCStatsCollector|. crbug.com/657854, crbug.com/657855
332 RTCStatsMember<uint64_t> qp_sum;
hbos6ded1902016-11-01 01:50:46 -0700333
334 protected:
335 RTCRTPStreamStats(const std::string& id, int64_t timestamp_us);
336 RTCRTPStreamStats(std::string&& id, int64_t timestamp_us);
337};
338
hboseeafe942016-11-01 03:00:17 -0700339// https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800340// Tracking bug crbug.com/657855
341// TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657855
hboseeafe942016-11-01 03:00:17 -0700342class RTCInboundRTPStreamStats final : public RTCRTPStreamStats {
343 public:
344 WEBRTC_RTCSTATS_DECL();
345
346 RTCInboundRTPStreamStats(const std::string& id, int64_t timestamp_us);
347 RTCInboundRTPStreamStats(std::string&& id, int64_t timestamp_us);
348 RTCInboundRTPStreamStats(const RTCInboundRTPStreamStats& other);
349 ~RTCInboundRTPStreamStats() override;
350
351 RTCStatsMember<uint32_t> packets_received;
352 RTCStatsMember<uint64_t> bytes_received;
hboseeafe942016-11-01 03:00:17 -0700353 RTCStatsMember<uint32_t> packets_lost;
354 // TODO(hbos): Not collected in the "video" case by |RTCStatsCollector|.
355 // crbug.com/657855
356 RTCStatsMember<double> jitter;
357 RTCStatsMember<double> fraction_lost;
358 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
359 RTCStatsMember<uint32_t> packets_discarded;
360 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
361 RTCStatsMember<uint32_t> packets_repaired;
362 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
363 RTCStatsMember<uint32_t> burst_packets_lost;
364 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
365 RTCStatsMember<uint32_t> burst_packets_discarded;
366 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
367 RTCStatsMember<uint32_t> burst_loss_count;
368 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
369 RTCStatsMember<uint32_t> burst_discard_count;
370 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
371 RTCStatsMember<double> burst_loss_rate;
372 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
373 RTCStatsMember<double> burst_discard_rate;
374 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
375 RTCStatsMember<double> gap_loss_rate;
376 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
377 RTCStatsMember<double> gap_discard_rate;
hbos6769c492017-01-02 08:35:13 -0800378 RTCStatsMember<uint32_t> frames_decoded;
hboseeafe942016-11-01 03:00:17 -0700379};
380
hbos6ded1902016-11-01 01:50:46 -0700381// https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800382// Tracking bug crbug.com/657856
383// TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657856
hbos6ded1902016-11-01 01:50:46 -0700384class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats {
385 public:
386 WEBRTC_RTCSTATS_DECL();
387
388 RTCOutboundRTPStreamStats(const std::string& id, int64_t timestamp_us);
389 RTCOutboundRTPStreamStats(std::string&& id, int64_t timestamp_us);
390 RTCOutboundRTPStreamStats(const RTCOutboundRTPStreamStats& other);
391 ~RTCOutboundRTPStreamStats() override;
392
393 RTCStatsMember<uint32_t> packets_sent;
394 RTCStatsMember<uint64_t> bytes_sent;
395 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657856
396 RTCStatsMember<double> target_bitrate;
397 RTCStatsMember<double> round_trip_time;
hbos6769c492017-01-02 08:35:13 -0800398 RTCStatsMember<uint32_t> frames_encoded;
hbos6ded1902016-11-01 01:50:46 -0700399};
400
hbos2fa7c672016-10-24 04:00:05 -0700401// https://w3c.github.io/webrtc-stats/#transportstats-dict*
402class RTCTransportStats final : public RTCStats {
403 public:
404 WEBRTC_RTCSTATS_DECL();
405
406 RTCTransportStats(const std::string& id, int64_t timestamp_us);
407 RTCTransportStats(std::string&& id, int64_t timestamp_us);
408 RTCTransportStats(const RTCTransportStats& other);
409 ~RTCTransportStats() override;
410
411 RTCStatsMember<uint64_t> bytes_sent;
412 RTCStatsMember<uint64_t> bytes_received;
413 RTCStatsMember<std::string> rtcp_transport_stats_id;
hbos7064d592017-01-16 07:38:02 -0800414 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDtlsTransportState>"?
415 RTCStatsMember<std::string> dtls_state;
hbos2fa7c672016-10-24 04:00:05 -0700416 RTCStatsMember<std::string> selected_candidate_pair_id;
417 RTCStatsMember<std::string> local_certificate_id;
418 RTCStatsMember<std::string> remote_certificate_id;
419};
420
hbosd565b732016-08-30 14:04:35 -0700421} // namespace webrtc
422
hbos74e1a4f2016-09-15 23:33:01 -0700423#endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_