OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 if (mediastream_signaling_) | 341 if (mediastream_signaling_) |
342 mediastream_signaling_->TearDown(); | 342 mediastream_signaling_->TearDown(); |
343 if (stream_handler_container_) | 343 if (stream_handler_container_) |
344 stream_handler_container_->TearDown(); | 344 stream_handler_container_->TearDown(); |
345 } | 345 } |
346 | 346 |
347 bool PeerConnection::Initialize( | 347 bool PeerConnection::Initialize( |
348 const PeerConnectionInterface::RTCConfiguration& configuration, | 348 const PeerConnectionInterface::RTCConfiguration& configuration, |
349 const MediaConstraintsInterface* constraints, | 349 const MediaConstraintsInterface* constraints, |
350 PortAllocatorFactoryInterface* allocator_factory, | 350 PortAllocatorFactoryInterface* allocator_factory, |
351 DTLSIdentityServiceInterface* dtls_identity_service, | 351 DtlsIdentityStoreInterface* dtls_identity_store, |
352 PeerConnectionObserver* observer) { | 352 PeerConnectionObserver* observer) { |
353 ASSERT(observer != NULL); | 353 ASSERT(observer != NULL); |
354 if (!observer) | 354 if (!observer) |
355 return false; | 355 return false; |
356 observer_ = observer; | 356 observer_ = observer; |
357 | 357 |
358 std::vector<PortAllocatorFactoryInterface::StunConfiguration> stun_config; | 358 std::vector<PortAllocatorFactoryInterface::StunConfiguration> stun_config; |
359 std::vector<PortAllocatorFactoryInterface::TurnConfiguration> turn_config; | 359 std::vector<PortAllocatorFactoryInterface::TurnConfiguration> turn_config; |
360 if (!ParseIceServers(configuration.servers, &stun_config, &turn_config)) { | 360 if (!ParseIceServers(configuration.servers, &stun_config, &turn_config)) { |
361 return false; | 361 return false; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 factory_->signaling_thread(), | 397 factory_->signaling_thread(), |
398 factory_->worker_thread(), | 398 factory_->worker_thread(), |
399 port_allocator_.get(), | 399 port_allocator_.get(), |
400 mediastream_signaling_.get())); | 400 mediastream_signaling_.get())); |
401 stream_handler_container_.reset(new MediaStreamHandlerContainer( | 401 stream_handler_container_.reset(new MediaStreamHandlerContainer( |
402 session_.get(), session_.get())); | 402 session_.get(), session_.get())); |
403 stats_.reset(new StatsCollector(session_.get())); | 403 stats_.reset(new StatsCollector(session_.get())); |
404 | 404 |
405 // Initialize the WebRtcSession. It creates transport channels etc. | 405 // Initialize the WebRtcSession. It creates transport channels etc. |
406 if (!session_->Initialize(factory_->options(), constraints, | 406 if (!session_->Initialize(factory_->options(), constraints, |
407 dtls_identity_service, configuration)) | 407 dtls_identity_store, configuration)) |
408 return false; | 408 return false; |
409 | 409 |
410 // Register PeerConnection as receiver of local ice candidates. | 410 // Register PeerConnection as receiver of local ice candidates. |
411 // All the callbacks will be posted to the application from PeerConnection. | 411 // All the callbacks will be posted to the application from PeerConnection. |
412 session_->RegisterIceObserver(this); | 412 session_->RegisterIceObserver(this); |
413 session_->SignalState.connect(this, &PeerConnection::OnSessionStateChange); | 413 session_->SignalState.connect(this, &PeerConnection::OnSessionStateChange); |
414 return true; | 414 return true; |
415 } | 415 } |
416 | 416 |
417 rtc::scoped_refptr<StreamCollectionInterface> | 417 rtc::scoped_refptr<StreamCollectionInterface> |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 if (ice_gathering_state_ != kIceGatheringComplete) { | 895 if (ice_gathering_state_ != kIceGatheringComplete) { |
896 ice_gathering_state_ = kIceGatheringComplete; | 896 ice_gathering_state_ = kIceGatheringComplete; |
897 observer_->OnIceGatheringChange(ice_gathering_state_); | 897 observer_->OnIceGatheringChange(ice_gathering_state_); |
898 } | 898 } |
899 } | 899 } |
900 observer_->OnSignalingChange(signaling_state_); | 900 observer_->OnSignalingChange(signaling_state_); |
901 observer_->OnStateChange(PeerConnectionObserver::kSignalingState); | 901 observer_->OnStateChange(PeerConnectionObserver::kSignalingState); |
902 } | 902 } |
903 | 903 |
904 } // namespace webrtc | 904 } // namespace webrtc |
OLD | NEW |