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

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

Issue 2672793002: Change rtc::VideoSinkWants to have target and a max pixel count (Closed)
Patch Set: Fixed incorrect behavior in VideoAdapter, updated test Created 3 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/videobroadcaster.cc
diff --git a/webrtc/media/base/videobroadcaster.cc b/webrtc/media/base/videobroadcaster.cc
index 6655d9365631a690627b7d3fd9dbc55a7e9a3ec5..5d0edeb6dfe4f9dc3129ba19231716f8caea03f5 100644
--- a/webrtc/media/base/videobroadcaster.cc
+++ b/webrtc/media/base/videobroadcaster.cc
@@ -89,18 +89,20 @@ 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.
+ // TODO(sprang): Consider using the median instead, since the limit can be
+ // expressed by max_pixel_count.
+ 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 = wants.max_pixel_count;
}
current_wants_ = wants;
}

Powered by Google App Engine
This is Rietveld 408576698