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

Unified Diff: webrtc/api/peerconnection.cc

Issue 1671173002: Track pending ICE restarts independently for different media sections. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Extend ICE restart test to check that a second answer has new credentials. Created 4 years, 10 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 a076f3ca3a67996889120c639bec7966e81e33a8..7924f50ec0b7dd31b15436c43bde9cce6af5624a 100644
--- a/webrtc/api/peerconnection.cc
+++ b/webrtc/api/peerconnection.cc
@@ -444,12 +444,10 @@ bool ConvertRtcOptionsForOffer(
}
session_options->vad_enabled = rtc_options.voice_activity_detection;
- session_options->audio_transport_options.ice_restart =
- rtc_options.ice_restart;
- session_options->video_transport_options.ice_restart =
- rtc_options.ice_restart;
- session_options->data_transport_options.ice_restart = rtc_options.ice_restart;
session_options->bundle_enabled = rtc_options.use_rtp_mux;
+ for (auto& kv : session_options->transport_options) {
+ kv.second.ice_restart = rtc_options.ice_restart;
+ }
return true;
}
@@ -492,16 +490,14 @@ bool ParseConstraintsForAnswer(const MediaConstraintsInterface* constraints,
session_options->bundle_enabled = true;
}
+ bool ice_restart = false;
if (FindConstraint(constraints, MediaConstraintsInterface::kIceRestart,
&value, &mandatory_constraints_satisfied)) {
- session_options->audio_transport_options.ice_restart = value;
- session_options->video_transport_options.ice_restart = value;
- session_options->data_transport_options.ice_restart = value;
- } else {
// kIceRestart defaults to false according to spec.
- session_options->audio_transport_options.ice_restart = false;
- session_options->video_transport_options.ice_restart = false;
- session_options->data_transport_options.ice_restart = false;
+ ice_restart = true;
+ }
+ for (auto& kv : session_options->transport_options) {
+ kv.second.ice_restart = ice_restart;
}
if (!constraints) {
@@ -1487,6 +1483,15 @@ void PeerConnection::PostCreateSessionDescriptionFailure(
bool PeerConnection::GetOptionsForOffer(
const PeerConnectionInterface::RTCOfferAnswerOptions& rtc_options,
cricket::MediaSessionOptions* session_options) {
+ // TODO(deadbeef): Once we have transceivers, enumerate them here instead of
+ // ContentInfos.
+ if (session_->local_description()) {
+ for (const cricket::ContentInfo& content :
+ session_->local_description()->description()->contents()) {
+ session_options->transport_options[content.name] =
+ cricket::TransportOptions();
+ }
+ }
if (!ConvertRtcOptionsForOffer(rtc_options, session_options)) {
return false;
}
@@ -1520,6 +1525,16 @@ bool PeerConnection::GetOptionsForAnswer(
cricket::MediaSessionOptions* session_options) {
session_options->recv_audio = false;
session_options->recv_video = false;
+ // TODO(deadbeef): Once we have transceivers, enumerate them here instead of
+ // ContentInfos.
+ if (session_->remote_description()) {
+ // Initialize the transport_options map.
+ for (const cricket::ContentInfo& content :
+ session_->remote_description()->description()->contents()) {
+ session_options->transport_options[content.name] =
+ cricket::TransportOptions();
+ }
+ }
if (!ParseConstraintsForAnswer(constraints, session_options)) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698