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

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: rebased 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..31d4eef3239fa0653e0d968f198398d775bf96f9 100644
--- a/webrtc/media/base/videoadapter.cc
+++ b/webrtc/media/base/videoadapter.cc
@@ -495,12 +495,31 @@ 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_);
+
+ AdaptRequest request = KEEP;
+ if (!max_pixel_count && !max_pixel_count_step_up) {
+ return;
+ }
+ if (max_pixel_count && *max_pixel_count < GetOutputNumPixels()) {
+ request = DOWNGRADE;
+ } else if (max_pixel_count_step_up &&
+ *max_pixel_count_step_up <= GetOutputNumPixels()) {
+ request = UPGRADE;
+ }
+ OnCpuResolutionRequest(request);
pthatcher1 2016/02/25 07:40:30 Could this be shortened to the following? if (max
perkj_webrtc 2016/02/25 13:57:07 Done.
+}
+
// 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