Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: webrtc/api/peerconnection.cc

Issue 2224563004: Add signaling to support ICE renomination. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Merge with head Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/api/peerconnection.cc
diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc
index c675015ac9bbee705038fa997b716571eb342357..4db3e786112908ba5bbbf2e6f6036c68b8cde22b 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,13 @@ bool ParseConstraintsForAnswer(const MediaConstraintsInterface* constraints,
session_options->bundle_enabled = true;
}
- bool ice_restart = false;
- if (FindConstraint(constraints, MediaConstraintsInterface::kIceRestart,
+ bool ice_renomination = false;
+ if (FindConstraint(constraints, MediaConstraintsInterface::kIceRenomination,
&value, &mandatory_constraints_satisfied)) {
- // kIceRestart defaults to false according to spec.
- ice_restart = true;
+ 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 +987,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 +1654,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 +1666,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 +1694,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 +1707,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;
}

Powered by Google App Engine
This is Rietveld 408576698