Chromium Code Reviews| Index: talk/media/webrtc/webrtcvideoengine2.cc |
| diff --git a/talk/media/webrtc/webrtcvideoengine2.cc b/talk/media/webrtc/webrtcvideoengine2.cc |
| index 0f1587d54fbe0ec208f88f633a55760b956b5492..6cbb0b83b8d387e9d17e089fb2b3caaab1f24ff8 100644 |
| --- a/talk/media/webrtc/webrtcvideoengine2.cc |
| +++ b/talk/media/webrtc/webrtcvideoengine2.cc |
| @@ -2142,6 +2142,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetDimensions( |
| // Configured using the same parameters, do not reconfigure. |
| return; |
| } |
| + bool switched_content_type = last_dimensions_.is_screencast != is_screencast; |
| LOG(LS_INFO) << "SetDimensions: " << width << "x" << height |
| << (is_screencast ? " (screencast)" : " (not screencast)"); |
| @@ -2149,6 +2150,12 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetDimensions( |
| last_dimensions_.height = height; |
| last_dimensions_.is_screencast = is_screencast; |
| + if (switched_content_type) { |
| + // If we change content type, reset entire stream so that state is reset |
| + // (stats flushed etc). |
| + RecreateWebRtcStream(); |
|
mflodman
2015/12/02 08:59:13
As I read the code, this will generate a new seque
mflodman
2015/12/02 09:12:25
Now I agree this seems to work, given the magic in
|
| + } |
| + |
| RTC_DCHECK(!parameters_.encoder_config.streams.empty()); |
| RTC_CHECK(parameters_.codec_settings); |