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}
This commit is contained in:
@ -598,6 +598,13 @@ class PeerConnectionObserver {
|
||||
// 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() {}
|
||||
|
||||
Reference in New Issue
Block a user