| Index: talk/media/webrtc/webrtcvideoengine2.cc
|
| diff --git a/talk/media/webrtc/webrtcvideoengine2.cc b/talk/media/webrtc/webrtcvideoengine2.cc
|
| index d33d1909cf65fb1a7a1471ec0ea280d2ada6a509..247748d6bc0d8285a76c32b8710a13e97887910e 100644
|
| --- a/talk/media/webrtc/webrtcvideoengine2.cc
|
| +++ b/talk/media/webrtc/webrtcvideoengine2.cc
|
| @@ -855,6 +855,22 @@ WebRtcVideoChannel2::FilterSupportedCodecs(
|
| return supported_codecs;
|
| }
|
|
|
| +bool WebRtcVideoChannel2::SetSendParameters(const VideoSendParameters& params) {
|
| + // TODO(pbos): Refactor this to only recreate the send streams once
|
| + // instead of 4 times.
|
| + return (SetSendCodecs(params.codecs) &&
|
| + SetSendRtpHeaderExtensions(params.extensions) &&
|
| + SetMaxSendBandwidth(params.max_bandwidth_bps) &&
|
| + SetOptions(params.options));
|
| +}
|
| +
|
| +bool WebRtcVideoChannel2::SetRecvParameters(const VideoRecvParameters& params) {
|
| + // TODO(pbos): Refactor this to only recreate the recv streams once
|
| + // instead of twice.
|
| + return (SetRecvCodecs(params.codecs) &&
|
| + SetRecvRtpHeaderExtensions(params.extensions));
|
| +}
|
| +
|
| bool WebRtcVideoChannel2::SetRecvCodecs(const std::vector<VideoCodec>& codecs) {
|
| TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::SetRecvCodecs");
|
| LOG(LS_INFO) << "SetRecvCodecs: " << CodecVectorToString(codecs);
|
| @@ -1534,7 +1550,8 @@ bool WebRtcVideoChannel2::SetOptions(const VideoOptions& options) {
|
| LOG(LS_INFO) << "SetOptions: " << options.ToString();
|
| VideoOptions old_options = options_;
|
| options_.SetAll(options);
|
| - if (options_ == old_options) {
|
| +
|
| + if (options_ == old_options && options_set_) {
|
| // No new options to set.
|
| return true;
|
| }
|
| @@ -1542,10 +1559,12 @@ bool WebRtcVideoChannel2::SetOptions(const VideoOptions& options) {
|
| rtc::CritScope lock(&capturer_crit_);
|
| options_.cpu_overuse_detection.Get(&signal_cpu_adaptation_);
|
| }
|
| +
|
| rtc::DiffServCodePoint dscp = options_.dscp.GetWithDefaultIfUnset(false)
|
| ? rtc::DSCP_AF41
|
| : rtc::DSCP_DEFAULT;
|
| MediaChannel::SetDscp(dscp);
|
| +
|
| rtc::CritScope stream_lock(&stream_crit_);
|
| for (std::map<uint32, WebRtcVideoSendStream*>::iterator it =
|
| send_streams_.begin();
|
| @@ -1553,6 +1572,7 @@ bool WebRtcVideoChannel2::SetOptions(const VideoOptions& options) {
|
| ++it) {
|
| it->second->SetOptions(options_);
|
| }
|
| + options_set_ = true;
|
| return true;
|
| }
|
|
|
|
|