Enable cpu adaptation for screenshare in chrome as field trial

Bug: webrtc:8433
Change-Id: I1632cb0191b06e99d090a090bad9db20d7a81349
Reviewed-on: https://webrtc-review.googlesource.com/14980
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20411}
This commit is contained in:
Ilya Nikolaevskiy 2017-10-24 13:51:26 +02:00 committed by Commit Bot
parent 21360eb01e
commit a0b66c7566

View File

@ -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<int64_t>(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)) {