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

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

Issue 1903393004: Added network thread to rtc::BaseChannel (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix flakiness of WebRtcSessionTest.TestPacketOptionsAndOnPacketSent 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_) {
57 return false;
58 }
56 worker_thread_ = thread; 59 worker_thread_ = thread;
57 return true; 60 return true;
58 } 61 }
62 rtc::Thread* network_thread() const { return network_thread_; }
63 bool set_network_thread(rtc::Thread* thread) {
64 if (initialized_) {
65 return false;
66 }
67 network_thread_ = thread;
68 return true;
69 }
59 70
60 MediaEngineInterface* media_engine() { return media_engine_.get(); } 71 MediaEngineInterface* media_engine() { return media_engine_.get(); }
61 72
62 // Retrieves the list of supported audio & video codec types. 73 // Retrieves the list of supported audio & video codec types.
63 // Can be called before starting the media engine. 74 // Can be called before starting the media engine.
64 void GetSupportedAudioCodecs(std::vector<AudioCodec>* codecs) const; 75 void GetSupportedAudioCodecs(std::vector<AudioCodec>* codecs) const;
65 void GetSupportedAudioRtpHeaderExtensions(RtpHeaderExtensions* ext) const; 76 void GetSupportedAudioRtpHeaderExtensions(RtpHeaderExtensions* ext) const;
66 void GetSupportedVideoCodecs(std::vector<VideoCodec>* codecs) const; 77 void GetSupportedVideoCodecs(std::vector<VideoCodec>* codecs) const;
67 void GetSupportedVideoRtpHeaderExtensions(RtpHeaderExtensions* ext) const; 78 void GetSupportedVideoRtpHeaderExtensions(RtpHeaderExtensions* ext) const;
68 void GetSupportedDataCodecs(std::vector<DataCodec>* codecs) const; 79 void GetSupportedDataCodecs(std::vector<DataCodec>* codecs) const;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // Stops logging RtcEventLog. 142 // Stops logging RtcEventLog.
132 void StopRtcEventLog(); 143 void StopRtcEventLog();
133 144
134 private: 145 private:
135 typedef std::vector<VoiceChannel*> VoiceChannels; 146 typedef std::vector<VoiceChannel*> VoiceChannels;
136 typedef std::vector<VideoChannel*> VideoChannels; 147 typedef std::vector<VideoChannel*> VideoChannels;
137 typedef std::vector<DataChannel*> DataChannels; 148 typedef std::vector<DataChannel*> DataChannels;
138 149
139 void Construct(MediaEngineInterface* me, 150 void Construct(MediaEngineInterface* me,
140 DataEngineInterface* dme, 151 DataEngineInterface* dme,
141 rtc::Thread* worker_thread); 152 rtc::Thread* worker_thread,
153 rtc::Thread* network_thread);
142 bool InitMediaEngine_w(); 154 bool InitMediaEngine_w();
143 void DestructorDeletes_w(); 155 void DestructorDeletes_w();
144 void Terminate_w(); 156 void Terminate_w();
145 VoiceChannel* CreateVoiceChannel_w( 157 VoiceChannel* CreateVoiceChannel_w(
146 webrtc::MediaControllerInterface* media_controller, 158 webrtc::MediaControllerInterface* media_controller,
147 TransportController* transport_controller, 159 TransportController* transport_controller,
148 const std::string& content_name, 160 const std::string& content_name,
149 bool rtcp, 161 bool rtcp,
150 const AudioOptions& options); 162 const AudioOptions& options);
151 void DestroyVoiceChannel_w(VoiceChannel* voice_channel); 163 void DestroyVoiceChannel_w(VoiceChannel* voice_channel);
152 VideoChannel* CreateVideoChannel_w( 164 VideoChannel* CreateVideoChannel_w(
153 webrtc::MediaControllerInterface* media_controller, 165 webrtc::MediaControllerInterface* media_controller,
154 TransportController* transport_controller, 166 TransportController* transport_controller,
155 const std::string& content_name, 167 const std::string& content_name,
156 bool rtcp, 168 bool rtcp,
157 const VideoOptions& options); 169 const VideoOptions& options);
158 void DestroyVideoChannel_w(VideoChannel* video_channel); 170 void DestroyVideoChannel_w(VideoChannel* video_channel);
159 DataChannel* CreateDataChannel_w(TransportController* transport_controller, 171 DataChannel* CreateDataChannel_w(TransportController* transport_controller,
160 const std::string& content_name, 172 const std::string& content_name,
161 bool rtcp, 173 bool rtcp,
162 DataChannelType data_channel_type); 174 DataChannelType data_channel_type);
163 void DestroyDataChannel_w(DataChannel* data_channel); 175 void DestroyDataChannel_w(DataChannel* data_channel);
164 176
165 std::unique_ptr<MediaEngineInterface> media_engine_; 177 std::unique_ptr<MediaEngineInterface> media_engine_;
166 std::unique_ptr<DataEngineInterface> data_media_engine_; 178 std::unique_ptr<DataEngineInterface> data_media_engine_;
167 bool initialized_; 179 bool initialized_;
168 rtc::Thread* main_thread_; 180 rtc::Thread* main_thread_;
169 rtc::Thread* worker_thread_; 181 rtc::Thread* worker_thread_;
182 rtc::Thread* network_thread_;
170 183
171 VoiceChannels voice_channels_; 184 VoiceChannels voice_channels_;
172 VideoChannels video_channels_; 185 VideoChannels video_channels_;
173 DataChannels data_channels_; 186 DataChannels data_channels_;
174 187
175 int audio_output_volume_; 188 int audio_output_volume_;
176 bool enable_rtx_; 189 bool enable_rtx_;
177 190
178 bool capturing_; 191 bool capturing_;
179 }; 192 };
180 193
181 } // namespace cricket 194 } // namespace cricket
182 195
183 #endif // WEBRTC_PC_CHANNELMANAGER_H_ 196 #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