Chromium Code Reviews| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 214 enum TcpCandidatePolicy { | 214 enum TcpCandidatePolicy { |
| 215 kTcpCandidatePolicyEnabled, | 215 kTcpCandidatePolicyEnabled, |
| 216 kTcpCandidatePolicyDisabled | 216 kTcpCandidatePolicyDisabled |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 enum ContinualGatheringPolicy { | 219 enum ContinualGatheringPolicy { |
| 220 GATHER_ONCE, | 220 GATHER_ONCE, |
| 221 GATHER_CONTINUALLY | 221 GATHER_CONTINUALLY |
| 222 }; | 222 }; |
| 223 | 223 |
| 224 // TODO(hbos): Change into class with private data and public getters. | 224 // TODO(hbos): Change into class with private data and public getters. |
|
hta-webrtc
2016/02/25 14:32:42
Since this class forms part of webrtc's public int
| |
| 225 struct RTCConfiguration { | 225 struct RTCConfiguration { |
| 226 static const int kUndefined = -1; | 226 static const int kUndefined = -1; |
| 227 // Default maximum number of packets in the audio jitter buffer. | 227 // Default maximum number of packets in the audio jitter buffer. |
| 228 static const int kAudioJitterBufferMaxPackets = 50; | 228 static const int kAudioJitterBufferMaxPackets = 50; |
| 229 // TODO(pthatcher): Rename this ice_transport_type, but update | 229 // TODO(pthatcher): Rename this ice_transport_type, but update |
| 230 // Chromium at the same time. | 230 // Chromium at the same time. |
| 231 IceTransportsType type; | 231 IceTransportsType type; |
| 232 // TODO(pthatcher): Rename this ice_servers, but update Chromium | 232 // TODO(pthatcher): Rename this ice_servers, but update Chromium |
| 233 // at the same time. | 233 // at the same time. |
| 234 IceServers servers; | 234 IceServers servers; |
| 235 BundlePolicy bundle_policy; | 235 BundlePolicy bundle_policy; |
| 236 RtcpMuxPolicy rtcp_mux_policy; | 236 RtcpMuxPolicy rtcp_mux_policy; |
| 237 TcpCandidatePolicy tcp_candidate_policy; | 237 TcpCandidatePolicy tcp_candidate_policy; |
| 238 int audio_jitter_buffer_max_packets; | 238 int audio_jitter_buffer_max_packets; |
| 239 bool audio_jitter_buffer_fast_accelerate; | 239 bool audio_jitter_buffer_fast_accelerate; |
| 240 int ice_connection_receiving_timeout; // ms | 240 int ice_connection_receiving_timeout; // ms |
| 241 int ice_backup_candidate_pair_ping_interval; // ms | 241 int ice_backup_candidate_pair_ping_interval; // ms |
| 242 ContinualGatheringPolicy continual_gathering_policy; | 242 ContinualGatheringPolicy continual_gathering_policy; |
| 243 std::vector<rtc::scoped_refptr<rtc::RTCCertificate>> certificates; | 243 std::vector<rtc::scoped_refptr<rtc::RTCCertificate>> certificates; |
| 244 bool disable_prerenderer_smoothing; | 244 bool disable_prerenderer_smoothing; |
| 245 // Flags corresponding to values set by constraint flags. | |
| 246 // rtc::Optional flags can be "missing", in which case the webrtc | |
| 247 // default applies. | |
| 248 bool disable_ipv6; | |
| 249 rtc::Optional<bool> enable_dscp; | |
| 250 bool enable_rtp_data_channel; | |
| 251 rtc::Optional<bool> cpu_overuse_detection; | |
| 252 rtc::Optional<bool> suspend_below_min_bitrate; | |
| 253 rtc::Optional<int> screencast_min_bitrate; | |
| 254 rtc::Optional<bool> combined_audio_video_bwe; | |
| 255 rtc::Optional<bool> enable_dtls_srtp; | |
| 245 RTCConfiguration() | 256 RTCConfiguration() |
| 246 : type(kAll), | 257 : type(kAll), |
| 247 bundle_policy(kBundlePolicyBalanced), | 258 bundle_policy(kBundlePolicyBalanced), |
| 248 rtcp_mux_policy(kRtcpMuxPolicyNegotiate), | 259 rtcp_mux_policy(kRtcpMuxPolicyNegotiate), |
| 249 tcp_candidate_policy(kTcpCandidatePolicyEnabled), | 260 tcp_candidate_policy(kTcpCandidatePolicyEnabled), |
| 250 audio_jitter_buffer_max_packets(kAudioJitterBufferMaxPackets), | 261 audio_jitter_buffer_max_packets(kAudioJitterBufferMaxPackets), |
| 251 audio_jitter_buffer_fast_accelerate(false), | 262 audio_jitter_buffer_fast_accelerate(false), |
| 252 ice_connection_receiving_timeout(kUndefined), | 263 ice_connection_receiving_timeout(kUndefined), |
| 253 ice_backup_candidate_pair_ping_interval(kUndefined), | 264 ice_backup_candidate_pair_ping_interval(kUndefined), |
| 254 continual_gathering_policy(GATHER_ONCE), | 265 continual_gathering_policy(GATHER_ONCE), |
| 255 disable_prerenderer_smoothing(false) {} | 266 disable_prerenderer_smoothing(false), |
| 267 disable_ipv6(false), | |
| 268 enable_rtp_data_channel(false) {} | |
| 256 }; | 269 }; |
| 257 | 270 |
| 258 struct RTCOfferAnswerOptions { | 271 struct RTCOfferAnswerOptions { |
| 259 static const int kUndefined = -1; | 272 static const int kUndefined = -1; |
| 260 static const int kMaxOfferToReceiveMedia = 1; | 273 static const int kMaxOfferToReceiveMedia = 1; |
| 261 | 274 |
| 262 // The default value for constraint offerToReceiveX:true. | 275 // The default value for constraint offerToReceiveX:true. |
| 263 static const int kOfferToReceiveMediaTrue = 1; | 276 static const int kOfferToReceiveMediaTrue = 1; |
| 264 | 277 |
| 265 int offer_to_receive_video; | 278 int offer_to_receive_video; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 374 | 387 |
| 375 // TODO(jiayl): remove the default impl and the old interface when chromium | 388 // TODO(jiayl): remove the default impl and the old interface when chromium |
| 376 // code is updated. | 389 // code is updated. |
| 377 virtual void CreateOffer(CreateSessionDescriptionObserver* observer, | 390 virtual void CreateOffer(CreateSessionDescriptionObserver* observer, |
| 378 const RTCOfferAnswerOptions& options) {} | 391 const RTCOfferAnswerOptions& options) {} |
| 379 | 392 |
| 380 // Create an answer to an offer. | 393 // Create an answer to an offer. |
| 381 // The CreateSessionDescriptionObserver callback will be called when done. | 394 // The CreateSessionDescriptionObserver callback will be called when done. |
| 382 virtual void CreateAnswer(CreateSessionDescriptionObserver* observer, | 395 virtual void CreateAnswer(CreateSessionDescriptionObserver* observer, |
| 383 const MediaConstraintsInterface* constraints) = 0; | 396 const MediaConstraintsInterface* constraints) = 0; |
| 397 virtual void CreateAnswer(CreateSessionDescriptionObserver* observer, | |
| 398 const RTCOfferAnswerOptions& options) = 0; | |
| 384 // Sets the local session description. | 399 // Sets the local session description. |
| 385 // JsepInterface takes the ownership of |desc| even if it fails. | 400 // JsepInterface takes the ownership of |desc| even if it fails. |
| 386 // The |observer| callback will be called when done. | 401 // The |observer| callback will be called when done. |
| 387 virtual void SetLocalDescription(SetSessionDescriptionObserver* observer, | 402 virtual void SetLocalDescription(SetSessionDescriptionObserver* observer, |
| 388 SessionDescriptionInterface* desc) = 0; | 403 SessionDescriptionInterface* desc) = 0; |
| 389 // Sets the remote session description. | 404 // Sets the remote session description. |
| 390 // JsepInterface takes the ownership of |desc| even if it fails. | 405 // JsepInterface takes the ownership of |desc| even if it fails. |
| 391 // The |observer| callback will be called when done. | 406 // The |observer| callback will be called when done. |
| 392 virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer, | 407 virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer, |
| 393 SessionDescriptionInterface* desc) = 0; | 408 SessionDescriptionInterface* desc) = 0; |
| 394 // Restarts or updates the ICE Agent process of gathering local candidates | 409 // Restarts or updates the ICE Agent process of gathering local candidates |
| 395 // and pinging remote candidates. | 410 // and pinging remote candidates. |
| 396 // TODO(deadbeef): Remove once Chrome is moved over to SetConfiguration. | 411 // TODO(deadbeef): Remove once Chrome is moved over to SetConfiguration. |
| 397 virtual bool UpdateIce(const IceServers& configuration, | 412 virtual bool UpdateIce(const IceServers& configuration, |
| 398 const MediaConstraintsInterface* constraints) { | 413 const MediaConstraintsInterface* constraints) { |
| 399 return false; | 414 return false; |
| 400 } | 415 } |
| 416 virtual bool UpdateIce(const IceServers& configuration) { return false; } | |
| 401 // Sets the PeerConnection's global configuration to |config|. | 417 // Sets the PeerConnection's global configuration to |config|. |
| 402 // Any changes to STUN/TURN servers or ICE candidate policy will affect the | 418 // Any changes to STUN/TURN servers or ICE candidate policy will affect the |
| 403 // next gathering phase, and cause the next call to createOffer to generate | 419 // next gathering phase, and cause the next call to createOffer to generate |
| 404 // new ICE credentials. Note that the BUNDLE and RTCP-multiplexing policies | 420 // new ICE credentials. Note that the BUNDLE and RTCP-multiplexing policies |
| 405 // cannot be changed with this method. | 421 // cannot be changed with this method. |
| 406 // TODO(deadbeef): Make this pure virtual once all Chrome subclasses of | 422 // TODO(deadbeef): Make this pure virtual once all Chrome subclasses of |
| 407 // PeerConnectionInterface implement it. | 423 // PeerConnectionInterface implement it. |
| 408 virtual bool SetConfiguration( | 424 virtual bool SetConfiguration( |
| 409 const PeerConnectionInterface::RTCConfiguration& config) { | 425 const PeerConnectionInterface::RTCConfiguration& config) { |
| 410 return false; | 426 return false; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 517 | 533 |
| 518 virtual void SetOptions(const Options& options) = 0; | 534 virtual void SetOptions(const Options& options) = 0; |
| 519 | 535 |
| 520 virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( | 536 virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( |
| 521 const PeerConnectionInterface::RTCConfiguration& configuration, | 537 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 522 const MediaConstraintsInterface* constraints, | 538 const MediaConstraintsInterface* constraints, |
| 523 rtc::scoped_ptr<cricket::PortAllocator> allocator, | 539 rtc::scoped_ptr<cricket::PortAllocator> allocator, |
| 524 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 540 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
| 525 PeerConnectionObserver* observer) = 0; | 541 PeerConnectionObserver* observer) = 0; |
| 526 | 542 |
| 543 virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( | |
| 544 const PeerConnectionInterface::RTCConfiguration& configuration, | |
| 545 rtc::scoped_ptr<cricket::PortAllocator> allocator, | |
| 546 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | |
| 547 PeerConnectionObserver* observer) = 0; | |
| 548 | |
| 527 virtual rtc::scoped_refptr<MediaStreamInterface> | 549 virtual rtc::scoped_refptr<MediaStreamInterface> |
| 528 CreateLocalMediaStream(const std::string& label) = 0; | 550 CreateLocalMediaStream(const std::string& label) = 0; |
| 529 | 551 |
| 530 // Creates a AudioSourceInterface. | 552 // Creates a AudioSourceInterface. |
| 531 // |constraints| decides audio processing settings but can be NULL. | 553 // |constraints| decides audio processing settings but can be NULL. |
| 532 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( | 554 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( |
| 533 const MediaConstraintsInterface* constraints) = 0; | 555 const MediaConstraintsInterface* constraints) = 0; |
| 556 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( | |
| 557 const cricket::AudioOptions& options) = 0; | |
| 534 | 558 |
| 535 // Creates a VideoSourceInterface. The new source take ownership of | 559 // Creates a VideoSourceInterface. The new source take ownership of |
| 536 // |capturer|. |constraints| decides video resolution and frame rate but can | 560 // |capturer|. |constraints| decides video resolution and frame rate but can |
| 537 // be NULL. | 561 // be NULL. |
| 538 virtual rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource( | 562 virtual rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource( |
| 539 cricket::VideoCapturer* capturer, | 563 cricket::VideoCapturer* capturer, |
| 540 const MediaConstraintsInterface* constraints) = 0; | 564 const MediaConstraintsInterface* constraints) = 0; |
| 565 virtual rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource( | |
| 566 cricket::VideoCapturer* capturer) = 0; | |
| 541 | 567 |
| 542 // Creates a new local VideoTrack. The same |source| can be used in several | 568 // Creates a new local VideoTrack. The same |source| can be used in several |
| 543 // tracks. | 569 // tracks. |
| 544 virtual rtc::scoped_refptr<VideoTrackInterface> | 570 virtual rtc::scoped_refptr<VideoTrackInterface> |
| 545 CreateVideoTrack(const std::string& label, | 571 CreateVideoTrack(const std::string& label, |
| 546 VideoSourceInterface* source) = 0; | 572 VideoSourceInterface* source) = 0; |
| 547 | 573 |
| 548 // Creates an new AudioTrack. At the moment |source| can be NULL. | 574 // Creates an new AudioTrack. At the moment |source| can be NULL. |
| 549 virtual rtc::scoped_refptr<AudioTrackInterface> | 575 virtual rtc::scoped_refptr<AudioTrackInterface> |
| 550 CreateAudioTrack(const std::string& label, | 576 CreateAudioTrack(const std::string& label, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 596 CreatePeerConnectionFactory( | 622 CreatePeerConnectionFactory( |
| 597 rtc::Thread* worker_thread, | 623 rtc::Thread* worker_thread, |
| 598 rtc::Thread* signaling_thread, | 624 rtc::Thread* signaling_thread, |
| 599 AudioDeviceModule* default_adm, | 625 AudioDeviceModule* default_adm, |
| 600 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 626 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
| 601 cricket::WebRtcVideoDecoderFactory* decoder_factory); | 627 cricket::WebRtcVideoDecoderFactory* decoder_factory); |
| 602 | 628 |
| 603 } // namespace webrtc | 629 } // namespace webrtc |
| 604 | 630 |
| 605 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ | 631 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ |
| OLD | NEW |