| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // TODO: Need to make sure only one VoE is created inside | 169 // TODO: Need to make sure only one VoE is created inside |
| 170 // WebRtcMediaEngine. | 170 // WebRtcMediaEngine. |
| 171 cricket::MediaEngineInterface* media_engine = | 171 cricket::MediaEngineInterface* media_engine = |
| 172 worker_thread_->Invoke<cricket::MediaEngineInterface*>(rtc::Bind( | 172 worker_thread_->Invoke<cricket::MediaEngineInterface*>(rtc::Bind( |
| 173 &PeerConnectionFactory::CreateMediaEngine_w, this)); | 173 &PeerConnectionFactory::CreateMediaEngine_w, this)); |
| 174 | 174 |
| 175 channel_manager_.reset( | 175 channel_manager_.reset( |
| 176 new cricket::ChannelManager(media_engine, worker_thread_)); | 176 new cricket::ChannelManager(media_engine, worker_thread_)); |
| 177 | 177 |
| 178 channel_manager_->SetVideoRtxEnabled(true); | 178 channel_manager_->SetVideoRtxEnabled(true); |
| 179 channel_manager_->SetCryptoOptions(options_.crypto_options); |
| 179 if (!channel_manager_->Init()) { | 180 if (!channel_manager_->Init()) { |
| 180 return false; | 181 return false; |
| 181 } | 182 } |
| 182 | 183 |
| 183 dtls_identity_store_ = new RefCountedDtlsIdentityStore( | 184 dtls_identity_store_ = new RefCountedDtlsIdentityStore( |
| 184 signaling_thread_, worker_thread_); | 185 signaling_thread_, worker_thread_); |
| 185 | 186 |
| 186 return true; | 187 return true; |
| 187 } | 188 } |
| 188 | 189 |
| 190 void PeerConnectionFactory::SetOptions(const Options& options) { |
| 191 options_ = options; |
| 192 if (channel_manager_) { |
| 193 channel_manager_->SetCryptoOptions(options.crypto_options); |
| 194 } |
| 195 } |
| 196 |
| 189 rtc::scoped_refptr<AudioSourceInterface> | 197 rtc::scoped_refptr<AudioSourceInterface> |
| 190 PeerConnectionFactory::CreateAudioSource( | 198 PeerConnectionFactory::CreateAudioSource( |
| 191 const MediaConstraintsInterface* constraints) { | 199 const MediaConstraintsInterface* constraints) { |
| 192 RTC_DCHECK(signaling_thread_->IsCurrent()); | 200 RTC_DCHECK(signaling_thread_->IsCurrent()); |
| 193 rtc::scoped_refptr<LocalAudioSource> source( | 201 rtc::scoped_refptr<LocalAudioSource> source( |
| 194 LocalAudioSource::Create(options_, constraints)); | 202 LocalAudioSource::Create(options_, constraints)); |
| 195 return source; | 203 return source; |
| 196 } | 204 } |
| 197 | 205 |
| 198 rtc::scoped_refptr<AudioSourceInterface> | 206 rtc::scoped_refptr<AudioSourceInterface> |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 } | 345 } |
| 338 | 346 |
| 339 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() { | 347 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() { |
| 340 ASSERT(worker_thread_ == rtc::Thread::Current()); | 348 ASSERT(worker_thread_ == rtc::Thread::Current()); |
| 341 return cricket::WebRtcMediaEngineFactory::Create( | 349 return cricket::WebRtcMediaEngineFactory::Create( |
| 342 default_adm_.get(), video_encoder_factory_.get(), | 350 default_adm_.get(), video_encoder_factory_.get(), |
| 343 video_decoder_factory_.get()); | 351 video_decoder_factory_.get()); |
| 344 } | 352 } |
| 345 | 353 |
| 346 } // namespace webrtc | 354 } // namespace webrtc |
| OLD | NEW |