Chromium Code Reviews| Index: talk/app/webrtc/mediastreamhandler.h |
| diff --git a/talk/app/webrtc/mediastreamhandler.h b/talk/app/webrtc/mediastreamhandler.h |
| index 801648dc047bf11720c4460cc7d8f6a6824fd425..f76f5ca95877bacdd32339f5829d631bf2cb62c1 100644 |
| --- a/talk/app/webrtc/mediastreamhandler.h |
| +++ b/talk/app/webrtc/mediastreamhandler.h |
| @@ -51,6 +51,8 @@ class TrackHandler : public ObserverInterface { |
| TrackHandler(MediaStreamTrackInterface* track, uint32 ssrc); |
| virtual ~TrackHandler(); |
| virtual void OnChanged(); |
| + // Associate |track_| with |_ssrc|. Can be called multiple times. |
|
pthatcher1
2015/07/08 20:45:31
ssrc_
Taylor Brandstetter
2015/07/08 23:04:03
Fixed
|
| + virtual void Start() = 0; |
| // Stop using |track_| on this PeerConnection. |
| virtual void Stop() = 0; |
| @@ -101,7 +103,7 @@ class LocalAudioTrackHandler : public TrackHandler { |
| uint32 ssrc, |
| AudioProviderInterface* provider); |
| virtual ~LocalAudioTrackHandler(); |
| - |
| + void Start() override; |
| void Stop() override; |
| protected: |
| @@ -127,6 +129,7 @@ class RemoteAudioTrackHandler : public AudioSourceInterface::AudioObserver, |
| uint32 ssrc, |
| AudioProviderInterface* provider); |
| virtual ~RemoteAudioTrackHandler(); |
| + void Start() override; |
| void Stop() override; |
| protected: |
| @@ -150,6 +153,7 @@ class LocalVideoTrackHandler : public TrackHandler { |
| uint32 ssrc, |
| VideoProviderInterface* provider); |
| virtual ~LocalVideoTrackHandler(); |
| + void Start() override; |
| void Stop() override; |
| protected: |
| @@ -170,6 +174,7 @@ class RemoteVideoTrackHandler : public TrackHandler { |
| uint32 ssrc, |
| VideoProviderInterface* provider); |
| virtual ~RemoteVideoTrackHandler(); |
| + void Start() override; |
| void Stop() override; |
| protected: |
| @@ -192,6 +197,7 @@ class MediaStreamHandler : public ObserverInterface { |
| virtual void AddAudioTrack(AudioTrackInterface* audio_track, uint32 ssrc) = 0; |
| virtual void AddVideoTrack(VideoTrackInterface* video_track, uint32 ssrc) = 0; |
| + virtual void RestartTracks() = 0; |
|
pthatcher1
2015/07/08 20:45:31
Maybe "RestartAllTracks" to make it doubly clear i
Taylor Brandstetter
2015/07/08 23:04:03
Done (also changed Restart[Local|Remote]Tracks for
|
| virtual void RemoveTrack(MediaStreamTrackInterface* track); |
| void OnChanged() override; |
| @@ -214,6 +220,7 @@ class LocalMediaStreamHandler : public MediaStreamHandler { |
| void AddAudioTrack(AudioTrackInterface* audio_track, uint32 ssrc) override; |
| void AddVideoTrack(VideoTrackInterface* video_track, uint32 ssrc) override; |
| + void RestartTracks() override; |
| }; |
| class RemoteMediaStreamHandler : public MediaStreamHandler { |
| @@ -224,6 +231,7 @@ class RemoteMediaStreamHandler : public MediaStreamHandler { |
| ~RemoteMediaStreamHandler(); |
| void AddAudioTrack(AudioTrackInterface* audio_track, uint32 ssrc) override; |
| void AddVideoTrack(VideoTrackInterface* video_track, uint32 ssrc) override; |
| + void RestartTracks() override; |
| }; |
| // Container for MediaStreamHandlers of currently known local and remote |
| @@ -256,6 +264,10 @@ class MediaStreamHandlerContainer { |
| void RemoveRemoteTrack(MediaStreamInterface* stream, |
| MediaStreamTrackInterface* track); |
| + // Make all remote track handlers reassociate their corresponding tracks |
| + // with their corresponding SSRCs. |
| + void RestartRemoteTracks(); |
| + |
| // Remove all TrackHandlers for tracks in |stream| and make sure |
| // the audio_provider and video_provider is notified that the tracks has been |
| // removed. |
| @@ -273,6 +285,10 @@ class MediaStreamHandlerContainer { |
| void RemoveLocalTrack(MediaStreamInterface* stream, |
| MediaStreamTrackInterface* track); |
| + // Make all local track handlers reassociate their corresponding tracks |
| + // with their corresponding SSRCs. |
| + void RestartLocalTracks(); |
| + |
| private: |
| typedef std::list<MediaStreamHandler*> StreamHandlerList; |
| MediaStreamHandler* FindStreamHandler(const StreamHandlerList& handlers, |