OLD | NEW |
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 Loading... |
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 |
OLD | NEW |