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_PC_RTCSTATSCOLLECTOR_H_ | 11 #ifndef WEBRTC_PC_RTCSTATSCOLLECTOR_H_ |
12 #define WEBRTC_PC_RTCSTATSCOLLECTOR_H_ | 12 #define WEBRTC_PC_RTCSTATSCOLLECTOR_H_ |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <memory> | 15 #include <memory> |
16 #include <set> | 16 #include <set> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/api/stats/rtcstats_objects.h" | 19 #include "webrtc/api/stats/rtcstats_objects.h" |
20 #include "webrtc/api/stats/rtcstatscollectorcallback.h" | 20 #include "webrtc/api/stats/rtcstatscollectorcallback.h" |
21 #include "webrtc/api/stats/rtcstatsreport.h" | 21 #include "webrtc/api/stats/rtcstatsreport.h" |
22 #include "webrtc/base/asyncinvoker.h" | 22 #include "webrtc/base/asyncinvoker.h" |
23 #include "webrtc/base/optional.h" | 23 #include "webrtc/base/optional.h" |
24 #include "webrtc/base/refcount.h" | 24 #include "webrtc/base/refcount.h" |
25 #include "webrtc/base/scoped_ref_ptr.h" | 25 #include "webrtc/base/scoped_ref_ptr.h" |
26 #include "webrtc/base/sigslot.h" | 26 #include "webrtc/base/sigslot.h" |
27 #include "webrtc/base/sslidentity.h" | 27 #include "webrtc/base/sslidentity.h" |
28 #include "webrtc/base/timeutils.h" | 28 #include "webrtc/base/timeutils.h" |
| 29 #include "webrtc/call/call.h" |
29 #include "webrtc/media/base/mediachannel.h" | 30 #include "webrtc/media/base/mediachannel.h" |
30 #include "webrtc/pc/datachannel.h" | 31 #include "webrtc/pc/datachannel.h" |
31 #include "webrtc/pc/trackmediainfomap.h" | 32 #include "webrtc/pc/trackmediainfomap.h" |
32 | 33 |
33 namespace cricket { | 34 namespace cricket { |
34 class Candidate; | 35 class Candidate; |
35 } // namespace cricket | 36 } // namespace cricket |
36 | 37 |
37 namespace rtc { | 38 namespace rtc { |
38 class SSLCertificate; | 39 class SSLCertificate; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 RTCStatsReport* report) const; | 98 RTCStatsReport* report) const; |
98 // Produces |RTCCodecStats|. | 99 // Produces |RTCCodecStats|. |
99 void ProduceCodecStats_n( | 100 void ProduceCodecStats_n( |
100 int64_t timestamp_us, const TrackMediaInfoMap& track_media_info_map, | 101 int64_t timestamp_us, const TrackMediaInfoMap& track_media_info_map, |
101 RTCStatsReport* report) const; | 102 RTCStatsReport* report) const; |
102 // Produces |RTCDataChannelStats|. | 103 // Produces |RTCDataChannelStats|. |
103 void ProduceDataChannelStats_s( | 104 void ProduceDataChannelStats_s( |
104 int64_t timestamp_us, RTCStatsReport* report) const; | 105 int64_t timestamp_us, RTCStatsReport* report) const; |
105 // Produces |RTCIceCandidatePairStats| and |RTCIceCandidateStats|. | 106 // Produces |RTCIceCandidatePairStats| and |RTCIceCandidateStats|. |
106 void ProduceIceCandidateAndPairStats_n( | 107 void ProduceIceCandidateAndPairStats_n( |
107 int64_t timestamp_us, const SessionStats& session_stats, | 108 int64_t timestamp_us, |
| 109 const SessionStats& session_stats, |
108 const cricket::VideoMediaInfo* video_media_info, | 110 const cricket::VideoMediaInfo* video_media_info, |
| 111 const Call::Stats& call_stats, |
109 RTCStatsReport* report) const; | 112 RTCStatsReport* report) const; |
110 // Produces |RTCMediaStreamStats| and |RTCMediaStreamTrackStats|. | 113 // Produces |RTCMediaStreamStats| and |RTCMediaStreamTrackStats|. |
111 void ProduceMediaStreamAndTrackStats_s( | 114 void ProduceMediaStreamAndTrackStats_s( |
112 int64_t timestamp_us, RTCStatsReport* report) const; | 115 int64_t timestamp_us, RTCStatsReport* report) const; |
113 // Produces |RTCPeerConnectionStats|. | 116 // Produces |RTCPeerConnectionStats|. |
114 void ProducePeerConnectionStats_s( | 117 void ProducePeerConnectionStats_s( |
115 int64_t timestamp_us, RTCStatsReport* report) const; | 118 int64_t timestamp_us, RTCStatsReport* report) const; |
116 // Produces |RTCInboundRTPStreamStats| and |RTCOutboundRTPStreamStats|. | 119 // Produces |RTCInboundRTPStreamStats| and |RTCOutboundRTPStreamStats|. |
117 void ProduceRTPStreamStats_n( | 120 void ProduceRTPStreamStats_n( |
118 int64_t timestamp_us, const SessionStats& session_stats, | 121 int64_t timestamp_us, const SessionStats& session_stats, |
(...skipping 28 matching lines...) Expand all Loading... |
147 rtc::scoped_refptr<RTCStatsReport> partial_report_; | 150 rtc::scoped_refptr<RTCStatsReport> partial_report_; |
148 std::vector<rtc::scoped_refptr<RTCStatsCollectorCallback>> callbacks_; | 151 std::vector<rtc::scoped_refptr<RTCStatsCollectorCallback>> callbacks_; |
149 | 152 |
150 // Set in |GetStatsReport|, read in |ProducePartialResultsOnNetworkThread| and | 153 // Set in |GetStatsReport|, read in |ProducePartialResultsOnNetworkThread| and |
151 // |ProducePartialResultsOnSignalingThread|, reset after work is complete. Not | 154 // |ProducePartialResultsOnSignalingThread|, reset after work is complete. Not |
152 // passed as arguments to avoid copies. This is thread safe - when we | 155 // passed as arguments to avoid copies. This is thread safe - when we |
153 // set/reset we know there are no pending stats requests in progress. | 156 // set/reset we know there are no pending stats requests in progress. |
154 std::unique_ptr<ChannelNamePairs> channel_name_pairs_; | 157 std::unique_ptr<ChannelNamePairs> channel_name_pairs_; |
155 std::unique_ptr<TrackMediaInfoMap> track_media_info_map_; | 158 std::unique_ptr<TrackMediaInfoMap> track_media_info_map_; |
156 std::map<MediaStreamTrackInterface*, std::string> track_to_id_; | 159 std::map<MediaStreamTrackInterface*, std::string> track_to_id_; |
| 160 Call::Stats call_stats_; |
157 | 161 |
158 // A timestamp, in microseconds, that is based on a timer that is | 162 // A timestamp, in microseconds, that is based on a timer that is |
159 // monotonically increasing. That is, even if the system clock is modified the | 163 // monotonically increasing. That is, even if the system clock is modified the |
160 // difference between the timer and this timestamp is how fresh the cached | 164 // difference between the timer and this timestamp is how fresh the cached |
161 // report is. | 165 // report is. |
162 int64_t cache_timestamp_us_; | 166 int64_t cache_timestamp_us_; |
163 int64_t cache_lifetime_us_; | 167 int64_t cache_lifetime_us_; |
164 rtc::scoped_refptr<const RTCStatsReport> cached_report_; | 168 rtc::scoped_refptr<const RTCStatsReport> cached_report_; |
165 | 169 |
166 // Data recorded and maintained by the stats collector during its lifetime. | 170 // Data recorded and maintained by the stats collector during its lifetime. |
(...skipping 17 matching lines...) Expand all Loading... |
184 }; | 188 }; |
185 | 189 |
186 const char* CandidateTypeToRTCIceCandidateTypeForTesting( | 190 const char* CandidateTypeToRTCIceCandidateTypeForTesting( |
187 const std::string& type); | 191 const std::string& type); |
188 const char* DataStateToRTCDataChannelStateForTesting( | 192 const char* DataStateToRTCDataChannelStateForTesting( |
189 DataChannelInterface::DataState state); | 193 DataChannelInterface::DataState state); |
190 | 194 |
191 } // namespace webrtc | 195 } // namespace webrtc |
192 | 196 |
193 #endif // WEBRTC_PC_RTCSTATSCOLLECTOR_H_ | 197 #endif // WEBRTC_PC_RTCSTATSCOLLECTOR_H_ |
OLD | NEW |