#pragma once #include #include "WebRTCPlugin.h" namespace unity { namespace webrtc { class Context; class MediaStreamObserver : public ::webrtc::MediaStreamObserver, public sigslot::has_slots<> { public: explicit MediaStreamObserver(webrtc::MediaStreamInterface* stream, Context* context); void RegisterOnAddTrack(DelegateMediaStreamOnAddTrack callback); void RegisterOnRemoveTrack(DelegateMediaStreamOnRemoveTrack callback); private: void OnVideoTrackAdded(webrtc::VideoTrackInterface* track, webrtc::MediaStreamInterface* stream); void OnAudioTrackAdded(webrtc::AudioTrackInterface* track, webrtc::MediaStreamInterface* stream); void OnVideoTrackRemoved(webrtc::VideoTrackInterface* track, webrtc::MediaStreamInterface* stream); void OnAudioTrackRemoved(webrtc::AudioTrackInterface* track, webrtc::MediaStreamInterface* stream); std::list m_listOnAddTrack; std::list m_listOnRemoveTrack; Context* m_context; }; } // end namespace webrtc } // end namespace unity