| OLD | NEW |
| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 } | 132 } |
| 133 | 133 |
| 134 PeerConnectionFactory::PeerConnectionFactory( | 134 PeerConnectionFactory::PeerConnectionFactory( |
| 135 rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory, | 135 rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory, |
| 136 rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory) | 136 rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory) |
| 137 : owns_ptrs_(true), | 137 : owns_ptrs_(true), |
| 138 wraps_current_thread_(false), | 138 wraps_current_thread_(false), |
| 139 network_thread_(rtc::Thread::CreateWithSocketServer().release()), | 139 network_thread_(rtc::Thread::CreateWithSocketServer().release()), |
| 140 worker_thread_(rtc::Thread::Create().release()), | 140 worker_thread_(rtc::Thread::Create().release()), |
| 141 signaling_thread_(rtc::Thread::Current()), | 141 signaling_thread_(rtc::Thread::Current()), |
| 142 low_priority_worker_queue_("low_prio_worker_queue"), |
| 142 audio_encoder_factory_(audio_encoder_factory), | 143 audio_encoder_factory_(audio_encoder_factory), |
| 143 audio_decoder_factory_(audio_decoder_factory) { | 144 audio_decoder_factory_(audio_decoder_factory) { |
| 144 if (!signaling_thread_) { | 145 if (!signaling_thread_) { |
| 145 signaling_thread_ = rtc::ThreadManager::Instance()->WrapCurrentThread(); | 146 signaling_thread_ = rtc::ThreadManager::Instance()->WrapCurrentThread(); |
| 146 wraps_current_thread_ = true; | 147 wraps_current_thread_ = true; |
| 147 } | 148 } |
| 148 network_thread_->Start(); | 149 network_thread_->Start(); |
| 149 worker_thread_->Start(); | 150 worker_thread_->Start(); |
| 150 } | 151 } |
| 151 | 152 |
| 152 PeerConnectionFactory::PeerConnectionFactory( | 153 PeerConnectionFactory::PeerConnectionFactory( |
| 153 rtc::Thread* network_thread, | 154 rtc::Thread* network_thread, |
| 154 rtc::Thread* worker_thread, | 155 rtc::Thread* worker_thread, |
| 155 rtc::Thread* signaling_thread, | 156 rtc::Thread* signaling_thread, |
| 156 AudioDeviceModule* default_adm, | 157 AudioDeviceModule* default_adm, |
| 157 rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory, | 158 rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory, |
| 158 rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory, | 159 rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory, |
| 159 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, | 160 cricket::WebRtcVideoEncoderFactory* video_encoder_factory, |
| 160 cricket::WebRtcVideoDecoderFactory* video_decoder_factory, | 161 cricket::WebRtcVideoDecoderFactory* video_decoder_factory, |
| 161 rtc::scoped_refptr<AudioMixer> audio_mixer) | 162 rtc::scoped_refptr<AudioMixer> audio_mixer) |
| 162 : owns_ptrs_(false), | 163 : owns_ptrs_(false), |
| 163 wraps_current_thread_(false), | 164 wraps_current_thread_(false), |
| 164 network_thread_(network_thread), | 165 network_thread_(network_thread), |
| 165 worker_thread_(worker_thread), | 166 worker_thread_(worker_thread), |
| 166 signaling_thread_(signaling_thread), | 167 signaling_thread_(signaling_thread), |
| 168 low_priority_worker_queue_("low_prio_worker_queue", |
| 169 rtc::TaskQueue::Priority::LOW), |
| 167 default_adm_(default_adm), | 170 default_adm_(default_adm), |
| 168 audio_encoder_factory_(audio_encoder_factory), | 171 audio_encoder_factory_(audio_encoder_factory), |
| 169 audio_decoder_factory_(audio_decoder_factory), | 172 audio_decoder_factory_(audio_decoder_factory), |
| 170 video_encoder_factory_(video_encoder_factory), | 173 video_encoder_factory_(video_encoder_factory), |
| 171 video_decoder_factory_(video_decoder_factory), | 174 video_decoder_factory_(video_decoder_factory), |
| 172 external_audio_mixer_(audio_mixer) { | 175 external_audio_mixer_(audio_mixer) { |
| 173 RTC_DCHECK(network_thread); | 176 RTC_DCHECK(network_thread); |
| 174 RTC_DCHECK(worker_thread); | 177 RTC_DCHECK(worker_thread); |
| 175 RTC_DCHECK(signaling_thread); | 178 RTC_DCHECK(signaling_thread); |
| 176 // TODO: Currently there is no way creating an external adm in | 179 // TODO: Currently there is no way creating an external adm in |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 | 383 |
| 381 rtc::Thread* PeerConnectionFactory::network_thread() { | 384 rtc::Thread* PeerConnectionFactory::network_thread() { |
| 382 return network_thread_; | 385 return network_thread_; |
| 383 } | 386 } |
| 384 | 387 |
| 385 std::unique_ptr<cricket::MediaEngineInterface> | 388 std::unique_ptr<cricket::MediaEngineInterface> |
| 386 PeerConnectionFactory::CreateMediaEngine_w() { | 389 PeerConnectionFactory::CreateMediaEngine_w() { |
| 387 RTC_DCHECK(worker_thread_ == rtc::Thread::Current()); | 390 RTC_DCHECK(worker_thread_ == rtc::Thread::Current()); |
| 388 return std::unique_ptr<cricket::MediaEngineInterface>( | 391 return std::unique_ptr<cricket::MediaEngineInterface>( |
| 389 cricket::WebRtcMediaEngineFactory::Create( | 392 cricket::WebRtcMediaEngineFactory::Create( |
| 390 default_adm_.get(), audio_encoder_factory_, | 393 default_adm_.get(), audio_encoder_factory_, audio_decoder_factory_, |
| 391 audio_decoder_factory_, | |
| 392 video_encoder_factory_.get(), video_decoder_factory_.get(), | 394 video_encoder_factory_.get(), video_decoder_factory_.get(), |
| 393 external_audio_mixer_)); | 395 external_audio_mixer_, &low_priority_worker_queue_)); |
| 394 } | 396 } |
| 395 | 397 |
| 396 } // namespace webrtc | 398 } // namespace webrtc |
| OLD | NEW |