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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 enum CandidateNetworkPolicy { | 220 enum CandidateNetworkPolicy { |
221 kCandidateNetworkPolicyAll, | 221 kCandidateNetworkPolicyAll, |
222 kCandidateNetworkPolicyLowCost | 222 kCandidateNetworkPolicyLowCost |
223 }; | 223 }; |
224 | 224 |
225 enum ContinualGatheringPolicy { | 225 enum ContinualGatheringPolicy { |
226 GATHER_ONCE, | 226 GATHER_ONCE, |
227 GATHER_CONTINUALLY | 227 GATHER_CONTINUALLY |
228 }; | 228 }; |
229 | 229 |
230 enum class RTCConfigurationType { | |
231 // A configuration that is safer to use, despite it may not have the best | |
pthatcher1
2016/09/01 21:25:49
despite it may not have => despite it not having
honghaiz3
2016/09/01 22:06:29
Done.
| |
232 // performance. Currently this is the default configuration. | |
233 kSafe, | |
234 // An aggressive configuration that has better performance, although it | |
235 // may be riskier and may need extra support in the application. | |
236 kAggressive | |
237 }; | |
238 | |
230 // TODO(hbos): Change into class with private data and public getters. | 239 // TODO(hbos): Change into class with private data and public getters. |
231 // TODO(nisse): In particular, accessing fields directly from an | 240 // TODO(nisse): In particular, accessing fields directly from an |
232 // application is brittle, since the organization mirrors the | 241 // application is brittle, since the organization mirrors the |
233 // organization of the implementation, which isn't stable. So we | 242 // organization of the implementation, which isn't stable. So we |
234 // need getters and setters at least for fields which applications | 243 // need getters and setters at least for fields which applications |
235 // are interested in. | 244 // are interested in. |
236 struct RTCConfiguration { | 245 struct RTCConfiguration { |
237 // This struct is subject to reorganization, both for naming | 246 // This struct is subject to reorganization, both for naming |
238 // consistency, and to group settings to match where they are used | 247 // consistency, and to group settings to match where they are used |
239 // in the implementation. To do that, we need getter and setter | 248 // in the implementation. To do that, we need getter and setter |
240 // methods for all settings which are of interest to applications, | 249 // methods for all settings which are of interest to applications, |
241 // Chrome in particular. | 250 // Chrome in particular. |
242 | 251 |
243 // A configuration that is safer to use, despite it may not have the best | 252 RTCConfiguration() = default; |
244 // performance. | 253 RTCConfiguration(RTCConfigurationType type) { |
245 static RTCConfiguration SafeConfiguration() { return RTCConfiguration(); } | 254 if (type == RTCConfigurationType::kAggressive) { |
246 | 255 redetermine_role_on_ice_restart = false; |
247 // An aggressive configuration that has better performance, although it | 256 } |
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 } | 257 } |
254 | 258 |
255 bool dscp() { return media_config.enable_dscp; } | 259 bool dscp() { return media_config.enable_dscp; } |
256 void set_dscp(bool enable) { media_config.enable_dscp = enable; } | 260 void set_dscp(bool enable) { media_config.enable_dscp = enable; } |
257 | 261 |
258 // TODO(nisse): The corresponding flag in MediaConfig and | 262 // TODO(nisse): The corresponding flag in MediaConfig and |
259 // elsewhere should be renamed enable_cpu_adaptation. | 263 // elsewhere should be renamed enable_cpu_adaptation. |
260 bool cpu_adaptation() { | 264 bool cpu_adaptation() { |
261 return media_config.video.enable_cpu_overuse_detection; | 265 return media_config.video.enable_cpu_overuse_detection; |
262 } | 266 } |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
752 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 756 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
753 cricket::WebRtcVideoDecoderFactory* decoder_factory) { | 757 cricket::WebRtcVideoDecoderFactory* decoder_factory) { |
754 return CreatePeerConnectionFactory( | 758 return CreatePeerConnectionFactory( |
755 worker_and_network_thread, worker_and_network_thread, signaling_thread, | 759 worker_and_network_thread, worker_and_network_thread, signaling_thread, |
756 default_adm, encoder_factory, decoder_factory); | 760 default_adm, encoder_factory, decoder_factory); |
757 } | 761 } |
758 | 762 |
759 } // namespace webrtc | 763 } // namespace webrtc |
760 | 764 |
761 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ | 765 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ |
OLD | NEW |