Index: webrtc/media/base/videocapturer.cc |
diff --git a/webrtc/media/base/videocapturer.cc b/webrtc/media/base/videocapturer.cc |
index 2d6a15e544046e3ee768ae7b39e4c8a18251cca0..b3850401776a4b579b177bc5232f1cadddf067c0 100644 |
--- a/webrtc/media/base/videocapturer.cc |
+++ b/webrtc/media/base/videocapturer.cc |
@@ -320,6 +320,7 @@ void VideoCapturer::GetStats(VariableInfo<int>* adapt_drops_stats, |
void VideoCapturer::RemoveSink( |
rtc::VideoSinkInterface<cricket::VideoFrame>* sink) { |
broadcaster_.RemoveSink(sink); |
+ OnSinkWantsChanged(broadcaster_.wants()); |
} |
void VideoCapturer::AddOrUpdateSink( |
@@ -334,6 +335,13 @@ void VideoCapturer::OnSinkWantsChanged(const rtc::VideoSinkWants& wants) { |
if (frame_factory_) { |
frame_factory_->SetApplyRotation(apply_rotation_); |
} |
+ |
+ // Do not adapt resolution for screen content as this will likely result in |
+ // blurry and unreadable text. |
+ if (!IsScreencast() && video_adapter()) { |
+ video_adapter()->OnCpuResolutionRequest( |
+ wants.max_pixel_count, wants.max_pixel_count_step_up); |
+ } |
} |
void VideoCapturer::OnFrameCaptured(VideoCapturer*, |