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 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 signaling_thread()->Post(RTC_FROM_HERE, this, | 1261 signaling_thread()->Post(RTC_FROM_HERE, this, |
1262 MSG_SET_SESSIONDESCRIPTION_SUCCESS, msg); | 1262 MSG_SET_SESSIONDESCRIPTION_SUCCESS, msg); |
1263 } | 1263 } |
1264 | 1264 |
1265 PeerConnectionInterface::RTCConfiguration PeerConnection::GetConfiguration() { | 1265 PeerConnectionInterface::RTCConfiguration PeerConnection::GetConfiguration() { |
1266 return configuration_; | 1266 return configuration_; |
1267 } | 1267 } |
1268 | 1268 |
1269 bool PeerConnection::SetConfiguration(const RTCConfiguration& configuration) { | 1269 bool PeerConnection::SetConfiguration(const RTCConfiguration& configuration) { |
1270 TRACE_EVENT0("webrtc", "PeerConnection::SetConfiguration"); | 1270 TRACE_EVENT0("webrtc", "PeerConnection::SetConfiguration"); |
| 1271 |
| 1272 if (session_->local_description() && |
| 1273 configuration.ice_candidate_pool_size != |
| 1274 configuration_.ice_candidate_pool_size) { |
| 1275 LOG(LS_ERROR) << "Can't change candidate pool size after calling " |
| 1276 "SetLocalDescription."; |
| 1277 return false; |
| 1278 } |
1271 // TODO(deadbeef): Return false and log an error if there are any unsupported | 1279 // TODO(deadbeef): Return false and log an error if there are any unsupported |
1272 // modifications. | 1280 // modifications. |
1273 if (port_allocator_) { | 1281 if (port_allocator_) { |
1274 if (!network_thread()->Invoke<bool>( | 1282 if (!network_thread()->Invoke<bool>( |
1275 RTC_FROM_HERE, | 1283 RTC_FROM_HERE, |
1276 rtc::Bind(&PeerConnection::ReconfigurePortAllocator_n, this, | 1284 rtc::Bind(&PeerConnection::ReconfigurePortAllocator_n, this, |
1277 configuration))) { | 1285 configuration))) { |
| 1286 LOG(LS_ERROR) << "Failed to apply configuration to PortAllocator."; |
1278 return false; | 1287 return false; |
1279 } | 1288 } |
1280 } | 1289 } |
1281 | 1290 |
1282 // TODO(deadbeef): Shouldn't have to hop to the worker thread twice... | 1291 // TODO(deadbeef): Shouldn't have to hop to the worker thread twice... |
1283 session_->SetIceConfig(session_->ParseIceConfig(configuration)); | 1292 session_->SetIceConfig(session_->ParseIceConfig(configuration)); |
1284 | 1293 |
1285 configuration_ = configuration; | 1294 configuration_ = configuration; |
1286 return true; | 1295 return true; |
1287 } | 1296 } |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2352 const RTCConfiguration& configuration) { | 2361 const RTCConfiguration& configuration) { |
2353 cricket::ServerAddresses stun_servers; | 2362 cricket::ServerAddresses stun_servers; |
2354 std::vector<cricket::RelayServerConfig> turn_servers; | 2363 std::vector<cricket::RelayServerConfig> turn_servers; |
2355 if (!ParseIceServers(configuration.servers, &stun_servers, &turn_servers)) { | 2364 if (!ParseIceServers(configuration.servers, &stun_servers, &turn_servers)) { |
2356 return false; | 2365 return false; |
2357 } | 2366 } |
2358 port_allocator_->set_candidate_filter( | 2367 port_allocator_->set_candidate_filter( |
2359 ConvertIceTransportTypeToCandidateFilter(configuration.type)); | 2368 ConvertIceTransportTypeToCandidateFilter(configuration.type)); |
2360 // Call this last since it may create pooled allocator sessions using the | 2369 // Call this last since it may create pooled allocator sessions using the |
2361 // candidate filter set above. | 2370 // candidate filter set above. |
2362 port_allocator_->SetConfiguration(stun_servers, turn_servers, | 2371 return port_allocator_->SetConfiguration( |
2363 configuration.ice_candidate_pool_size, | 2372 stun_servers, turn_servers, configuration.ice_candidate_pool_size, |
2364 configuration.prune_turn_ports); | 2373 configuration.prune_turn_ports); |
2365 return true; | |
2366 } | 2374 } |
2367 | 2375 |
2368 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, | 2376 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, |
2369 int64_t max_size_bytes) { | 2377 int64_t max_size_bytes) { |
2370 return event_log_->StartLogging(file, max_size_bytes); | 2378 return event_log_->StartLogging(file, max_size_bytes); |
2371 } | 2379 } |
2372 | 2380 |
2373 void PeerConnection::StopRtcEventLog_w() { | 2381 void PeerConnection::StopRtcEventLog_w() { |
2374 event_log_->StopLogging(); | 2382 event_log_->StopLogging(); |
2375 } | 2383 } |
2376 } // namespace webrtc | 2384 } // namespace webrtc |
OLD | NEW |