Added PeerConnectionObserver::OnRemoveTrack.
This corresponds to processing the removal of a remote track step of
the spec, with processing the addition of a remote track already
covered by OnAddTrack.
https://w3c.github.io/webrtc-pc/#processing-remote-mediastreamtracks
Bug: webrtc:8260, webrtc:8315
Change-Id: Ica8be92369733eb3cf1397fb60385d45a9b58700
Reviewed-on: https://webrtc-review.googlesource.com/4722
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20214}
diff --git a/api/peerconnectioninterface.h b/api/peerconnectioninterface.h
index 7291a86..1039cb5 100644
--- a/api/peerconnectioninterface.h
+++ b/api/peerconnectioninterface.h
@@ -868,13 +868,31 @@
// Called when the ICE connection receiving status changes.
virtual void OnIceConnectionReceivingChange(bool receiving) {}
- // Called when a track is added to streams.
- // TODO(zhihuang) Make this a pure virtual method when all its subclasses
- // implement it.
+ // This is called when a receiver and its track is created.
+ // TODO(zhihuang): Make this pure virtual when all subclasses implement it.
virtual void OnAddTrack(
rtc::scoped_refptr<RtpReceiverInterface> receiver,
const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams) {}
+ // TODO(hbos,deadbeef): Add |OnAssociatedStreamsUpdated| with |receiver| and
+ // |streams| as arguments. This should be called when an existing receiver its
+ // associated streams updated. https://crbug.com/webrtc/8315
+ // This may be blocked on supporting multiple streams per sender or else
+ // this may count as the removal and addition of a track?
+ // https://crbug.com/webrtc/7932
+
+ // Called when a receiver is completely removed. This is current (Plan B SDP)
+ // behavior that occurs when processing the removal of a remote track, and is
+ // called when the receiver is removed and the track is muted. When Unified
+ // Plan SDP is supported, transceivers can change direction (and receivers
+ // stopped) but receivers are never removed.
+ // https://w3c.github.io/webrtc-pc/#process-remote-track-removal
+ // TODO(hbos,deadbeef): When Unified Plan SDP is supported and receivers are
+ // no longer removed, deprecate and remove this callback.
+ // TODO(hbos,deadbeef): Make pure virtual when all subclasses implement it.
+ virtual void OnRemoveTrack(
+ rtc::scoped_refptr<RtpReceiverInterface> receiver) {}
+
protected:
// Dtor protected as objects shouldn't be deleted via this interface.
~PeerConnectionObserver() {}