blob: e8a1842dbe8e3e82a2125d78bf70cb454d8e56df [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;
270 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
271 RTCStatsMember<uint32_t> frames_received;
272 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
273 RTCStatsMember<uint32_t> frames_decoded;
274 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
275 RTCStatsMember<uint32_t> frames_dropped;
276 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
277 RTCStatsMember<uint32_t> frames_corrupted;
278 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
279 RTCStatsMember<uint32_t> partial_frames_lost;
280 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
281 RTCStatsMember<uint32_t> full_frames_lost;
282 // Audio-only members
283 RTCStatsMember<double> audio_level;
284 RTCStatsMember<double> echo_return_loss;
285 RTCStatsMember<double> echo_return_loss_enhancement;
286};
287
hbos6ab97ce2016-10-03 14:16:56 -0700288// https://w3c.github.io/webrtc-stats/#pcstats-dict*
hbosab9f6e42016-10-07 02:18:47 -0700289class RTCPeerConnectionStats final : public RTCStats {
hbosd565b732016-08-30 14:04:35 -0700290 public:
hbosfc5e0502016-10-06 02:06:10 -0700291 WEBRTC_RTCSTATS_DECL();
292
hbos0e6758d2016-08-31 07:57:36 -0700293 RTCPeerConnectionStats(const std::string& id, int64_t timestamp_us);
294 RTCPeerConnectionStats(std::string&& id, int64_t timestamp_us);
hbosfc5e0502016-10-06 02:06:10 -0700295 RTCPeerConnectionStats(const RTCPeerConnectionStats& other);
296 ~RTCPeerConnectionStats() override;
hbosd565b732016-08-30 14:04:35 -0700297
298 RTCStatsMember<uint32_t> data_channels_opened;
299 RTCStatsMember<uint32_t> data_channels_closed;
300};
301
hbos6ded1902016-11-01 01:50:46 -0700302// https://w3c.github.io/webrtc-stats/#streamstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800303// TODO(hbos): Tracking bug crbug.com/657854
hbos6ded1902016-11-01 01:50:46 -0700304class RTCRTPStreamStats : public RTCStats {
305 public:
306 WEBRTC_RTCSTATS_DECL();
307
308 RTCRTPStreamStats(const RTCRTPStreamStats& other);
309 ~RTCRTPStreamStats() override;
310
311 RTCStatsMember<std::string> ssrc;
312 // TODO(hbos): When the remote case is supported |RTCStatsCollector| needs to
313 // set this. crbug.com/657855, 657856
314 RTCStatsMember<std::string> associate_stats_id;
315 // TODO(hbos): Remote case not supported by |RTCStatsCollector|.
316 // crbug.com/657855, 657856
317 RTCStatsMember<bool> is_remote; // = false
318 RTCStatsMember<std::string> media_type;
hbos6ded1902016-11-01 01:50:46 -0700319 RTCStatsMember<std::string> media_track_id;
320 RTCStatsMember<std::string> transport_id;
hbos6ded1902016-11-01 01:50:46 -0700321 RTCStatsMember<std::string> codec_id;
322 // FIR and PLI counts are only defined for |media_type == "video"|.
323 RTCStatsMember<uint32_t> fir_count;
324 RTCStatsMember<uint32_t> pli_count;
325 // TODO(hbos): NACK count should be collected by |RTCStatsCollector| for both
326 // audio and video but is only defined in the "video" case. crbug.com/657856
327 RTCStatsMember<uint32_t> nack_count;
328 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657854
329 // SLI count is only defined for |media_type == "video"|.
330 RTCStatsMember<uint32_t> sli_count;
hbos6769c492017-01-02 08:35:13 -0800331 // TODO(hbos): Only collected for the outbound case, should also be collected
332 // for inbound case by |RTCStatsCollector|. crbug.com/657854, crbug.com/657855
333 RTCStatsMember<uint64_t> qp_sum;
hbos6ded1902016-11-01 01:50:46 -0700334
335 protected:
336 RTCRTPStreamStats(const std::string& id, int64_t timestamp_us);
337 RTCRTPStreamStats(std::string&& id, int64_t timestamp_us);
338};
339
hboseeafe942016-11-01 03:00:17 -0700340// https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800341// Tracking bug crbug.com/657855
342// TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657855
hboseeafe942016-11-01 03:00:17 -0700343class RTCInboundRTPStreamStats final : public RTCRTPStreamStats {
344 public:
345 WEBRTC_RTCSTATS_DECL();
346
347 RTCInboundRTPStreamStats(const std::string& id, int64_t timestamp_us);
348 RTCInboundRTPStreamStats(std::string&& id, int64_t timestamp_us);
349 RTCInboundRTPStreamStats(const RTCInboundRTPStreamStats& other);
350 ~RTCInboundRTPStreamStats() override;
351
352 RTCStatsMember<uint32_t> packets_received;
353 RTCStatsMember<uint64_t> bytes_received;
hboseeafe942016-11-01 03:00:17 -0700354 RTCStatsMember<uint32_t> packets_lost;
355 // TODO(hbos): Not collected in the "video" case by |RTCStatsCollector|.
356 // crbug.com/657855
357 RTCStatsMember<double> jitter;
358 RTCStatsMember<double> fraction_lost;
359 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
360 RTCStatsMember<uint32_t> packets_discarded;
361 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
362 RTCStatsMember<uint32_t> packets_repaired;
363 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
364 RTCStatsMember<uint32_t> burst_packets_lost;
365 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
366 RTCStatsMember<uint32_t> burst_packets_discarded;
367 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
368 RTCStatsMember<uint32_t> burst_loss_count;
369 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
370 RTCStatsMember<uint32_t> burst_discard_count;
371 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
372 RTCStatsMember<double> burst_loss_rate;
373 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
374 RTCStatsMember<double> burst_discard_rate;
375 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
376 RTCStatsMember<double> gap_loss_rate;
377 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
378 RTCStatsMember<double> gap_discard_rate;
hbos6769c492017-01-02 08:35:13 -0800379 RTCStatsMember<uint32_t> frames_decoded;
hboseeafe942016-11-01 03:00:17 -0700380};
381
hbos6ded1902016-11-01 01:50:46 -0700382// https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800383// Tracking bug crbug.com/657856
384// TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657856
hbos6ded1902016-11-01 01:50:46 -0700385class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats {
386 public:
387 WEBRTC_RTCSTATS_DECL();
388
389 RTCOutboundRTPStreamStats(const std::string& id, int64_t timestamp_us);
390 RTCOutboundRTPStreamStats(std::string&& id, int64_t timestamp_us);
391 RTCOutboundRTPStreamStats(const RTCOutboundRTPStreamStats& other);
392 ~RTCOutboundRTPStreamStats() override;
393
394 RTCStatsMember<uint32_t> packets_sent;
395 RTCStatsMember<uint64_t> bytes_sent;
396 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657856
397 RTCStatsMember<double> target_bitrate;
398 RTCStatsMember<double> round_trip_time;
hbos6769c492017-01-02 08:35:13 -0800399 RTCStatsMember<uint32_t> frames_encoded;
hbos6ded1902016-11-01 01:50:46 -0700400};
401
hbos2fa7c672016-10-24 04:00:05 -0700402// https://w3c.github.io/webrtc-stats/#transportstats-dict*
403class RTCTransportStats final : public RTCStats {
404 public:
405 WEBRTC_RTCSTATS_DECL();
406
407 RTCTransportStats(const std::string& id, int64_t timestamp_us);
408 RTCTransportStats(std::string&& id, int64_t timestamp_us);
409 RTCTransportStats(const RTCTransportStats& other);
410 ~RTCTransportStats() override;
411
412 RTCStatsMember<uint64_t> bytes_sent;
413 RTCStatsMember<uint64_t> bytes_received;
414 RTCStatsMember<std::string> rtcp_transport_stats_id;
hbos7064d592017-01-16 07:38:02 -0800415 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDtlsTransportState>"?
416 RTCStatsMember<std::string> dtls_state;
hbos2fa7c672016-10-24 04:00:05 -0700417 RTCStatsMember<std::string> selected_candidate_pair_id;
418 RTCStatsMember<std::string> local_certificate_id;
419 RTCStatsMember<std::string> remote_certificate_id;
420};
421
hbosd565b732016-08-30 14:04:35 -0700422} // namespace webrtc
423
hbos74e1a4f2016-09-15 23:33:01 -0700424#endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_