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

Side by Side Diff: webrtc/pc/peerconnectionfactory.cc

Issue 2934103002: Allow WebRtcMediaEngine to be created from any thread. (Closed)
Patch Set: Adding DCHECK for encoder_factory Created 3 years, 6 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/peerconnectionfactory.h ('k') | no next file » | 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 if (!default_network_manager_) { 203 if (!default_network_manager_) {
204 return false; 204 return false;
205 } 205 }
206 206
207 default_socket_factory_.reset( 207 default_socket_factory_.reset(
208 new rtc::BasicPacketSocketFactory(network_thread_)); 208 new rtc::BasicPacketSocketFactory(network_thread_));
209 if (!default_socket_factory_) { 209 if (!default_socket_factory_) {
210 return false; 210 return false;
211 } 211 }
212 212
213 std::unique_ptr<cricket::MediaEngineInterface> media_engine = 213 std::unique_ptr<cricket::MediaEngineInterface> media_engine(
214 worker_thread_->Invoke<std::unique_ptr<cricket::MediaEngineInterface>>( 214 cricket::WebRtcMediaEngineFactory::Create(
215 RTC_FROM_HERE, 215 default_adm_.get(), audio_encoder_factory_, audio_decoder_factory_,
216 rtc::Bind(&PeerConnectionFactory::CreateMediaEngine_w, this)); 216 video_encoder_factory_.get(), video_decoder_factory_.get(),
217 external_audio_mixer_));
217 218
218 channel_manager_.reset(new cricket::ChannelManager( 219 channel_manager_.reset(new cricket::ChannelManager(
219 std::move(media_engine), worker_thread_, network_thread_)); 220 std::move(media_engine), worker_thread_, network_thread_));
220 221
221 channel_manager_->SetVideoRtxEnabled(true); 222 channel_manager_->SetVideoRtxEnabled(true);
222 if (!channel_manager_->Init()) { 223 if (!channel_manager_->Init()) {
223 return false; 224 return false;
224 } 225 }
225 226
226 return true; 227 return true;
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 376
376 rtc::Thread* PeerConnectionFactory::worker_thread() { 377 rtc::Thread* PeerConnectionFactory::worker_thread() {
377 RTC_DCHECK(signaling_thread_->IsCurrent()); 378 RTC_DCHECK(signaling_thread_->IsCurrent());
378 return worker_thread_; 379 return worker_thread_;
379 } 380 }
380 381
381 rtc::Thread* PeerConnectionFactory::network_thread() { 382 rtc::Thread* PeerConnectionFactory::network_thread() {
382 return network_thread_; 383 return network_thread_;
383 } 384 }
384 385
385 std::unique_ptr<cricket::MediaEngineInterface>
386 PeerConnectionFactory::CreateMediaEngine_w() {
387 RTC_DCHECK(worker_thread_ == rtc::Thread::Current());
388 return std::unique_ptr<cricket::MediaEngineInterface>(
389 cricket::WebRtcMediaEngineFactory::Create(
390 default_adm_.get(), audio_encoder_factory_,
391 audio_decoder_factory_,
392 video_encoder_factory_.get(), video_decoder_factory_.get(),
393 external_audio_mixer_));
394 }
395
396 } // namespace webrtc 386 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/pc/peerconnectionfactory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698