From 772eb2115ac16bc547da722837f39e5eaca0c372 Mon Sep 17 00:00:00 2001 From: Steve Anton Date: Tue, 16 Jan 2018 10:11:06 -0800 Subject: [PATCH] Make OnAddStream and OnRemoveStream not required This changes PeerConnectionObserver to not default the stream events as pure virtual. Applications which have switched to using OnAddTrack and OnRemoveTrack will no longer need to implement these callbacks. Bug: webrtc:8587 Change-Id: I659ce7b5a208ebfcb29e899dd17916ae0072d3cc Reviewed-on: https://webrtc-review.googlesource.com/39384 Reviewed-by: Taylor Brandstetter Reviewed-by: Peter Thatcher Commit-Queue: Taylor Brandstetter Cr-Commit-Position: refs/heads/master@{#21665} --- api/peerconnectioninterface.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/api/peerconnectioninterface.h b/api/peerconnectioninterface.h index 9e26df5594..192a39a830 100644 --- a/api/peerconnectioninterface.h +++ b/api/peerconnectioninterface.h @@ -976,27 +976,22 @@ class PeerConnectionInterface : public rtc::RefCountInterface { // Application should implement these methods. class PeerConnectionObserver { public: - enum StateType { - kSignalingState, - kIceState, - }; - virtual ~PeerConnectionObserver() = default; // Triggered when the SignalingState changed. virtual void OnSignalingChange( PeerConnectionInterface::SignalingState new_state) = 0; - // TODO(deadbeef): Once all subclasses override the scoped_refptr versions - // of the below three methods, make them pure virtual and remove the raw - // pointer version. - // Triggered when media is received on a new stream from remote peer. - virtual void OnAddStream(rtc::scoped_refptr stream) = 0; + // Deprecated: This callback will no longer be fired with Unified Plan + // semantics. Consider switching to OnAddTrack. + virtual void OnAddStream(rtc::scoped_refptr stream) {} // Triggered when a remote peer close a stream. - virtual void OnRemoveStream( - rtc::scoped_refptr stream) = 0; + // Deprecated: This callback will no longer be fired with Unified Plan + // semantics. + virtual void OnRemoveStream(rtc::scoped_refptr stream) { + } // Triggered when a remote peer opens a data channel. virtual void OnDataChannel(