Chromium Code Reviews| Index: webrtc/api/peerconnection.cc |
| diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc |
| index c675015ac9bbee705038fa997b716571eb342357..3d4139c940df269fb555e4667ec5d74b87362bf6 100644 |
| --- a/webrtc/api/peerconnection.cc |
| +++ b/webrtc/api/peerconnection.cc |
| @@ -470,6 +470,7 @@ bool ExtractMediaSessionOptions( |
| session_options->bundle_enabled = rtc_options.use_rtp_mux; |
| for (auto& kv : session_options->transport_options) { |
| kv.second.ice_restart = rtc_options.ice_restart; |
| + kv.second.ice_renomination = rtc_options.ice_renomination; |
| } |
| return true; |
| @@ -513,14 +514,20 @@ bool ParseConstraintsForAnswer(const MediaConstraintsInterface* constraints, |
| session_options->bundle_enabled = true; |
| } |
| + // kIceRestart defaults to false according to spec. |
| bool ice_restart = false; |
| if (FindConstraint(constraints, MediaConstraintsInterface::kIceRestart, |
| &value, &mandatory_constraints_satisfied)) { |
| - // kIceRestart defaults to false according to spec. |
| - ice_restart = true; |
| + ice_restart = value; |
|
honghaiz3
2016/08/11 04:57:58
This appeared to be wrong before.
Plus this value
Taylor Brandstetter
2016/08/11 22:36:50
You're right; setting the value here (in ParseCons
honghaiz3
2016/08/12 18:26:40
Done.
|
| + } |
| + bool ice_renomination = false; |
| + if (FindConstraint(constraints, MediaConstraintsInterface::kIceRenomination, |
| + &value, &mandatory_constraints_satisfied)) { |
| + ice_renomination = value; |
| } |
| for (auto& kv : session_options->transport_options) { |
| kv.second.ice_restart = ice_restart; |
| + kv.second.ice_renomination = ice_renomination; |
| } |
| if (!constraints) { |
| @@ -987,6 +994,11 @@ void PeerConnection::CreateOffer(CreateSessionDescriptionObserver* observer, |
| options.ice_restart = value; |
| } |
| + if (FindConstraint(constraints, MediaConstraintsInterface::kIceRenomination, |
| + &value, &mandatory_constraints)) { |
| + options.ice_renomination = value; |
| + } |
| + |
| if (FindConstraint(constraints, |
| MediaConstraintsInterface::kUseRtpMux, |
| &value, |
| @@ -1649,10 +1661,10 @@ bool PeerConnection::GetOptionsForOffer( |
| return true; |
| } |
| -void PeerConnection::FinishOptionsForAnswer( |
| +void PeerConnection::InitializeOptionsForAnswer( |
| cricket::MediaSessionOptions* session_options) { |
| - // TODO(deadbeef): Once we have transceivers, enumerate them here instead of |
| - // ContentInfos. |
| + session_options->recv_audio = false; |
| + session_options->recv_video = false; |
| if (session_->remote_description()) { |
| // Initialize the transport_options map. |
| for (const cricket::ContentInfo& content : |
| @@ -1661,6 +1673,12 @@ void PeerConnection::FinishOptionsForAnswer( |
| cricket::TransportOptions(); |
| } |
| } |
| +} |
| + |
| +void PeerConnection::FinishOptionsForAnswer( |
| + cricket::MediaSessionOptions* session_options) { |
| + // TODO(deadbeef): Once we have transceivers, enumerate them here instead of |
| + // ContentInfos. |
| AddSendStreams(session_options, senders_, rtp_data_channels_); |
| session_options->bundle_enabled = |
| session_options->bundle_enabled && |
| @@ -1683,8 +1701,7 @@ void PeerConnection::FinishOptionsForAnswer( |
| bool PeerConnection::GetOptionsForAnswer( |
| const MediaConstraintsInterface* constraints, |
| cricket::MediaSessionOptions* session_options) { |
| - session_options->recv_audio = false; |
| - session_options->recv_video = false; |
| + InitializeOptionsForAnswer(session_options); |
| if (!ParseConstraintsForAnswer(constraints, session_options)) { |
| return false; |
| } |
| @@ -1697,8 +1714,7 @@ bool PeerConnection::GetOptionsForAnswer( |
| bool PeerConnection::GetOptionsForAnswer( |
| const RTCOfferAnswerOptions& options, |
| cricket::MediaSessionOptions* session_options) { |
| - session_options->recv_audio = false; |
| - session_options->recv_video = false; |
| + InitializeOptionsForAnswer(session_options); |
| if (!ExtractMediaSessionOptions(options, false, session_options)) { |
| return false; |
| } |