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

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: Merging with master. 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
« no previous file with comments | « webrtc/api/peerconnection.h ('k') | webrtc/api/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnection.cc
diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc
index eacbeaedc3c8bd2262169362276572d95772ce73..ee359271c2fc2573b2f209d9af2c365ed6a5970c 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) {
@@ -1500,6 +1496,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;
}
@@ -1533,6 +1538,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;
}
« no previous file with comments | « webrtc/api/peerconnection.h ('k') | webrtc/api/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698