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

Unified Diff: webrtc/media/base/videoadapter.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/videoadapter.cc
diff --git a/webrtc/media/base/videoadapter.cc b/webrtc/media/base/videoadapter.cc
index 9228e6d84cf75846ce3dc72c96cb96c0c0c58ace..c8d0481398f3e3d1161b17d2240487fcb483e8b6 100644
--- a/webrtc/media/base/videoadapter.cc
+++ b/webrtc/media/base/videoadapter.cc
@@ -495,12 +495,25 @@ void CoordinatedVideoAdapter::OnEncoderResolutionRequest(
<< " To: " << new_width << "x" << new_height;
}
+void CoordinatedVideoAdapter::OnCpuResolutionRequest(
+ rtc::Optional<int> max_pixel_count,
+ rtc::Optional<int> max_pixel_count_step_up) {
+ rtc::CritScope cs(&request_critical_section_);
+ if (max_pixel_count && *max_pixel_count < GetOutputNumPixels()) {
+ OnCpuResolutionRequest(DOWNGRADE);
+ } else if (max_pixel_count_step_up &&
+ *max_pixel_count_step_up <= GetOutputNumPixels()) {
perkj_webrtc 2016/02/26 14:08:25 right- this will currently increase the resolution
+ OnCpuResolutionRequest(UPGRADE);
+ }
+}
+
// A Bandwidth GD request for new resolution
void CoordinatedVideoAdapter::OnCpuResolutionRequest(AdaptRequest request) {
rtc::CritScope cs(&request_critical_section_);
if (!cpu_adaptation_) {
return;
}
+
// Update how many times we have downgraded due to the cpu load.
switch (request) {
case DOWNGRADE:

Powered by Google App Engine
This is Rietveld 408576698