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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // organization of the implementation, which isn't stable. So we | 233 // organization of the implementation, which isn't stable. So we |
234 // need getters and setters at least for fields which applications | 234 // need getters and setters at least for fields which applications |
235 // are interested in. | 235 // are interested in. |
236 struct RTCConfiguration { | 236 struct RTCConfiguration { |
237 // This struct is subject to reorganization, both for naming | 237 // This struct is subject to reorganization, both for naming |
238 // consistency, and to group settings to match where they are used | 238 // consistency, and to group settings to match where they are used |
239 // in the implementation. To do that, we need getter and setter | 239 // in the implementation. To do that, we need getter and setter |
240 // methods for all settings which are of interest to applications, | 240 // methods for all settings which are of interest to applications, |
241 // Chrome in particular. | 241 // Chrome in particular. |
242 | 242 |
| 243 // A configuration that is safer to use, despite it may not have the best |
| 244 // performance. |
| 245 static RTCConfiguration SafeConfiguration() { return RTCConfiguration(); } |
| 246 |
| 247 // An aggressive configuration that has better performance, although it |
| 248 // may be riskier and may need extra support in the application. |
| 249 static RTCConfiguration AggressiveConfiguration() { |
| 250 RTCConfiguration config; |
| 251 config.redetermine_role_on_ice_restart = false; |
| 252 return config; |
| 253 } |
| 254 |
243 bool dscp() { return media_config.enable_dscp; } | 255 bool dscp() { return media_config.enable_dscp; } |
244 void set_dscp(bool enable) { media_config.enable_dscp = enable; } | 256 void set_dscp(bool enable) { media_config.enable_dscp = enable; } |
245 | 257 |
246 // TODO(nisse): The corresponding flag in MediaConfig and | 258 // TODO(nisse): The corresponding flag in MediaConfig and |
247 // elsewhere should be renamed enable_cpu_adaptation. | 259 // elsewhere should be renamed enable_cpu_adaptation. |
248 bool cpu_adaptation() { | 260 bool cpu_adaptation() { |
249 return media_config.video.enable_cpu_overuse_detection; | 261 return media_config.video.enable_cpu_overuse_detection; |
250 } | 262 } |
251 void set_cpu_adaptation(bool enable) { | 263 void set_cpu_adaptation(bool enable) { |
252 media_config.video.enable_cpu_overuse_detection = enable; | 264 media_config.video.enable_cpu_overuse_detection = enable; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 bool enable_rtp_data_channel = false; | 310 bool enable_rtp_data_channel = false; |
299 bool enable_quic = false; | 311 bool enable_quic = false; |
300 rtc::Optional<int> screencast_min_bitrate; | 312 rtc::Optional<int> screencast_min_bitrate; |
301 rtc::Optional<bool> combined_audio_video_bwe; | 313 rtc::Optional<bool> combined_audio_video_bwe; |
302 rtc::Optional<bool> enable_dtls_srtp; | 314 rtc::Optional<bool> enable_dtls_srtp; |
303 int ice_candidate_pool_size = 0; | 315 int ice_candidate_pool_size = 0; |
304 bool prune_turn_ports = false; | 316 bool prune_turn_ports = false; |
305 // If set to true, this means the ICE transport should presume TURN-to-TURN | 317 // If set to true, this means the ICE transport should presume TURN-to-TURN |
306 // candidate pairs will succeed, even before a binding response is received. | 318 // candidate pairs will succeed, even before a binding response is received. |
307 bool presume_writable_when_fully_relayed = false; | 319 bool presume_writable_when_fully_relayed = false; |
| 320 // If true, ICE role is redetermined when peerconnection sets a local |
| 321 // transport description that indicates an ICE restart. |
| 322 bool redetermine_role_on_ice_restart = true; |
308 }; | 323 }; |
309 | 324 |
310 struct RTCOfferAnswerOptions { | 325 struct RTCOfferAnswerOptions { |
311 static const int kUndefined = -1; | 326 static const int kUndefined = -1; |
312 static const int kMaxOfferToReceiveMedia = 1; | 327 static const int kMaxOfferToReceiveMedia = 1; |
313 | 328 |
314 // The default value for constraint offerToReceiveX:true. | 329 // The default value for constraint offerToReceiveX:true. |
315 static const int kOfferToReceiveMediaTrue = 1; | 330 static const int kOfferToReceiveMediaTrue = 1; |
316 | 331 |
317 int offer_to_receive_video; | 332 int offer_to_receive_video; |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 754 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
740 cricket::WebRtcVideoDecoderFactory* decoder_factory) { | 755 cricket::WebRtcVideoDecoderFactory* decoder_factory) { |
741 return CreatePeerConnectionFactory( | 756 return CreatePeerConnectionFactory( |
742 worker_and_network_thread, worker_and_network_thread, signaling_thread, | 757 worker_and_network_thread, worker_and_network_thread, signaling_thread, |
743 default_adm, encoder_factory, decoder_factory); | 758 default_adm, encoder_factory, decoder_factory); |
744 } | 759 } |
745 | 760 |
746 } // namespace webrtc | 761 } // namespace webrtc |
747 | 762 |
748 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ | 763 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ |
OLD | NEW |