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

Side by Side Diff: talk/app/webrtc/peerconnectionfactory.cc

Issue 1176383004: DtlsIdentityStore[Interface/Impl] updated, DtlsIdentityService to be removed (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Del old requestobserver & service interface (forgot), made global common_name_ const char* Created 5 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
OLDNEW
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 10 matching lines...) Expand all
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #include "talk/app/webrtc/peerconnectionfactory.h" 28 #include "talk/app/webrtc/peerconnectionfactory.h"
29 29
30 #include "talk/app/webrtc/audiotrack.h" 30 #include "talk/app/webrtc/audiotrack.h"
31 #include "talk/app/webrtc/dtlsidentityservice.h"
32 #include "talk/app/webrtc/dtlsidentitystore.h" 31 #include "talk/app/webrtc/dtlsidentitystore.h"
33 #include "talk/app/webrtc/localaudiosource.h" 32 #include "talk/app/webrtc/localaudiosource.h"
34 #include "talk/app/webrtc/mediastreamproxy.h" 33 #include "talk/app/webrtc/mediastreamproxy.h"
35 #include "talk/app/webrtc/mediastreamtrackproxy.h" 34 #include "talk/app/webrtc/mediastreamtrackproxy.h"
36 #include "talk/app/webrtc/peerconnection.h" 35 #include "talk/app/webrtc/peerconnection.h"
37 #include "talk/app/webrtc/peerconnectionfactoryproxy.h" 36 #include "talk/app/webrtc/peerconnectionfactoryproxy.h"
38 #include "talk/app/webrtc/peerconnectionproxy.h" 37 #include "talk/app/webrtc/peerconnectionproxy.h"
39 #include "talk/app/webrtc/portallocatorfactory.h" 38 #include "talk/app/webrtc/portallocatorfactory.h"
40 #include "talk/app/webrtc/videosource.h" 39 #include "talk/app/webrtc/videosource.h"
41 #include "talk/app/webrtc/videosourceproxy.h" 40 #include "talk/app/webrtc/videosourceproxy.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 162
164 channel_manager_.reset(new cricket::ChannelManager( 163 channel_manager_.reset(new cricket::ChannelManager(
165 media_engine, device_manager, worker_thread_)); 164 media_engine, device_manager, worker_thread_));
166 165
167 channel_manager_->SetVideoRtxEnabled(true); 166 channel_manager_->SetVideoRtxEnabled(true);
168 if (!channel_manager_->Init()) { 167 if (!channel_manager_->Init()) {
169 return false; 168 return false;
170 } 169 }
171 170
172 dtls_identity_store_.reset( 171 dtls_identity_store_.reset(
173 new DtlsIdentityStore(signaling_thread_, worker_thread_)); 172 new DtlsIdentityStoreImpl(signaling_thread_, worker_thread_));
174 dtls_identity_store_->Initialize(); 173 dtls_identity_store_->Initialize();
175 174
176 return true; 175 return true;
177 } 176 }
178 177
179 rtc::scoped_refptr<AudioSourceInterface> 178 rtc::scoped_refptr<AudioSourceInterface>
180 PeerConnectionFactory::CreateAudioSource( 179 PeerConnectionFactory::CreateAudioSource(
181 const MediaConstraintsInterface* constraints) { 180 const MediaConstraintsInterface* constraints) {
182 DCHECK(signaling_thread_->IsCurrent()); 181 DCHECK(signaling_thread_->IsCurrent());
183 rtc::scoped_refptr<LocalAudioSource> source( 182 rtc::scoped_refptr<LocalAudioSource> source(
(...skipping 14 matching lines...) Expand all
198 bool PeerConnectionFactory::StartAecDump(rtc::PlatformFile file) { 197 bool PeerConnectionFactory::StartAecDump(rtc::PlatformFile file) {
199 DCHECK(signaling_thread_->IsCurrent()); 198 DCHECK(signaling_thread_->IsCurrent());
200 return channel_manager_->StartAecDump(file); 199 return channel_manager_->StartAecDump(file);
201 } 200 }
202 201
203 rtc::scoped_refptr<PeerConnectionInterface> 202 rtc::scoped_refptr<PeerConnectionInterface>
204 PeerConnectionFactory::CreatePeerConnection( 203 PeerConnectionFactory::CreatePeerConnection(
205 const PeerConnectionInterface::RTCConfiguration& configuration, 204 const PeerConnectionInterface::RTCConfiguration& configuration,
206 const MediaConstraintsInterface* constraints, 205 const MediaConstraintsInterface* constraints,
207 PortAllocatorFactoryInterface* allocator_factory, 206 PortAllocatorFactoryInterface* allocator_factory,
208 DTLSIdentityServiceInterface* dtls_identity_service, 207 DtlsIdentityStoreInterface* dtls_identity_store,
209 PeerConnectionObserver* observer) { 208 PeerConnectionObserver* observer) {
210 DCHECK(signaling_thread_->IsCurrent()); 209 DCHECK(signaling_thread_->IsCurrent());
211 DCHECK(allocator_factory || default_allocator_factory_); 210 DCHECK(allocator_factory || default_allocator_factory_);
212 211
213 if (!dtls_identity_service) { 212 if (!dtls_identity_store) {
214 dtls_identity_service = new DtlsIdentityService(dtls_identity_store_.get()); 213 dtls_identity_store = dtls_identity_store_.get();
215 } 214 }
216 215
217 PortAllocatorFactoryInterface* chosen_allocator_factory = 216 PortAllocatorFactoryInterface* chosen_allocator_factory =
218 allocator_factory ? allocator_factory : default_allocator_factory_.get(); 217 allocator_factory ? allocator_factory : default_allocator_factory_.get();
219 chosen_allocator_factory->SetNetworkIgnoreMask(options_.network_ignore_mask); 218 chosen_allocator_factory->SetNetworkIgnoreMask(options_.network_ignore_mask);
220 219
221 rtc::scoped_refptr<PeerConnection> pc( 220 rtc::scoped_refptr<PeerConnection> pc(
222 new rtc::RefCountedObject<PeerConnection>(this)); 221 new rtc::RefCountedObject<PeerConnection>(this));
223 if (!pc->Initialize( 222 if (!pc->Initialize(
224 configuration, 223 configuration,
225 constraints, 224 constraints,
226 chosen_allocator_factory, 225 chosen_allocator_factory,
227 dtls_identity_service, 226 dtls_identity_store,
228 observer)) { 227 observer)) {
229 return NULL; 228 return NULL;
230 } 229 }
231 return PeerConnectionProxy::Create(signaling_thread(), pc); 230 return PeerConnectionProxy::Create(signaling_thread(), pc);
232 } 231 }
233 232
234 rtc::scoped_refptr<MediaStreamInterface> 233 rtc::scoped_refptr<MediaStreamInterface>
235 PeerConnectionFactory::CreateLocalMediaStream(const std::string& label) { 234 PeerConnectionFactory::CreateLocalMediaStream(const std::string& label) {
236 DCHECK(signaling_thread_->IsCurrent()); 235 DCHECK(signaling_thread_->IsCurrent());
237 return MediaStreamProxy::Create(signaling_thread_, 236 return MediaStreamProxy::Create(signaling_thread_,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 273 }
275 274
276 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() { 275 cricket::MediaEngineInterface* PeerConnectionFactory::CreateMediaEngine_w() {
277 ASSERT(worker_thread_ == rtc::Thread::Current()); 276 ASSERT(worker_thread_ == rtc::Thread::Current());
278 return cricket::WebRtcMediaEngineFactory::Create( 277 return cricket::WebRtcMediaEngineFactory::Create(
279 default_adm_.get(), video_encoder_factory_.get(), 278 default_adm_.get(), video_encoder_factory_.get(),
280 video_decoder_factory_.get()); 279 video_decoder_factory_.get());
281 } 280 }
282 281
283 } // namespace webrtc 282 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698