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

Side by Side Diff: webrtc/media/base/videoadapter_unittest.cc

Issue 2713683002: Fix issue where video scaling gets stuck at low resolution (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « webrtc/media/base/videoadapter.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 adapter_.OnResolutionRequest(rtc::Optional<int>(), 1009 adapter_.OnResolutionRequest(rtc::Optional<int>(),
1010 rtc::Optional<int>(640 * 480 - 1)); 1010 rtc::Optional<int>(640 * 480 - 1));
1011 1011
1012 // Still expect all frames to be dropped 1012 // Still expect all frames to be dropped
1013 EXPECT_FALSE(adapter_.AdaptFrameResolution( 1013 EXPECT_FALSE(adapter_.AdaptFrameResolution(
1014 capture_format_.width, capture_format_.height, 0, 1014 capture_format_.width, capture_format_.height, 0,
1015 &cropped_width_, &cropped_height_, 1015 &cropped_width_, &cropped_height_,
1016 &out_width_, &out_height_)); 1016 &out_width_, &out_height_));
1017 } 1017 }
1018 1018
1019 // Test that we will adapt to max given a target pixel count close to max.
1020 TEST_F(VideoAdapterTest, TestAdaptToMax) {
1021 adapter_.OnOutputFormatRequest(VideoFormat(640, 360, 0, FOURCC_I420));
1022 adapter_.OnResolutionRequest(rtc::Optional<int>(640 * 360 - 1) /* target */,
1023 rtc::Optional<int>());
1024
1025 EXPECT_TRUE(adapter_.AdaptFrameResolution(640, 360, 0, &cropped_width_,
1026 &cropped_height_, &out_width_,
1027 &out_height_));
1028 EXPECT_EQ(640, out_width_);
1029 EXPECT_EQ(360, out_height_);
1030 }
1031
1019 } // namespace cricket 1032 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/base/videoadapter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698