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