| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 #include "webrtc/api/mediastreaminterface.h" | 63 #include "webrtc/api/mediastreaminterface.h" |
| 64 #include "webrtc/api/rtpreceiverinterface.h" | 64 #include "webrtc/api/rtpreceiverinterface.h" |
| 65 #include "webrtc/api/rtpsenderinterface.h" | 65 #include "webrtc/api/rtpsenderinterface.h" |
| 66 #include "webrtc/api/statstypes.h" | 66 #include "webrtc/api/statstypes.h" |
| 67 #include "webrtc/api/umametrics.h" | 67 #include "webrtc/api/umametrics.h" |
| 68 #include "webrtc/base/fileutils.h" | 68 #include "webrtc/base/fileutils.h" |
| 69 #include "webrtc/base/network.h" | 69 #include "webrtc/base/network.h" |
| 70 #include "webrtc/base/rtccertificate.h" | 70 #include "webrtc/base/rtccertificate.h" |
| 71 #include "webrtc/base/socketaddress.h" | 71 #include "webrtc/base/socketaddress.h" |
| 72 #include "webrtc/base/sslstreamadapter.h" | 72 #include "webrtc/base/sslstreamadapter.h" |
| 73 #include "webrtc/media/base/mediachannel.h" |
| 73 #include "webrtc/p2p/base/portallocator.h" | 74 #include "webrtc/p2p/base/portallocator.h" |
| 74 | 75 |
| 75 namespace rtc { | 76 namespace rtc { |
| 76 class SSLIdentity; | 77 class SSLIdentity; |
| 77 class Thread; | 78 class Thread; |
| 78 } | 79 } |
| 79 | 80 |
| 80 namespace cricket { | 81 namespace cricket { |
| 81 class WebRtcVideoDecoderFactory; | 82 class WebRtcVideoDecoderFactory; |
| 82 class WebRtcVideoEncoderFactory; | 83 class WebRtcVideoEncoderFactory; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 kTcpCandidatePolicyEnabled, | 216 kTcpCandidatePolicyEnabled, |
| 216 kTcpCandidatePolicyDisabled | 217 kTcpCandidatePolicyDisabled |
| 217 }; | 218 }; |
| 218 | 219 |
| 219 enum ContinualGatheringPolicy { | 220 enum ContinualGatheringPolicy { |
| 220 GATHER_ONCE, | 221 GATHER_ONCE, |
| 221 GATHER_CONTINUALLY | 222 GATHER_CONTINUALLY |
| 222 }; | 223 }; |
| 223 | 224 |
| 224 // TODO(hbos): Change into class with private data and public getters. | 225 // TODO(hbos): Change into class with private data and public getters. |
| 226 // TODO(nisse): In particular, accessing fields directly from an |
| 227 // application is brittle, since the organization mirrors the |
| 228 // organization of the implementation, which isn't stable. So we |
| 229 // need getters and setters at least for fields which applications |
| 230 // are interested in. |
| 225 struct RTCConfiguration { | 231 struct RTCConfiguration { |
| 226 // This struct is subject to reorganization, both for naming | 232 // This struct is subject to reorganization, both for naming |
| 227 // consistency, and to group settings to match where they are used | 233 // consistency, and to group settings to match where they are used |
| 228 // in the implementation. To do that, we need getter and setter | 234 // in the implementation. To do that, we need getter and setter |
| 229 // methods for all settings which are of interest to applications, | 235 // methods for all settings which are of interest to applications, |
| 230 // Chrome in particular. | 236 // Chrome in particular. |
| 231 | 237 |
| 232 bool dscp() { return enable_dscp.value_or(false); } | 238 bool dscp() { return media_config.enable_dscp; } |
| 233 void set_dscp(bool enable) { enable_dscp = rtc::Optional<bool>(enable); } | 239 void set_dscp(bool enable) { media_config.enable_dscp = enable; } |
| 234 | 240 |
| 235 // TODO(nisse): The corresponding flag in MediaConfig and | 241 // TODO(nisse): The corresponding flag in MediaConfig and |
| 236 // elsewhere should be renamed enable_cpu_adaptation. | 242 // elsewhere should be renamed enable_cpu_adaptation. |
| 237 bool cpu_adaptation() { return cpu_overuse_detection.value_or(true); } | 243 bool cpu_adaptation() { |
| 244 return media_config.video.enable_cpu_overuse_detection; |
| 245 } |
| 238 void set_cpu_adaptation(bool enable) { | 246 void set_cpu_adaptation(bool enable) { |
| 239 cpu_overuse_detection = rtc::Optional<bool>(enable); | 247 media_config.video.enable_cpu_overuse_detection = enable; |
| 240 } | 248 } |
| 241 | 249 |
| 242 // TODO(nisse): Currently no getter method, since it collides with | 250 bool suspend_below_min_bitrate() { |
| 243 // the flag itself. Add when the flag is moved to MediaConfig. | 251 return media_config.video.suspend_below_min_bitrate; |
| 252 } |
| 244 void set_suspend_below_min_bitrate(bool enable) { | 253 void set_suspend_below_min_bitrate(bool enable) { |
| 245 suspend_below_min_bitrate = rtc::Optional<bool>(enable); | 254 media_config.video.suspend_below_min_bitrate = enable; |
| 246 } | 255 } |
| 247 | 256 |
| 248 // TODO(nisse): The negation in the corresponding MediaConfig | 257 // TODO(nisse): The negation in the corresponding MediaConfig |
| 249 // attribute is inconsistent, and it should be renamed at some | 258 // attribute is inconsistent, and it should be renamed at some |
| 250 // point. | 259 // point. |
| 251 bool prerenderer_smoothing() { return !disable_prerenderer_smoothing; } | 260 bool prerenderer_smoothing() { |
| 261 return !media_config.video.disable_prerenderer_smoothing; |
| 262 } |
| 252 void set_prerenderer_smoothing(bool enable) { | 263 void set_prerenderer_smoothing(bool enable) { |
| 253 disable_prerenderer_smoothing = !enable; | 264 media_config.video.disable_prerenderer_smoothing = !enable; |
| 254 } | 265 } |
| 255 | 266 |
| 256 static const int kUndefined = -1; | 267 static const int kUndefined = -1; |
| 257 // Default maximum number of packets in the audio jitter buffer. | 268 // Default maximum number of packets in the audio jitter buffer. |
| 258 static const int kAudioJitterBufferMaxPackets = 50; | 269 static const int kAudioJitterBufferMaxPackets = 50; |
| 259 // TODO(pthatcher): Rename this ice_transport_type, but update | 270 // TODO(pthatcher): Rename this ice_transport_type, but update |
| 260 // Chromium at the same time. | 271 // Chromium at the same time. |
| 261 IceTransportsType type; | 272 IceTransportsType type; |
| 262 // TODO(pthatcher): Rename this ice_servers, but update Chromium | 273 // TODO(pthatcher): Rename this ice_servers, but update Chromium |
| 263 // at the same time. | 274 // at the same time. |
| 264 IceServers servers; | 275 IceServers servers; |
| 265 BundlePolicy bundle_policy; | 276 BundlePolicy bundle_policy; |
| 266 RtcpMuxPolicy rtcp_mux_policy; | 277 RtcpMuxPolicy rtcp_mux_policy; |
| 267 TcpCandidatePolicy tcp_candidate_policy; | 278 TcpCandidatePolicy tcp_candidate_policy; |
| 268 int audio_jitter_buffer_max_packets; | 279 int audio_jitter_buffer_max_packets; |
| 269 bool audio_jitter_buffer_fast_accelerate; | 280 bool audio_jitter_buffer_fast_accelerate; |
| 270 int ice_connection_receiving_timeout; // ms | 281 int ice_connection_receiving_timeout; // ms |
| 271 int ice_backup_candidate_pair_ping_interval; // ms | 282 int ice_backup_candidate_pair_ping_interval; // ms |
| 272 ContinualGatheringPolicy continual_gathering_policy; | 283 ContinualGatheringPolicy continual_gathering_policy; |
| 273 std::vector<rtc::scoped_refptr<rtc::RTCCertificate>> certificates; | 284 std::vector<rtc::scoped_refptr<rtc::RTCCertificate>> certificates; |
| 274 bool disable_prerenderer_smoothing; | |
| 275 bool prioritize_most_likely_ice_candidate_pairs; | 285 bool prioritize_most_likely_ice_candidate_pairs; |
| 286 struct cricket::MediaConfig media_config; |
| 276 // Flags corresponding to values set by constraint flags. | 287 // Flags corresponding to values set by constraint flags. |
| 277 // rtc::Optional flags can be "missing", in which case the webrtc | 288 // rtc::Optional flags can be "missing", in which case the webrtc |
| 278 // default applies. | 289 // default applies. |
| 279 bool disable_ipv6; | 290 bool disable_ipv6; |
| 280 rtc::Optional<bool> enable_dscp; | |
| 281 bool enable_rtp_data_channel; | 291 bool enable_rtp_data_channel; |
| 282 rtc::Optional<bool> cpu_overuse_detection; | |
| 283 rtc::Optional<bool> suspend_below_min_bitrate; | |
| 284 rtc::Optional<int> screencast_min_bitrate; | 292 rtc::Optional<int> screencast_min_bitrate; |
| 285 rtc::Optional<bool> combined_audio_video_bwe; | 293 rtc::Optional<bool> combined_audio_video_bwe; |
| 286 rtc::Optional<bool> enable_dtls_srtp; | 294 rtc::Optional<bool> enable_dtls_srtp; |
| 287 RTCConfiguration() | 295 RTCConfiguration() |
| 288 : type(kAll), | 296 : type(kAll), |
| 289 bundle_policy(kBundlePolicyBalanced), | 297 bundle_policy(kBundlePolicyBalanced), |
| 290 rtcp_mux_policy(kRtcpMuxPolicyNegotiate), | 298 rtcp_mux_policy(kRtcpMuxPolicyNegotiate), |
| 291 tcp_candidate_policy(kTcpCandidatePolicyEnabled), | 299 tcp_candidate_policy(kTcpCandidatePolicyEnabled), |
| 292 audio_jitter_buffer_max_packets(kAudioJitterBufferMaxPackets), | 300 audio_jitter_buffer_max_packets(kAudioJitterBufferMaxPackets), |
| 293 audio_jitter_buffer_fast_accelerate(false), | 301 audio_jitter_buffer_fast_accelerate(false), |
| 294 ice_connection_receiving_timeout(kUndefined), | 302 ice_connection_receiving_timeout(kUndefined), |
| 295 ice_backup_candidate_pair_ping_interval(kUndefined), | 303 ice_backup_candidate_pair_ping_interval(kUndefined), |
| 296 continual_gathering_policy(GATHER_ONCE), | 304 continual_gathering_policy(GATHER_ONCE), |
| 297 disable_prerenderer_smoothing(false), | |
| 298 prioritize_most_likely_ice_candidate_pairs(false), | 305 prioritize_most_likely_ice_candidate_pairs(false), |
| 299 disable_ipv6(false), | 306 disable_ipv6(false), |
| 300 enable_rtp_data_channel(false) {} | 307 enable_rtp_data_channel(false) {} |
| 301 }; | 308 }; |
| 302 | 309 |
| 303 struct RTCOfferAnswerOptions { | 310 struct RTCOfferAnswerOptions { |
| 304 static const int kUndefined = -1; | 311 static const int kUndefined = -1; |
| 305 static const int kMaxOfferToReceiveMedia = 1; | 312 static const int kMaxOfferToReceiveMedia = 1; |
| 306 | 313 |
| 307 // The default value for constraint offerToReceiveX:true. | 314 // The default value for constraint offerToReceiveX:true. |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 CreatePeerConnectionFactory( | 694 CreatePeerConnectionFactory( |
| 688 rtc::Thread* worker_thread, | 695 rtc::Thread* worker_thread, |
| 689 rtc::Thread* signaling_thread, | 696 rtc::Thread* signaling_thread, |
| 690 AudioDeviceModule* default_adm, | 697 AudioDeviceModule* default_adm, |
| 691 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 698 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
| 692 cricket::WebRtcVideoDecoderFactory* decoder_factory); | 699 cricket::WebRtcVideoDecoderFactory* decoder_factory); |
| 693 | 700 |
| 694 } // namespace webrtc | 701 } // namespace webrtc |
| 695 | 702 |
| 696 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ | 703 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ |
| OLD | NEW |