| 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 // stream, with the one difference that if "stream->AddTrack(...)" is called | 511 // stream, with the one difference that if "stream->AddTrack(...)" is called |
| 512 // later, the PeerConnection will automatically pick up the new track. Though | 512 // later, the PeerConnection will automatically pick up the new track. Though |
| 513 // this functionality will be deprecated in the future. | 513 // this functionality will be deprecated in the future. |
| 514 virtual bool AddStream(MediaStreamInterface* stream) = 0; | 514 virtual bool AddStream(MediaStreamInterface* stream) = 0; |
| 515 | 515 |
| 516 // Remove a MediaStream from this PeerConnection. | 516 // Remove a MediaStream from this PeerConnection. |
| 517 // Note that a SessionDescription negotiation is needed before the | 517 // Note that a SessionDescription negotiation is needed before the |
| 518 // remote peer is notified. | 518 // remote peer is notified. |
| 519 virtual void RemoveStream(MediaStreamInterface* stream) = 0; | 519 virtual void RemoveStream(MediaStreamInterface* stream) = 0; |
| 520 | 520 |
| 521 // TODO(deadbeef): Make the following two methods pure virtual once | |
| 522 // implemented by all subclasses of PeerConnectionInterface. | |
| 523 | |
| 524 // Add a new MediaStreamTrack to be sent on this PeerConnection, and return | 521 // Add a new MediaStreamTrack to be sent on this PeerConnection, and return |
| 525 // the newly created RtpSender. | 522 // the newly created RtpSender. |
| 526 // | 523 // |
| 527 // |streams| indicates which stream labels the track should be associated | 524 // |streams| indicates which stream labels the track should be associated |
| 528 // with. | 525 // with. |
| 529 virtual rtc::scoped_refptr<RtpSenderInterface> AddTrack( | 526 virtual rtc::scoped_refptr<RtpSenderInterface> AddTrack( |
| 530 MediaStreamTrackInterface* track, | 527 MediaStreamTrackInterface* track, |
| 531 std::vector<MediaStreamInterface*> streams) { | 528 std::vector<MediaStreamInterface*> streams) = 0; |
| 532 return nullptr; | |
| 533 } | |
| 534 | 529 |
| 535 // Remove an RtpSender from this PeerConnection. | 530 // Remove an RtpSender from this PeerConnection. |
| 536 // Returns true on success. | 531 // Returns true on success. |
| 537 virtual bool RemoveTrack(RtpSenderInterface* sender) { | 532 virtual bool RemoveTrack(RtpSenderInterface* sender) = 0; |
| 538 return false; | |
| 539 } | |
| 540 | 533 |
| 541 // Returns pointer to a DtmfSender on success. Otherwise returns null. | 534 // Returns pointer to a DtmfSender on success. Otherwise returns null. |
| 542 // | 535 // |
| 543 // This API is no longer part of the standard; instead DtmfSenders are | 536 // This API is no longer part of the standard; instead DtmfSenders are |
| 544 // obtained from RtpSenders. Which is what the implementation does; it finds | 537 // obtained from RtpSenders. Which is what the implementation does; it finds |
| 545 // an RtpSender for |track| and just returns its DtmfSender. | 538 // an RtpSender for |track| and just returns its DtmfSender. |
| 546 virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( | 539 virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender( |
| 547 AudioTrackInterface* track) = 0; | 540 AudioTrackInterface* track) = 0; |
| 548 | 541 |
| 549 // TODO(deadbeef): Make these pure virtual once all subclasses implement them. | 542 // TODO(deadbeef): Make these pure virtual once all subclasses implement them. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 | 766 |
| 774 // Triggered when the SignalingState changed. | 767 // Triggered when the SignalingState changed. |
| 775 virtual void OnSignalingChange( | 768 virtual void OnSignalingChange( |
| 776 PeerConnectionInterface::SignalingState new_state) = 0; | 769 PeerConnectionInterface::SignalingState new_state) = 0; |
| 777 | 770 |
| 778 // TODO(deadbeef): Once all subclasses override the scoped_refptr versions | 771 // TODO(deadbeef): Once all subclasses override the scoped_refptr versions |
| 779 // of the below three methods, make them pure virtual and remove the raw | 772 // of the below three methods, make them pure virtual and remove the raw |
| 780 // pointer version. | 773 // pointer version. |
| 781 | 774 |
| 782 // Triggered when media is received on a new stream from remote peer. | 775 // Triggered when media is received on a new stream from remote peer. |
| 783 virtual void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) {} | 776 virtual void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) = 0; |
| 784 // Deprecated; please use the version that uses a scoped_refptr. | |
| 785 virtual void OnAddStream(MediaStreamInterface* stream) {} | |
| 786 | 777 |
| 787 // Triggered when a remote peer close a stream. | 778 // Triggered when a remote peer close a stream. |
| 788 virtual void OnRemoveStream(rtc::scoped_refptr<MediaStreamInterface> stream) { | 779 virtual void OnRemoveStream( |
| 789 } | 780 rtc::scoped_refptr<MediaStreamInterface> stream) = 0; |
| 790 // Deprecated; please use the version that uses a scoped_refptr. | |
| 791 virtual void OnRemoveStream(MediaStreamInterface* stream) {} | |
| 792 | 781 |
| 793 // Triggered when a remote peer opens a data channel. | 782 // Triggered when a remote peer opens a data channel. |
| 794 virtual void OnDataChannel( | 783 virtual void OnDataChannel( |
| 795 rtc::scoped_refptr<DataChannelInterface> data_channel) {} | 784 rtc::scoped_refptr<DataChannelInterface> data_channel) = 0; |
| 796 // Deprecated; please use the version that uses a scoped_refptr. | |
| 797 virtual void OnDataChannel(DataChannelInterface* data_channel) {} | |
| 798 | 785 |
| 799 // Triggered when renegotiation is needed. For example, an ICE restart | 786 // Triggered when renegotiation is needed. For example, an ICE restart |
| 800 // has begun. | 787 // has begun. |
| 801 virtual void OnRenegotiationNeeded() = 0; | 788 virtual void OnRenegotiationNeeded() = 0; |
| 802 | 789 |
| 803 // Called any time the IceConnectionState changes. | 790 // Called any time the IceConnectionState changes. |
| 804 // | 791 // |
| 805 // Note that our ICE states lag behind the standard slightly. The most | 792 // Note that our ICE states lag behind the standard slightly. The most |
| 806 // notable differences include the fact that "failed" occurs after 15 | 793 // notable differences include the fact that "failed" occurs after 15 |
| 807 // seconds, not 30, and this actually represents a combination ICE + DTLS | 794 // seconds, not 30, and this actually represents a combination ICE + DTLS |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 1096 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
| 1110 cricket::WebRtcVideoDecoderFactory* decoder_factory) { | 1097 cricket::WebRtcVideoDecoderFactory* decoder_factory) { |
| 1111 return CreatePeerConnectionFactory( | 1098 return CreatePeerConnectionFactory( |
| 1112 worker_and_network_thread, worker_and_network_thread, signaling_thread, | 1099 worker_and_network_thread, worker_and_network_thread, signaling_thread, |
| 1113 default_adm, encoder_factory, decoder_factory); | 1100 default_adm, encoder_factory, decoder_factory); |
| 1114 } | 1101 } |
| 1115 | 1102 |
| 1116 } // namespace webrtc | 1103 } // namespace webrtc |
| 1117 | 1104 |
| 1118 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ | 1105 #endif // WEBRTC_API_PEERCONNECTIONINTERFACE_H_ |
| OLD | NEW |