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

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

Issue 2698203003: Update sink wants with ranges for both pixel count and frame rate.
Patch Set: Slightly updated sink wants merging in videobroadcaster 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/videocapturer_unittest.cc
diff --git a/webrtc/media/base/videocapturer_unittest.cc b/webrtc/media/base/videocapturer_unittest.cc
index 0e6f992934962c6d981670f41a13d842f884437b..a09a919068ede47a82b2297c82787ba83589a08f 100644
--- a/webrtc/media/base/videocapturer_unittest.cc
+++ b/webrtc/media/base/videocapturer_unittest.cc
@@ -266,7 +266,8 @@ TEST_F(VideoCapturerTest, SinkWantsMaxPixelAndMaxPixelCountStepUp) {
// with less than or equal to |wants.max_pixel_count| depending on how the
// capturer can scale the input frame size.
rtc::VideoSinkWants wants;
- wants.max_pixel_count = rtc::Optional<int>(1280 * 720 * 3 / 5);
+ wants.pixel_count.emplace(
+ rtc::VideoSinkWants::Range(0, 1280 * 720 * 3 / 5, 1280 * 720 - 1));
capturer_->AddOrUpdateSink(&renderer_, wants);
EXPECT_TRUE(capturer_->CaptureFrame());
EXPECT_EQ(2, renderer_.num_rendered_frames());
@@ -274,8 +275,9 @@ TEST_F(VideoCapturerTest, SinkWantsMaxPixelAndMaxPixelCountStepUp) {
EXPECT_EQ(540, renderer_.height());
// Request a lower resolution.
- wants.max_pixel_count =
- rtc::Optional<int>((renderer_.width() * renderer_.height() * 3) / 5);
+ wants.pixel_count.emplace(rtc::VideoSinkWants::Range(
+ 0, (renderer_.width() * renderer_.height() * 3) / 5,
+ renderer_.width() * renderer_.height() - 1));
capturer_->AddOrUpdateSink(&renderer_, wants);
EXPECT_TRUE(capturer_->CaptureFrame());
EXPECT_EQ(3, renderer_.num_rendered_frames());
@@ -294,8 +296,9 @@ TEST_F(VideoCapturerTest, SinkWantsMaxPixelAndMaxPixelCountStepUp) {
EXPECT_EQ(360, renderer2.height());
// Request higher resolution.
- wants.target_pixel_count.emplace((*wants.max_pixel_count * 5) / 3);
- wants.max_pixel_count.emplace(*wants.max_pixel_count * 4);
+ wants.pixel_count.emplace(rtc::VideoSinkWants::Range(
+ 0, (renderer_.width() * renderer_.height() * 5) / 3,
+ renderer_.width() * renderer_.height() * 4));
capturer_->AddOrUpdateSink(&renderer_, wants);
EXPECT_TRUE(capturer_->CaptureFrame());
EXPECT_EQ(5, renderer_.num_rendered_frames());

Powered by Google App Engine
This is Rietveld 408576698