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

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

Issue 2672793002: Change rtc::VideoSinkWants to have target and a max pixel count (Closed)
Patch Set: Created 3 years, 11 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/videobroadcaster.cc
diff --git a/webrtc/media/base/videobroadcaster.cc b/webrtc/media/base/videobroadcaster.cc
index 6655d9365631a690627b7d3fd9dbc55a7e9a3ec5..d7c6d73df64a515ac712f8d4a8eb4e53e953c699 100644
--- a/webrtc/media/base/videobroadcaster.cc
+++ b/webrtc/media/base/videobroadcaster.cc
@@ -89,18 +89,18 @@ void VideoBroadcaster::UpdateWants() {
(*sink.wants.max_pixel_count < *wants.max_pixel_count))) {
wants.max_pixel_count = sink.wants.max_pixel_count;
}
- // wants.max_pixel_count_step_up == MIN(sink.wants.max_pixel_count_step_up)
- if (sink.wants.max_pixel_count_step_up &&
- (!wants.max_pixel_count_step_up ||
- (*sink.wants.max_pixel_count_step_up <
- *wants.max_pixel_count_step_up))) {
- wants.max_pixel_count_step_up = sink.wants.max_pixel_count_step_up;
+ // Select the minimum requested target_pixel_count, if any, of all sinks so
+ // that we don't over utilize the resources for any one.
+ if (sink.wants.target_pixel_count &&
+ (!wants.target_pixel_count ||
+ (*sink.wants.target_pixel_count < *wants.target_pixel_count))) {
+ wants.target_pixel_count = sink.wants.target_pixel_count;
}
}
- if (wants.max_pixel_count && wants.max_pixel_count_step_up &&
- *wants.max_pixel_count_step_up >= *wants.max_pixel_count) {
- wants.max_pixel_count_step_up = Optional<int>();
+ if (wants.max_pixel_count && wants.target_pixel_count &&
+ *wants.target_pixel_count >= *wants.max_pixel_count) {
+ wants.target_pixel_count = Optional<int>();
nisse-webrtc 2017/02/02 15:34:02 Wouldn't it be more natural in this case to clip t
sprang_webrtc 2017/02/03 13:51:46 Yes, I think so. The outcome won't change, but cha
}
current_wants_ = wants;
}

Powered by Google App Engine
This is Rietveld 408576698