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

Side by Side Diff: webrtc/pc/channelmanager.h

Issue 1888903003: Network thread (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 7 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
« no previous file with comments | « webrtc/pc/channel_unittest.cc ('k') | webrtc/pc/channelmanager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 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 24 matching lines...) Expand all
35 // voice or just video channels. 35 // voice or just video channels.
36 // ChannelManager also allows the application to discover what devices it has 36 // ChannelManager also allows the application to discover what devices it has
37 // using device manager. 37 // using device manager.
38 class ChannelManager { 38 class ChannelManager {
39 public: 39 public:
40 // For testing purposes. Allows the media engine and data media 40 // For testing purposes. Allows the media engine and data media
41 // engine and dev manager to be mocks. The ChannelManager takes 41 // engine and dev manager to be mocks. The ChannelManager takes
42 // ownership of these objects. 42 // ownership of these objects.
43 ChannelManager(MediaEngineInterface* me, 43 ChannelManager(MediaEngineInterface* me,
44 DataEngineInterface* dme, 44 DataEngineInterface* dme,
45 rtc::Thread* worker); 45 rtc::Thread* worker_and_network);
46 // Same as above, but gives an easier default DataEngine. 46 // Same as above, but gives an easier default DataEngine.
47 ChannelManager(MediaEngineInterface* me, 47 ChannelManager(MediaEngineInterface* me,
48 rtc::Thread* worker); 48 rtc::Thread* worker,
49 rtc::Thread* network);
49 ~ChannelManager(); 50 ~ChannelManager();
50 51
51 // Accessors for the worker thread, allowing it to be set after construction, 52 // Accessors for the worker thread, allowing it to be set after construction,
52 // but before Init. set_worker_thread will return false if called after Init. 53 // but before Init. set_worker_thread will return false if called after Init.
53 rtc::Thread* worker_thread() const { return worker_thread_; } 54 rtc::Thread* worker_thread() const { return worker_thread_; }
54 bool set_worker_thread(rtc::Thread* thread) { 55 bool set_worker_thread(rtc::Thread* thread) {
55 if (initialized_) return false; 56 if (initialized_) return false;
56 worker_thread_ = thread; 57 worker_thread_ = thread;
57 return true; 58 return true;
58 } 59 }
60 rtc::Thread* network_thread() const { return network_thread_; }
61 bool set_network_thread(rtc::Thread* thread) {
62 if (initialized_)
63 return false;
64 network_thread_ = thread;
65 return true;
66 }
59 67
60 MediaEngineInterface* media_engine() { return media_engine_.get(); } 68 MediaEngineInterface* media_engine() { return media_engine_.get(); }
61 69
62 // Retrieves the list of supported audio & video codec types. 70 // Retrieves the list of supported audio & video codec types.
63 // Can be called before starting the media engine. 71 // Can be called before starting the media engine.
64 void GetSupportedAudioCodecs(std::vector<AudioCodec>* codecs) const; 72 void GetSupportedAudioCodecs(std::vector<AudioCodec>* codecs) const;
65 void GetSupportedAudioRtpHeaderExtensions(RtpHeaderExtensions* ext) const; 73 void GetSupportedAudioRtpHeaderExtensions(RtpHeaderExtensions* ext) const;
66 void GetSupportedVideoCodecs(std::vector<VideoCodec>* codecs) const; 74 void GetSupportedVideoCodecs(std::vector<VideoCodec>* codecs) const;
67 void GetSupportedVideoRtpHeaderExtensions(RtpHeaderExtensions* ext) const; 75 void GetSupportedVideoRtpHeaderExtensions(RtpHeaderExtensions* ext) const;
68 void GetSupportedDataCodecs(std::vector<DataCodec>* codecs) const; 76 void GetSupportedDataCodecs(std::vector<DataCodec>* codecs) const;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // Stops logging RtcEventLog. 139 // Stops logging RtcEventLog.
132 void StopRtcEventLog(); 140 void StopRtcEventLog();
133 141
134 private: 142 private:
135 typedef std::vector<VoiceChannel*> VoiceChannels; 143 typedef std::vector<VoiceChannel*> VoiceChannels;
136 typedef std::vector<VideoChannel*> VideoChannels; 144 typedef std::vector<VideoChannel*> VideoChannels;
137 typedef std::vector<DataChannel*> DataChannels; 145 typedef std::vector<DataChannel*> DataChannels;
138 146
139 void Construct(MediaEngineInterface* me, 147 void Construct(MediaEngineInterface* me,
140 DataEngineInterface* dme, 148 DataEngineInterface* dme,
141 rtc::Thread* worker_thread); 149 rtc::Thread* worker_thread,
142 bool InitMediaEngine_w(); 150 rtc::Thread* network_thread);
143 void DestructorDeletes_w(); 151 void DestructorDeletes_w();
144 void Terminate_w(); 152 void Terminate_w();
145 VoiceChannel* CreateVoiceChannel_w( 153 VoiceChannel* CreateVoiceChannel_w(
146 webrtc::MediaControllerInterface* media_controller, 154 webrtc::MediaControllerInterface* media_controller,
147 TransportController* transport_controller, 155 TransportController* transport_controller,
148 const std::string& content_name, 156 const std::string& content_name,
149 bool rtcp, 157 bool rtcp,
150 const AudioOptions& options); 158 const AudioOptions& options);
151 void DestroyVoiceChannel_w(VoiceChannel* voice_channel); 159 void DestroyVoiceChannel_w(VoiceChannel* voice_channel);
152 VideoChannel* CreateVideoChannel_w( 160 VideoChannel* CreateVideoChannel_w(
153 webrtc::MediaControllerInterface* media_controller, 161 webrtc::MediaControllerInterface* media_controller,
154 TransportController* transport_controller, 162 TransportController* transport_controller,
155 const std::string& content_name, 163 const std::string& content_name,
156 bool rtcp, 164 bool rtcp,
157 const VideoOptions& options); 165 const VideoOptions& options);
158 void DestroyVideoChannel_w(VideoChannel* video_channel); 166 void DestroyVideoChannel_w(VideoChannel* video_channel);
159 DataChannel* CreateDataChannel_w(TransportController* transport_controller, 167 DataChannel* CreateDataChannel_w(TransportController* transport_controller,
160 const std::string& content_name, 168 const std::string& content_name,
161 bool rtcp, 169 bool rtcp,
162 DataChannelType data_channel_type); 170 DataChannelType data_channel_type);
163 void DestroyDataChannel_w(DataChannel* data_channel); 171 void DestroyDataChannel_w(DataChannel* data_channel);
164 172
165 std::unique_ptr<MediaEngineInterface> media_engine_; 173 std::unique_ptr<MediaEngineInterface> media_engine_;
166 std::unique_ptr<DataEngineInterface> data_media_engine_; 174 std::unique_ptr<DataEngineInterface> data_media_engine_;
167 bool initialized_; 175 bool initialized_;
168 rtc::Thread* main_thread_; 176 rtc::Thread* main_thread_;
169 rtc::Thread* worker_thread_; 177 rtc::Thread* worker_thread_;
178 rtc::Thread* network_thread_;
170 179
171 VoiceChannels voice_channels_; 180 VoiceChannels voice_channels_;
172 VideoChannels video_channels_; 181 VideoChannels video_channels_;
173 DataChannels data_channels_; 182 DataChannels data_channels_;
174 183
175 int audio_output_volume_; 184 int audio_output_volume_;
176 bool enable_rtx_; 185 bool enable_rtx_;
177 186
178 bool capturing_; 187 bool capturing_;
179 }; 188 };
180 189
181 } // namespace cricket 190 } // namespace cricket
182 191
183 #endif // WEBRTC_PC_CHANNELMANAGER_H_ 192 #endif // WEBRTC_PC_CHANNELMANAGER_H_
OLDNEW
« no previous file with comments | « webrtc/pc/channel_unittest.cc ('k') | webrtc/pc/channelmanager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698