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

Unified Diff: webrtc/media/base/videocapturer.cc

Issue 1695263002: Move direct use of VideoCapturer::VideoAdapter to VideoSinkWants. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added from_width && from_height in resolution change req. Created 4 years, 10 months 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
Index: webrtc/media/base/videocapturer.cc
diff --git a/webrtc/media/base/videocapturer.cc b/webrtc/media/base/videocapturer.cc
index 2d6a15e544046e3ee768ae7b39e4c8a18251cca0..c83448dcd35e3b8556118d20b053780329b23b91 100644
--- a/webrtc/media/base/videocapturer.cc
+++ b/webrtc/media/base/videocapturer.cc
@@ -334,6 +334,18 @@ 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 (wants.resolution_request.change !=
+ rtc::VideoSinkWants::ResolutionRequest::NONE &&
+ !IsScreencast() && video_adapter()) {
+ video_adapter()->OnCpuResolutionRequest(
+ wants.resolution_request.change ==
+ rtc::VideoSinkWants::ResolutionRequest::DOWN
+ ? CoordinatedVideoAdapter::DOWNGRADE
+ : CoordinatedVideoAdapter::UPGRADE);
+ }
}
void VideoCapturer::OnFrameCaptured(VideoCapturer*,

Powered by Google App Engine
This is Rietveld 408576698