From a0b66c75663229580b8fed82c34d13f0d96f8337 Mon Sep 17 00:00:00 2001 From: Ilya Nikolaevskiy Date: Tue, 24 Oct 2017 13:51:26 +0200 Subject: [PATCH] Enable cpu adaptation for screenshare in chrome as field trial MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:8433 Change-Id: I1632cb0191b06e99d090a090bad9db20d7a81349 Reviewed-on: https://webrtc-review.googlesource.com/14980 Reviewed-by: Magnus Jedvert Reviewed-by: Erik Språng Commit-Queue: Ilya Nikolaevskiy Cr-Commit-Position: refs/heads/master@{#20411} --- media/base/videocapturer.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/media/base/videocapturer.cc b/media/base/videocapturer.cc index 592f3e20e3..88cf9a8e3e 100644 --- a/media/base/videocapturer.cc +++ b/media/base/videocapturer.cc @@ -17,6 +17,7 @@ #include "api/video/i420_buffer.h" #include "api/video/video_frame.h" #include "rtc_base/logging.h" +#include "system_wrappers/include/field_trial.h" namespace cricket { @@ -26,6 +27,8 @@ static const int64_t kMaxDistance = ~(static_cast(1) << 63); #ifdef WEBRTC_LINUX static const int kYU12Penalty = 16; // Needs to be higher than MJPG index. #endif +static const char* kSimulcastScreenshareFieldTrialName = + "WebRTC-SimulcastScreenshare"; } // namespace @@ -174,7 +177,10 @@ bool VideoCapturer::AdaptFrame(int width, return false; } - if (enable_video_adapter_ && !IsScreencast()) { + bool simulcast_screenshare_enabled = + webrtc::field_trial::IsEnabled(kSimulcastScreenshareFieldTrialName); + if (enable_video_adapter_ && + (!IsScreencast() || simulcast_screenshare_enabled)) { if (!video_adapter_.AdaptFrameResolution( width, height, camera_time_us * rtc::kNumNanosecsPerMicrosec, crop_width, crop_height, out_width, out_height)) {