Index: webrtc/media/engine/webrtcvideoengine2.cc |
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc |
index 0dd8938dc3451758fb0441cb4df457baa6832abe..26d7b70a76c77b351e184a0ad19fe8ca9c45e367 100644 |
--- a/webrtc/media/engine/webrtcvideoengine2.cc |
+++ b/webrtc/media/engine/webrtcvideoengine2.cc |
@@ -733,15 +733,6 @@ bool WebRtcVideoChannel2::GetChangedSendParameters( |
params.max_bandwidth_bps == 0 ? -1 : params.max_bandwidth_bps); |
} |
- // Handle options. |
- // TODO(pbos): Require VideoSendParameters to contain a full set of options |
- // and check if params.options != options_ instead of applying a delta. |
- VideoOptions new_options = options_; |
- new_options.SetAll(params.options); |
- if (!(new_options == options_)) { |
- changed_params->options = rtc::Optional<VideoOptions>(new_options); |
- } |
- |
// Handle RTCP mode. |
if (params.rtcp.reduced_size != send_params_.rtcp.reduced_size) { |
changed_params->rtcp_mode = rtc::Optional<webrtc::RtcpMode>( |
@@ -800,9 +791,6 @@ bool WebRtcVideoChannel2::SetSendParameters(const VideoSendParameters& params) { |
call_->SetBitrateConfig(bitrate_config_); |
} |
- if (changed_params.options) |
- options_.SetAll(*changed_params.options); |
- |
{ |
rtc::CritScope stream_lock(&stream_crit_); |
for (auto& kv : send_streams_) { |
@@ -950,9 +938,7 @@ bool WebRtcVideoChannel2::SetVideoSend(uint32_t ssrc, bool enable, |
return false; |
} |
if (enable && options) { |
- VideoSendParameters new_params = send_params_; |
- new_params.options.SetAll(*options); |
- SetSendParameters(send_params_); |
+ SetOptions(ssrc, *options); |
} |
return true; |
} |
@@ -1376,10 +1362,15 @@ bool WebRtcVideoChannel2::MuteStream(uint32_t ssrc, bool mute) { |
} |
// TODO(pbos): Remove SetOptions in favor of SetSendParameters. |
-void WebRtcVideoChannel2::SetOptions(const VideoOptions& options) { |
- VideoSendParameters new_params = send_params_; |
- new_params.options.SetAll(options); |
- SetSendParameters(send_params_); |
+void WebRtcVideoChannel2::SetOptions(uint32_t ssrc, |
+ const VideoOptions& options) { |
+ LOG(LS_INFO) << "SetOptions: ssrc " << ssrc << ": " << options.ToString(); |
+ |
+ rtc::CritScope stream_lock(&stream_crit_); |
+ if (send_streams_.find(ssrc) == send_streams_.end()) { |
+ return; |
+ } |
+ send_streams_[ssrc]->SetOptions(options); |
} |
void WebRtcVideoChannel2::SetInterface(NetworkInterface* iface) { |
@@ -1794,17 +1785,8 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetSendParameters( |
} |
// Set codecs and options. |
if (params.codec) { |
- SetCodecAndOptions(*params.codec, |
- params.options ? *params.options : parameters_.options); |
+ SetCodecAndOptions(*params.codec, parameters_.options); |
return; |
- } else if (params.options) { |
- // Reconfigure if codecs are already set. |
- if (parameters_.codec_settings) { |
- SetCodecAndOptions(*parameters_.codec_settings, *params.options); |
- return; |
- } else { |
- parameters_.options = *params.options; |
- } |
} |
if (recreate_stream) { |
LOG(LS_INFO) << "RecreateWebRtcStream (send) because of SetSendParameters"; |