OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 // https://w3c.github.io/webrtc-pc/#idl-def-rtcdtlstransportstate | 45 // https://w3c.github.io/webrtc-pc/#idl-def-rtcdtlstransportstate |
46 struct RTCDtlsTransportState { | 46 struct RTCDtlsTransportState { |
47 static const char* kNew; | 47 static const char* kNew; |
48 static const char* kConnecting; | 48 static const char* kConnecting; |
49 static const char* kConnected; | 49 static const char* kConnected; |
50 static const char* kClosed; | 50 static const char* kClosed; |
51 static const char* kFailed; | 51 static const char* kFailed; |
52 }; | 52 }; |
53 | 53 |
| 54 // |RTCMediaStreamTrackStats::kind| is not an enum in the spec but the only |
| 55 // valid values are "audio" and "video". |
| 56 // https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats-kind |
| 57 struct RTCMediaStreamTrackKind { |
| 58 static const char* kAudio; |
| 59 static const char* kVideo; |
| 60 }; |
| 61 |
54 // https://w3c.github.io/webrtc-stats/#certificatestats-dict* | 62 // https://w3c.github.io/webrtc-stats/#certificatestats-dict* |
55 class RTCCertificateStats final : public RTCStats { | 63 class RTCCertificateStats final : public RTCStats { |
56 public: | 64 public: |
57 WEBRTC_RTCSTATS_DECL(); | 65 WEBRTC_RTCSTATS_DECL(); |
58 | 66 |
59 RTCCertificateStats(const std::string& id, int64_t timestamp_us); | 67 RTCCertificateStats(const std::string& id, int64_t timestamp_us); |
60 RTCCertificateStats(std::string&& id, int64_t timestamp_us); | 68 RTCCertificateStats(std::string&& id, int64_t timestamp_us); |
61 RTCCertificateStats(const RTCCertificateStats& other); | 69 RTCCertificateStats(const RTCCertificateStats& other); |
62 ~RTCCertificateStats() override; | 70 ~RTCCertificateStats() override; |
63 | 71 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 RTCStatsMember<std::string> stream_identifier; | 238 RTCStatsMember<std::string> stream_identifier; |
231 RTCStatsMember<std::vector<std::string>> track_ids; | 239 RTCStatsMember<std::vector<std::string>> track_ids; |
232 }; | 240 }; |
233 | 241 |
234 // https://w3c.github.io/webrtc-stats/#mststats-dict* | 242 // https://w3c.github.io/webrtc-stats/#mststats-dict* |
235 // TODO(hbos): Tracking bug crbug.com/659137 | 243 // TODO(hbos): Tracking bug crbug.com/659137 |
236 class RTCMediaStreamTrackStats final : public RTCStats { | 244 class RTCMediaStreamTrackStats final : public RTCStats { |
237 public: | 245 public: |
238 WEBRTC_RTCSTATS_DECL(); | 246 WEBRTC_RTCSTATS_DECL(); |
239 | 247 |
240 RTCMediaStreamTrackStats(const std::string& id, int64_t timestamp_us); | 248 RTCMediaStreamTrackStats(const std::string& id, int64_t timestamp_us, |
241 RTCMediaStreamTrackStats(std::string&& id, int64_t timestamp_us); | 249 const char* kind); |
| 250 RTCMediaStreamTrackStats(std::string&& id, int64_t timestamp_us, |
| 251 const char* kind); |
242 RTCMediaStreamTrackStats(const RTCMediaStreamTrackStats& other); | 252 RTCMediaStreamTrackStats(const RTCMediaStreamTrackStats& other); |
243 ~RTCMediaStreamTrackStats() override; | 253 ~RTCMediaStreamTrackStats() override; |
244 | 254 |
245 RTCStatsMember<std::string> track_identifier; | 255 RTCStatsMember<std::string> track_identifier; |
246 RTCStatsMember<bool> remote_source; | 256 RTCStatsMember<bool> remote_source; |
247 RTCStatsMember<bool> ended; | 257 RTCStatsMember<bool> ended; |
248 // TODO(hbos): |RTCStatsCollector| does not return stats for detached tracks. | 258 // TODO(hbos): |RTCStatsCollector| does not return stats for detached tracks. |
249 // crbug.com/659137 | 259 // crbug.com/659137 |
250 RTCStatsMember<bool> detached; | 260 RTCStatsMember<bool> detached; |
| 261 // See |RTCMediaStreamTrackKind| for valid values. |
| 262 RTCStatsMember<std::string> kind; |
251 // Video-only members | 263 // Video-only members |
252 RTCStatsMember<uint32_t> frame_width; | 264 RTCStatsMember<uint32_t> frame_width; |
253 RTCStatsMember<uint32_t> frame_height; | 265 RTCStatsMember<uint32_t> frame_height; |
254 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 | 266 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
255 RTCStatsMember<double> frames_per_second; | 267 RTCStatsMember<double> frames_per_second; |
256 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 | 268 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
257 RTCStatsMember<uint32_t> frames_sent; | 269 RTCStatsMember<uint32_t> frames_sent; |
258 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 | 270 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
259 RTCStatsMember<uint32_t> frames_received; | 271 RTCStatsMember<uint32_t> frames_received; |
260 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 | 272 // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDtlsTransportState>"? | 415 // TODO(hbos): Support enum types? "RTCStatsMember<RTCDtlsTransportState>"? |
404 RTCStatsMember<std::string> dtls_state; | 416 RTCStatsMember<std::string> dtls_state; |
405 RTCStatsMember<std::string> selected_candidate_pair_id; | 417 RTCStatsMember<std::string> selected_candidate_pair_id; |
406 RTCStatsMember<std::string> local_certificate_id; | 418 RTCStatsMember<std::string> local_certificate_id; |
407 RTCStatsMember<std::string> remote_certificate_id; | 419 RTCStatsMember<std::string> remote_certificate_id; |
408 }; | 420 }; |
409 | 421 |
410 } // namespace webrtc | 422 } // namespace webrtc |
411 | 423 |
412 #endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ | 424 #endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ |
OLD | NEW |