hbos | 059d0e3 | 2016-08-30 21:04:35 | [diff] [blame] | 1 | /* |
| 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 | |
hbos | 4220421 | 2016-09-16 06:33:01 | [diff] [blame] | 11 | #ifndef WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ |
| 12 | #define WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ |
hbos | 059d0e3 | 2016-08-30 21:04:35 | [diff] [blame] | 13 | |
| 14 | #include <string> |
oprypin | 13c97c7 | 2017-02-01 09:55:59 | [diff] [blame] | 15 | #include <vector> |
hbos | 059d0e3 | 2016-08-30 21:04:35 | [diff] [blame] | 16 | |
hbos | 4220421 | 2016-09-16 06:33:01 | [diff] [blame] | 17 | #include "webrtc/api/stats/rtcstats.h" |
hbos | 059d0e3 | 2016-08-30 21:04:35 | [diff] [blame] | 18 | |
| 19 | namespace webrtc { |
| 20 | |
hbos | 2b6447d | 2016-10-18 19:48:31 | [diff] [blame] | 21 | // https://w3c.github.io/webrtc-pc/#idl-def-rtcdatachannelstate |
| 22 | struct RTCDataChannelState { |
agrieve | 0f6b13a | 2017-08-08 17:48:15 | [diff] [blame] | 23 | static const char* const kConnecting; |
| 24 | static const char* const kOpen; |
| 25 | static const char* const kClosing; |
| 26 | static const char* const kClosed; |
hbos | 2b6447d | 2016-10-18 19:48:31 | [diff] [blame] | 27 | }; |
| 28 | |
hbos | d706ab4 | 2016-10-11 21:54:49 | [diff] [blame] | 29 | // https://w3c.github.io/webrtc-stats/#dom-rtcstatsicecandidatepairstate |
| 30 | struct RTCStatsIceCandidatePairState { |
agrieve | 0f6b13a | 2017-08-08 17:48:15 | [diff] [blame] | 31 | 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; |
hbos | d706ab4 | 2016-10-11 21:54:49 | [diff] [blame] | 36 | }; |
| 37 | |
hbos | 2b6447d | 2016-10-18 19:48:31 | [diff] [blame] | 38 | // https://w3c.github.io/webrtc-pc/#rtcicecandidatetype-enum |
hbos | 1f3dee6 | 2016-10-07 09:18:47 | [diff] [blame] | 39 | struct RTCIceCandidateType { |
agrieve | 0f6b13a | 2017-08-08 17:48:15 | [diff] [blame] | 40 | static const char* const kHost; |
| 41 | static const char* const kSrflx; |
| 42 | static const char* const kPrflx; |
| 43 | static const char* const kRelay; |
hbos | 1f3dee6 | 2016-10-07 09:18:47 | [diff] [blame] | 44 | }; |
| 45 | |
hbos | ee5b9ea | 2017-01-16 15:38:02 | [diff] [blame] | 46 | // https://w3c.github.io/webrtc-pc/#idl-def-rtcdtlstransportstate |
| 47 | struct RTCDtlsTransportState { |
agrieve | 0f6b13a | 2017-08-08 17:48:15 | [diff] [blame] | 48 | 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; |
hbos | ee5b9ea | 2017-01-16 15:38:02 | [diff] [blame] | 53 | }; |
| 54 | |
hbos | b20cdfc | 2017-01-17 10:53:23 | [diff] [blame] | 55 | // |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 |
| 58 | struct RTCMediaStreamTrackKind { |
agrieve | 0f6b13a | 2017-08-08 17:48:15 | [diff] [blame] | 59 | static const char* const kAudio; |
| 60 | static const char* const kVideo; |
hbos | b20cdfc | 2017-01-17 10:53:23 | [diff] [blame] | 61 | }; |
| 62 | |
hbos | ab8516c | 2016-10-24 11:00:05 | [diff] [blame] | 63 | // https://w3c.github.io/webrtc-stats/#certificatestats-dict* |
| 64 | class 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 | |
hbos | 25b5d4d | 2016-11-23 10:32:06 | [diff] [blame] | 79 | // https://w3c.github.io/webrtc-stats/#codec-dict* |
hbos | 25b5d4d | 2016-11-23 10:32:06 | [diff] [blame] | 80 | class 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; |
hbos | 95aa50b | 2017-02-28 14:56:04 | [diff] [blame] | 90 | RTCStatsMember<std::string> mime_type; |
hbos | 25b5d4d | 2016-11-23 10:32:06 | [diff] [blame] | 91 | RTCStatsMember<uint32_t> clock_rate; |
hbos | 9759bb7 | 2017-02-07 12:59:16 | [diff] [blame] | 92 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7061 |
hbos | 25b5d4d | 2016-11-23 10:32:06 | [diff] [blame] | 93 | RTCStatsMember<uint32_t> channels; |
hbos | 9759bb7 | 2017-02-07 12:59:16 | [diff] [blame] | 94 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7061 |
hbos | 95aa50b | 2017-02-28 14:56:04 | [diff] [blame] | 95 | RTCStatsMember<std::string> sdp_fmtp_line; |
hbos | 9759bb7 | 2017-02-07 12:59:16 | [diff] [blame] | 96 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7061 |
hbos | 25b5d4d | 2016-11-23 10:32:06 | [diff] [blame] | 97 | RTCStatsMember<std::string> implementation; |
| 98 | }; |
| 99 | |
hbos | ab8516c | 2016-10-24 11:00:05 | [diff] [blame] | 100 | // https://w3c.github.io/webrtc-stats/#dcstats-dict* |
| 101 | class 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* |
hbos | 22ec864 | 2017-02-07 14:41:21 | [diff] [blame] | 122 | // TODO(hbos): Tracking bug https://bugs.webrtc.org/7062 |
hbos | a7ab11e | 2016-11-01 08:50:46 | [diff] [blame] | 123 | class RTCIceCandidatePairStats final : public RTCStats { |
hbos | d706ab4 | 2016-10-11 21:54:49 | [diff] [blame] | 124 | 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; |
hbos | 22ec864 | 2017-02-07 14:41:21 | [diff] [blame] | 140 | // 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 |
hbos | d706ab4 | 2016-10-11 21:54:49 | [diff] [blame] | 142 | RTCStatsMember<bool> writable; |
hbos | 22ec864 | 2017-02-07 14:41:21 | [diff] [blame] | 143 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062 |
hbos | d706ab4 | 2016-10-11 21:54:49 | [diff] [blame] | 144 | RTCStatsMember<bool> readable; |
| 145 | RTCStatsMember<uint64_t> bytes_sent; |
| 146 | RTCStatsMember<uint64_t> bytes_received; |
hbos | a75e2b0 | 2016-12-15 14:17:08 | [diff] [blame] | 147 | RTCStatsMember<double> total_round_trip_time; |
hbos | a75e2b0 | 2016-12-15 14:17:08 | [diff] [blame] | 148 | RTCStatsMember<double> current_round_trip_time; |
hbos | d706ab4 | 2016-10-11 21:54:49 | [diff] [blame] | 149 | RTCStatsMember<double> available_outgoing_bitrate; |
hbos | 22ec864 | 2017-02-07 14:41:21 | [diff] [blame] | 150 | // TODO(hbos): Populate this value. It is wired up and collected the same way |
hbos | fca0fe0 | 2017-02-28 14:34:47 | [diff] [blame] | 151 | // "VideoBwe.googAvailableReceiveBandwidth" is, but that value is always |
hbos | 22ec864 | 2017-02-07 14:41:21 | [diff] [blame] | 152 | // undefined. https://bugs.webrtc.org/7062 |
hbos | d706ab4 | 2016-10-11 21:54:49 | [diff] [blame] | 153 | 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; |
hbos | 22ec864 | 2017-02-07 14:41:21 | [diff] [blame] | 158 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062 |
hbos | d706ab4 | 2016-10-11 21:54:49 | [diff] [blame] | 159 | RTCStatsMember<uint64_t> retransmissions_received; |
hbos | 22ec864 | 2017-02-07 14:41:21 | [diff] [blame] | 160 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062 |
hbos | d706ab4 | 2016-10-11 21:54:49 | [diff] [blame] | 161 | RTCStatsMember<uint64_t> retransmissions_sent; |
hbos | 22ec864 | 2017-02-07 14:41:21 | [diff] [blame] | 162 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062 |
hbos | d706ab4 | 2016-10-11 21:54:49 | [diff] [blame] | 163 | RTCStatsMember<uint64_t> consent_requests_received; |
| 164 | RTCStatsMember<uint64_t> consent_requests_sent; |
hbos | 22ec864 | 2017-02-07 14:41:21 | [diff] [blame] | 165 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062 |
hbos | d706ab4 | 2016-10-11 21:54:49 | [diff] [blame] | 166 | RTCStatsMember<uint64_t> consent_responses_received; |
hbos | 22ec864 | 2017-02-07 14:41:21 | [diff] [blame] | 167 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7062 |
hbos | d706ab4 | 2016-10-11 21:54:49 | [diff] [blame] | 168 | RTCStatsMember<uint64_t> consent_responses_sent; |
| 169 | }; |
| 170 | |
hbos | 1f3dee6 | 2016-10-07 09:18:47 | [diff] [blame] | 171 | // https://w3c.github.io/webrtc-stats/#icecandidate-dict* |
hbos | c262c70 | 2016-10-24 16:27:10 | [diff] [blame] | 172 | // 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 |
hbos | 1f3dee6 | 2016-10-07 09:18:47 | [diff] [blame] | 175 | class RTCIceCandidateStats : public RTCStats { |
| 176 | public: |
| 177 | WEBRTC_RTCSTATS_DECL(); |
| 178 | |
| 179 | RTCIceCandidateStats(const RTCIceCandidateStats& other); |
| 180 | ~RTCIceCandidateStats() override; |
| 181 | |
hbos | 7c8813f | 2017-01-02 17:59:31 | [diff] [blame] | 182 | RTCStatsMember<std::string> transport_id; |
hbos | dd7f2be | 2017-01-02 12:46:15 | [diff] [blame] | 183 | RTCStatsMember<bool> is_remote; |
hbos | 1f3dee6 | 2016-10-07 09:18:47 | [diff] [blame] | 184 | 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; |
hbos | c262c70 | 2016-10-24 16:27:10 | [diff] [blame] | 190 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/632723 |
hbos | 1f3dee6 | 2016-10-07 09:18:47 | [diff] [blame] | 191 | RTCStatsMember<std::string> url; |
hbos | 69f4979 | 2017-01-02 16:09:59 | [diff] [blame] | 192 | // TODO(hbos): |deleted = true| case is not supported by |RTCStatsCollector|. |
| 193 | // crbug.com/632723 |
| 194 | RTCStatsMember<bool> deleted; // = false |
hbos | 1f3dee6 | 2016-10-07 09:18:47 | [diff] [blame] | 195 | |
| 196 | protected: |
hbos | dd7f2be | 2017-01-02 12:46:15 | [diff] [blame] | 197 | 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); |
hbos | 1f3dee6 | 2016-10-07 09:18:47 | [diff] [blame] | 200 | }; |
| 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* |
| 206 | class 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 | |
| 214 | class 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 | |
hbos | bafa0b3 | 2016-11-08 14:29:22 | [diff] [blame] | 222 | // https://w3c.github.io/webrtc-stats/#msstats-dict* |
hbos | 25b5d4d | 2016-11-23 10:32:06 | [diff] [blame] | 223 | // TODO(hbos): Tracking bug crbug.com/660827 |
hbos | bafa0b3 | 2016-11-08 14:29:22 | [diff] [blame] | 224 | class 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* |
hbos | 25b5d4d | 2016-11-23 10:32:06 | [diff] [blame] | 238 | // TODO(hbos): Tracking bug crbug.com/659137 |
hbos | bafa0b3 | 2016-11-08 14:29:22 | [diff] [blame] | 239 | class RTCMediaStreamTrackStats final : public RTCStats { |
| 240 | public: |
| 241 | WEBRTC_RTCSTATS_DECL(); |
| 242 | |
hbos | b20cdfc | 2017-01-17 10:53:23 | [diff] [blame] | 243 | 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); |
hbos | bafa0b3 | 2016-11-08 14:29:22 | [diff] [blame] | 247 | 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; |
hbos | b20cdfc | 2017-01-17 10:53:23 | [diff] [blame] | 256 | // See |RTCMediaStreamTrackKind| for valid values. |
| 257 | RTCStatsMember<std::string> kind; |
hbos | bafa0b3 | 2016-11-08 14:29:22 | [diff] [blame] | 258 | // 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; |
hbos | bafa0b3 | 2016-11-08 14:29:22 | [diff] [blame] | 263 | RTCStatsMember<uint32_t> frames_sent; |
hbos | bafa0b3 | 2016-11-08 14:29:22 | [diff] [blame] | 264 | RTCStatsMember<uint32_t> frames_received; |
hbos | bafa0b3 | 2016-11-08 14:29:22 | [diff] [blame] | 265 | RTCStatsMember<uint32_t> frames_decoded; |
hbos | bafa0b3 | 2016-11-08 14:29:22 | [diff] [blame] | 266 | 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; |
zstein | d1701d0 | 2017-07-14 19:17:49 | [diff] [blame] | 275 | RTCStatsMember<double> total_audio_energy; |
hbos | bafa0b3 | 2016-11-08 14:29:22 | [diff] [blame] | 276 | RTCStatsMember<double> echo_return_loss; |
| 277 | RTCStatsMember<double> echo_return_loss_enhancement; |
Steve Anton | 94ac82f | 2017-08-25 00:15:13 | [diff] [blame] | 278 | RTCStatsMember<uint64_t> total_samples_received; |
| 279 | RTCStatsMember<double> total_samples_duration; |
| 280 | RTCStatsMember<uint64_t> concealed_samples; |
hbos | bafa0b3 | 2016-11-08 14:29:22 | [diff] [blame] | 281 | }; |
| 282 | |
hbos | 3869112 | 2016-10-03 21:16:56 | [diff] [blame] | 283 | // https://w3c.github.io/webrtc-stats/#pcstats-dict* |
hbos | 1f3dee6 | 2016-10-07 09:18:47 | [diff] [blame] | 284 | class RTCPeerConnectionStats final : public RTCStats { |
hbos | 059d0e3 | 2016-08-30 21:04:35 | [diff] [blame] | 285 | public: |
hbos | 2cbdcd8 | 2016-10-06 09:06:10 | [diff] [blame] | 286 | WEBRTC_RTCSTATS_DECL(); |
| 287 | |
hbos | 7831d0d | 2016-08-31 14:57:36 | [diff] [blame] | 288 | RTCPeerConnectionStats(const std::string& id, int64_t timestamp_us); |
| 289 | RTCPeerConnectionStats(std::string&& id, int64_t timestamp_us); |
hbos | 2cbdcd8 | 2016-10-06 09:06:10 | [diff] [blame] | 290 | RTCPeerConnectionStats(const RTCPeerConnectionStats& other); |
| 291 | ~RTCPeerConnectionStats() override; |
hbos | 059d0e3 | 2016-08-30 21:04:35 | [diff] [blame] | 292 | |
| 293 | RTCStatsMember<uint32_t> data_channels_opened; |
| 294 | RTCStatsMember<uint32_t> data_channels_closed; |
| 295 | }; |
| 296 | |
hbos | a7ab11e | 2016-11-01 08:50:46 | [diff] [blame] | 297 | // https://w3c.github.io/webrtc-stats/#streamstats-dict* |
hbos | 25b5d4d | 2016-11-23 10:32:06 | [diff] [blame] | 298 | // TODO(hbos): Tracking bug crbug.com/657854 |
hbos | a7ab11e | 2016-11-01 08:50:46 | [diff] [blame] | 299 | class RTCRTPStreamStats : public RTCStats { |
| 300 | public: |
| 301 | WEBRTC_RTCSTATS_DECL(); |
| 302 | |
| 303 | RTCRTPStreamStats(const RTCRTPStreamStats& other); |
| 304 | ~RTCRTPStreamStats() override; |
| 305 | |
hbos | ce9ceb6 | 2017-02-07 14:28:11 | [diff] [blame] | 306 | RTCStatsMember<uint32_t> ssrc; |
hbos | a7ab11e | 2016-11-01 08:50:46 | [diff] [blame] | 307 | // 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; |
hbos | 68eafed | 2017-01-27 14:35:16 | [diff] [blame] | 314 | RTCStatsMember<std::string> track_id; |
hbos | a7ab11e | 2016-11-01 08:50:46 | [diff] [blame] | 315 | RTCStatsMember<std::string> transport_id; |
hbos | a7ab11e | 2016-11-01 08:50:46 | [diff] [blame] | 316 | 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; |
hbos | cfcb96e | 2017-01-02 16:35:13 | [diff] [blame] | 326 | RTCStatsMember<uint64_t> qp_sum; |
hbos | a7ab11e | 2016-11-01 08:50:46 | [diff] [blame] | 327 | |
| 328 | protected: |
| 329 | RTCRTPStreamStats(const std::string& id, int64_t timestamp_us); |
| 330 | RTCRTPStreamStats(std::string&& id, int64_t timestamp_us); |
| 331 | }; |
| 332 | |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 333 | // https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict* |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 334 | // TODO(hbos): Support the remote case |is_remote = true|. |
| 335 | // https://bugs.webrtc.org/7065 |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 336 | class 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; |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 347 | RTCStatsMember<uint32_t> packets_lost; |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 348 | // TODO(hbos): Collect and populate this value for both "audio" and "video", |
| 349 | // currently not collected for "video". https://bugs.webrtc.org/7065 |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 350 | RTCStatsMember<double> jitter; |
| 351 | RTCStatsMember<double> fraction_lost; |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 352 | // 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 |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 355 | RTCStatsMember<uint32_t> packets_discarded; |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 356 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 357 | RTCStatsMember<uint32_t> packets_repaired; |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 358 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 359 | RTCStatsMember<uint32_t> burst_packets_lost; |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 360 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 361 | RTCStatsMember<uint32_t> burst_packets_discarded; |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 362 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 363 | RTCStatsMember<uint32_t> burst_loss_count; |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 364 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 365 | RTCStatsMember<uint32_t> burst_discard_count; |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 366 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 367 | RTCStatsMember<double> burst_loss_rate; |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 368 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 369 | RTCStatsMember<double> burst_discard_rate; |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 370 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 371 | RTCStatsMember<double> gap_loss_rate; |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 372 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 373 | RTCStatsMember<double> gap_discard_rate; |
hbos | cfcb96e | 2017-01-02 16:35:13 | [diff] [blame] | 374 | RTCStatsMember<uint32_t> frames_decoded; |
hbos | 2e6d69a | 2016-11-01 10:00:17 | [diff] [blame] | 375 | }; |
| 376 | |
hbos | a7ab11e | 2016-11-01 08:50:46 | [diff] [blame] | 377 | // https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict* |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 378 | // TODO(hbos): Support the remote case |is_remote = true|. |
| 379 | // https://bugs.webrtc.org/7066 |
hbos | a7ab11e | 2016-11-01 08:50:46 | [diff] [blame] | 380 | class 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; |
hbos | 27e573e | 2017-03-01 09:02:45 | [diff] [blame] | 391 | // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7066 |
hbos | a7ab11e | 2016-11-01 08:50:46 | [diff] [blame] | 392 | RTCStatsMember<double> target_bitrate; |
hbos | cfcb96e | 2017-01-02 16:35:13 | [diff] [blame] | 393 | RTCStatsMember<uint32_t> frames_encoded; |
hbos | a7ab11e | 2016-11-01 08:50:46 | [diff] [blame] | 394 | }; |
| 395 | |
hbos | ab8516c | 2016-10-24 11:00:05 | [diff] [blame] | 396 | // https://w3c.github.io/webrtc-stats/#transportstats-dict* |
| 397 | class 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; |
hbos | ee5b9ea | 2017-01-16 15:38:02 | [diff] [blame] | 409 | // TODO(hbos): Support enum types? "RTCStatsMember<RTCDtlsTransportState>"? |
| 410 | RTCStatsMember<std::string> dtls_state; |
hbos | ab8516c | 2016-10-24 11:00:05 | [diff] [blame] | 411 | RTCStatsMember<std::string> selected_candidate_pair_id; |
| 412 | RTCStatsMember<std::string> local_certificate_id; |
| 413 | RTCStatsMember<std::string> remote_certificate_id; |
| 414 | }; |
| 415 | |
hbos | 059d0e3 | 2016-08-30 21:04:35 | [diff] [blame] | 416 | } // namespace webrtc |
| 417 | |
hbos | 4220421 | 2016-09-16 06:33:01 | [diff] [blame] | 418 | #endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ |