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

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: Fixed wants.rotation_applied = false + fixed unittests. 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..3490c86d0e65ec889d9cecf05486f00f2de7cf25 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*,

Powered by Google App Engine
This is Rietveld 408576698