Chromium Code Reviews| Index: talk/app/webrtc/peerconnection.h |
| diff --git a/talk/app/webrtc/peerconnection.h b/talk/app/webrtc/peerconnection.h |
| index cd6f67121f2d32384bbda7889c804134023d36b3..aaaaebaa4619b6073b23617fb6d2636e789b2cdd 100644 |
| --- a/talk/app/webrtc/peerconnection.h |
| +++ b/talk/app/webrtc/peerconnection.h |
| @@ -158,32 +158,16 @@ class PeerConnection : public PeerConnectionInterface, |
| const std::string track_id, |
| uint32_t ssrc) |
| : stream_label(stream_label), track_id(track_id), ssrc(ssrc) {} |
| + bool operator==(const TrackInfo& other) { |
| + return this->stream_label == other.stream_label && |
| + this->track_id == other.track_id && this->ssrc == other.ssrc; |
| + } |
| std::string stream_label; |
| std::string track_id; |
| uint32_t ssrc; |
| }; |
| typedef std::vector<TrackInfo> TrackInfos; |
| - struct RemotePeerInfo { |
| - RemotePeerInfo() |
| - : msid_supported(false), |
| - default_audio_track_needed(false), |
| - default_video_track_needed(false) {} |
| - // True if it has been discovered that the remote peer support MSID. |
| - bool msid_supported; |
| - // The remote peer indicates in the session description that audio will be |
| - // sent but no MSID is given. |
| - bool default_audio_track_needed; |
| - // The remote peer indicates in the session description that video will be |
| - // sent but no MSID is given. |
| - bool default_video_track_needed; |
| - |
| - bool IsDefaultMediaStreamNeeded() { |
| - return !msid_supported && |
| - (default_audio_track_needed || default_video_track_needed); |
| - } |
| - }; |
| - |
| // Implements MessageHandler. |
| void OnMessage(rtc::Message* msg) override; |
| @@ -250,12 +234,14 @@ class PeerConnection : public PeerConnectionInterface, |
| // Called when a media type is rejected (m-line set to port 0). |
| void RemoveTracks(cricket::MediaType media_type); |
| - // Makes sure a MediaStream Track is created for each StreamParam in |
| - // |streams|. |media_type| is the type of the |streams| and can be either |
| - // audio or video. |
| + // Makes sure a MediaStreamTrack is created for each StreamParam in |
| + // |streams|. If |default_track_needed| is true create a default |
| + // MediaStreamTrack. |media_type| is the type of the |streams| and can be |
|
pthatcher1
2015/12/03 20:07:40
Then perhaps a better name would be create_default
Taylor Brandstetter
2015/12/04 22:04:54
But an existing default track will be destroyed if
|
| + // either audio or video. |
| // If a new MediaStream is created it is added to |new_streams|. |
| void UpdateRemoteStreamsList( |
| const std::vector<cricket::StreamParams>& streams, |
| + bool default_track_needed, |
| cricket::MediaType media_type, |
| StreamCollection* new_streams); |
| @@ -279,8 +265,6 @@ class PeerConnection : public PeerConnectionInterface, |
| // exist. |
| void UpdateEndedRemoteMediaStreams(); |
| - void MaybeCreateDefaultStream(); |
| - |
| // Set the MediaStreamTrackInterface::TrackState to |kEnded| on all remote |
| // tracks of type |media_type|. |
| void EndRemoteTracks(cricket::MediaType media_type); |
| @@ -391,7 +375,8 @@ class PeerConnection : public PeerConnectionInterface, |
| std::map<std::string, rtc::scoped_refptr<DataChannel>> rtp_data_channels_; |
| std::vector<rtc::scoped_refptr<DataChannel>> sctp_data_channels_; |
| - RemotePeerInfo remote_info_; |
| + // True if it has been discovered that the remote peer supports MSID. |
| + bool remote_peer_msid_supported_ = false; |
|
pthatcher1
2015/12/03 20:07:40
Perhaps a better name would be remote_peer_support
Taylor Brandstetter
2015/12/04 22:04:54
Done.
|
| rtc::scoped_ptr<RemoteMediaStreamFactory> remote_stream_factory_; |
| std::vector<rtc::scoped_refptr<RtpSenderInterface>> senders_; |