Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: webrtc/api/peerconnectioninterface.h

Issue 1717583002: Non-constraint interfaces for all constrainable interfaces (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Review comments Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/api/peerconnectionfactoryproxy.h ('k') | webrtc/api/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 bool prioritize_most_likely_ice_candidate_pairs; 245 bool prioritize_most_likely_ice_candidate_pairs;
246 // Flags corresponding to values set by constraint flags.
247 // rtc::Optional flags can be "missing", in which case the webrtc
248 // default applies.
249 bool disable_ipv6;
250 rtc::Optional<bool> enable_dscp;
251 bool enable_rtp_data_channel;
252 rtc::Optional<bool> cpu_overuse_detection;
253 rtc::Optional<bool> suspend_below_min_bitrate;
254 rtc::Optional<int> screencast_min_bitrate;
255 rtc::Optional<bool> combined_audio_video_bwe;
256 rtc::Optional<bool> enable_dtls_srtp;
246 RTCConfiguration() 257 RTCConfiguration()
247 : type(kAll), 258 : type(kAll),
248 bundle_policy(kBundlePolicyBalanced), 259 bundle_policy(kBundlePolicyBalanced),
249 rtcp_mux_policy(kRtcpMuxPolicyNegotiate), 260 rtcp_mux_policy(kRtcpMuxPolicyNegotiate),
250 tcp_candidate_policy(kTcpCandidatePolicyEnabled), 261 tcp_candidate_policy(kTcpCandidatePolicyEnabled),
251 audio_jitter_buffer_max_packets(kAudioJitterBufferMaxPackets), 262 audio_jitter_buffer_max_packets(kAudioJitterBufferMaxPackets),
252 audio_jitter_buffer_fast_accelerate(false), 263 audio_jitter_buffer_fast_accelerate(false),
253 ice_connection_receiving_timeout(kUndefined), 264 ice_connection_receiving_timeout(kUndefined),
254 ice_backup_candidate_pair_ping_interval(kUndefined), 265 ice_backup_candidate_pair_ping_interval(kUndefined),
255 continual_gathering_policy(GATHER_ONCE), 266 continual_gathering_policy(GATHER_ONCE),
256 disable_prerenderer_smoothing(false), 267 disable_prerenderer_smoothing(false),
257 prioritize_most_likely_ice_candidate_pairs(false) {} 268 prioritize_most_likely_ice_candidate_pairs(false),
269 disable_ipv6(false),
270 enable_rtp_data_channel(false) {}
258 }; 271 };
259 272
260 struct RTCOfferAnswerOptions { 273 struct RTCOfferAnswerOptions {
261 static const int kUndefined = -1; 274 static const int kUndefined = -1;
262 static const int kMaxOfferToReceiveMedia = 1; 275 static const int kMaxOfferToReceiveMedia = 1;
263 276
264 // The default value for constraint offerToReceiveX:true. 277 // The default value for constraint offerToReceiveX:true.
265 static const int kOfferToReceiveMediaTrue = 1; 278 static const int kOfferToReceiveMediaTrue = 1;
266 279
267 int offer_to_receive_video; 280 int offer_to_receive_video;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 const MediaConstraintsInterface* constraints) {} 388 const MediaConstraintsInterface* constraints) {}
376 389
377 // TODO(jiayl): remove the default impl and the old interface when chromium 390 // TODO(jiayl): remove the default impl and the old interface when chromium
378 // code is updated. 391 // code is updated.
379 virtual void CreateOffer(CreateSessionDescriptionObserver* observer, 392 virtual void CreateOffer(CreateSessionDescriptionObserver* observer,
380 const RTCOfferAnswerOptions& options) {} 393 const RTCOfferAnswerOptions& options) {}
381 394
382 // Create an answer to an offer. 395 // Create an answer to an offer.
383 // The CreateSessionDescriptionObserver callback will be called when done. 396 // The CreateSessionDescriptionObserver callback will be called when done.
384 virtual void CreateAnswer(CreateSessionDescriptionObserver* observer, 397 virtual void CreateAnswer(CreateSessionDescriptionObserver* observer,
385 const MediaConstraintsInterface* constraints) = 0; 398 const RTCOfferAnswerOptions& options) {}
399 // Deprecated - use version above.
400 // TODO(hta): Remove and remove default implementations when all callers
401 // are updated.
402 virtual void CreateAnswer(CreateSessionDescriptionObserver* observer,
403 const MediaConstraintsInterface* constraints) {}
404
386 // Sets the local session description. 405 // Sets the local session description.
387 // JsepInterface takes the ownership of |desc| even if it fails. 406 // JsepInterface takes the ownership of |desc| even if it fails.
388 // The |observer| callback will be called when done. 407 // The |observer| callback will be called when done.
389 virtual void SetLocalDescription(SetSessionDescriptionObserver* observer, 408 virtual void SetLocalDescription(SetSessionDescriptionObserver* observer,
390 SessionDescriptionInterface* desc) = 0; 409 SessionDescriptionInterface* desc) = 0;
391 // Sets the remote session description. 410 // Sets the remote session description.
392 // JsepInterface takes the ownership of |desc| even if it fails. 411 // JsepInterface takes the ownership of |desc| even if it fails.
393 // The |observer| callback will be called when done. 412 // The |observer| callback will be called when done.
394 virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer, 413 virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer,
395 SessionDescriptionInterface* desc) = 0; 414 SessionDescriptionInterface* desc) = 0;
396 // Restarts or updates the ICE Agent process of gathering local candidates 415 // Restarts or updates the ICE Agent process of gathering local candidates
397 // and pinging remote candidates. 416 // and pinging remote candidates.
398 // TODO(deadbeef): Remove once Chrome is moved over to SetConfiguration. 417 // TODO(deadbeef): Remove once Chrome is moved over to SetConfiguration.
399 virtual bool UpdateIce(const IceServers& configuration, 418 virtual bool UpdateIce(const IceServers& configuration,
400 const MediaConstraintsInterface* constraints) { 419 const MediaConstraintsInterface* constraints) {
401 return false; 420 return false;
402 } 421 }
422 virtual bool UpdateIce(const IceServers& configuration) { return false; }
403 // Sets the PeerConnection's global configuration to |config|. 423 // Sets the PeerConnection's global configuration to |config|.
404 // Any changes to STUN/TURN servers or ICE candidate policy will affect the 424 // Any changes to STUN/TURN servers or ICE candidate policy will affect the
405 // next gathering phase, and cause the next call to createOffer to generate 425 // next gathering phase, and cause the next call to createOffer to generate
406 // new ICE credentials. Note that the BUNDLE and RTCP-multiplexing policies 426 // new ICE credentials. Note that the BUNDLE and RTCP-multiplexing policies
407 // cannot be changed with this method. 427 // cannot be changed with this method.
408 // TODO(deadbeef): Make this pure virtual once all Chrome subclasses of 428 // TODO(deadbeef): Make this pure virtual once all Chrome subclasses of
409 // PeerConnectionInterface implement it. 429 // PeerConnectionInterface implement it.
410 virtual bool SetConfiguration( 430 virtual bool SetConfiguration(
411 const PeerConnectionInterface::RTCConfiguration& config) { 431 const PeerConnectionInterface::RTCConfiguration& config) {
412 return false; 432 return false;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 539
520 virtual void SetOptions(const Options& options) = 0; 540 virtual void SetOptions(const Options& options) = 0;
521 541
522 virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection( 542 virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
523 const PeerConnectionInterface::RTCConfiguration& configuration, 543 const PeerConnectionInterface::RTCConfiguration& configuration,
524 const MediaConstraintsInterface* constraints, 544 const MediaConstraintsInterface* constraints,
525 rtc::scoped_ptr<cricket::PortAllocator> allocator, 545 rtc::scoped_ptr<cricket::PortAllocator> allocator,
526 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, 546 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store,
527 PeerConnectionObserver* observer) = 0; 547 PeerConnectionObserver* observer) = 0;
528 548
549 virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
550 const PeerConnectionInterface::RTCConfiguration& configuration,
551 rtc::scoped_ptr<cricket::PortAllocator> allocator,
552 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store,
553 PeerConnectionObserver* observer) = 0;
554
529 virtual rtc::scoped_refptr<MediaStreamInterface> 555 virtual rtc::scoped_refptr<MediaStreamInterface>
530 CreateLocalMediaStream(const std::string& label) = 0; 556 CreateLocalMediaStream(const std::string& label) = 0;
531 557
532 // Creates a AudioSourceInterface. 558 // Creates a AudioSourceInterface.
533 // |constraints| decides audio processing settings but can be NULL. 559 // |constraints| decides audio processing settings but can be NULL.
534 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource( 560 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource(
561 const cricket::AudioOptions& options) = 0;
562 // Deprecated - use version above.
563 virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource(
535 const MediaConstraintsInterface* constraints) = 0; 564 const MediaConstraintsInterface* constraints) = 0;
536 565
537 // Creates a VideoSourceInterface. The new source take ownership of 566 // Creates a VideoSourceInterface. The new source take ownership of
538 // |capturer|. |constraints| decides video resolution and frame rate but can 567 // |capturer|.
568 virtual rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource(
569 cricket::VideoCapturer* capturer) = 0;
570 // A video source creator that allows selection of resolution and frame rate.
571 // |constraints| decides video resolution and frame rate but can
539 // be NULL. 572 // be NULL.
573 // In the NULL case, use the version above.
540 virtual rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource( 574 virtual rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource(
541 cricket::VideoCapturer* capturer, 575 cricket::VideoCapturer* capturer,
542 const MediaConstraintsInterface* constraints) = 0; 576 const MediaConstraintsInterface* constraints) = 0;
543 577
544 // Creates a new local VideoTrack. The same |source| can be used in several 578 // Creates a new local VideoTrack. The same |source| can be used in several
545 // tracks. 579 // tracks.
546 virtual rtc::scoped_refptr<VideoTrackInterface> 580 virtual rtc::scoped_refptr<VideoTrackInterface>
547 CreateVideoTrack(const std::string& label, 581 CreateVideoTrack(const std::string& label,
548 VideoSourceInterface* source) = 0; 582 VideoSourceInterface* source) = 0;
549 583
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 CreatePeerConnectionFactory( 632 CreatePeerConnectionFactory(
599 rtc::Thread* worker_thread, 633 rtc::Thread* worker_thread,
600 rtc::Thread* signaling_thread, 634 rtc::Thread* signaling_thread,
601 AudioDeviceModule* default_adm, 635 AudioDeviceModule* default_adm,
602 cricket::WebRtcVideoEncoderFactory* encoder_factory, 636 cricket::WebRtcVideoEncoderFactory* encoder_factory,
603 cricket::WebRtcVideoDecoderFactory* decoder_factory); 637 cricket::WebRtcVideoDecoderFactory* decoder_factory);
604 638
605 } // namespace webrtc 639 } // namespace webrtc
606 640
607 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ 641 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_
OLDNEW
« no previous file with comments | « webrtc/api/peerconnectionfactoryproxy.h ('k') | webrtc/api/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698