blob: 29e2d7633ccad83b3b89a117cbc71f74ddd1084d [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>
oprypin803dc292017-02-01 01:55:59 -080015#include <vector>
hbosd565b732016-08-30 14:04:35 -070016
hbos74e1a4f2016-09-15 23:33:01 -070017#include "webrtc/api/stats/rtcstats.h"
hbosd565b732016-08-30 14:04:35 -070018
19namespace webrtc {
20
hboscc555c52016-10-18 12:48:31 -070021// https://w3c.github.io/webrtc-pc/#idl-def-rtcdatachannelstate
22struct RTCDataChannelState {
23 static const char* kConnecting;
24 static const char* kOpen;
25 static const char* kClosing;
26 static const char* kClosed;
27};
28
hbosc47a0c32016-10-11 14:54:49 -070029// https://w3c.github.io/webrtc-stats/#dom-rtcstatsicecandidatepairstate
30struct RTCStatsIceCandidatePairState {
31 static const char* kFrozen;
32 static const char* kWaiting;
33 static const char* kInProgress;
34 static const char* kFailed;
35 static const char* kSucceeded;
hbosc47a0c32016-10-11 14:54:49 -070036};
37
hboscc555c52016-10-18 12:48:31 -070038// https://w3c.github.io/webrtc-pc/#rtcicecandidatetype-enum
hbosab9f6e42016-10-07 02:18:47 -070039struct RTCIceCandidateType {
40 static const char* kHost;
41 static const char* kSrflx;
42 static const char* kPrflx;
43 static const char* kRelay;
44};
45
hbos7064d592017-01-16 07:38:02 -080046// https://w3c.github.io/webrtc-pc/#idl-def-rtcdtlstransportstate
47struct RTCDtlsTransportState {
48 static const char* kNew;
49 static const char* kConnecting;
50 static const char* kConnected;
51 static const char* kClosed;
52 static const char* kFailed;
53};
54
hbos160e4a72017-01-17 02:53:23 -080055// |RTCMediaStreamTrackStats::kind| is not an enum in the spec but the only
56// valid values are "audio" and "video".
57// https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats-kind
58struct RTCMediaStreamTrackKind {
59 static const char* kAudio;
60 static const char* kVideo;
61};
62
hbos2fa7c672016-10-24 04:00:05 -070063// https://w3c.github.io/webrtc-stats/#certificatestats-dict*
64class RTCCertificateStats final : public RTCStats {
65 public:
66 WEBRTC_RTCSTATS_DECL();
67
68 RTCCertificateStats(const std::string& id, int64_t timestamp_us);
69 RTCCertificateStats(std::string&& id, int64_t timestamp_us);
70 RTCCertificateStats(const RTCCertificateStats& other);
71 ~RTCCertificateStats() override;
72
73 RTCStatsMember<std::string> fingerprint;
74 RTCStatsMember<std::string> fingerprint_algorithm;
75 RTCStatsMember<std::string> base64_certificate;
76 RTCStatsMember<std::string> issuer_certificate_id;
77};
78
hbos0adb8282016-11-23 02:32:06 -080079// https://w3c.github.io/webrtc-stats/#codec-dict*
hbos0adb8282016-11-23 02:32:06 -080080class RTCCodecStats final : public RTCStats {
81 public:
82 WEBRTC_RTCSTATS_DECL();
83
84 RTCCodecStats(const std::string& id, int64_t timestamp_us);
85 RTCCodecStats(std::string&& id, int64_t timestamp_us);
86 RTCCodecStats(const RTCCodecStats& other);
87 ~RTCCodecStats() override;
88
89 RTCStatsMember<uint32_t> payload_type;
90 RTCStatsMember<std::string> codec;
91 RTCStatsMember<uint32_t> clock_rate;
hbos585a9b12017-02-07 04:59:16 -080092 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7061
hbos0adb8282016-11-23 02:32:06 -080093 RTCStatsMember<uint32_t> channels;
hbos585a9b12017-02-07 04:59:16 -080094 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7061
hbos0adb8282016-11-23 02:32:06 -080095 RTCStatsMember<std::string> parameters;
hbos585a9b12017-02-07 04:59:16 -080096 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7061
hbos0adb8282016-11-23 02:32:06 -080097 RTCStatsMember<std::string> implementation;
98};
99
hbos2fa7c672016-10-24 04:00:05 -0700100// https://w3c.github.io/webrtc-stats/#dcstats-dict*
101class RTCDataChannelStats final : public RTCStats {
102 public:
103 WEBRTC_RTCSTATS_DECL();
104
105 RTCDataChannelStats(const std::string& id, int64_t timestamp_us);
106 RTCDataChannelStats(std::string&& id, int64_t timestamp_us);
107 RTCDataChannelStats(const RTCDataChannelStats& other);
108 ~RTCDataChannelStats() override;
109
110 RTCStatsMember<std::string> label;
111 RTCStatsMember<std::string> protocol;
112 RTCStatsMember<int32_t> datachannelid;
113 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDataChannelState>"?
114 RTCStatsMember<std::string> state;
115 RTCStatsMember<uint32_t> messages_sent;
116 RTCStatsMember<uint64_t> bytes_sent;
117 RTCStatsMember<uint32_t> messages_received;
118 RTCStatsMember<uint64_t> bytes_received;
119};
120
121// https://w3c.github.io/webrtc-stats/#candidatepair-dict*
hbos338f78a2017-02-07 06:41:21 -0800122// TODO(hbos): Tracking bug https://bugs.webrtc.org/7062
hbos6ded1902016-11-01 01:50:46 -0700123class RTCIceCandidatePairStats final : public RTCStats {
hbosc47a0c32016-10-11 14:54:49 -0700124 public:
125 WEBRTC_RTCSTATS_DECL();
126
127 RTCIceCandidatePairStats(const std::string& id, int64_t timestamp_us);
128 RTCIceCandidatePairStats(std::string&& id, int64_t timestamp_us);
129 RTCIceCandidatePairStats(const RTCIceCandidatePairStats& other);
130 ~RTCIceCandidatePairStats() override;
131
132 RTCStatsMember<std::string> transport_id;
133 RTCStatsMember<std::string> local_candidate_id;
134 RTCStatsMember<std::string> remote_candidate_id;
135 // TODO(hbos): Support enum types?
136 // "RTCStatsMember<RTCStatsIceCandidatePairState>"?
137 RTCStatsMember<std::string> state;
138 RTCStatsMember<uint64_t> priority;
139 RTCStatsMember<bool> nominated;
hbos338f78a2017-02-07 06:41:21 -0800140 // TODO(hbos): Collect this the way the spec describes it. We have a value for
141 // it but it is not spec-compliant. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700142 RTCStatsMember<bool> writable;
hbos338f78a2017-02-07 06:41:21 -0800143 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700144 RTCStatsMember<bool> readable;
145 RTCStatsMember<uint64_t> bytes_sent;
146 RTCStatsMember<uint64_t> bytes_received;
hbos338f78a2017-02-07 06:41:21 -0800147 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbos3168c7a2016-12-15 06:17:08 -0800148 RTCStatsMember<double> total_round_trip_time;
hbos338f78a2017-02-07 06:41:21 -0800149 // TODO(hbos): Collect this the way the spec describes it. We have a value for
150 // it but it is not spec-compliant. https://bugs.webrtc.org/7062
hbos3168c7a2016-12-15 06:17:08 -0800151 RTCStatsMember<double> current_round_trip_time;
hbosc47a0c32016-10-11 14:54:49 -0700152 RTCStatsMember<double> available_outgoing_bitrate;
hbos338f78a2017-02-07 06:41:21 -0800153 // TODO(hbos): Populate this value. It is wired up and collected the same way
154 // |VideoBwe.googAvailableReceiveBandwidth| is, but that value is always
155 // undefined. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700156 RTCStatsMember<double> available_incoming_bitrate;
157 RTCStatsMember<uint64_t> requests_received;
158 RTCStatsMember<uint64_t> requests_sent;
159 RTCStatsMember<uint64_t> responses_received;
160 RTCStatsMember<uint64_t> responses_sent;
hbos338f78a2017-02-07 06:41:21 -0800161 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700162 RTCStatsMember<uint64_t> retransmissions_received;
hbos338f78a2017-02-07 06:41:21 -0800163 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700164 RTCStatsMember<uint64_t> retransmissions_sent;
hbos338f78a2017-02-07 06:41:21 -0800165 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700166 RTCStatsMember<uint64_t> consent_requests_received;
167 RTCStatsMember<uint64_t> consent_requests_sent;
hbos338f78a2017-02-07 06:41:21 -0800168 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700169 RTCStatsMember<uint64_t> consent_responses_received;
hbos338f78a2017-02-07 06:41:21 -0800170 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700171 RTCStatsMember<uint64_t> consent_responses_sent;
172};
173
hbosab9f6e42016-10-07 02:18:47 -0700174// https://w3c.github.io/webrtc-stats/#icecandidate-dict*
hbos5d79a7c2016-10-24 09:27:10 -0700175// TODO(hbos): |RTCStatsCollector| only collects candidates that are part of
176// ice candidate pairs, but there could be candidates not paired with anything.
177// crbug.com/632723
hbosab9f6e42016-10-07 02:18:47 -0700178class RTCIceCandidateStats : public RTCStats {
179 public:
180 WEBRTC_RTCSTATS_DECL();
181
182 RTCIceCandidateStats(const RTCIceCandidateStats& other);
183 ~RTCIceCandidateStats() override;
184
hbosb4e426e2017-01-02 09:59:31 -0800185 RTCStatsMember<std::string> transport_id;
hbosc3a2b7f2017-01-02 04:46:15 -0800186 RTCStatsMember<bool> is_remote;
hbosab9f6e42016-10-07 02:18:47 -0700187 RTCStatsMember<std::string> ip;
188 RTCStatsMember<int32_t> port;
189 RTCStatsMember<std::string> protocol;
190 // TODO(hbos): Support enum types? "RTCStatsMember<RTCIceCandidateType>"?
191 RTCStatsMember<std::string> candidate_type;
192 RTCStatsMember<int32_t> priority;
hbos5d79a7c2016-10-24 09:27:10 -0700193 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/632723
hbosab9f6e42016-10-07 02:18:47 -0700194 RTCStatsMember<std::string> url;
hbosd17a5a72017-01-02 08:09:59 -0800195 // TODO(hbos): |deleted = true| case is not supported by |RTCStatsCollector|.
196 // crbug.com/632723
197 RTCStatsMember<bool> deleted; // = false
hbosab9f6e42016-10-07 02:18:47 -0700198
199 protected:
hbosc3a2b7f2017-01-02 04:46:15 -0800200 RTCIceCandidateStats(
201 const std::string& id, int64_t timestamp_us, bool is_remote);
202 RTCIceCandidateStats(std::string&& id, int64_t timestamp_us, bool is_remote);
hbosab9f6e42016-10-07 02:18:47 -0700203};
204
205// In the spec both local and remote varieties are of type RTCIceCandidateStats.
206// But here we define them as subclasses of |RTCIceCandidateStats| because the
207// |kType| need to be different ("RTCStatsType type") in the local/remote case.
208// https://w3c.github.io/webrtc-stats/#rtcstatstype-str*
209class RTCLocalIceCandidateStats final : public RTCIceCandidateStats {
210 public:
211 static const char kType[];
212 RTCLocalIceCandidateStats(const std::string& id, int64_t timestamp_us);
213 RTCLocalIceCandidateStats(std::string&& id, int64_t timestamp_us);
214 const char* type() const override;
215};
216
217class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats {
218 public:
219 static const char kType[];
220 RTCRemoteIceCandidateStats(const std::string& id, int64_t timestamp_us);
221 RTCRemoteIceCandidateStats(std::string&& id, int64_t timestamp_us);
222 const char* type() const override;
223};
224
hbos09bc1282016-11-08 06:29:22 -0800225// https://w3c.github.io/webrtc-stats/#msstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800226// TODO(hbos): Tracking bug crbug.com/660827
hbos09bc1282016-11-08 06:29:22 -0800227class RTCMediaStreamStats final : public RTCStats {
228 public:
229 WEBRTC_RTCSTATS_DECL();
230
231 RTCMediaStreamStats(const std::string& id, int64_t timestamp_us);
232 RTCMediaStreamStats(std::string&& id, int64_t timestamp_us);
233 RTCMediaStreamStats(const RTCMediaStreamStats& other);
234 ~RTCMediaStreamStats() override;
235
236 RTCStatsMember<std::string> stream_identifier;
237 RTCStatsMember<std::vector<std::string>> track_ids;
238};
239
240// https://w3c.github.io/webrtc-stats/#mststats-dict*
hbos0adb8282016-11-23 02:32:06 -0800241// TODO(hbos): Tracking bug crbug.com/659137
hbos09bc1282016-11-08 06:29:22 -0800242class RTCMediaStreamTrackStats final : public RTCStats {
243 public:
244 WEBRTC_RTCSTATS_DECL();
245
hbos160e4a72017-01-17 02:53:23 -0800246 RTCMediaStreamTrackStats(const std::string& id, int64_t timestamp_us,
247 const char* kind);
248 RTCMediaStreamTrackStats(std::string&& id, int64_t timestamp_us,
249 const char* kind);
hbos09bc1282016-11-08 06:29:22 -0800250 RTCMediaStreamTrackStats(const RTCMediaStreamTrackStats& other);
251 ~RTCMediaStreamTrackStats() override;
252
253 RTCStatsMember<std::string> track_identifier;
254 RTCStatsMember<bool> remote_source;
255 RTCStatsMember<bool> ended;
256 // TODO(hbos): |RTCStatsCollector| does not return stats for detached tracks.
257 // crbug.com/659137
258 RTCStatsMember<bool> detached;
hbos160e4a72017-01-17 02:53:23 -0800259 // See |RTCMediaStreamTrackKind| for valid values.
260 RTCStatsMember<std::string> kind;
hbos09bc1282016-11-08 06:29:22 -0800261 // Video-only members
262 RTCStatsMember<uint32_t> frame_width;
263 RTCStatsMember<uint32_t> frame_height;
264 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
265 RTCStatsMember<double> frames_per_second;
hbos09bc1282016-11-08 06:29:22 -0800266 RTCStatsMember<uint32_t> frames_sent;
hbos09bc1282016-11-08 06:29:22 -0800267 RTCStatsMember<uint32_t> frames_received;
hbos09bc1282016-11-08 06:29:22 -0800268 RTCStatsMember<uint32_t> frames_decoded;
hbos09bc1282016-11-08 06:29:22 -0800269 RTCStatsMember<uint32_t> frames_dropped;
270 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
271 RTCStatsMember<uint32_t> frames_corrupted;
272 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
273 RTCStatsMember<uint32_t> partial_frames_lost;
274 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
275 RTCStatsMember<uint32_t> full_frames_lost;
276 // Audio-only members
277 RTCStatsMember<double> audio_level;
278 RTCStatsMember<double> echo_return_loss;
279 RTCStatsMember<double> echo_return_loss_enhancement;
280};
281
hbos6ab97ce2016-10-03 14:16:56 -0700282// https://w3c.github.io/webrtc-stats/#pcstats-dict*
hbosab9f6e42016-10-07 02:18:47 -0700283class RTCPeerConnectionStats final : public RTCStats {
hbosd565b732016-08-30 14:04:35 -0700284 public:
hbosfc5e0502016-10-06 02:06:10 -0700285 WEBRTC_RTCSTATS_DECL();
286
hbos0e6758d2016-08-31 07:57:36 -0700287 RTCPeerConnectionStats(const std::string& id, int64_t timestamp_us);
288 RTCPeerConnectionStats(std::string&& id, int64_t timestamp_us);
hbosfc5e0502016-10-06 02:06:10 -0700289 RTCPeerConnectionStats(const RTCPeerConnectionStats& other);
290 ~RTCPeerConnectionStats() override;
hbosd565b732016-08-30 14:04:35 -0700291
292 RTCStatsMember<uint32_t> data_channels_opened;
293 RTCStatsMember<uint32_t> data_channels_closed;
294};
295
hbos6ded1902016-11-01 01:50:46 -0700296// https://w3c.github.io/webrtc-stats/#streamstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800297// TODO(hbos): Tracking bug crbug.com/657854
hbos6ded1902016-11-01 01:50:46 -0700298class RTCRTPStreamStats : public RTCStats {
299 public:
300 WEBRTC_RTCSTATS_DECL();
301
302 RTCRTPStreamStats(const RTCRTPStreamStats& other);
303 ~RTCRTPStreamStats() override;
304
hbos3443bb72017-02-07 06:28:11 -0800305 RTCStatsMember<uint32_t> ssrc;
hbos6ded1902016-11-01 01:50:46 -0700306 // TODO(hbos): When the remote case is supported |RTCStatsCollector| needs to
307 // set this. crbug.com/657855, 657856
308 RTCStatsMember<std::string> associate_stats_id;
309 // TODO(hbos): Remote case not supported by |RTCStatsCollector|.
310 // crbug.com/657855, 657856
311 RTCStatsMember<bool> is_remote; // = false
312 RTCStatsMember<std::string> media_type;
hbosb0ae9202017-01-27 06:35:16 -0800313 RTCStatsMember<std::string> track_id;
hbos6ded1902016-11-01 01:50:46 -0700314 RTCStatsMember<std::string> transport_id;
hbos6ded1902016-11-01 01:50:46 -0700315 RTCStatsMember<std::string> codec_id;
316 // FIR and PLI counts are only defined for |media_type == "video"|.
317 RTCStatsMember<uint32_t> fir_count;
318 RTCStatsMember<uint32_t> pli_count;
319 // TODO(hbos): NACK count should be collected by |RTCStatsCollector| for both
320 // audio and video but is only defined in the "video" case. crbug.com/657856
321 RTCStatsMember<uint32_t> nack_count;
322 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657854
323 // SLI count is only defined for |media_type == "video"|.
324 RTCStatsMember<uint32_t> sli_count;
hbos6769c492017-01-02 08:35:13 -0800325 RTCStatsMember<uint64_t> qp_sum;
hbos6ded1902016-11-01 01:50:46 -0700326
327 protected:
328 RTCRTPStreamStats(const std::string& id, int64_t timestamp_us);
329 RTCRTPStreamStats(std::string&& id, int64_t timestamp_us);
330};
331
hboseeafe942016-11-01 03:00:17 -0700332// https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800333// Tracking bug crbug.com/657855
334// TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657855
hboseeafe942016-11-01 03:00:17 -0700335class RTCInboundRTPStreamStats final : public RTCRTPStreamStats {
336 public:
337 WEBRTC_RTCSTATS_DECL();
338
339 RTCInboundRTPStreamStats(const std::string& id, int64_t timestamp_us);
340 RTCInboundRTPStreamStats(std::string&& id, int64_t timestamp_us);
341 RTCInboundRTPStreamStats(const RTCInboundRTPStreamStats& other);
342 ~RTCInboundRTPStreamStats() override;
343
344 RTCStatsMember<uint32_t> packets_received;
345 RTCStatsMember<uint64_t> bytes_received;
hboseeafe942016-11-01 03:00:17 -0700346 RTCStatsMember<uint32_t> packets_lost;
347 // TODO(hbos): Not collected in the "video" case by |RTCStatsCollector|.
348 // crbug.com/657855
349 RTCStatsMember<double> jitter;
350 RTCStatsMember<double> fraction_lost;
351 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
352 RTCStatsMember<uint32_t> packets_discarded;
353 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
354 RTCStatsMember<uint32_t> packets_repaired;
355 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
356 RTCStatsMember<uint32_t> burst_packets_lost;
357 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
358 RTCStatsMember<uint32_t> burst_packets_discarded;
359 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
360 RTCStatsMember<uint32_t> burst_loss_count;
361 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
362 RTCStatsMember<uint32_t> burst_discard_count;
363 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
364 RTCStatsMember<double> burst_loss_rate;
365 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
366 RTCStatsMember<double> burst_discard_rate;
367 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
368 RTCStatsMember<double> gap_loss_rate;
369 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
370 RTCStatsMember<double> gap_discard_rate;
hbos6769c492017-01-02 08:35:13 -0800371 RTCStatsMember<uint32_t> frames_decoded;
hboseeafe942016-11-01 03:00:17 -0700372};
373
hbos6ded1902016-11-01 01:50:46 -0700374// https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800375// Tracking bug crbug.com/657856
376// TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657856
hbos6ded1902016-11-01 01:50:46 -0700377class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats {
378 public:
379 WEBRTC_RTCSTATS_DECL();
380
381 RTCOutboundRTPStreamStats(const std::string& id, int64_t timestamp_us);
382 RTCOutboundRTPStreamStats(std::string&& id, int64_t timestamp_us);
383 RTCOutboundRTPStreamStats(const RTCOutboundRTPStreamStats& other);
384 ~RTCOutboundRTPStreamStats() override;
385
386 RTCStatsMember<uint32_t> packets_sent;
387 RTCStatsMember<uint64_t> bytes_sent;
388 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657856
389 RTCStatsMember<double> target_bitrate;
390 RTCStatsMember<double> round_trip_time;
hbos6769c492017-01-02 08:35:13 -0800391 RTCStatsMember<uint32_t> frames_encoded;
hbos6ded1902016-11-01 01:50:46 -0700392};
393
hbos2fa7c672016-10-24 04:00:05 -0700394// https://w3c.github.io/webrtc-stats/#transportstats-dict*
395class RTCTransportStats final : public RTCStats {
396 public:
397 WEBRTC_RTCSTATS_DECL();
398
399 RTCTransportStats(const std::string& id, int64_t timestamp_us);
400 RTCTransportStats(std::string&& id, int64_t timestamp_us);
401 RTCTransportStats(const RTCTransportStats& other);
402 ~RTCTransportStats() override;
403
404 RTCStatsMember<uint64_t> bytes_sent;
405 RTCStatsMember<uint64_t> bytes_received;
406 RTCStatsMember<std::string> rtcp_transport_stats_id;
hbos7064d592017-01-16 07:38:02 -0800407 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDtlsTransportState>"?
408 RTCStatsMember<std::string> dtls_state;
hbos2fa7c672016-10-24 04:00:05 -0700409 RTCStatsMember<std::string> selected_candidate_pair_id;
410 RTCStatsMember<std::string> local_certificate_id;
411 RTCStatsMember<std::string> remote_certificate_id;
412};
413
hbosd565b732016-08-30 14:04:35 -0700414} // namespace webrtc
415
hbos74e1a4f2016-09-15 23:33:01 -0700416#endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_