Added a callback function OnAddTrack to PeerConnectionObserver
Added the callback in native c++ API.
The callback function is called when a track is added and a new RtpReceiver is created.
The application can tell when tracks are added to the streams by listening to this callback.
BUG=webrtc:6112
Review-Url: https://codereview.webrtc.org/2505173002
Cr-Commit-Position: refs/heads/master@{#15142}
diff --git a/webrtc/api/peerconnectioninterface.h b/webrtc/api/peerconnectioninterface.h
index a597c98..b304b14 100644
--- a/webrtc/api/peerconnectioninterface.h
+++ b/webrtc/api/peerconnectioninterface.h
@@ -598,6 +598,13 @@
// 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.
+ virtual void OnAddTrack(
+ rtc::scoped_refptr<RtpReceiverInterface> receiver,
+ std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams) {}
+
protected:
// Dtor protected as objects shouldn't be deleted via this interface.
~PeerConnectionObserver() {}