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

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: Removed test for screencast from videocapturer 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..9a9666657cfa5423de2e4c8c7a796358e9124634 100644
--- a/webrtc/media/base/videoadapter.cc
+++ b/webrtc/media/base/videoadapter.cc
@@ -495,12 +495,28 @@ 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_);
+ // TODO(perkj): We should support taking larger steps up and down and
+ // actually look at the values set in max_pixel_count and
+ // max_pixel_count_step_up.
+ if (max_pixel_count && *max_pixel_count < GetOutputNumPixels()) {
+ OnCpuResolutionRequest(DOWNGRADE);
+ } else if (max_pixel_count_step_up &&
+ *max_pixel_count_step_up >= GetOutputNumPixels()) {
+ OnCpuResolutionRequest(UPGRADE);
pbos-webrtc 2016/02/26 14:26:18 Should we take this lock recursively or can you an
+ }
+}
+
// 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