Index: webrtc/media/base/videobroadcaster.cc |
diff --git a/webrtc/media/base/videobroadcaster.cc b/webrtc/media/base/videobroadcaster.cc |
index e369ee07c632480404080415271572d593c87f06..3c98a00e894efd8658ccfc23d9829d940a751a5a 100644 |
--- a/webrtc/media/base/videobroadcaster.cc |
+++ b/webrtc/media/base/videobroadcaster.cc |
@@ -33,8 +33,26 @@ void VideoBroadcaster::AddOrUpdateSink( |
// Rotation must be applied by the source if one sink wants it. |
current_wants_.rotation_applied = false; |
+ current_wants_.resolution_request.change = |
+ VideoSinkWants::ResolutionRequest::NONE; |
for (auto& sink_pair : sinks_) { |
current_wants_.rotation_applied |= sink_pair.wants.rotation_applied; |
+ |
+ if (sink_pair.wants.resolution_request.change == |
+ VideoSinkWants::ResolutionRequest::UP && |
+ current_wants_.resolution_request.change != |
+ VideoSinkWants::ResolutionRequest::DOWN && |
+ sink_pair.wants.resolution_request.from_width >= width_ && |
+ sink_pair.wants.resolution_request.from_height >= height_) { |
+ current_wants_.resolution_request = sink_pair.wants.resolution_request; |
+ } |
+ |
+ if (sink_pair.wants.resolution_request.change == |
+ VideoSinkWants::ResolutionRequest::DOWN && |
+ sink_pair.wants.resolution_request.from_width <= width_ && |
+ sink_pair.wants.resolution_request.from_height <= height_) { |
+ current_wants_.resolution_request = sink_pair.wants.resolution_request; |
+ } |
} |
} |
@@ -63,6 +81,8 @@ VideoSinkWants VideoBroadcaster::wants() const { |
void VideoBroadcaster::OnFrame(const cricket::VideoFrame& frame) { |
RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
+ width_ = frame.GetWidth(); |
+ height_ = frame.GetHeight(); |
for (auto& sink_pair : sinks_) { |
sink_pair.sink->OnFrame(frame); |
} |