| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 const MediaConstraintsInterface* constraints) {} | 386 const MediaConstraintsInterface* constraints) {} |
| 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 RTCOfferAnswerOptions& options) {} |
| 397 // Deprecated - use version above. |
| 398 // TODO(hta): Remove and remove default implementations when all callers |
| 399 // are updated. |
| 400 virtual void CreateAnswer(CreateSessionDescriptionObserver* observer, |
| 401 const MediaConstraintsInterface* constraints) {} |
| 402 |
| 384 // Sets the local session description. | 403 // Sets the local session description. |
| 385 // JsepInterface takes the ownership of |desc| even if it fails. | 404 // JsepInterface takes the ownership of |desc| even if it fails. |
| 386 // The |observer| callback will be called when done. | 405 // The |observer| callback will be called when done. |
| 387 virtual void SetLocalDescription(SetSessionDescriptionObserver* observer, | 406 virtual void SetLocalDescription(SetSessionDescriptionObserver* observer, |
| 388 SessionDescriptionInterface* desc) = 0; | 407 SessionDescriptionInterface* desc) = 0; |
| 389 // Sets the remote session description. | 408 // Sets the remote session description. |
| 390 // JsepInterface takes the ownership of |desc| even if it fails. | 409 // JsepInterface takes the ownership of |desc| even if it fails. |
| 391 // The |observer| callback will be called when done. | 410 // The |observer| callback will be called when done. |
| 392 virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer, | 411 virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer, |
| 393 SessionDescriptionInterface* desc) = 0; | 412 SessionDescriptionInterface* desc) = 0; |
| 394 // Restarts or updates the ICE Agent process of gathering local candidates | 413 // Restarts or updates the ICE Agent process of gathering local candidates |
| 395 // and pinging remote candidates. | 414 // and pinging remote candidates. |
| 396 // TODO(deadbeef): Remove once Chrome is moved over to SetConfiguration. | 415 // TODO(deadbeef): Remove once Chrome is moved over to SetConfiguration. |
| 397 virtual bool UpdateIce(const IceServers& configuration, | 416 virtual bool UpdateIce(const IceServers& configuration, |
| 398 const MediaConstraintsInterface* constraints) { | 417 const MediaConstraintsInterface* constraints) { |
| 399 return false; | 418 return false; |
| 400 } | 419 } |
| 420 virtual bool UpdateIce(const IceServers& configuration) { return false; } |
| 401 // Sets the PeerConnection's global configuration to |config|. | 421 // Sets the PeerConnection's global configuration to |config|. |
| 402 // Any changes to STUN/TURN servers or ICE candidate policy will affect the | 422 // 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 | 423 // next gathering phase, and cause the next call to createOffer to generate |
| 404 // new ICE credentials. Note that the BUNDLE and RTCP-multiplexing policies | 424 // new ICE credentials. Note that the BUNDLE and RTCP-multiplexing policies |
| 405 // cannot be changed with this method. | 425 // cannot be changed with this method. |
| 406 // TODO(deadbeef): Make this pure virtual once all Chrome subclasses of | 426 // TODO(deadbeef): Make this pure virtual once all Chrome subclasses of |
| 407 // PeerConnectionInterface implement it. | 427 // PeerConnectionInterface implement it. |
| 408 virtual bool SetConfiguration( | 428 virtual bool SetConfiguration( |
| 409 const PeerConnectionInterface::RTCConfiguration& config) { | 429 const PeerConnectionInterface::RTCConfiguration& config) { |
| 410 return false; | 430 return false; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 537 |
| 518 virtual void SetOptions(const Options& options) = 0; | 538 virtual void SetOptions(const Options& options) = 0; |
| 519 | 539 |
| 520 virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( | 540 virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( |
| 521 const PeerConnectionInterface::RTCConfiguration& configuration, | 541 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 522 const MediaConstraintsInterface* constraints, | 542 const MediaConstraintsInterface* constraints, |
| 523 rtc::scoped_ptr<cricket::PortAllocator> allocator, | 543 rtc::scoped_ptr<cricket::PortAllocator> allocator, |
| 524 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 544 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
| 525 PeerConnectionObserver* observer) = 0; | 545 PeerConnectionObserver* observer) = 0; |
| 526 | 546 |
| 547 virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( |
| 548 const PeerConnectionInterface::RTCConfiguration& configuration, |
| 549 rtc::scoped_ptr<cricket::PortAllocator> allocator, |
| 550 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
| 551 PeerConnectionObserver* observer) = 0; |
| 552 |
| 527 virtual rtc::scoped_refptr<MediaStreamInterface> | 553 virtual rtc::scoped_refptr<MediaStreamInterface> |
| 528 CreateLocalMediaStream(const std::string& label) = 0; | 554 CreateLocalMediaStream(const std::string& label) = 0; |
| 529 | 555 |
| 530 // Creates a AudioSourceInterface. | 556 // Creates a AudioSourceInterface. |
| 531 // |constraints| decides audio processing settings but can be NULL. | 557 // |constraints| decides audio processing settings but can be NULL. |
| 532 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( | 558 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( |
| 559 const cricket::AudioOptions& options) = 0; |
| 560 // Deprecated - use version above. |
| 561 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( |
| 533 const MediaConstraintsInterface* constraints) = 0; | 562 const MediaConstraintsInterface* constraints) = 0; |
| 534 | 563 |
| 535 // Creates a VideoSourceInterface. The new source take ownership of | 564 // Creates a VideoSourceInterface. The new source take ownership of |
| 536 // |capturer|. |constraints| decides video resolution and frame rate but can | 565 // |capturer|. |
| 566 virtual rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource( |
| 567 cricket::VideoCapturer* capturer) = 0; |
| 568 // A video source creator that allows selection of resolution and frame rate. |
| 569 // |constraints| decides video resolution and frame rate but can |
| 537 // be NULL. | 570 // be NULL. |
| 571 // In the NULL case, use the version above. |
| 538 virtual rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource( | 572 virtual rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource( |
| 539 cricket::VideoCapturer* capturer, | 573 cricket::VideoCapturer* capturer, |
| 540 const MediaConstraintsInterface* constraints) = 0; | 574 const MediaConstraintsInterface* constraints) = 0; |
| 541 | 575 |
| 542 // Creates a new local VideoTrack. The same |source| can be used in several | 576 // Creates a new local VideoTrack. The same |source| can be used in several |
| 543 // tracks. | 577 // tracks. |
| 544 virtual rtc::scoped_refptr<VideoTrackInterface> | 578 virtual rtc::scoped_refptr<VideoTrackInterface> |
| 545 CreateVideoTrack(const std::string& label, | 579 CreateVideoTrack(const std::string& label, |
| 546 VideoSourceInterface* source) = 0; | 580 VideoSourceInterface* source) = 0; |
| 547 | 581 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 CreatePeerConnectionFactory( | 630 CreatePeerConnectionFactory( |
| 597 rtc::Thread* worker_thread, | 631 rtc::Thread* worker_thread, |
| 598 rtc::Thread* signaling_thread, | 632 rtc::Thread* signaling_thread, |
| 599 AudioDeviceModule* default_adm, | 633 AudioDeviceModule* default_adm, |
| 600 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 634 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
| 601 cricket::WebRtcVideoDecoderFactory* decoder_factory); | 635 cricket::WebRtcVideoDecoderFactory* decoder_factory); |
| 602 | 636 |
| 603 } // namespace webrtc | 637 } // namespace webrtc |
| 604 | 638 |
| 605 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ | 639 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ |
| OLD | NEW |