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

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

Issue 2716643002: Add framerate to VideoSinkWants and ability to signal on overuse (Closed)
Patch Set: Comments Created 3 years, 9 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
« no previous file with comments | « webrtc/media/base/videoadapter_unittest.cc ('k') | webrtc/media/base/videobroadcaster_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/videobroadcaster.cc
diff --git a/webrtc/media/base/videobroadcaster.cc b/webrtc/media/base/videobroadcaster.cc
index 5d0edeb6dfe4f9dc3129ba19231716f8caea03f5..c5b1484110c1775b976afd39f4596cd5aec71bb5 100644
--- a/webrtc/media/base/videobroadcaster.cc
+++ b/webrtc/media/base/videobroadcaster.cc
@@ -84,9 +84,7 @@ void VideoBroadcaster::UpdateWants() {
wants.rotation_applied = true;
}
// wants.max_pixel_count == MIN(sink.wants.max_pixel_count)
- if (sink.wants.max_pixel_count &&
- (!wants.max_pixel_count ||
- (*sink.wants.max_pixel_count < *wants.max_pixel_count))) {
+ if (sink.wants.max_pixel_count < wants.max_pixel_count) {
wants.max_pixel_count = sink.wants.max_pixel_count;
}
// Select the minimum requested target_pixel_count, if any, of all sinks so
@@ -98,11 +96,15 @@ void VideoBroadcaster::UpdateWants() {
(*sink.wants.target_pixel_count < *wants.target_pixel_count))) {
wants.target_pixel_count = sink.wants.target_pixel_count;
}
+ // Select the minimum for the requested max framerates.
+ if (sink.wants.max_framerate_fps < wants.max_framerate_fps) {
+ wants.max_framerate_fps = sink.wants.max_framerate_fps;
+ }
}
- 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;
+ if (wants.target_pixel_count &&
+ *wants.target_pixel_count >= wants.max_pixel_count) {
+ wants.target_pixel_count.emplace(wants.max_pixel_count);
}
current_wants_ = wants;
}
« no previous file with comments | « webrtc/media/base/videoadapter_unittest.cc ('k') | webrtc/media/base/videobroadcaster_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698