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 2504103002: Adding GetConfiguration to PeerConnection. (Closed)
Patch Set: Fixing typo in comment. Created 4 years, 1 month 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.h » ('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 34beeffa7c152f78fce1486abd4c9f0b31647f3f..7814bb469ef3315a945a8f62cf3ccdc808da8ee8 100644
--- a/webrtc/api/peerconnection.cc
+++ b/webrtc/api/peerconnection.cc
@@ -636,8 +636,6 @@ bool PeerConnection::Initialize(
stats_.reset(new StatsCollector(this));
stats_collector_ = RTCStatsCollector::Create(this);
- enable_ice_renomination_ = configuration.enable_ice_renomination;
-
// Initialize the WebRtcSession. It creates transport channels etc.
if (!session_->Initialize(factory_->options(), std::move(cert_generator),
configuration)) {
@@ -662,6 +660,8 @@ bool PeerConnection::Initialize(
this, &PeerConnection::OnDataChannelDestroyed);
session_->SignalDataChannelOpenMessage.connect(
this, &PeerConnection::OnDataChannelOpenMessage);
+
+ configuration_ = configuration;
return true;
}
@@ -1255,8 +1255,14 @@ void PeerConnection::SetRemoteDescription(
MSG_SET_SESSIONDESCRIPTION_SUCCESS, msg);
}
+PeerConnectionInterface::RTCConfiguration PeerConnection::GetConfiguration() {
+ return configuration_;
+}
+
bool PeerConnection::SetConfiguration(const RTCConfiguration& configuration) {
TRACE_EVENT0("webrtc", "PeerConnection::SetConfiguration");
+ // TODO(deadbeef): Return false and log an error if there are any unsupported
+ // modifications.
if (port_allocator_) {
if (!network_thread()->Invoke<bool>(
RTC_FROM_HERE,
@@ -1269,7 +1275,7 @@ bool PeerConnection::SetConfiguration(const RTCConfiguration& configuration) {
// TODO(deadbeef): Shouldn't have to hop to the worker thread twice...
session_->SetIceConfig(session_->ParseIceConfig(configuration));
- enable_ice_renomination_ = configuration.enable_ice_renomination;
+ configuration_ = configuration;
return true;
}
@@ -1624,7 +1630,8 @@ bool PeerConnection::GetOptionsForOffer(
cricket::TransportOptions();
}
}
- session_options->enable_ice_renomination = enable_ice_renomination_;
+ session_options->enable_ice_renomination =
+ configuration_.enable_ice_renomination;
if (!ExtractMediaSessionOptions(rtc_options, true, session_options)) {
return false;
@@ -1667,7 +1674,8 @@ void PeerConnection::InitializeOptionsForAnswer(
cricket::MediaSessionOptions* session_options) {
session_options->recv_audio = false;
session_options->recv_video = false;
- session_options->enable_ice_renomination = enable_ice_renomination_;
+ session_options->enable_ice_renomination =
+ configuration_.enable_ice_renomination;
}
void PeerConnection::FinishOptionsForAnswer(
« no previous file with comments | « webrtc/api/peerconnection.h ('k') | webrtc/api/peerconnectioninterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698