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 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 } | 1383 } |
1384 ice_gathering_state_ = new_state; | 1384 ice_gathering_state_ = new_state; |
1385 observer_->OnIceGatheringChange(ice_gathering_state_); | 1385 observer_->OnIceGatheringChange(ice_gathering_state_); |
1386 } | 1386 } |
1387 | 1387 |
1388 void PeerConnection::OnIceCandidate(const IceCandidateInterface* candidate) { | 1388 void PeerConnection::OnIceCandidate(const IceCandidateInterface* candidate) { |
1389 RTC_DCHECK(signaling_thread()->IsCurrent()); | 1389 RTC_DCHECK(signaling_thread()->IsCurrent()); |
1390 observer_->OnIceCandidate(candidate); | 1390 observer_->OnIceCandidate(candidate); |
1391 } | 1391 } |
1392 | 1392 |
1393 void PeerConnection::OnIceComplete() { | |
1394 RTC_DCHECK(signaling_thread()->IsCurrent()); | |
1395 observer_->OnIceComplete(); | |
1396 } | |
1397 | |
1398 void PeerConnection::OnIceConnectionReceivingChange(bool receiving) { | 1393 void PeerConnection::OnIceConnectionReceivingChange(bool receiving) { |
1399 RTC_DCHECK(signaling_thread()->IsCurrent()); | 1394 RTC_DCHECK(signaling_thread()->IsCurrent()); |
1400 observer_->OnIceConnectionReceivingChange(receiving); | 1395 observer_->OnIceConnectionReceivingChange(receiving); |
1401 } | 1396 } |
1402 | 1397 |
1403 void PeerConnection::ChangeSignalingState( | 1398 void PeerConnection::ChangeSignalingState( |
1404 PeerConnectionInterface::SignalingState signaling_state) { | 1399 PeerConnectionInterface::SignalingState signaling_state) { |
1405 signaling_state_ = signaling_state; | 1400 signaling_state_ = signaling_state; |
1406 if (signaling_state == kClosed) { | 1401 if (signaling_state == kClosed) { |
1407 ice_connection_state_ = kIceConnectionClosed; | 1402 ice_connection_state_ = kIceConnectionClosed; |
1408 observer_->OnIceConnectionChange(ice_connection_state_); | 1403 observer_->OnIceConnectionChange(ice_connection_state_); |
1409 if (ice_gathering_state_ != kIceGatheringComplete) { | 1404 if (ice_gathering_state_ != kIceGatheringComplete) { |
1410 ice_gathering_state_ = kIceGatheringComplete; | 1405 ice_gathering_state_ = kIceGatheringComplete; |
1411 observer_->OnIceGatheringChange(ice_gathering_state_); | 1406 observer_->OnIceGatheringChange(ice_gathering_state_); |
1412 } | 1407 } |
1413 } | 1408 } |
1414 observer_->OnSignalingChange(signaling_state_); | 1409 observer_->OnSignalingChange(signaling_state_); |
1415 observer_->OnStateChange(PeerConnectionObserver::kSignalingState); | |
1416 } | 1410 } |
1417 | 1411 |
1418 void PeerConnection::OnAudioTrackAdded(AudioTrackInterface* track, | 1412 void PeerConnection::OnAudioTrackAdded(AudioTrackInterface* track, |
1419 MediaStreamInterface* stream) { | 1413 MediaStreamInterface* stream) { |
1420 auto sender = FindSenderForTrack(track); | 1414 auto sender = FindSenderForTrack(track); |
1421 if (sender != senders_.end()) { | 1415 if (sender != senders_.end()) { |
1422 // We already have a sender for this track, so just change the stream_id | 1416 // We already have a sender for this track, so just change the stream_id |
1423 // so that it's correct in the next call to CreateOffer. | 1417 // so that it's correct in the next call to CreateOffer. |
1424 (*sender)->set_stream_id(stream->label()); | 1418 (*sender)->set_stream_id(stream->label()); |
1425 return; | 1419 return; |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2088 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { | 2082 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { |
2089 for (const auto& channel : sctp_data_channels_) { | 2083 for (const auto& channel : sctp_data_channels_) { |
2090 if (channel->id() == sid) { | 2084 if (channel->id() == sid) { |
2091 return channel; | 2085 return channel; |
2092 } | 2086 } |
2093 } | 2087 } |
2094 return nullptr; | 2088 return nullptr; |
2095 } | 2089 } |
2096 | 2090 |
2097 } // namespace webrtc | 2091 } // namespace webrtc |
OLD | NEW |