Enable video adaptation for all screenshare content

Since screenshare uses "Maintain resolution" degradation preference,
adapting should be enabled to reduce framerate if encoder can't keep up.

Bug: chromium:690537
Change-Id: I1f4418b7b7b4faa13f34d5353e3c625a59975c05
Reviewed-on: https://webrtc-review.googlesource.com/95460
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24426}
This commit is contained in:
Ilya Nikolaevskiy 2018-08-22 12:58:55 +02:00 committed by Commit Bot
parent 41dd22b15d
commit 3288168e4f

View File

@ -17,7 +17,6 @@
#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 {
@ -27,8 +26,6 @@ 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
@ -184,10 +181,7 @@ bool VideoCapturer::AdaptFrame(int width,
return false;
}
bool simulcast_screenshare_enabled =
!webrtc::field_trial::IsDisabled(kSimulcastScreenshareFieldTrialName);
if (enable_video_adapter_ &&
(!IsScreencast() || simulcast_screenshare_enabled)) {
if (enable_video_adapter_) {
if (!video_adapter_.AdaptFrameResolution(
width, height, camera_time_us * rtc::kNumNanosecsPerMicrosec,
crop_width, crop_height, out_width, out_height)) {