blob: a600fb995c4d43cb646b92b0998f83979af5de5f [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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef API_STATS_RTCSTATS_OBJECTS_H_
12#define 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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "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 {
agrieve26622d32017-08-08 10:48:15 -070023 static const char* const kConnecting;
24 static const char* const kOpen;
25 static const char* const kClosing;
26 static const char* const kClosed;
hboscc555c52016-10-18 12:48:31 -070027};
28
hbosc47a0c32016-10-11 14:54:49 -070029// https://w3c.github.io/webrtc-stats/#dom-rtcstatsicecandidatepairstate
30struct RTCStatsIceCandidatePairState {
agrieve26622d32017-08-08 10:48:15 -070031 static const char* const kFrozen;
32 static const char* const kWaiting;
33 static const char* const kInProgress;
34 static const char* const kFailed;
35 static const char* const 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 {
agrieve26622d32017-08-08 10:48:15 -070040 static const char* const kHost;
41 static const char* const kSrflx;
42 static const char* const kPrflx;
43 static const char* const kRelay;
hbosab9f6e42016-10-07 02:18:47 -070044};
45
hbos7064d592017-01-16 07:38:02 -080046// https://w3c.github.io/webrtc-pc/#idl-def-rtcdtlstransportstate
47struct RTCDtlsTransportState {
agrieve26622d32017-08-08 10:48:15 -070048 static const char* const kNew;
49 static const char* const kConnecting;
50 static const char* const kConnected;
51 static const char* const kClosed;
52 static const char* const kFailed;
hbos7064d592017-01-16 07:38:02 -080053};
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 {
agrieve26622d32017-08-08 10:48:15 -070059 static const char* const kAudio;
60 static const char* const kVideo;
hbos160e4a72017-01-17 02:53:23 -080061};
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;
hbos13f54b22017-02-28 06:56:04 -080090 RTCStatsMember<std::string> mime_type;
hbos0adb8282016-11-23 02:32:06 -080091 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
hbos13f54b22017-02-28 06:56:04 -080095 RTCStatsMember<std::string> sdp_fmtp_line;
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;
hbos3168c7a2016-12-15 06:17:08 -0800147 RTCStatsMember<double> total_round_trip_time;
hbos3168c7a2016-12-15 06:17:08 -0800148 RTCStatsMember<double> current_round_trip_time;
hbosc47a0c32016-10-11 14:54:49 -0700149 RTCStatsMember<double> available_outgoing_bitrate;
hbos338f78a2017-02-07 06:41:21 -0800150 // TODO(hbos): Populate this value. It is wired up and collected the same way
hbosbf8d3e52017-02-28 06:34:47 -0800151 // "VideoBwe.googAvailableReceiveBandwidth" is, but that value is always
hbos338f78a2017-02-07 06:41:21 -0800152 // undefined. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700153 RTCStatsMember<double> available_incoming_bitrate;
154 RTCStatsMember<uint64_t> requests_received;
155 RTCStatsMember<uint64_t> requests_sent;
156 RTCStatsMember<uint64_t> responses_received;
157 RTCStatsMember<uint64_t> responses_sent;
hbos338f78a2017-02-07 06:41:21 -0800158 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700159 RTCStatsMember<uint64_t> retransmissions_received;
hbos338f78a2017-02-07 06:41:21 -0800160 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700161 RTCStatsMember<uint64_t> retransmissions_sent;
hbos338f78a2017-02-07 06:41:21 -0800162 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700163 RTCStatsMember<uint64_t> consent_requests_received;
164 RTCStatsMember<uint64_t> consent_requests_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_responses_received;
hbos338f78a2017-02-07 06:41:21 -0800167 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosc47a0c32016-10-11 14:54:49 -0700168 RTCStatsMember<uint64_t> consent_responses_sent;
169};
170
hbosab9f6e42016-10-07 02:18:47 -0700171// https://w3c.github.io/webrtc-stats/#icecandidate-dict*
hbos5d79a7c2016-10-24 09:27:10 -0700172// TODO(hbos): |RTCStatsCollector| only collects candidates that are part of
173// ice candidate pairs, but there could be candidates not paired with anything.
174// crbug.com/632723
hbosab9f6e42016-10-07 02:18:47 -0700175class RTCIceCandidateStats : public RTCStats {
176 public:
177 WEBRTC_RTCSTATS_DECL();
178
179 RTCIceCandidateStats(const RTCIceCandidateStats& other);
180 ~RTCIceCandidateStats() override;
181
hbosb4e426e2017-01-02 09:59:31 -0800182 RTCStatsMember<std::string> transport_id;
hbosc3a2b7f2017-01-02 04:46:15 -0800183 RTCStatsMember<bool> is_remote;
hbosab9f6e42016-10-07 02:18:47 -0700184 RTCStatsMember<std::string> ip;
185 RTCStatsMember<int32_t> port;
186 RTCStatsMember<std::string> protocol;
187 // TODO(hbos): Support enum types? "RTCStatsMember<RTCIceCandidateType>"?
188 RTCStatsMember<std::string> candidate_type;
189 RTCStatsMember<int32_t> priority;
hbos5d79a7c2016-10-24 09:27:10 -0700190 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/632723
hbosab9f6e42016-10-07 02:18:47 -0700191 RTCStatsMember<std::string> url;
hbosd17a5a72017-01-02 08:09:59 -0800192 // TODO(hbos): |deleted = true| case is not supported by |RTCStatsCollector|.
193 // crbug.com/632723
194 RTCStatsMember<bool> deleted; // = false
hbosab9f6e42016-10-07 02:18:47 -0700195
196 protected:
hbosc3a2b7f2017-01-02 04:46:15 -0800197 RTCIceCandidateStats(
198 const std::string& id, int64_t timestamp_us, bool is_remote);
199 RTCIceCandidateStats(std::string&& id, int64_t timestamp_us, bool is_remote);
hbosab9f6e42016-10-07 02:18:47 -0700200};
201
202// In the spec both local and remote varieties are of type RTCIceCandidateStats.
203// But here we define them as subclasses of |RTCIceCandidateStats| because the
204// |kType| need to be different ("RTCStatsType type") in the local/remote case.
205// https://w3c.github.io/webrtc-stats/#rtcstatstype-str*
206class RTCLocalIceCandidateStats final : public RTCIceCandidateStats {
207 public:
208 static const char kType[];
209 RTCLocalIceCandidateStats(const std::string& id, int64_t timestamp_us);
210 RTCLocalIceCandidateStats(std::string&& id, int64_t timestamp_us);
211 const char* type() const override;
212};
213
214class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats {
215 public:
216 static const char kType[];
217 RTCRemoteIceCandidateStats(const std::string& id, int64_t timestamp_us);
218 RTCRemoteIceCandidateStats(std::string&& id, int64_t timestamp_us);
219 const char* type() const override;
220};
221
hbos09bc1282016-11-08 06:29:22 -0800222// https://w3c.github.io/webrtc-stats/#msstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800223// TODO(hbos): Tracking bug crbug.com/660827
hbos09bc1282016-11-08 06:29:22 -0800224class RTCMediaStreamStats final : public RTCStats {
225 public:
226 WEBRTC_RTCSTATS_DECL();
227
228 RTCMediaStreamStats(const std::string& id, int64_t timestamp_us);
229 RTCMediaStreamStats(std::string&& id, int64_t timestamp_us);
230 RTCMediaStreamStats(const RTCMediaStreamStats& other);
231 ~RTCMediaStreamStats() override;
232
233 RTCStatsMember<std::string> stream_identifier;
234 RTCStatsMember<std::vector<std::string>> track_ids;
235};
236
237// https://w3c.github.io/webrtc-stats/#mststats-dict*
hbos0adb8282016-11-23 02:32:06 -0800238// TODO(hbos): Tracking bug crbug.com/659137
hbos09bc1282016-11-08 06:29:22 -0800239class RTCMediaStreamTrackStats final : public RTCStats {
240 public:
241 WEBRTC_RTCSTATS_DECL();
242
hbos160e4a72017-01-17 02:53:23 -0800243 RTCMediaStreamTrackStats(const std::string& id, int64_t timestamp_us,
244 const char* kind);
245 RTCMediaStreamTrackStats(std::string&& id, int64_t timestamp_us,
246 const char* kind);
hbos09bc1282016-11-08 06:29:22 -0800247 RTCMediaStreamTrackStats(const RTCMediaStreamTrackStats& other);
248 ~RTCMediaStreamTrackStats() override;
249
250 RTCStatsMember<std::string> track_identifier;
251 RTCStatsMember<bool> remote_source;
252 RTCStatsMember<bool> ended;
253 // TODO(hbos): |RTCStatsCollector| does not return stats for detached tracks.
254 // crbug.com/659137
255 RTCStatsMember<bool> detached;
hbos160e4a72017-01-17 02:53:23 -0800256 // See |RTCMediaStreamTrackKind| for valid values.
257 RTCStatsMember<std::string> kind;
hbos09bc1282016-11-08 06:29:22 -0800258 // Video-only members
259 RTCStatsMember<uint32_t> frame_width;
260 RTCStatsMember<uint32_t> frame_height;
261 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
262 RTCStatsMember<double> frames_per_second;
hbos09bc1282016-11-08 06:29:22 -0800263 RTCStatsMember<uint32_t> frames_sent;
hbos09bc1282016-11-08 06:29:22 -0800264 RTCStatsMember<uint32_t> frames_received;
hbos09bc1282016-11-08 06:29:22 -0800265 RTCStatsMember<uint32_t> frames_decoded;
hbos09bc1282016-11-08 06:29:22 -0800266 RTCStatsMember<uint32_t> frames_dropped;
267 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
268 RTCStatsMember<uint32_t> frames_corrupted;
269 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
270 RTCStatsMember<uint32_t> partial_frames_lost;
271 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137
272 RTCStatsMember<uint32_t> full_frames_lost;
273 // Audio-only members
274 RTCStatsMember<double> audio_level;
zsteine76bd3a2017-07-14 12:17:49 -0700275 RTCStatsMember<double> total_audio_energy;
hbos09bc1282016-11-08 06:29:22 -0800276 RTCStatsMember<double> echo_return_loss;
277 RTCStatsMember<double> echo_return_loss_enhancement;
Steve Anton2dbc69f2017-08-24 17:15:13 -0700278 RTCStatsMember<uint64_t> total_samples_received;
279 RTCStatsMember<double> total_samples_duration;
280 RTCStatsMember<uint64_t> concealed_samples;
hbos09bc1282016-11-08 06:29:22 -0800281};
282
hbos6ab97ce2016-10-03 14:16:56 -0700283// https://w3c.github.io/webrtc-stats/#pcstats-dict*
hbosab9f6e42016-10-07 02:18:47 -0700284class RTCPeerConnectionStats final : public RTCStats {
hbosd565b732016-08-30 14:04:35 -0700285 public:
hbosfc5e0502016-10-06 02:06:10 -0700286 WEBRTC_RTCSTATS_DECL();
287
hbos0e6758d2016-08-31 07:57:36 -0700288 RTCPeerConnectionStats(const std::string& id, int64_t timestamp_us);
289 RTCPeerConnectionStats(std::string&& id, int64_t timestamp_us);
hbosfc5e0502016-10-06 02:06:10 -0700290 RTCPeerConnectionStats(const RTCPeerConnectionStats& other);
291 ~RTCPeerConnectionStats() override;
hbosd565b732016-08-30 14:04:35 -0700292
293 RTCStatsMember<uint32_t> data_channels_opened;
294 RTCStatsMember<uint32_t> data_channels_closed;
295};
296
hbos6ded1902016-11-01 01:50:46 -0700297// https://w3c.github.io/webrtc-stats/#streamstats-dict*
hbos0adb8282016-11-23 02:32:06 -0800298// TODO(hbos): Tracking bug crbug.com/657854
hbos6ded1902016-11-01 01:50:46 -0700299class RTCRTPStreamStats : public RTCStats {
300 public:
301 WEBRTC_RTCSTATS_DECL();
302
303 RTCRTPStreamStats(const RTCRTPStreamStats& other);
304 ~RTCRTPStreamStats() override;
305
hbos3443bb72017-02-07 06:28:11 -0800306 RTCStatsMember<uint32_t> ssrc;
hbos6ded1902016-11-01 01:50:46 -0700307 // TODO(hbos): When the remote case is supported |RTCStatsCollector| needs to
308 // set this. crbug.com/657855, 657856
309 RTCStatsMember<std::string> associate_stats_id;
310 // TODO(hbos): Remote case not supported by |RTCStatsCollector|.
311 // crbug.com/657855, 657856
312 RTCStatsMember<bool> is_remote; // = false
313 RTCStatsMember<std::string> media_type;
hbosb0ae9202017-01-27 06:35:16 -0800314 RTCStatsMember<std::string> track_id;
hbos6ded1902016-11-01 01:50:46 -0700315 RTCStatsMember<std::string> transport_id;
hbos6ded1902016-11-01 01:50:46 -0700316 RTCStatsMember<std::string> codec_id;
317 // FIR and PLI counts are only defined for |media_type == "video"|.
318 RTCStatsMember<uint32_t> fir_count;
319 RTCStatsMember<uint32_t> pli_count;
320 // TODO(hbos): NACK count should be collected by |RTCStatsCollector| for both
321 // audio and video but is only defined in the "video" case. crbug.com/657856
322 RTCStatsMember<uint32_t> nack_count;
323 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657854
324 // SLI count is only defined for |media_type == "video"|.
325 RTCStatsMember<uint32_t> sli_count;
hbos6769c492017-01-02 08:35:13 -0800326 RTCStatsMember<uint64_t> qp_sum;
hbos6ded1902016-11-01 01:50:46 -0700327
328 protected:
329 RTCRTPStreamStats(const std::string& id, int64_t timestamp_us);
330 RTCRTPStreamStats(std::string&& id, int64_t timestamp_us);
331};
332
hboseeafe942016-11-01 03:00:17 -0700333// https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict*
hbosa7a9be12017-03-01 01:02:45 -0800334// TODO(hbos): Support the remote case |is_remote = true|.
335// https://bugs.webrtc.org/7065
hboseeafe942016-11-01 03:00:17 -0700336class RTCInboundRTPStreamStats final : public RTCRTPStreamStats {
337 public:
338 WEBRTC_RTCSTATS_DECL();
339
340 RTCInboundRTPStreamStats(const std::string& id, int64_t timestamp_us);
341 RTCInboundRTPStreamStats(std::string&& id, int64_t timestamp_us);
342 RTCInboundRTPStreamStats(const RTCInboundRTPStreamStats& other);
343 ~RTCInboundRTPStreamStats() override;
344
345 RTCStatsMember<uint32_t> packets_received;
346 RTCStatsMember<uint64_t> bytes_received;
hboseeafe942016-11-01 03:00:17 -0700347 RTCStatsMember<uint32_t> packets_lost;
hbosa7a9be12017-03-01 01:02:45 -0800348 // TODO(hbos): Collect and populate this value for both "audio" and "video",
349 // currently not collected for "video". https://bugs.webrtc.org/7065
hboseeafe942016-11-01 03:00:17 -0700350 RTCStatsMember<double> jitter;
351 RTCStatsMember<double> fraction_lost;
hbosa7a9be12017-03-01 01:02:45 -0800352 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
353 RTCStatsMember<double> round_trip_time;
354 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hboseeafe942016-11-01 03:00:17 -0700355 RTCStatsMember<uint32_t> packets_discarded;
hbosa7a9be12017-03-01 01:02:45 -0800356 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hboseeafe942016-11-01 03:00:17 -0700357 RTCStatsMember<uint32_t> packets_repaired;
hbosa7a9be12017-03-01 01:02:45 -0800358 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hboseeafe942016-11-01 03:00:17 -0700359 RTCStatsMember<uint32_t> burst_packets_lost;
hbosa7a9be12017-03-01 01:02:45 -0800360 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hboseeafe942016-11-01 03:00:17 -0700361 RTCStatsMember<uint32_t> burst_packets_discarded;
hbosa7a9be12017-03-01 01:02:45 -0800362 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hboseeafe942016-11-01 03:00:17 -0700363 RTCStatsMember<uint32_t> burst_loss_count;
hbosa7a9be12017-03-01 01:02:45 -0800364 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hboseeafe942016-11-01 03:00:17 -0700365 RTCStatsMember<uint32_t> burst_discard_count;
hbosa7a9be12017-03-01 01:02:45 -0800366 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hboseeafe942016-11-01 03:00:17 -0700367 RTCStatsMember<double> burst_loss_rate;
hbosa7a9be12017-03-01 01:02:45 -0800368 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hboseeafe942016-11-01 03:00:17 -0700369 RTCStatsMember<double> burst_discard_rate;
hbosa7a9be12017-03-01 01:02:45 -0800370 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hboseeafe942016-11-01 03:00:17 -0700371 RTCStatsMember<double> gap_loss_rate;
hbosa7a9be12017-03-01 01:02:45 -0800372 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hboseeafe942016-11-01 03:00:17 -0700373 RTCStatsMember<double> gap_discard_rate;
hbos6769c492017-01-02 08:35:13 -0800374 RTCStatsMember<uint32_t> frames_decoded;
hboseeafe942016-11-01 03:00:17 -0700375};
376
hbos6ded1902016-11-01 01:50:46 -0700377// https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict*
hbosa7a9be12017-03-01 01:02:45 -0800378// TODO(hbos): Support the remote case |is_remote = true|.
379// https://bugs.webrtc.org/7066
hbos6ded1902016-11-01 01:50:46 -0700380class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats {
381 public:
382 WEBRTC_RTCSTATS_DECL();
383
384 RTCOutboundRTPStreamStats(const std::string& id, int64_t timestamp_us);
385 RTCOutboundRTPStreamStats(std::string&& id, int64_t timestamp_us);
386 RTCOutboundRTPStreamStats(const RTCOutboundRTPStreamStats& other);
387 ~RTCOutboundRTPStreamStats() override;
388
389 RTCStatsMember<uint32_t> packets_sent;
390 RTCStatsMember<uint64_t> bytes_sent;
hbosa7a9be12017-03-01 01:02:45 -0800391 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7066
hbos6ded1902016-11-01 01:50:46 -0700392 RTCStatsMember<double> target_bitrate;
hbos6769c492017-01-02 08:35:13 -0800393 RTCStatsMember<uint32_t> frames_encoded;
hbos6ded1902016-11-01 01:50:46 -0700394};
395
hbos2fa7c672016-10-24 04:00:05 -0700396// https://w3c.github.io/webrtc-stats/#transportstats-dict*
397class RTCTransportStats final : public RTCStats {
398 public:
399 WEBRTC_RTCSTATS_DECL();
400
401 RTCTransportStats(const std::string& id, int64_t timestamp_us);
402 RTCTransportStats(std::string&& id, int64_t timestamp_us);
403 RTCTransportStats(const RTCTransportStats& other);
404 ~RTCTransportStats() override;
405
406 RTCStatsMember<uint64_t> bytes_sent;
407 RTCStatsMember<uint64_t> bytes_received;
408 RTCStatsMember<std::string> rtcp_transport_stats_id;
hbos7064d592017-01-16 07:38:02 -0800409 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDtlsTransportState>"?
410 RTCStatsMember<std::string> dtls_state;
hbos2fa7c672016-10-24 04:00:05 -0700411 RTCStatsMember<std::string> selected_candidate_pair_id;
412 RTCStatsMember<std::string> local_certificate_id;
413 RTCStatsMember<std::string> remote_certificate_id;
414};
415
hbosd565b732016-08-30 14:04:35 -0700416} // namespace webrtc
417
Mirko Bonadei92ea95e2017-09-15 06:47:31 +0200418#endif // API_STATS_RTCSTATS_OBJECTS_H_