blob: 0cbea7cff544addb4d12e4ce839b79141460fc31 [file] [log] [blame]
hbos059d0e32016-08-30 21:04:351/*
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
hbos42204212016-09-16 06:33:0111#ifndef WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_
12#define WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_
hbos059d0e32016-08-30 21:04:3513
14#include <string>
oprypin13c97c72017-02-01 09:55:5915#include <vector>
hbos059d0e32016-08-30 21:04:3516
hbos42204212016-09-16 06:33:0117#include "webrtc/api/stats/rtcstats.h"
hbos059d0e32016-08-30 21:04:3518
19namespace webrtc {
20
hbos2b6447d2016-10-18 19:48:3121// https://w3c.github.io/webrtc-pc/#idl-def-rtcdatachannelstate
22struct RTCDataChannelState {
agrieve0f6b13a2017-08-08 17:48:1523 static const char* const kConnecting;
24 static const char* const kOpen;
25 static const char* const kClosing;
26 static const char* const kClosed;
hbos2b6447d2016-10-18 19:48:3127};
28
hbosd706ab42016-10-11 21:54:4929// https://w3c.github.io/webrtc-stats/#dom-rtcstatsicecandidatepairstate
30struct RTCStatsIceCandidatePairState {
agrieve0f6b13a2017-08-08 17:48:1531 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;
hbosd706ab42016-10-11 21:54:4936};
37
hbos2b6447d2016-10-18 19:48:3138// https://w3c.github.io/webrtc-pc/#rtcicecandidatetype-enum
hbos1f3dee62016-10-07 09:18:4739struct RTCIceCandidateType {
agrieve0f6b13a2017-08-08 17:48:1540 static const char* const kHost;
41 static const char* const kSrflx;
42 static const char* const kPrflx;
43 static const char* const kRelay;
hbos1f3dee62016-10-07 09:18:4744};
45
hbosee5b9ea2017-01-16 15:38:0246// https://w3c.github.io/webrtc-pc/#idl-def-rtcdtlstransportstate
47struct RTCDtlsTransportState {
agrieve0f6b13a2017-08-08 17:48:1548 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;
hbosee5b9ea2017-01-16 15:38:0253};
54
hbosb20cdfc2017-01-17 10:53:2355// |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 {
agrieve0f6b13a2017-08-08 17:48:1559 static const char* const kAudio;
60 static const char* const kVideo;
hbosb20cdfc2017-01-17 10:53:2361};
62
hbosab8516c2016-10-24 11:00:0563// 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
hbos25b5d4d2016-11-23 10:32:0679// https://w3c.github.io/webrtc-stats/#codec-dict*
hbos25b5d4d2016-11-23 10:32:0680class 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;
hbos95aa50b2017-02-28 14:56:0490 RTCStatsMember<std::string> mime_type;
hbos25b5d4d2016-11-23 10:32:0691 RTCStatsMember<uint32_t> clock_rate;
hbos9759bb72017-02-07 12:59:1692 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7061
hbos25b5d4d2016-11-23 10:32:0693 RTCStatsMember<uint32_t> channels;
hbos9759bb72017-02-07 12:59:1694 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7061
hbos95aa50b2017-02-28 14:56:0495 RTCStatsMember<std::string> sdp_fmtp_line;
hbos9759bb72017-02-07 12:59:1696 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7061
hbos25b5d4d2016-11-23 10:32:0697 RTCStatsMember<std::string> implementation;
98};
99
hbosab8516c2016-10-24 11:00:05100// 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*
hbos22ec8642017-02-07 14:41:21122// TODO(hbos): Tracking bug https://bugs.webrtc.org/7062
hbosa7ab11e2016-11-01 08:50:46123class RTCIceCandidatePairStats final : public RTCStats {
hbosd706ab42016-10-11 21:54:49124 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;
hbos22ec8642017-02-07 14:41:21140 // 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
hbosd706ab42016-10-11 21:54:49142 RTCStatsMember<bool> writable;
hbos22ec8642017-02-07 14:41:21143 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosd706ab42016-10-11 21:54:49144 RTCStatsMember<bool> readable;
145 RTCStatsMember<uint64_t> bytes_sent;
146 RTCStatsMember<uint64_t> bytes_received;
hbosa75e2b02016-12-15 14:17:08147 RTCStatsMember<double> total_round_trip_time;
hbosa75e2b02016-12-15 14:17:08148 RTCStatsMember<double> current_round_trip_time;
hbosd706ab42016-10-11 21:54:49149 RTCStatsMember<double> available_outgoing_bitrate;
hbos22ec8642017-02-07 14:41:21150 // TODO(hbos): Populate this value. It is wired up and collected the same way
hbosfca0fe02017-02-28 14:34:47151 // "VideoBwe.googAvailableReceiveBandwidth" is, but that value is always
hbos22ec8642017-02-07 14:41:21152 // undefined. https://bugs.webrtc.org/7062
hbosd706ab42016-10-11 21:54:49153 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;
hbos22ec8642017-02-07 14:41:21158 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosd706ab42016-10-11 21:54:49159 RTCStatsMember<uint64_t> retransmissions_received;
hbos22ec8642017-02-07 14:41:21160 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosd706ab42016-10-11 21:54:49161 RTCStatsMember<uint64_t> retransmissions_sent;
hbos22ec8642017-02-07 14:41:21162 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosd706ab42016-10-11 21:54:49163 RTCStatsMember<uint64_t> consent_requests_received;
164 RTCStatsMember<uint64_t> consent_requests_sent;
hbos22ec8642017-02-07 14:41:21165 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosd706ab42016-10-11 21:54:49166 RTCStatsMember<uint64_t> consent_responses_received;
hbos22ec8642017-02-07 14:41:21167 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062
hbosd706ab42016-10-11 21:54:49168 RTCStatsMember<uint64_t> consent_responses_sent;
169};
170
hbos1f3dee62016-10-07 09:18:47171// https://w3c.github.io/webrtc-stats/#icecandidate-dict*
hbosc262c702016-10-24 16:27:10172// 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
hbos1f3dee62016-10-07 09:18:47175class RTCIceCandidateStats : public RTCStats {
176 public:
177 WEBRTC_RTCSTATS_DECL();
178
179 RTCIceCandidateStats(const RTCIceCandidateStats& other);
180 ~RTCIceCandidateStats() override;
181
hbos7c8813f2017-01-02 17:59:31182 RTCStatsMember<std::string> transport_id;
hbosdd7f2be2017-01-02 12:46:15183 RTCStatsMember<bool> is_remote;
hbos1f3dee62016-10-07 09:18:47184 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;
hbosc262c702016-10-24 16:27:10190 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/632723
hbos1f3dee62016-10-07 09:18:47191 RTCStatsMember<std::string> url;
hbos69f49792017-01-02 16:09:59192 // TODO(hbos): |deleted = true| case is not supported by |RTCStatsCollector|.
193 // crbug.com/632723
194 RTCStatsMember<bool> deleted; // = false
hbos1f3dee62016-10-07 09:18:47195
196 protected:
hbosdd7f2be2017-01-02 12:46:15197 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);
hbos1f3dee62016-10-07 09:18:47200};
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
hbosbafa0b32016-11-08 14:29:22222// https://w3c.github.io/webrtc-stats/#msstats-dict*
hbos25b5d4d2016-11-23 10:32:06223// TODO(hbos): Tracking bug crbug.com/660827
hbosbafa0b32016-11-08 14:29:22224class 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*
hbos25b5d4d2016-11-23 10:32:06238// TODO(hbos): Tracking bug crbug.com/659137
hbosbafa0b32016-11-08 14:29:22239class RTCMediaStreamTrackStats final : public RTCStats {
240 public:
241 WEBRTC_RTCSTATS_DECL();
242
hbosb20cdfc2017-01-17 10:53:23243 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);
hbosbafa0b32016-11-08 14:29:22247 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;
hbosb20cdfc2017-01-17 10:53:23256 // See |RTCMediaStreamTrackKind| for valid values.
257 RTCStatsMember<std::string> kind;
hbosbafa0b32016-11-08 14:29:22258 // 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;
hbosbafa0b32016-11-08 14:29:22263 RTCStatsMember<uint32_t> frames_sent;
hbosbafa0b32016-11-08 14:29:22264 RTCStatsMember<uint32_t> frames_received;
hbosbafa0b32016-11-08 14:29:22265 RTCStatsMember<uint32_t> frames_decoded;
hbosbafa0b32016-11-08 14:29:22266 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;
zsteind1701d02017-07-14 19:17:49275 RTCStatsMember<double> total_audio_energy;
hbosbafa0b32016-11-08 14:29:22276 RTCStatsMember<double> echo_return_loss;
277 RTCStatsMember<double> echo_return_loss_enhancement;
Steve Anton94ac82f2017-08-25 00:15:13278 RTCStatsMember<uint64_t> total_samples_received;
279 RTCStatsMember<double> total_samples_duration;
280 RTCStatsMember<uint64_t> concealed_samples;
hbosbafa0b32016-11-08 14:29:22281};
282
hbos38691122016-10-03 21:16:56283// https://w3c.github.io/webrtc-stats/#pcstats-dict*
hbos1f3dee62016-10-07 09:18:47284class RTCPeerConnectionStats final : public RTCStats {
hbos059d0e32016-08-30 21:04:35285 public:
hbos2cbdcd82016-10-06 09:06:10286 WEBRTC_RTCSTATS_DECL();
287
hbos7831d0d2016-08-31 14:57:36288 RTCPeerConnectionStats(const std::string& id, int64_t timestamp_us);
289 RTCPeerConnectionStats(std::string&& id, int64_t timestamp_us);
hbos2cbdcd82016-10-06 09:06:10290 RTCPeerConnectionStats(const RTCPeerConnectionStats& other);
291 ~RTCPeerConnectionStats() override;
hbos059d0e32016-08-30 21:04:35292
293 RTCStatsMember<uint32_t> data_channels_opened;
294 RTCStatsMember<uint32_t> data_channels_closed;
295};
296
hbosa7ab11e2016-11-01 08:50:46297// https://w3c.github.io/webrtc-stats/#streamstats-dict*
hbos25b5d4d2016-11-23 10:32:06298// TODO(hbos): Tracking bug crbug.com/657854
hbosa7ab11e2016-11-01 08:50:46299class RTCRTPStreamStats : public RTCStats {
300 public:
301 WEBRTC_RTCSTATS_DECL();
302
303 RTCRTPStreamStats(const RTCRTPStreamStats& other);
304 ~RTCRTPStreamStats() override;
305
hbosce9ceb62017-02-07 14:28:11306 RTCStatsMember<uint32_t> ssrc;
hbosa7ab11e2016-11-01 08:50:46307 // 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;
hbos68eafed2017-01-27 14:35:16314 RTCStatsMember<std::string> track_id;
hbosa7ab11e2016-11-01 08:50:46315 RTCStatsMember<std::string> transport_id;
hbosa7ab11e2016-11-01 08:50:46316 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;
hboscfcb96e2017-01-02 16:35:13326 RTCStatsMember<uint64_t> qp_sum;
hbosa7ab11e2016-11-01 08:50:46327
328 protected:
329 RTCRTPStreamStats(const std::string& id, int64_t timestamp_us);
330 RTCRTPStreamStats(std::string&& id, int64_t timestamp_us);
331};
332
hbos2e6d69a2016-11-01 10:00:17333// https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict*
hbos27e573e2017-03-01 09:02:45334// TODO(hbos): Support the remote case |is_remote = true|.
335// https://bugs.webrtc.org/7065
hbos2e6d69a2016-11-01 10:00:17336class 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;
hbos2e6d69a2016-11-01 10:00:17347 RTCStatsMember<uint32_t> packets_lost;
hbos27e573e2017-03-01 09:02:45348 // TODO(hbos): Collect and populate this value for both "audio" and "video",
349 // currently not collected for "video". https://bugs.webrtc.org/7065
hbos2e6d69a2016-11-01 10:00:17350 RTCStatsMember<double> jitter;
351 RTCStatsMember<double> fraction_lost;
hbos27e573e2017-03-01 09:02:45352 // 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
hbos2e6d69a2016-11-01 10:00:17355 RTCStatsMember<uint32_t> packets_discarded;
hbos27e573e2017-03-01 09:02:45356 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hbos2e6d69a2016-11-01 10:00:17357 RTCStatsMember<uint32_t> packets_repaired;
hbos27e573e2017-03-01 09:02:45358 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hbos2e6d69a2016-11-01 10:00:17359 RTCStatsMember<uint32_t> burst_packets_lost;
hbos27e573e2017-03-01 09:02:45360 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hbos2e6d69a2016-11-01 10:00:17361 RTCStatsMember<uint32_t> burst_packets_discarded;
hbos27e573e2017-03-01 09:02:45362 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hbos2e6d69a2016-11-01 10:00:17363 RTCStatsMember<uint32_t> burst_loss_count;
hbos27e573e2017-03-01 09:02:45364 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hbos2e6d69a2016-11-01 10:00:17365 RTCStatsMember<uint32_t> burst_discard_count;
hbos27e573e2017-03-01 09:02:45366 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hbos2e6d69a2016-11-01 10:00:17367 RTCStatsMember<double> burst_loss_rate;
hbos27e573e2017-03-01 09:02:45368 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hbos2e6d69a2016-11-01 10:00:17369 RTCStatsMember<double> burst_discard_rate;
hbos27e573e2017-03-01 09:02:45370 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hbos2e6d69a2016-11-01 10:00:17371 RTCStatsMember<double> gap_loss_rate;
hbos27e573e2017-03-01 09:02:45372 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065
hbos2e6d69a2016-11-01 10:00:17373 RTCStatsMember<double> gap_discard_rate;
hboscfcb96e2017-01-02 16:35:13374 RTCStatsMember<uint32_t> frames_decoded;
hbos2e6d69a2016-11-01 10:00:17375};
376
hbosa7ab11e2016-11-01 08:50:46377// https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict*
hbos27e573e2017-03-01 09:02:45378// TODO(hbos): Support the remote case |is_remote = true|.
379// https://bugs.webrtc.org/7066
hbosa7ab11e2016-11-01 08:50:46380class 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;
hbos27e573e2017-03-01 09:02:45391 // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7066
hbosa7ab11e2016-11-01 08:50:46392 RTCStatsMember<double> target_bitrate;
hboscfcb96e2017-01-02 16:35:13393 RTCStatsMember<uint32_t> frames_encoded;
hbosa7ab11e2016-11-01 08:50:46394};
395
hbosab8516c2016-10-24 11:00:05396// 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;
hbosee5b9ea2017-01-16 15:38:02409 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDtlsTransportState>"?
410 RTCStatsMember<std::string> dtls_state;
hbosab8516c2016-10-24 11:00:05411 RTCStatsMember<std::string> selected_candidate_pair_id;
412 RTCStatsMember<std::string> local_certificate_id;
413 RTCStatsMember<std::string> remote_certificate_id;
414};
415
hbos059d0e32016-08-30 21:04:35416} // namespace webrtc
417
hbos42204212016-09-16 06:33:01418#endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_