Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Unified Diff: talk/media/webrtc/webrtcvideoengine2.cc

Issue 1433393002: Add separate send-side UMA stats for screenshare and video. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed use-after-free in test Created 5 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 | « talk/libjingle_tests.gyp ('k') | talk/media/webrtc/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « talk/libjingle_tests.gyp ('k') | talk/media/webrtc/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698