From b940a7d97b27bec56d545a54f1dd7a4306656543 Mon Sep 17 00:00:00 2001 From: Evan Shrubsole Date: Thu, 28 May 2020 17:04:56 +0200 Subject: [PATCH] [Adaptation] Add const to Can* methods in VideoSourceRestrictor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R=hbos@webrtc.org Bug: None Change-Id: I36e3f2d55b4a5bca6087baf04099dce5093629ac Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176301 Reviewed-by: Henrik Boström Commit-Queue: Evan Shrubsole Cr-Commit-Position: refs/heads/master@{#31384} --- call/adaptation/video_stream_adapter.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/call/adaptation/video_stream_adapter.cc b/call/adaptation/video_stream_adapter.cc index ebca989f42..28ffc358c5 100644 --- a/call/adaptation/video_stream_adapter.cc +++ b/call/adaptation/video_stream_adapter.cc @@ -194,7 +194,7 @@ class VideoStreamAdapter::VideoSourceRestrictor { int min_pixels_per_frame() const { return min_pixels_per_frame_; } - bool CanDecreaseResolutionTo(int target_pixels) { + bool CanDecreaseResolutionTo(int target_pixels) const { int max_pixels_per_frame = rtc::dchecked_cast( source_restrictions_.max_pixels_per_frame().value_or( std::numeric_limits::max())); @@ -202,7 +202,7 @@ class VideoStreamAdapter::VideoSourceRestrictor { target_pixels >= min_pixels_per_frame_; } - bool CanIncreaseResolutionTo(int target_pixels) { + bool CanIncreaseResolutionTo(int target_pixels) const { int max_pixels_wanted = GetIncreasedMaxPixelsWanted(target_pixels); int max_pixels_per_frame = rtc::dchecked_cast( source_restrictions_.max_pixels_per_frame().value_or( @@ -210,14 +210,14 @@ class VideoStreamAdapter::VideoSourceRestrictor { return max_pixels_wanted > max_pixels_per_frame; } - bool CanDecreaseFrameRateTo(int max_frame_rate) { + bool CanDecreaseFrameRateTo(int max_frame_rate) const { const int fps_wanted = std::max(kMinFrameRateFps, max_frame_rate); return fps_wanted < rtc::dchecked_cast( source_restrictions_.max_frame_rate().value_or( std::numeric_limits::max())); } - bool CanIncreaseFrameRateTo(int max_frame_rate) { + bool CanIncreaseFrameRateTo(int max_frame_rate) const { return max_frame_rate > rtc::dchecked_cast( source_restrictions_.max_frame_rate().value_or( std::numeric_limits::max()));