Chromium Code Reviews| Index: webrtc/media/engine/webrtcvideoengine2.cc |
| diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc |
| index c192b52402ee95ef3f2ffd9dbe25f65ded5ecf6d..02063954921b28a228a7de8a6dbc576c042a9154 100644 |
| --- a/webrtc/media/engine/webrtcvideoengine2.cc |
| +++ b/webrtc/media/engine/webrtcvideoengine2.cc |
| @@ -1612,7 +1612,15 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetVideoSend( |
| if (options_present) { |
| VideoOptions old_options = parameters_.options; |
| parameters_.options.SetAll(*options); |
| - if (parameters_.options != old_options) { |
| + if (parameters_.options.is_screencast.value_or(false) != |
| + old_options.is_screencast.value_or(false) && |
| + parameters_.codec_settings) { |
|
pthatcher1
2017/02/22 22:24:14
This needs to test that all the other parameters_.
Taylor Brandstetter
2017/02/23 00:46:49
Why? A whole new webrtc::VideoEncoder will be crea
pthatcher1
2017/02/23 21:05:33
First, it's not clear from the code that this case
sprang_webrtc
2017/02/26 13:41:27
Agree that it's not entirely obvious that Reconfig
|
| + // If screen content settings change, we may need to recreate the codec |
| + // instance so that the correct type is used. Add a param to force the |
| + // SetCodec() to not resuse the current instance. |
| + allocated_encoder_.codec.params["recreate"] = "true"; |
|
pthatcher1
2017/02/22 22:24:14
What is this codec parameter? Is it already defin
sprang_webrtc
2017/02/23 15:10:14
It is kinda hacky, and is workaround just to avoid
pthatcher1
2017/02/23 21:05:33
It seems like we should just have a small refactor
Taylor Brandstetter
2017/02/24 00:13:55
Or, just make CreateVideoEncoder a bit smarter. Th
sprang_webrtc
2017/02/26 13:41:27
CreateVideoEncoder doesn't know about the change i
|
| + SetCodec(*parameters_.codec_settings); |
| + } else if (parameters_.options != old_options) { |
| ReconfigureEncoder(); |
| } |
| } |