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_RTCSTATSCOLLECTOR_H_ | 11 #ifndef WEBRTC_PC_RTCSTATSCOLLECTOR_H_ |
12 #define WEBRTC_API_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/datachannel.h" | |
20 #include "webrtc/api/datachannelinterface.h" | |
21 #include "webrtc/api/stats/rtcstats_objects.h" | 19 #include "webrtc/api/stats/rtcstats_objects.h" |
| 20 #include "webrtc/api/stats/rtcstatscollectorcallback.h" |
22 #include "webrtc/api/stats/rtcstatsreport.h" | 21 #include "webrtc/api/stats/rtcstatsreport.h" |
23 #include "webrtc/api/trackmediainfomap.h" | 22 #include "webrtc/api/trackmediainfomap.h" |
24 #include "webrtc/base/asyncinvoker.h" | 23 #include "webrtc/base/asyncinvoker.h" |
25 #include "webrtc/base/optional.h" | 24 #include "webrtc/base/optional.h" |
26 #include "webrtc/base/refcount.h" | 25 #include "webrtc/base/refcount.h" |
27 #include "webrtc/base/scoped_ref_ptr.h" | 26 #include "webrtc/base/scoped_ref_ptr.h" |
28 #include "webrtc/base/sigslot.h" | 27 #include "webrtc/base/sigslot.h" |
29 #include "webrtc/base/sslidentity.h" | 28 #include "webrtc/base/sslidentity.h" |
30 #include "webrtc/base/timeutils.h" | 29 #include "webrtc/base/timeutils.h" |
31 #include "webrtc/media/base/mediachannel.h" | 30 #include "webrtc/media/base/mediachannel.h" |
| 31 #include "webrtc/pc/datachannel.h" |
32 | 32 |
33 namespace cricket { | 33 namespace cricket { |
34 class Candidate; | 34 class Candidate; |
35 } // namespace cricket | 35 } // namespace cricket |
36 | 36 |
37 namespace rtc { | 37 namespace rtc { |
38 class SSLCertificate; | 38 class SSLCertificate; |
39 } // namespace rtc | 39 } // namespace rtc |
40 | 40 |
41 namespace webrtc { | 41 namespace webrtc { |
42 | 42 |
43 class PeerConnection; | 43 class PeerConnection; |
44 struct SessionStats; | 44 struct SessionStats; |
45 struct ChannelNamePairs; | 45 struct ChannelNamePairs; |
46 | 46 |
47 class RTCStatsCollectorCallback : public virtual rtc::RefCountInterface { | |
48 public: | |
49 virtual ~RTCStatsCollectorCallback() {} | |
50 | |
51 virtual void OnStatsDelivered( | |
52 const rtc::scoped_refptr<const RTCStatsReport>& report) = 0; | |
53 }; | |
54 | |
55 // All public methods of the collector are to be called on the signaling thread. | 47 // All public methods of the collector are to be called on the signaling thread. |
56 // Stats are gathered on the signaling, worker and network threads | 48 // Stats are gathered on the signaling, worker and network threads |
57 // asynchronously. The callback is invoked on the signaling thread. Resulting | 49 // asynchronously. The callback is invoked on the signaling thread. Resulting |
58 // reports are cached for |cache_lifetime_| ms. | 50 // reports are cached for |cache_lifetime_| ms. |
59 class RTCStatsCollector : public virtual rtc::RefCountInterface, | 51 class RTCStatsCollector : public virtual rtc::RefCountInterface, |
60 public sigslot::has_slots<> { | 52 public sigslot::has_slots<> { |
61 public: | 53 public: |
62 static rtc::scoped_refptr<RTCStatsCollector> Create( | 54 static rtc::scoped_refptr<RTCStatsCollector> Create( |
63 PeerConnection* pc, | 55 PeerConnection* pc, |
64 int64_t cache_lifetime_us = 50 * rtc::kNumMicrosecsPerMillisec); | 56 int64_t cache_lifetime_us = 50 * rtc::kNumMicrosecsPerMillisec); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 InternalRecord internal_record_; | 182 InternalRecord internal_record_; |
191 }; | 183 }; |
192 | 184 |
193 const char* CandidateTypeToRTCIceCandidateTypeForTesting( | 185 const char* CandidateTypeToRTCIceCandidateTypeForTesting( |
194 const std::string& type); | 186 const std::string& type); |
195 const char* DataStateToRTCDataChannelStateForTesting( | 187 const char* DataStateToRTCDataChannelStateForTesting( |
196 DataChannelInterface::DataState state); | 188 DataChannelInterface::DataState state); |
197 | 189 |
198 } // namespace webrtc | 190 } // namespace webrtc |
199 | 191 |
200 #endif // WEBRTC_API_RTCSTATSCOLLECTOR_H_ | 192 #endif // WEBRTC_PC_RTCSTATSCOLLECTOR_H_ |
OLD | NEW |