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 |
11 #ifndef WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ | 11 #ifndef WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ |
12 #define WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ | 12 #define WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "webrtc/api/stats/rtcstats.h" | 16 #include "webrtc/api/stats/rtcstats.h" |
17 | 17 |
18 namespace webrtc { | 18 namespace webrtc { |
19 | 19 |
| 20 // https://w3c.github.io/webrtc-stats/#dom-rtcstatsicecandidatepairstate |
| 21 struct RTCStatsIceCandidatePairState { |
| 22 static const char* kFrozen; |
| 23 static const char* kWaiting; |
| 24 static const char* kInProgress; |
| 25 static const char* kFailed; |
| 26 static const char* kSucceeded; |
| 27 static const char* kCancelled; |
| 28 }; |
| 29 |
20 // https://www.w3.org/TR/webrtc/#rtcicecandidatetype-enum | 30 // https://www.w3.org/TR/webrtc/#rtcicecandidatetype-enum |
21 struct RTCIceCandidateType { | 31 struct RTCIceCandidateType { |
22 static const char* kHost; | 32 static const char* kHost; |
23 static const char* kSrflx; | 33 static const char* kSrflx; |
24 static const char* kPrflx; | 34 static const char* kPrflx; |
25 static const char* kRelay; | 35 static const char* kRelay; |
26 }; | 36 }; |
27 | 37 |
| 38 class RTCIceCandidatePairStats : public RTCStats { |
| 39 public: |
| 40 WEBRTC_RTCSTATS_DECL(); |
| 41 |
| 42 RTCIceCandidatePairStats(const std::string& id, int64_t timestamp_us); |
| 43 RTCIceCandidatePairStats(std::string&& id, int64_t timestamp_us); |
| 44 RTCIceCandidatePairStats(const RTCIceCandidatePairStats& other); |
| 45 ~RTCIceCandidatePairStats() override; |
| 46 |
| 47 RTCStatsMember<std::string> transport_id; |
| 48 RTCStatsMember<std::string> local_candidate_id; |
| 49 RTCStatsMember<std::string> remote_candidate_id; |
| 50 // TODO(hbos): Support enum types? |
| 51 // "RTCStatsMember<RTCStatsIceCandidatePairState>"? |
| 52 RTCStatsMember<std::string> state; |
| 53 RTCStatsMember<uint64_t> priority; |
| 54 RTCStatsMember<bool> nominated; |
| 55 RTCStatsMember<bool> writable; |
| 56 RTCStatsMember<bool> readable; |
| 57 RTCStatsMember<uint64_t> bytes_sent; |
| 58 RTCStatsMember<uint64_t> bytes_received; |
| 59 RTCStatsMember<double> total_rtt; |
| 60 RTCStatsMember<double> current_rtt; |
| 61 RTCStatsMember<double> available_outgoing_bitrate; |
| 62 RTCStatsMember<double> available_incoming_bitrate; |
| 63 RTCStatsMember<uint64_t> requests_received; |
| 64 RTCStatsMember<uint64_t> requests_sent; |
| 65 RTCStatsMember<uint64_t> responses_received; |
| 66 RTCStatsMember<uint64_t> responses_sent; |
| 67 RTCStatsMember<uint64_t> retransmissions_received; |
| 68 RTCStatsMember<uint64_t> retransmissions_sent; |
| 69 RTCStatsMember<uint64_t> consent_requests_received; |
| 70 RTCStatsMember<uint64_t> consent_requests_sent; |
| 71 RTCStatsMember<uint64_t> consent_responses_received; |
| 72 RTCStatsMember<uint64_t> consent_responses_sent; |
| 73 }; |
| 74 |
28 // https://w3c.github.io/webrtc-stats/#icecandidate-dict* | 75 // https://w3c.github.io/webrtc-stats/#icecandidate-dict* |
29 class RTCIceCandidateStats : public RTCStats { | 76 class RTCIceCandidateStats : public RTCStats { |
30 public: | 77 public: |
31 WEBRTC_RTCSTATS_DECL(); | 78 WEBRTC_RTCSTATS_DECL(); |
32 | 79 |
33 RTCIceCandidateStats(const RTCIceCandidateStats& other); | 80 RTCIceCandidateStats(const RTCIceCandidateStats& other); |
34 ~RTCIceCandidateStats() override; | 81 ~RTCIceCandidateStats() override; |
35 | 82 |
36 RTCStatsMember<std::string> ip; | 83 RTCStatsMember<std::string> ip; |
37 RTCStatsMember<int32_t> port; | 84 RTCStatsMember<int32_t> port; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 RTCPeerConnectionStats(const RTCPeerConnectionStats& other); | 140 RTCPeerConnectionStats(const RTCPeerConnectionStats& other); |
94 ~RTCPeerConnectionStats() override; | 141 ~RTCPeerConnectionStats() override; |
95 | 142 |
96 RTCStatsMember<uint32_t> data_channels_opened; | 143 RTCStatsMember<uint32_t> data_channels_opened; |
97 RTCStatsMember<uint32_t> data_channels_closed; | 144 RTCStatsMember<uint32_t> data_channels_closed; |
98 }; | 145 }; |
99 | 146 |
100 } // namespace webrtc | 147 } // namespace webrtc |
101 | 148 |
102 #endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ | 149 #endif // WEBRTC_API_STATS_RTCSTATS_OBJECTS_H_ |
OLD | NEW |