blob: ac00386370d04b5f7f4d3973d45b596c96ae7aa3 [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*
80// Tracking bug crbug.com/659117
81// TODO(hbos): The present codec ID assignment is not sufficient to support
82// Unified Plan or unbundled connections in all cases. crbug.com/659117
83class RTCCodecStats final : public RTCStats {
84 public:
85 WEBRTC_RTCSTATS_DECL();
86
87 RTCCodecStats(const std::string& id, int64_t timestamp_us);
88 RTCCodecStats(std::string&& id, int64_t timestamp_us);
89 RTCCodecStats(const RTCCodecStats& other);
90 ~RTCCodecStats() override;
91
92 RTCStatsMember<uint32_t> payload_type;
93 RTCStatsMember<std::string> codec;
94 RTCStatsMember<uint32_t> clock_rate;
95 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659117
96 RTCStatsMember<uint32_t> channels;
97 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659117
98 RTCStatsMember<std::string> parameters;
99 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659117
100 RTCStatsMember<std::string> implementation;
101};
102
hbos2fa7c672016-10-24 04:00:05 -0700103// https://w3c.github.io/webrtc-stats/#dcstats-dict*
104class RTCDataChannelStats final : public RTCStats {
105 public:
106 WEBRTC_RTCSTATS_DECL();
107
108 RTCDataChannelStats(const std::string& id, int64_t timestamp_us);
109 RTCDataChannelStats(std::string&& id, int64_t timestamp_us);
110 RTCDataChannelStats(const RTCDataChannelStats& other);
111 ~RTCDataChannelStats() override;
112
113 RTCStatsMember<std::string> label;
114 RTCStatsMember<std::string> protocol;
115 RTCStatsMember<int32_t> datachannelid;
116 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDataChannelState>"?
117 RTCStatsMember<std::string> state;
118 RTCStatsMember<uint32_t> messages_sent;
119 RTCStatsMember<uint64_t> bytes_sent;
120 RTCStatsMember<uint32_t> messages_received;
121 RTCStatsMember<uint64_t> bytes_received;
122};
123
124// https://w3c.github.io/webrtc-stats/#candidatepair-dict*
hbos0adb8282016-11-23 02:32:06 -0800125// TODO(hbos): Tracking bug crbug.com/633550
hbos6ded1902016-11-01 01:50:46 -0700126class RTCIceCandidatePairStats final : public RTCStats {
hbosc47a0c32016-10-11 14:54:49 -0700127 public:
128 WEBRTC_RTCSTATS_DECL();
129
130 RTCIceCandidatePairStats(const std::string& id, int64_t timestamp_us);
131 RTCIceCandidatePairStats(std::string&& id, int64_t timestamp_us);
132 RTCIceCandidatePairStats(const RTCIceCandidatePairStats& other);
133 ~RTCIceCandidatePairStats() override;
134
135 RTCStatsMember<std::string> transport_id;
136 RTCStatsMember<std::string> local_candidate_id;
137 RTCStatsMember<std::string> remote_candidate_id;
138 // TODO(hbos): Support enum types?
139 // "RTCStatsMember<RTCStatsIceCandidatePairState>"?
140 RTCStatsMember<std::string> state;
141 RTCStatsMember<uint64_t> priority;
hbos5d79a7c2016-10-24 09:27:10 -0700142 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700143 RTCStatsMember<bool> nominated;
hbos5d79a7c2016-10-24 09:27:10 -0700144 // TODO(hbos): Collected by |RTCStatsCollector| but different than the spec.
145 // crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700146 RTCStatsMember<bool> writable;
hbos5d79a7c2016-10-24 09:27:10 -0700147 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700148 RTCStatsMember<bool> readable;
149 RTCStatsMember<uint64_t> bytes_sent;
150 RTCStatsMember<uint64_t> bytes_received;
hbos5d79a7c2016-10-24 09:27:10 -0700151 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbos3168c7a2016-12-15 06:17:08 -0800152 RTCStatsMember<double> total_round_trip_time;
hbos5d79a7c2016-10-24 09:27:10 -0700153 // TODO(hbos): Collected by |RTCStatsCollector| but different than the spec.
154 // crbug.com/633550
hbos3168c7a2016-12-15 06:17:08 -0800155 RTCStatsMember<double> current_round_trip_time;
hbos5d79a7c2016-10-24 09:27:10 -0700156 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700157 RTCStatsMember<double> available_outgoing_bitrate;
hbos5d79a7c2016-10-24 09:27:10 -0700158 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700159 RTCStatsMember<double> available_incoming_bitrate;
160 RTCStatsMember<uint64_t> requests_received;
161 RTCStatsMember<uint64_t> requests_sent;
162 RTCStatsMember<uint64_t> responses_received;
163 RTCStatsMember<uint64_t> responses_sent;
hbos5d79a7c2016-10-24 09:27:10 -0700164 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700165 RTCStatsMember<uint64_t> retransmissions_received;
hbos5d79a7c2016-10-24 09:27:10 -0700166 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700167 RTCStatsMember<uint64_t> retransmissions_sent;
hbos5d79a7c2016-10-24 09:27:10 -0700168 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700169 RTCStatsMember<uint64_t> consent_requests_received;
170 RTCStatsMember<uint64_t> consent_requests_sent;
hbos5d79a7c2016-10-24 09:27:10 -0700171 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700172 RTCStatsMember<uint64_t> consent_responses_received;
hbos5d79a7c2016-10-24 09:27:10 -0700173 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550
hbosc47a0c32016-10-11 14:54:49 -0700174 RTCStatsMember<uint64_t> consent_responses_sent;
175};
176
hbosab9f6e42016-10-07 02:18:47 -0700177// https://w3c.github.io/webrtc-stats/#icecandidate-dict*
hbos5d79a7c2016-10-24 09:27:10 -0700178// TODO(hbos): |RTCStatsCollector| only collects candidates that are part of
179// ice candidate pairs, but there could be candidates not paired with anything.
180// crbug.com/632723
hbosab9f6e42016-10-07 02:18:47 -0700181class RTCIceCandidateStats : public RTCStats {
182 public:
183 WEBRTC_RTCSTATS_DECL();
184
185 RTCIceCandidateStats(const RTCIceCandidateStats& other);
186 ~RTCIceCandidateStats() override;
187
hbosb4e426e2017-01-02 09:59:31 -0800188 RTCStatsMember<std::string> transport_id;
hbosc3a2b7f2017-01-02 04:46:15 -0800189 RTCStatsMember<bool> is_remote;
hbosab9f6e42016-10-07 02:18:47 -0700190 RTCStatsMember<std::string> ip;
191 RTCStatsMember<int32_t> port;
192 RTCStatsMember<std::string> protocol;
193 // TODO(hbos): Support enum types? "RTCStatsMember<RTCIceCandidateType>"?
194 RTCStatsMember<std::string> candidate_type;
195 RTCStatsMember<int32_t> priority;
hbos5d79a7c2016-10-24 09:27:10 -0700196 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/632723
hbosab9f6e42016-10-07 02:18:47 -0700197 RTCStatsMember<std::string> url;
hbosd17a5a72017-01-02 08:09:59 -0800198 // TODO(hbos): |deleted = true| case is not supported by |RTCStatsCollector|.
199 // crbug.com/632723
200 RTCStatsMember<bool> deleted; // = false
hbosab9f6e42016-10-07 02:18:47 -0700201
202 protected:
hbosc3a2b7f2017-01-02 04:46:15 -0800203 RTCIceCandidateStats(
204 const std::string& id, int64_t timestamp_us, bool is_remote);
205 RTCIceCandidateStats(std::string&& id, int64_t timestamp_us, bool is_remote);
hbosab9f6e42016-10-07 02:18:47 -0700206};
207
208// In the spec both local and remote varieties are of type RTCIceCandidateStats.
209// But here we define them as subclasses of |RTCIceCandidateStats| because the
210// |kType| need to be different ("RTCStatsType type") in the local/remote case.
211// https://w3c.github.io/webrtc-stats/#rtcstatstype-str*
212class RTCLocalIceCandidateStats final : public RTCIceCandidateStats {
213 public:
214 static const char kType[];
215 RTCLocalIceCandidateStats(const std::string& id, int64_t timestamp_us);
216 RTCLocalIceCandidateStats(std::string&& id, int64_t timestamp_us);
217 const char* type() const override;
218};
219
220class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats {
221 public:
222 static const char kType[];
223 RTCRemoteIceCandidateStats(const std::string& id, int64_t timestamp_us);
224 RTCRemoteIceCandidateStats(std::string&& id, int64_t timestamp_us);
225 const char* type() const override;
226};
227
hbos09bc1282016-11-08 06:29:22 -0800228// https://w3c.github.io/webrtc-stats/#msstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800229// TODO(hbos): Tracking bug crbug.com/660827
hbos09bc1282016-11-08 06:29:22 -0800230class RTCMediaStreamStats final : public RTCStats {
231 public:
232 WEBRTC_RTCSTATS_DECL();
233
234 RTCMediaStreamStats(const std::string& id, int64_t timestamp_us);
235 RTCMediaStreamStats(std::string&& id, int64_t timestamp_us);
236 RTCMediaStreamStats(const RTCMediaStreamStats& other);
237 ~RTCMediaStreamStats() override;
238
239 RTCStatsMember<std::string> stream_identifier;
240 RTCStatsMember<std::vector<std::string>> track_ids;
241};
242
243// https://w3c.github.io/webrtc-stats/#mststats-dict*
hbos0adb8282016-11-23 02:32:06 -0800244// TODO(hbos): Tracking bug crbug.com/659137
hbos09bc1282016-11-08 06:29:22 -0800245class RTCMediaStreamTrackStats final : public RTCStats {
246 public:
247 WEBRTC_RTCSTATS_DECL();
248
hbos160e4a72017-01-17 02:53:23 -0800249 RTCMediaStreamTrackStats(const std::string& id, int64_t timestamp_us,
250 const char* kind);
251 RTCMediaStreamTrackStats(std::string&& id, int64_t timestamp_us,
252 const char* kind);
hbos09bc1282016-11-08 06:29:22 -0800253 RTCMediaStreamTrackStats(const RTCMediaStreamTrackStats& other);
254 ~RTCMediaStreamTrackStats() override;
255
256 RTCStatsMember<std::string> track_identifier;
257 RTCStatsMember<bool> remote_source;
258 RTCStatsMember<bool> ended;
259 // TODO(hbos): |RTCStatsCollector| does not return stats for detached tracks.
260 // crbug.com/659137
261 RTCStatsMember<bool> detached;
hbos160e4a72017-01-17 02:53:23 -0800262 // See |RTCMediaStreamTrackKind| for valid values.
263 RTCStatsMember<std::string> kind;
hbos09bc1282016-11-08 06:29:22 -0800264 // Video-only members
265 RTCStatsMember<uint32_t> frame_width;
266 RTCStatsMember<uint32_t> frame_height;
267 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
268 RTCStatsMember<double> frames_per_second;
hbos09bc1282016-11-08 06:29:22 -0800269 RTCStatsMember<uint32_t> frames_sent;
hbos09bc1282016-11-08 06:29:22 -0800270 RTCStatsMember<uint32_t> frames_received;
hbos09bc1282016-11-08 06:29:22 -0800271 RTCStatsMember<uint32_t> frames_decoded;
hbos09bc1282016-11-08 06:29:22 -0800272 RTCStatsMember<uint32_t> frames_dropped;
273 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
274 RTCStatsMember<uint32_t> frames_corrupted;
275 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
276 RTCStatsMember<uint32_t> partial_frames_lost;
277 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
278 RTCStatsMember<uint32_t> full_frames_lost;
279 // Audio-only members
280 RTCStatsMember<double> audio_level;
281 RTCStatsMember<double> echo_return_loss;
282 RTCStatsMember<double> echo_return_loss_enhancement;
283};
284
hbos6ab97ce2016-10-03 14:16:56 -0700285// https://w3c.github.io/webrtc-stats/#pcstats-dict*
hbosab9f6e42016-10-07 02:18:47 -0700286class RTCPeerConnectionStats final : public RTCStats {
hbosd565b732016-08-30 14:04:35 -0700287 public:
hbosfc5e0502016-10-06 02:06:10 -0700288 WEBRTC_RTCSTATS_DECL();
289
hbos0e6758d2016-08-31 07:57:36 -0700290 RTCPeerConnectionStats(const std::string& id, int64_t timestamp_us);
291 RTCPeerConnectionStats(std::string&& id, int64_t timestamp_us);
hbosfc5e0502016-10-06 02:06:10 -0700292 RTCPeerConnectionStats(const RTCPeerConnectionStats& other);
293 ~RTCPeerConnectionStats() override;
hbosd565b732016-08-30 14:04:35 -0700294
295 RTCStatsMember<uint32_t> data_channels_opened;
296 RTCStatsMember<uint32_t> data_channels_closed;
297};
298
hbos6ded1902016-11-01 01:50:46 -0700299// https://w3c.github.io/webrtc-stats/#streamstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800300// TODO(hbos): Tracking bug crbug.com/657854
hbos6ded1902016-11-01 01:50:46 -0700301class RTCRTPStreamStats : public RTCStats {
302 public:
303 WEBRTC_RTCSTATS_DECL();
304
305 RTCRTPStreamStats(const RTCRTPStreamStats& other);
306 ~RTCRTPStreamStats() override;
307
308 RTCStatsMember<std::string> ssrc;
309 // TODO(hbos): When the remote case is supported |RTCStatsCollector| needs to
310 // set this. crbug.com/657855, 657856
311 RTCStatsMember<std::string> associate_stats_id;
312 // TODO(hbos): Remote case not supported by |RTCStatsCollector|.
313 // crbug.com/657855, 657856
314 RTCStatsMember<bool> is_remote; // = false
315 RTCStatsMember<std::string> media_type;
hbosb0ae9202017-01-27 06:35:16 -0800316 RTCStatsMember<std::string> track_id;
hbos6ded1902016-11-01 01:50:46 -0700317 RTCStatsMember<std::string> transport_id;
hbos6ded1902016-11-01 01:50:46 -0700318 RTCStatsMember<std::string> codec_id;
319 // FIR and PLI counts are only defined for |media_type == "video"|.
320 RTCStatsMember<uint32_t> fir_count;
321 RTCStatsMember<uint32_t> pli_count;
322 // TODO(hbos): NACK count should be collected by |RTCStatsCollector| for both
323 // audio and video but is only defined in the "video" case. crbug.com/657856
324 RTCStatsMember<uint32_t> nack_count;
325 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657854
326 // SLI count is only defined for |media_type == "video"|.
327 RTCStatsMember<uint32_t> sli_count;
hbos6769c492017-01-02 08:35:13 -0800328 // TODO(hbos): Only collected for the outbound case, should also be collected
329 // for inbound case by |RTCStatsCollector|. crbug.com/657854, crbug.com/657855
330 RTCStatsMember<uint64_t> qp_sum;
hbos6ded1902016-11-01 01:50:46 -0700331
332 protected:
333 RTCRTPStreamStats(const std::string& id, int64_t timestamp_us);
334 RTCRTPStreamStats(std::string&& id, int64_t timestamp_us);
335};
336
hboseeafe942016-11-01 03:00:17 -0700337// https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800338// Tracking bug crbug.com/657855
339// TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657855
hboseeafe942016-11-01 03:00:17 -0700340class RTCInboundRTPStreamStats final : public RTCRTPStreamStats {
341 public:
342 WEBRTC_RTCSTATS_DECL();
343
344 RTCInboundRTPStreamStats(const std::string& id, int64_t timestamp_us);
345 RTCInboundRTPStreamStats(std::string&& id, int64_t timestamp_us);
346 RTCInboundRTPStreamStats(const RTCInboundRTPStreamStats& other);
347 ~RTCInboundRTPStreamStats() override;
348
349 RTCStatsMember<uint32_t> packets_received;
350 RTCStatsMember<uint64_t> bytes_received;
hboseeafe942016-11-01 03:00:17 -0700351 RTCStatsMember<uint32_t> packets_lost;
352 // TODO(hbos): Not collected in the "video" case by |RTCStatsCollector|.
353 // crbug.com/657855
354 RTCStatsMember<double> jitter;
355 RTCStatsMember<double> fraction_lost;
356 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
357 RTCStatsMember<uint32_t> packets_discarded;
358 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
359 RTCStatsMember<uint32_t> packets_repaired;
360 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
361 RTCStatsMember<uint32_t> burst_packets_lost;
362 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
363 RTCStatsMember<uint32_t> burst_packets_discarded;
364 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
365 RTCStatsMember<uint32_t> burst_loss_count;
366 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
367 RTCStatsMember<uint32_t> burst_discard_count;
368 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
369 RTCStatsMember<double> burst_loss_rate;
370 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
371 RTCStatsMember<double> burst_discard_rate;
372 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
373 RTCStatsMember<double> gap_loss_rate;
374 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855
375 RTCStatsMember<double> gap_discard_rate;
hbos6769c492017-01-02 08:35:13 -0800376 RTCStatsMember<uint32_t> frames_decoded;
hboseeafe942016-11-01 03:00:17 -0700377};
378
hbos6ded1902016-11-01 01:50:46 -0700379// https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800380// Tracking bug crbug.com/657856
381// TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657856
hbos6ded1902016-11-01 01:50:46 -0700382class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats {
383 public:
384 WEBRTC_RTCSTATS_DECL();
385
386 RTCOutboundRTPStreamStats(const std::string& id, int64_t timestamp_us);
387 RTCOutboundRTPStreamStats(std::string&& id, int64_t timestamp_us);
388 RTCOutboundRTPStreamStats(const RTCOutboundRTPStreamStats& other);
389 ~RTCOutboundRTPStreamStats() override;
390
391 RTCStatsMember<uint32_t> packets_sent;
392 RTCStatsMember<uint64_t> bytes_sent;
393 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657856
394 RTCStatsMember<double> target_bitrate;
395 RTCStatsMember<double> round_trip_time;
hbos6769c492017-01-02 08:35:13 -0800396 RTCStatsMember<uint32_t> frames_encoded;
hbos6ded1902016-11-01 01:50:46 -0700397};
398
hbos2fa7c672016-10-24 04:00:05 -0700399// https://w3c.github.io/webrtc-stats/#transportstats-dict*
400class RTCTransportStats final : public RTCStats {
401 public:
402 WEBRTC_RTCSTATS_DECL();
403
404 RTCTransportStats(const std::string& id, int64_t timestamp_us);
405 RTCTransportStats(std::string&& id, int64_t timestamp_us);
406 RTCTransportStats(const RTCTransportStats& other);
407 ~RTCTransportStats() override;
408
409 RTCStatsMember<uint64_t> bytes_sent;
410 RTCStatsMember<uint64_t> bytes_received;
411 RTCStatsMember<std::string> rtcp_transport_stats_id;
hbos7064d592017-01-16 07:38:02 -0800412 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDtlsTransportState>"?
413 RTCStatsMember<std::string> dtls_state;
hbos2fa7c672016-10-24 04:00:05 -0700414 RTCStatsMember<std::string> selected_candidate_pair_id;
415 RTCStatsMember<std::string> local_certificate_id;
416 RTCStatsMember<std::string> remote_certificate_id;
417};
418
hbosd565b732016-08-30 14:04:35 -0700419} // namespace webrtc
420
hbos74e1a4f2016-09-15 23:33:01 -0700421#endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_