hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [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 | 74e1a4f | 2016-09-15 23:33:01 -0700 | [diff] [blame] | 11 | #ifndef WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ |
| 12 | #define WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ |
hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 13 | |
| 14 | #include <string> |
| 15 | |
hbos | 74e1a4f | 2016-09-15 23:33:01 -0700 | [diff] [blame] | 16 | #include "webrtc/api/stats/rtcstats.h" |
hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
| 19 | |
hbos | cc555c5 | 2016-10-18 12:48:31 -0700 | [diff] [blame] | 20 | // https://w3c.github.io/webrtc-pc/#idl-def-rtcdatachannelstate |
| 21 | struct RTCDataChannelState { |
| 22 | static const char* kConnecting; |
| 23 | static const char* kOpen; |
| 24 | static const char* kClosing; |
| 25 | static const char* kClosed; |
| 26 | }; |
| 27 | |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 28 | // https://w3c.github.io/webrtc-stats/#dom-rtcstatsicecandidatepairstate |
| 29 | struct RTCStatsIceCandidatePairState { |
| 30 | static const char* kFrozen; |
| 31 | static const char* kWaiting; |
| 32 | static const char* kInProgress; |
| 33 | static const char* kFailed; |
| 34 | static const char* kSucceeded; |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
hbos | cc555c5 | 2016-10-18 12:48:31 -0700 | [diff] [blame] | 37 | // https://w3c.github.io/webrtc-pc/#rtcicecandidatetype-enum |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 38 | struct RTCIceCandidateType { |
| 39 | static const char* kHost; |
| 40 | static const char* kSrflx; |
| 41 | static const char* kPrflx; |
| 42 | static const char* kRelay; |
| 43 | }; |
| 44 | |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 45 | // https://w3c.github.io/webrtc-stats/#certificatestats-dict* |
| 46 | class RTCCertificateStats final : public RTCStats { |
| 47 | public: |
| 48 | WEBRTC_RTCSTATS_DECL(); |
| 49 | |
| 50 | RTCCertificateStats(const std::string& id, int64_t timestamp_us); |
| 51 | RTCCertificateStats(std::string&& id, int64_t timestamp_us); |
| 52 | RTCCertificateStats(const RTCCertificateStats& other); |
| 53 | ~RTCCertificateStats() override; |
| 54 | |
| 55 | RTCStatsMember<std::string> fingerprint; |
| 56 | RTCStatsMember<std::string> fingerprint_algorithm; |
| 57 | RTCStatsMember<std::string> base64_certificate; |
| 58 | RTCStatsMember<std::string> issuer_certificate_id; |
| 59 | }; |
| 60 | |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 61 | // https://w3c.github.io/webrtc-stats/#codec-dict* |
| 62 | // Tracking bug crbug.com/659117 |
| 63 | // TODO(hbos): The present codec ID assignment is not sufficient to support |
| 64 | // Unified Plan or unbundled connections in all cases. crbug.com/659117 |
| 65 | class RTCCodecStats final : public RTCStats { |
| 66 | public: |
| 67 | WEBRTC_RTCSTATS_DECL(); |
| 68 | |
| 69 | RTCCodecStats(const std::string& id, int64_t timestamp_us); |
| 70 | RTCCodecStats(std::string&& id, int64_t timestamp_us); |
| 71 | RTCCodecStats(const RTCCodecStats& other); |
| 72 | ~RTCCodecStats() override; |
| 73 | |
| 74 | RTCStatsMember<uint32_t> payload_type; |
| 75 | RTCStatsMember<std::string> codec; |
| 76 | RTCStatsMember<uint32_t> clock_rate; |
| 77 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659117 |
| 78 | RTCStatsMember<uint32_t> channels; |
| 79 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659117 |
| 80 | RTCStatsMember<std::string> parameters; |
| 81 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659117 |
| 82 | RTCStatsMember<std::string> implementation; |
| 83 | }; |
| 84 | |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 85 | // https://w3c.github.io/webrtc-stats/#dcstats-dict* |
| 86 | class RTCDataChannelStats final : public RTCStats { |
| 87 | public: |
| 88 | WEBRTC_RTCSTATS_DECL(); |
| 89 | |
| 90 | RTCDataChannelStats(const std::string& id, int64_t timestamp_us); |
| 91 | RTCDataChannelStats(std::string&& id, int64_t timestamp_us); |
| 92 | RTCDataChannelStats(const RTCDataChannelStats& other); |
| 93 | ~RTCDataChannelStats() override; |
| 94 | |
| 95 | RTCStatsMember<std::string> label; |
| 96 | RTCStatsMember<std::string> protocol; |
| 97 | RTCStatsMember<int32_t> datachannelid; |
| 98 | // TODO(hbos): Support enum types? "RTCStatsMember<RTCDataChannelState>"? |
| 99 | RTCStatsMember<std::string> state; |
| 100 | RTCStatsMember<uint32_t> messages_sent; |
| 101 | RTCStatsMember<uint64_t> bytes_sent; |
| 102 | RTCStatsMember<uint32_t> messages_received; |
| 103 | RTCStatsMember<uint64_t> bytes_received; |
| 104 | }; |
| 105 | |
| 106 | // https://w3c.github.io/webrtc-stats/#candidatepair-dict* |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 107 | // TODO(hbos): Tracking bug crbug.com/633550 |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 108 | class RTCIceCandidatePairStats final : public RTCStats { |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 109 | public: |
| 110 | WEBRTC_RTCSTATS_DECL(); |
| 111 | |
| 112 | RTCIceCandidatePairStats(const std::string& id, int64_t timestamp_us); |
| 113 | RTCIceCandidatePairStats(std::string&& id, int64_t timestamp_us); |
| 114 | RTCIceCandidatePairStats(const RTCIceCandidatePairStats& other); |
| 115 | ~RTCIceCandidatePairStats() override; |
| 116 | |
| 117 | RTCStatsMember<std::string> transport_id; |
| 118 | RTCStatsMember<std::string> local_candidate_id; |
| 119 | RTCStatsMember<std::string> remote_candidate_id; |
| 120 | // TODO(hbos): Support enum types? |
| 121 | // "RTCStatsMember<RTCStatsIceCandidatePairState>"? |
| 122 | RTCStatsMember<std::string> state; |
| 123 | RTCStatsMember<uint64_t> priority; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 124 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550 |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 125 | RTCStatsMember<bool> nominated; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 126 | // TODO(hbos): Collected by |RTCStatsCollector| but different than the spec. |
| 127 | // crbug.com/633550 |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 128 | RTCStatsMember<bool> writable; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 129 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550 |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 130 | RTCStatsMember<bool> readable; |
| 131 | RTCStatsMember<uint64_t> bytes_sent; |
| 132 | RTCStatsMember<uint64_t> bytes_received; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 133 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550 |
hbos | 3168c7a | 2016-12-15 06:17:08 -0800 | [diff] [blame] | 134 | RTCStatsMember<double> total_round_trip_time; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 135 | // TODO(hbos): Collected by |RTCStatsCollector| but different than the spec. |
| 136 | // crbug.com/633550 |
hbos | 3168c7a | 2016-12-15 06:17:08 -0800 | [diff] [blame] | 137 | RTCStatsMember<double> current_round_trip_time; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 138 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550 |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 139 | RTCStatsMember<double> available_outgoing_bitrate; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 140 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550 |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 141 | RTCStatsMember<double> available_incoming_bitrate; |
| 142 | RTCStatsMember<uint64_t> requests_received; |
| 143 | RTCStatsMember<uint64_t> requests_sent; |
| 144 | RTCStatsMember<uint64_t> responses_received; |
| 145 | RTCStatsMember<uint64_t> responses_sent; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 146 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550 |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 147 | RTCStatsMember<uint64_t> retransmissions_received; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 148 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550 |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 149 | RTCStatsMember<uint64_t> retransmissions_sent; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 150 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550 |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 151 | RTCStatsMember<uint64_t> consent_requests_received; |
| 152 | RTCStatsMember<uint64_t> consent_requests_sent; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 153 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550 |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 154 | RTCStatsMember<uint64_t> consent_responses_received; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 155 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/633550 |
hbos | c47a0c3 | 2016-10-11 14:54:49 -0700 | [diff] [blame] | 156 | RTCStatsMember<uint64_t> consent_responses_sent; |
| 157 | }; |
| 158 | |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 159 | // https://w3c.github.io/webrtc-stats/#icecandidate-dict* |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 160 | // TODO(hbos): |RTCStatsCollector| only collects candidates that are part of |
| 161 | // ice candidate pairs, but there could be candidates not paired with anything. |
| 162 | // crbug.com/632723 |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 163 | class RTCIceCandidateStats : public RTCStats { |
| 164 | public: |
| 165 | WEBRTC_RTCSTATS_DECL(); |
| 166 | |
| 167 | RTCIceCandidateStats(const RTCIceCandidateStats& other); |
| 168 | ~RTCIceCandidateStats() override; |
| 169 | |
hbos | b4e426e | 2017-01-02 09:59:31 -0800 | [diff] [blame^] | 170 | RTCStatsMember<std::string> transport_id; |
hbos | c3a2b7f | 2017-01-02 04:46:15 -0800 | [diff] [blame] | 171 | RTCStatsMember<bool> is_remote; |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 172 | RTCStatsMember<std::string> ip; |
| 173 | RTCStatsMember<int32_t> port; |
| 174 | RTCStatsMember<std::string> protocol; |
| 175 | // TODO(hbos): Support enum types? "RTCStatsMember<RTCIceCandidateType>"? |
| 176 | RTCStatsMember<std::string> candidate_type; |
| 177 | RTCStatsMember<int32_t> priority; |
hbos | 5d79a7c | 2016-10-24 09:27:10 -0700 | [diff] [blame] | 178 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/632723 |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 179 | RTCStatsMember<std::string> url; |
hbos | d17a5a7 | 2017-01-02 08:09:59 -0800 | [diff] [blame] | 180 | // TODO(hbos): |deleted = true| case is not supported by |RTCStatsCollector|. |
| 181 | // crbug.com/632723 |
| 182 | RTCStatsMember<bool> deleted; // = false |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 183 | |
| 184 | protected: |
hbos | c3a2b7f | 2017-01-02 04:46:15 -0800 | [diff] [blame] | 185 | RTCIceCandidateStats( |
| 186 | const std::string& id, int64_t timestamp_us, bool is_remote); |
| 187 | RTCIceCandidateStats(std::string&& id, int64_t timestamp_us, bool is_remote); |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 188 | }; |
| 189 | |
| 190 | // In the spec both local and remote varieties are of type RTCIceCandidateStats. |
| 191 | // But here we define them as subclasses of |RTCIceCandidateStats| because the |
| 192 | // |kType| need to be different ("RTCStatsType type") in the local/remote case. |
| 193 | // https://w3c.github.io/webrtc-stats/#rtcstatstype-str* |
| 194 | class RTCLocalIceCandidateStats final : public RTCIceCandidateStats { |
| 195 | public: |
| 196 | static const char kType[]; |
| 197 | RTCLocalIceCandidateStats(const std::string& id, int64_t timestamp_us); |
| 198 | RTCLocalIceCandidateStats(std::string&& id, int64_t timestamp_us); |
| 199 | const char* type() const override; |
| 200 | }; |
| 201 | |
| 202 | class RTCRemoteIceCandidateStats final : public RTCIceCandidateStats { |
| 203 | public: |
| 204 | static const char kType[]; |
| 205 | RTCRemoteIceCandidateStats(const std::string& id, int64_t timestamp_us); |
| 206 | RTCRemoteIceCandidateStats(std::string&& id, int64_t timestamp_us); |
| 207 | const char* type() const override; |
| 208 | }; |
| 209 | |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 210 | // https://w3c.github.io/webrtc-stats/#msstats-dict* |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 211 | // TODO(hbos): Tracking bug crbug.com/660827 |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 212 | class RTCMediaStreamStats final : public RTCStats { |
| 213 | public: |
| 214 | WEBRTC_RTCSTATS_DECL(); |
| 215 | |
| 216 | RTCMediaStreamStats(const std::string& id, int64_t timestamp_us); |
| 217 | RTCMediaStreamStats(std::string&& id, int64_t timestamp_us); |
| 218 | RTCMediaStreamStats(const RTCMediaStreamStats& other); |
| 219 | ~RTCMediaStreamStats() override; |
| 220 | |
| 221 | RTCStatsMember<std::string> stream_identifier; |
| 222 | RTCStatsMember<std::vector<std::string>> track_ids; |
| 223 | }; |
| 224 | |
| 225 | // https://w3c.github.io/webrtc-stats/#mststats-dict* |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 226 | // TODO(hbos): Tracking bug crbug.com/659137 |
hbos | 09bc128 | 2016-11-08 06:29:22 -0800 | [diff] [blame] | 227 | class RTCMediaStreamTrackStats final : public RTCStats { |
| 228 | public: |
| 229 | WEBRTC_RTCSTATS_DECL(); |
| 230 | |
| 231 | RTCMediaStreamTrackStats(const std::string& id, int64_t timestamp_us); |
| 232 | RTCMediaStreamTrackStats(std::string&& id, int64_t timestamp_us); |
| 233 | RTCMediaStreamTrackStats(const RTCMediaStreamTrackStats& other); |
| 234 | ~RTCMediaStreamTrackStats() override; |
| 235 | |
| 236 | RTCStatsMember<std::string> track_identifier; |
| 237 | RTCStatsMember<bool> remote_source; |
| 238 | RTCStatsMember<bool> ended; |
| 239 | // TODO(hbos): |RTCStatsCollector| does not return stats for detached tracks. |
| 240 | // crbug.com/659137 |
| 241 | RTCStatsMember<bool> detached; |
| 242 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
| 243 | RTCStatsMember<std::vector<std::string>> ssrc_ids; |
| 244 | // Video-only members |
| 245 | RTCStatsMember<uint32_t> frame_width; |
| 246 | RTCStatsMember<uint32_t> frame_height; |
| 247 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
| 248 | RTCStatsMember<double> frames_per_second; |
| 249 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
| 250 | RTCStatsMember<uint32_t> frames_sent; |
| 251 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
| 252 | RTCStatsMember<uint32_t> frames_received; |
| 253 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
| 254 | RTCStatsMember<uint32_t> frames_decoded; |
| 255 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
| 256 | RTCStatsMember<uint32_t> frames_dropped; |
| 257 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
| 258 | RTCStatsMember<uint32_t> frames_corrupted; |
| 259 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
| 260 | RTCStatsMember<uint32_t> partial_frames_lost; |
| 261 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
| 262 | RTCStatsMember<uint32_t> full_frames_lost; |
| 263 | // Audio-only members |
| 264 | RTCStatsMember<double> audio_level; |
| 265 | RTCStatsMember<double> echo_return_loss; |
| 266 | RTCStatsMember<double> echo_return_loss_enhancement; |
| 267 | }; |
| 268 | |
hbos | 6ab97ce | 2016-10-03 14:16:56 -0700 | [diff] [blame] | 269 | // https://w3c.github.io/webrtc-stats/#pcstats-dict* |
hbos | ab9f6e4 | 2016-10-07 02:18:47 -0700 | [diff] [blame] | 270 | class RTCPeerConnectionStats final : public RTCStats { |
hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 271 | public: |
hbos | fc5e050 | 2016-10-06 02:06:10 -0700 | [diff] [blame] | 272 | WEBRTC_RTCSTATS_DECL(); |
| 273 | |
hbos | 0e6758d | 2016-08-31 07:57:36 -0700 | [diff] [blame] | 274 | RTCPeerConnectionStats(const std::string& id, int64_t timestamp_us); |
| 275 | RTCPeerConnectionStats(std::string&& id, int64_t timestamp_us); |
hbos | fc5e050 | 2016-10-06 02:06:10 -0700 | [diff] [blame] | 276 | RTCPeerConnectionStats(const RTCPeerConnectionStats& other); |
| 277 | ~RTCPeerConnectionStats() override; |
hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 278 | |
| 279 | RTCStatsMember<uint32_t> data_channels_opened; |
| 280 | RTCStatsMember<uint32_t> data_channels_closed; |
| 281 | }; |
| 282 | |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 283 | // https://w3c.github.io/webrtc-stats/#streamstats-dict* |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 284 | // TODO(hbos): Tracking bug crbug.com/657854 |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 285 | class RTCRTPStreamStats : public RTCStats { |
| 286 | public: |
| 287 | WEBRTC_RTCSTATS_DECL(); |
| 288 | |
| 289 | RTCRTPStreamStats(const RTCRTPStreamStats& other); |
| 290 | ~RTCRTPStreamStats() override; |
| 291 | |
| 292 | RTCStatsMember<std::string> ssrc; |
| 293 | // TODO(hbos): When the remote case is supported |RTCStatsCollector| needs to |
| 294 | // set this. crbug.com/657855, 657856 |
| 295 | RTCStatsMember<std::string> associate_stats_id; |
| 296 | // TODO(hbos): Remote case not supported by |RTCStatsCollector|. |
| 297 | // crbug.com/657855, 657856 |
| 298 | RTCStatsMember<bool> is_remote; // = false |
| 299 | RTCStatsMember<std::string> media_type; |
| 300 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657854, 659137 |
| 301 | RTCStatsMember<std::string> media_track_id; |
| 302 | RTCStatsMember<std::string> transport_id; |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 303 | RTCStatsMember<std::string> codec_id; |
| 304 | // FIR and PLI counts are only defined for |media_type == "video"|. |
| 305 | RTCStatsMember<uint32_t> fir_count; |
| 306 | RTCStatsMember<uint32_t> pli_count; |
| 307 | // TODO(hbos): NACK count should be collected by |RTCStatsCollector| for both |
| 308 | // audio and video but is only defined in the "video" case. crbug.com/657856 |
| 309 | RTCStatsMember<uint32_t> nack_count; |
| 310 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657854 |
| 311 | // SLI count is only defined for |media_type == "video"|. |
| 312 | RTCStatsMember<uint32_t> sli_count; |
hbos | 6769c49 | 2017-01-02 08:35:13 -0800 | [diff] [blame] | 313 | // TODO(hbos): Only collected for the outbound case, should also be collected |
| 314 | // for inbound case by |RTCStatsCollector|. crbug.com/657854, crbug.com/657855 |
| 315 | RTCStatsMember<uint64_t> qp_sum; |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 316 | |
| 317 | protected: |
| 318 | RTCRTPStreamStats(const std::string& id, int64_t timestamp_us); |
| 319 | RTCRTPStreamStats(std::string&& id, int64_t timestamp_us); |
| 320 | }; |
| 321 | |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 322 | // https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict* |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 323 | // Tracking bug crbug.com/657855 |
| 324 | // TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657855 |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 325 | class RTCInboundRTPStreamStats final : public RTCRTPStreamStats { |
| 326 | public: |
| 327 | WEBRTC_RTCSTATS_DECL(); |
| 328 | |
| 329 | RTCInboundRTPStreamStats(const std::string& id, int64_t timestamp_us); |
| 330 | RTCInboundRTPStreamStats(std::string&& id, int64_t timestamp_us); |
| 331 | RTCInboundRTPStreamStats(const RTCInboundRTPStreamStats& other); |
| 332 | ~RTCInboundRTPStreamStats() override; |
| 333 | |
| 334 | RTCStatsMember<uint32_t> packets_received; |
| 335 | RTCStatsMember<uint64_t> bytes_received; |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 336 | RTCStatsMember<uint32_t> packets_lost; |
| 337 | // TODO(hbos): Not collected in the "video" case by |RTCStatsCollector|. |
| 338 | // crbug.com/657855 |
| 339 | RTCStatsMember<double> jitter; |
| 340 | RTCStatsMember<double> fraction_lost; |
| 341 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 |
| 342 | RTCStatsMember<uint32_t> packets_discarded; |
| 343 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 |
| 344 | RTCStatsMember<uint32_t> packets_repaired; |
| 345 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 |
| 346 | RTCStatsMember<uint32_t> burst_packets_lost; |
| 347 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 |
| 348 | RTCStatsMember<uint32_t> burst_packets_discarded; |
| 349 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 |
| 350 | RTCStatsMember<uint32_t> burst_loss_count; |
| 351 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 |
| 352 | RTCStatsMember<uint32_t> burst_discard_count; |
| 353 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 |
| 354 | RTCStatsMember<double> burst_loss_rate; |
| 355 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 |
| 356 | RTCStatsMember<double> burst_discard_rate; |
| 357 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 |
| 358 | RTCStatsMember<double> gap_loss_rate; |
| 359 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 |
| 360 | RTCStatsMember<double> gap_discard_rate; |
hbos | 6769c49 | 2017-01-02 08:35:13 -0800 | [diff] [blame] | 361 | RTCStatsMember<uint32_t> frames_decoded; |
hbos | eeafe94 | 2016-11-01 03:00:17 -0700 | [diff] [blame] | 362 | }; |
| 363 | |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 364 | // https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict* |
hbos | 0adb828 | 2016-11-23 02:32:06 -0800 | [diff] [blame] | 365 | // Tracking bug crbug.com/657856 |
| 366 | // TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657856 |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 367 | class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats { |
| 368 | public: |
| 369 | WEBRTC_RTCSTATS_DECL(); |
| 370 | |
| 371 | RTCOutboundRTPStreamStats(const std::string& id, int64_t timestamp_us); |
| 372 | RTCOutboundRTPStreamStats(std::string&& id, int64_t timestamp_us); |
| 373 | RTCOutboundRTPStreamStats(const RTCOutboundRTPStreamStats& other); |
| 374 | ~RTCOutboundRTPStreamStats() override; |
| 375 | |
| 376 | RTCStatsMember<uint32_t> packets_sent; |
| 377 | RTCStatsMember<uint64_t> bytes_sent; |
| 378 | // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657856 |
| 379 | RTCStatsMember<double> target_bitrate; |
| 380 | RTCStatsMember<double> round_trip_time; |
hbos | 6769c49 | 2017-01-02 08:35:13 -0800 | [diff] [blame] | 381 | RTCStatsMember<uint32_t> frames_encoded; |
hbos | 6ded190 | 2016-11-01 01:50:46 -0700 | [diff] [blame] | 382 | }; |
| 383 | |
hbos | 2fa7c67 | 2016-10-24 04:00:05 -0700 | [diff] [blame] | 384 | // https://w3c.github.io/webrtc-stats/#transportstats-dict* |
| 385 | class RTCTransportStats final : public RTCStats { |
| 386 | public: |
| 387 | WEBRTC_RTCSTATS_DECL(); |
| 388 | |
| 389 | RTCTransportStats(const std::string& id, int64_t timestamp_us); |
| 390 | RTCTransportStats(std::string&& id, int64_t timestamp_us); |
| 391 | RTCTransportStats(const RTCTransportStats& other); |
| 392 | ~RTCTransportStats() override; |
| 393 | |
| 394 | RTCStatsMember<uint64_t> bytes_sent; |
| 395 | RTCStatsMember<uint64_t> bytes_received; |
| 396 | RTCStatsMember<std::string> rtcp_transport_stats_id; |
| 397 | RTCStatsMember<bool> active_connection; |
| 398 | RTCStatsMember<std::string> selected_candidate_pair_id; |
| 399 | RTCStatsMember<std::string> local_certificate_id; |
| 400 | RTCStatsMember<std::string> remote_certificate_id; |
| 401 | }; |
| 402 | |
hbos | d565b73 | 2016-08-30 14:04:35 -0700 | [diff] [blame] | 403 | } // namespace webrtc |
| 404 | |
hbos | 74e1a4f | 2016-09-15 23:33:01 -0700 | [diff] [blame] | 405 | #endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ |