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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
438 // Add a new MediaStream to be sent on this PeerConnection. | 438 // Add a new MediaStream to be sent on this PeerConnection. |
439 // Note that a SessionDescription negotiation is needed before the | 439 // Note that a SessionDescription negotiation is needed before the |
440 // remote peer can receive the stream. | 440 // remote peer can receive the stream. |
441 virtual bool AddStream(MediaStreamInterface* stream) = 0; | 441 virtual bool AddStream(MediaStreamInterface* stream) = 0; |
442 | 442 |
443 // Remove a MediaStream from this PeerConnection. | 443 // Remove a MediaStream from this PeerConnection. |
444 // Note that a SessionDescription negotiation is need before the | 444 // Note that a SessionDescription negotiation is need before the |
445 // remote peer is notified. | 445 // remote peer is notified. |
446 virtual void RemoveStream(MediaStreamInterface* stream) = 0; | 446 virtual void RemoveStream(MediaStreamInterface* stream) = 0; |
447 | 447 |
448 // TODO(deadbeef): Make the following two methods pure virtual once | |
449 // implemented by all subclasses of PeerConnectionInterface. | |
450 // Add a new MediaStreamTrack to be sent on this PeerConnection. | 448 // Add a new MediaStreamTrack to be sent on this PeerConnection. |
451 // |streams| indicates which stream labels the track should be associated | 449 // |streams| indicates which stream labels the track should be associated |
452 // with. | 450 // with. |
453 virtual rtc::scoped_refptr<RtpSenderInterface> AddTrack( | 451 virtual rtc::scoped_refptr<RtpSenderInterface> AddTrack( |
454 MediaStreamTrackInterface* track, | 452 MediaStreamTrackInterface* track, |
455 std::vector<MediaStreamInterface*> streams) { | 453 std::vector<MediaStreamInterface*> streams) = 0; |
Taylor Brandstetter
2017/01/16 23:44:57
It doesn't look like chromium's mock PeerConnectio
| |
456 return nullptr; | |
457 } | |
458 | 454 |
459 // Remove an RtpSender from this PeerConnection. | 455 // Remove an RtpSender from this PeerConnection. |
460 // Returns true on success. | 456 // Returns true on success. |
461 virtual bool RemoveTrack(RtpSenderInterface* sender) { | 457 virtual bool RemoveTrack(RtpSenderInterface* sender) = 0; |
462 return false; | |
463 } | |
464 | 458 |
465 // Returns pointer to the created DtmfSender on success. | 459 // Returns pointer to the created DtmfSender on success. |
466 // Otherwise returns NULL. | 460 // Otherwise returns NULL. |
467 virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( | 461 virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( |
468 AudioTrackInterface* track) = 0; | 462 AudioTrackInterface* track) = 0; |
469 | 463 |
470 // TODO(deadbeef): Make these pure virtual once all subclasses implement them. | 464 // TODO(deadbeef): Make these pure virtual once all subclasses implement them. |
471 // |kind| must be "audio" or "video". | 465 // |kind| must be "audio" or "video". |
472 // |stream_id| is used to populate the msid attribute; if empty, one will | 466 // |stream_id| is used to populate the msid attribute; if empty, one will |
473 // be generated automatically. | 467 // be generated automatically. |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
656 | 650 |
657 // Triggered when the SignalingState changed. | 651 // Triggered when the SignalingState changed. |
658 virtual void OnSignalingChange( | 652 virtual void OnSignalingChange( |
659 PeerConnectionInterface::SignalingState new_state) = 0; | 653 PeerConnectionInterface::SignalingState new_state) = 0; |
660 | 654 |
661 // TODO(deadbeef): Once all subclasses override the scoped_refptr versions | 655 // TODO(deadbeef): Once all subclasses override the scoped_refptr versions |
662 // of the below three methods, make them pure virtual and remove the raw | 656 // of the below three methods, make them pure virtual and remove the raw |
663 // pointer version. | 657 // pointer version. |
664 | 658 |
665 // Triggered when media is received on a new stream from remote peer. | 659 // Triggered when media is received on a new stream from remote peer. |
666 virtual void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) {} | 660 virtual void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) = 0; |
667 // Deprecated; please use the version that uses a scoped_refptr. | |
668 virtual void OnAddStream(MediaStreamInterface* stream) {} | |
669 | 661 |
670 // Triggered when a remote peer close a stream. | 662 // Triggered when a remote peer close a stream. |
671 virtual void OnRemoveStream(rtc::scoped_refptr<MediaStreamInterface> stream) { | 663 virtual void OnRemoveStream( |
672 } | 664 rtc::scoped_refptr<MediaStreamInterface> stream) = 0; |
673 // Deprecated; please use the version that uses a scoped_refptr. | |
674 virtual void OnRemoveStream(MediaStreamInterface* stream) {} | |
675 | 665 |
676 // Triggered when a remote peer opens a data channel. | 666 // Triggered when a remote peer opens a data channel. |
677 virtual void OnDataChannel( | 667 virtual void OnDataChannel( |
678 rtc::scoped_refptr<DataChannelInterface> data_channel){}; | 668 rtc::scoped_refptr<DataChannelInterface> data_channel) = 0; |
679 // Deprecated; please use the version that uses a scoped_refptr. | |
680 virtual void OnDataChannel(DataChannelInterface* data_channel) {} | |
681 | 669 |
682 // Triggered when renegotiation is needed. For example, an ICE restart | 670 // Triggered when renegotiation is needed. For example, an ICE restart |
683 // has begun. | 671 // has begun. |
684 virtual void OnRenegotiationNeeded() = 0; | 672 virtual void OnRenegotiationNeeded() = 0; |
685 | 673 |
686 // Called any time the IceConnectionState changes. | 674 // Called any time the IceConnectionState changes. |
687 virtual void OnIceConnectionChange( | 675 virtual void OnIceConnectionChange( |
688 PeerConnectionInterface::IceConnectionState new_state) = 0; | 676 PeerConnectionInterface::IceConnectionState new_state) = 0; |
689 | 677 |
690 // Called any time the IceGatheringState changes. | 678 // Called any time the IceGatheringState changes. |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
889 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 877 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
890 cricket::WebRtcVideoDecoderFactory* decoder_factory) { | 878 cricket::WebRtcVideoDecoderFactory* decoder_factory) { |
891 return CreatePeerConnectionFactory( | 879 return CreatePeerConnectionFactory( |
892 worker_and_network_thread, worker_and_network_thread, signaling_thread, | 880 worker_and_network_thread, worker_and_network_thread, signaling_thread, |
893 default_adm, encoder_factory, decoder_factory); | 881 default_adm, encoder_factory, decoder_factory); |
894 } | 882 } |
895 | 883 |
896 } // namespace webrtc | 884 } // namespace webrtc |
897 | 885 |
898 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ | 886 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ |
OLD | NEW |