OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 LOG(LS_INFO) << "Changing IceConnectionState " << ice_connection_state_ | 1469 LOG(LS_INFO) << "Changing IceConnectionState " << ice_connection_state_ |
1470 << " => " << state; | 1470 << " => " << state; |
1471 RTC_DCHECK(ice_connection_state_ != | 1471 RTC_DCHECK(ice_connection_state_ != |
1472 PeerConnectionInterface::kIceConnectionClosed); | 1472 PeerConnectionInterface::kIceConnectionClosed); |
1473 ice_connection_state_ = state; | 1473 ice_connection_state_ = state; |
1474 if (ice_observer_) { | 1474 if (ice_observer_) { |
1475 ice_observer_->OnIceConnectionChange(ice_connection_state_); | 1475 ice_observer_->OnIceConnectionChange(ice_connection_state_); |
1476 } | 1476 } |
1477 } | 1477 } |
1478 | 1478 |
| 1479 void WebRtcSession::SetTransportController( |
| 1480 cricket::TransportController* transport_controller) { |
| 1481 transport_controller_.reset(transport_controller); |
| 1482 transport_controller_->SetIceRole(cricket::ICEROLE_CONTROLLED); |
| 1483 transport_controller_->SignalConnectionState.connect( |
| 1484 this, &WebRtcSession::OnTransportControllerConnectionState); |
| 1485 transport_controller_->SignalReceiving.connect( |
| 1486 this, &WebRtcSession::OnTransportControllerReceiving); |
| 1487 transport_controller_->SignalGatheringState.connect( |
| 1488 this, &WebRtcSession::OnTransportControllerGatheringState); |
| 1489 transport_controller_->SignalCandidatesGathered.connect( |
| 1490 this, &WebRtcSession::OnTransportControllerCandidatesGathered); |
| 1491 transport_controller_->SignalCandidatesRemoved.connect( |
| 1492 this, &WebRtcSession::OnTransportControllerCandidatesRemoved); |
| 1493 } |
| 1494 |
1479 void WebRtcSession::OnTransportControllerConnectionState( | 1495 void WebRtcSession::OnTransportControllerConnectionState( |
1480 cricket::IceConnectionState state) { | 1496 cricket::IceConnectionState state) { |
1481 switch (state) { | 1497 switch (state) { |
1482 case cricket::kIceConnectionConnecting: | 1498 case cricket::kIceConnectionConnecting: |
1483 // If the current state is Connected or Completed, then there were | 1499 // If the current state is Connected or Completed, then there were |
1484 // writable channels but now there are not, so the next state must | 1500 // writable channels but now there are not, so the next state must |
1485 // be Disconnected. | 1501 // be Disconnected. |
1486 // kIceConnectionConnecting is currently used as the default, | 1502 // kIceConnectionConnecting is currently used as the default, |
1487 // un-connected state by the TransportController, so its only use is | 1503 // un-connected state by the TransportController, so its only use is |
1488 // detecting disconnections. | 1504 // detecting disconnections. |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2156 ssl_cipher_suite); | 2172 ssl_cipher_suite); |
2157 } | 2173 } |
2158 } | 2174 } |
2159 | 2175 |
2160 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) { | 2176 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) { |
2161 RTC_DCHECK(worker_thread()->IsCurrent()); | 2177 RTC_DCHECK(worker_thread()->IsCurrent()); |
2162 media_controller_->call_w()->OnSentPacket(sent_packet); | 2178 media_controller_->call_w()->OnSentPacket(sent_packet); |
2163 } | 2179 } |
2164 | 2180 |
2165 } // namespace webrtc | 2181 } // namespace webrtc |
OLD | NEW |