OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004--2011 Google Inc. | 3 * Copyright 2004--2011 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // TODO: Need to make sure only one VoE is created inside | 194 // TODO: Need to make sure only one VoE is created inside |
195 // WebRtcMediaEngine. | 195 // WebRtcMediaEngine. |
196 cricket::MediaEngineInterface* media_engine = | 196 cricket::MediaEngineInterface* media_engine = |
197 worker_thread_->Invoke<cricket::MediaEngineInterface*>(rtc::Bind( | 197 worker_thread_->Invoke<cricket::MediaEngineInterface*>(rtc::Bind( |
198 &PeerConnectionFactory::CreateMediaEngine_w, this)); | 198 &PeerConnectionFactory::CreateMediaEngine_w, this)); |
199 | 199 |
200 channel_manager_.reset( | 200 channel_manager_.reset( |
201 new cricket::ChannelManager(media_engine, worker_thread_)); | 201 new cricket::ChannelManager(media_engine, worker_thread_)); |
202 | 202 |
203 channel_manager_->SetVideoRtxEnabled(true); | 203 channel_manager_->SetVideoRtxEnabled(true); |
| 204 channel_manager_->SetEnableGcmCryptoSuites(options_.enable_gcm_crypto_suites); |
204 if (!channel_manager_->Init()) { | 205 if (!channel_manager_->Init()) { |
205 return false; | 206 return false; |
206 } | 207 } |
207 | 208 |
208 dtls_identity_store_ = new RefCountedDtlsIdentityStore( | 209 dtls_identity_store_ = new RefCountedDtlsIdentityStore( |
209 signaling_thread_, worker_thread_); | 210 signaling_thread_, worker_thread_); |
210 | 211 |
211 return true; | 212 return true; |
212 } | 213 } |
213 | 214 |
| 215 void PeerConnectionFactory::SetOptions(const Options& options) { |
| 216 options_ = options; |
| 217 if (channel_manager_) { |
| 218 channel_manager_->SetEnableGcmCryptoSuites( |
| 219 options.enable_gcm_crypto_suites); |
| 220 } |
| 221 } |
| 222 |
214 rtc::scoped_refptr<AudioSourceInterface> | 223 rtc::scoped_refptr<AudioSourceInterface> |
215 PeerConnectionFactory::CreateAudioSource( | 224 PeerConnectionFactory::CreateAudioSource( |
216 const MediaConstraintsInterface* constraints) { | 225 const MediaConstraintsInterface* constraints) { |
217 RTC_DCHECK(signaling_thread_->IsCurrent()); | 226 RTC_DCHECK(signaling_thread_->IsCurrent()); |
218 rtc::scoped_refptr<LocalAudioSource> source( | 227 rtc::scoped_refptr<LocalAudioSource> source( |
219 LocalAudioSource::Create(options_, constraints)); | 228 LocalAudioSource::Create(options_, constraints)); |
220 return source; | 229 return source; |
221 } | 230 } |
222 | 231 |
223 rtc::scoped_refptr<VideoSourceInterface> | 232 rtc::scoped_refptr<VideoSourceInterface> |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 } | 372 } |
364 | 373 |
365 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() { | 374 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() { |
366 ASSERT(worker_thread_ == rtc::Thread::Current()); | 375 ASSERT(worker_thread_ == rtc::Thread::Current()); |
367 return cricket::WebRtcMediaEngineFactory::Create( | 376 return cricket::WebRtcMediaEngineFactory::Create( |
368 default_adm_.get(), video_encoder_factory_.get(), | 377 default_adm_.get(), video_encoder_factory_.get(), |
369 video_decoder_factory_.get()); | 378 video_decoder_factory_.get()); |
370 } | 379 } |
371 | 380 |
372 } // namespace webrtc | 381 } // namespace webrtc |
OLD | NEW |