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 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1121 std::string error; | 1121 std::string error; |
1122 bool res = transport_controller_->RemoveRemoteCandidates(candidates, &error); | 1122 bool res = transport_controller_->RemoveRemoteCandidates(candidates, &error); |
1123 if (!res && !error.empty()) { | 1123 if (!res && !error.empty()) { |
1124 LOG(LS_ERROR) << "Error when removing remote candidates: " << error; | 1124 LOG(LS_ERROR) << "Error when removing remote candidates: " << error; |
1125 } | 1125 } |
1126 return true; | 1126 return true; |
1127 } | 1127 } |
1128 | 1128 |
1129 cricket::IceConfig WebRtcSession::ParseIceConfig( | 1129 cricket::IceConfig WebRtcSession::ParseIceConfig( |
1130 const PeerConnectionInterface::RTCConfiguration& config) const { | 1130 const PeerConnectionInterface::RTCConfiguration& config) const { |
1131 cricket::IceConfig ice_config; | 1131 cricket::ContinualGatheringPolicy gathering_policy; |
1132 ice_config.receiving_timeout = config.ice_connection_receiving_timeout; | 1132 // TODO(honghaiz): Add the third continual gathering policy in |
1133 ice_config.prioritize_most_likely_candidate_pairs = | 1133 // PeerConnectionInterface and map it to GATHER_CONTINUALLY_AND_RECOVER. |
1134 config.prioritize_most_likely_ice_candidate_pairs; | 1134 switch (config.continual_gathering_policy) { |
1135 ice_config.backup_connection_ping_interval = | 1135 case PeerConnectionInterface::GATHER_ONCE: |
1136 config.ice_backup_candidate_pair_ping_interval; | 1136 gathering_policy = cricket::GATHER_ONCE; |
1137 ice_config.gather_continually = (config.continual_gathering_policy == | 1137 break; |
1138 PeerConnectionInterface::GATHER_CONTINUALLY); | 1138 case PeerConnectionInterface::GATHER_CONTINUALLY: |
1139 return ice_config; | 1139 gathering_policy = cricket::GATHER_CONTINUALLY; |
1140 break; | |
1141 default: | |
1142 RTC_DCHECK(false); | |
1143 gathering_policy = cricket::GATHER_ONCE; | |
1144 } | |
1145 return cricket::IceConfig( | |
1146 config.ice_connection_receiving_timeout, | |
1147 config.ice_backup_candidate_pair_ping_interval, gathering_policy, | |
1148 config.prioritize_most_likely_ice_candidate_pairs, | |
1149 -1 /* stable_writable_connection_ping_interval_ms */, | |
1150 false /* presumed_writable_when_fully_relayed */, | |
1151 -1 /* regather_on_failed_networks_interval */); | |
pthatcher1
2016/06/29 18:53:27
This seems less readable to me. Setting them each
honghaiz3
2016/06/29 20:19:22
Done.
| |
1140 } | 1152 } |
1141 | 1153 |
1142 void WebRtcSession::SetIceConfig(const cricket::IceConfig& config) { | 1154 void WebRtcSession::SetIceConfig(const cricket::IceConfig& config) { |
1143 transport_controller_->SetIceConfig(config); | 1155 transport_controller_->SetIceConfig(config); |
1144 } | 1156 } |
1145 | 1157 |
1146 void WebRtcSession::MaybeStartGathering() { | 1158 void WebRtcSession::MaybeStartGathering() { |
1147 transport_controller_->MaybeStartGathering(); | 1159 transport_controller_->MaybeStartGathering(); |
1148 } | 1160 } |
1149 | 1161 |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1987 ssl_cipher_suite); | 1999 ssl_cipher_suite); |
1988 } | 2000 } |
1989 } | 2001 } |
1990 | 2002 |
1991 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) { | 2003 void WebRtcSession::OnSentPacket_w(const rtc::SentPacket& sent_packet) { |
1992 RTC_DCHECK(worker_thread()->IsCurrent()); | 2004 RTC_DCHECK(worker_thread()->IsCurrent()); |
1993 media_controller_->call_w()->OnSentPacket(sent_packet); | 2005 media_controller_->call_w()->OnSentPacket(sent_packet); |
1994 } | 2006 } |
1995 | 2007 |
1996 } // namespace webrtc | 2008 } // namespace webrtc |
OLD | NEW |