Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: webrtc/api/statscollector.h

Issue 1713043002: Late initialize MediaController, for less resource i.e. ProcessThread, usage by PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: some comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 // This file contains a class used for gathering statistics from an ongoing 11 // This file contains a class used for gathering statistics from an ongoing
12 // libjingle PeerConnection. 12 // libjingle PeerConnection.
13 13
14 #ifndef WEBRTC_API_STATSCOLLECTOR_H_ 14 #ifndef WEBRTC_API_STATSCOLLECTOR_H_
15 #define WEBRTC_API_STATSCOLLECTOR_H_ 15 #define WEBRTC_API_STATSCOLLECTOR_H_
16 16
17 #include <map> 17 #include <map>
18 #include <string> 18 #include <string>
19 #include <vector> 19 #include <vector>
20 20
21 #include "webrtc/api/mediastreaminterface.h" 21 #include "webrtc/api/mediastreaminterface.h"
22 #include "webrtc/api/peerconnectioninterface.h" 22 #include "webrtc/api/peerconnectioninterface.h"
23 #include "webrtc/api/statstypes.h" 23 #include "webrtc/api/statstypes.h"
24 #include "webrtc/api/webrtcsession.h" 24 #include "webrtc/api/webrtcsession.h"
25 #include "webrtc/base/thread_checker.h"
25 26
26 namespace webrtc { 27 namespace webrtc {
27 28
28 class PeerConnection; 29 class PeerConnection;
29 30
30 // Conversion function to convert candidate type string to the corresponding one 31 // Conversion function to convert candidate type string to the corresponding one
31 // from enum RTCStatsIceCandidateType. 32 // from enum RTCStatsIceCandidateType.
32 const char* IceCandidateTypeToStatsType(const std::string& candidate_type); 33 const char* IceCandidateTypeToStatsType(const std::string& candidate_type);
33 34
34 // Conversion function to convert adapter type to report string which are more 35 // Conversion function to convert adapter type to report string which are more
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 126
126 // Helper method to get the id for the track identified by ssrc. 127 // Helper method to get the id for the track identified by ssrc.
127 // |direction| tells if the track is for sending or receiving. 128 // |direction| tells if the track is for sending or receiving.
128 bool GetTrackIdBySsrc(uint32_t ssrc, 129 bool GetTrackIdBySsrc(uint32_t ssrc,
129 std::string* track_id, 130 std::string* track_id,
130 StatsReport::Direction direction); 131 StatsReport::Direction direction);
131 132
132 // Helper method to update the timestamp of track records. 133 // Helper method to update the timestamp of track records.
133 void UpdateTrackReports(); 134 void UpdateTrackReports();
134 135
136 rtc::ThreadChecker signal_thread_checker_;
137
135 // A collection for all of our stats reports. 138 // A collection for all of our stats reports.
136 StatsCollection reports_; 139 StatsCollection reports_;
137 TrackIdMap track_ids_; 140 TrackIdMap track_ids_;
138 // Raw pointer to the peer connection the statistics are gathered from. 141 // Raw pointer to the peer connection the statistics are gathered from.
139 PeerConnection* const pc_; 142 PeerConnection* const pc_;
140 double stats_gathering_started_; 143 double stats_gathering_started_;
141 ProxyTransportMap proxy_to_transport_; 144 ProxyTransportMap proxy_to_transport_;
142 145
143 // TODO(tommi): We appear to be holding on to raw pointers to reference 146 // TODO(tommi): We appear to be holding on to raw pointers to reference
144 // counted objects? We should be using scoped_refptr here. 147 // counted objects? We should be using scoped_refptr here.
145 typedef std::vector<std::pair<AudioTrackInterface*, uint32_t> > 148 typedef std::vector<std::pair<AudioTrackInterface*, uint32_t> >
146 LocalAudioTrackVector; 149 LocalAudioTrackVector;
147 LocalAudioTrackVector local_audio_tracks_; 150 LocalAudioTrackVector local_audio_tracks_;
148 }; 151 };
149 152
150 } // namespace webrtc 153 } // namespace webrtc
151 154
152 #endif // WEBRTC_API_STATSCOLLECTOR_H_ 155 #endif // WEBRTC_API_STATSCOLLECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698