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

Unified Diff: webrtc/media/base/videocapturer_unittest.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/videocapturer_unittest.cc
diff --git a/webrtc/media/base/videocapturer_unittest.cc b/webrtc/media/base/videocapturer_unittest.cc
index 5bbf5c39248eee31e4ebeb3a050c1d0a6c9084c5..0e6f992934962c6d981670f41a13d842f884437b 100644
--- a/webrtc/media/base/videocapturer_unittest.cc
+++ b/webrtc/media/base/videocapturer_unittest.cc
@@ -275,7 +275,7 @@ TEST_F(VideoCapturerTest, SinkWantsMaxPixelAndMaxPixelCountStepUp) {
// Request a lower resolution.
wants.max_pixel_count =
- rtc::Optional<int>(renderer_.width() * renderer_.height() * 3 / 5);
+ rtc::Optional<int>((renderer_.width() * renderer_.height() * 3) / 5);
capturer_->AddOrUpdateSink(&renderer_, wants);
EXPECT_TRUE(capturer_->CaptureFrame());
EXPECT_EQ(3, renderer_.num_rendered_frames());
@@ -294,8 +294,8 @@ TEST_F(VideoCapturerTest, SinkWantsMaxPixelAndMaxPixelCountStepUp) {
EXPECT_EQ(360, renderer2.height());
// Request higher resolution.
- wants.max_pixel_count_step_up = wants.max_pixel_count;
- wants.max_pixel_count = rtc::Optional<int>();
+ wants.target_pixel_count.emplace((*wants.max_pixel_count * 5) / 3);
+ wants.max_pixel_count.emplace(*wants.max_pixel_count * 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