OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2008 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 EXPECT_EQ(4096, scaled_width); | 119 EXPECT_EQ(4096, scaled_width); |
120 EXPECT_EQ(512, scaled_height); | 120 EXPECT_EQ(512, scaled_height); |
121 | 121 |
122 // Request too tall. Expect 1/4 size. | 122 // Request too tall. Expect 1/4 size. |
123 ComputeScale(1024, 8192, 5, &scaled_width, &scaled_height); | 123 ComputeScale(1024, 8192, 5, &scaled_width, &scaled_height); |
124 EXPECT_EQ(256, scaled_width); | 124 EXPECT_EQ(256, scaled_width); |
125 EXPECT_EQ(2048, scaled_height); | 125 EXPECT_EQ(2048, scaled_height); |
126 } | 126 } |
127 | 127 |
128 // Same as TestComputeScale but with 15 fps instead of 5 fps. | 128 // Same as TestComputeScale but with 15 fps instead of 5 fps. |
129 TEST(VideoCommonTest, TestComputeScaleWithHighFps) { | 129 // Disabled for UBSan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5487 |
| 130 #ifdef UNDEFINED_SANITIZER |
| 131 #define MAYBE_TestComputeScaleWithHighFps DISABLED_TestComputeScaleWithHighFps |
| 132 #else |
| 133 #define MAYBE_TestComputeScaleWithHighFps TestComputeScaleWithHighFps |
| 134 #endif |
| 135 TEST(VideoCommonTest, MAYBE_TestComputeScaleWithHighFps) { |
130 int scaled_width, scaled_height; | 136 int scaled_width, scaled_height; |
131 | 137 |
132 // Request small enough but high fps. Expect 1/2 size. | 138 // Request small enough but high fps. Expect 1/2 size. |
133 ComputeScale(2560, 1600, 15, &scaled_width, &scaled_height); | 139 ComputeScale(2560, 1600, 15, &scaled_width, &scaled_height); |
134 EXPECT_EQ(1280, scaled_width); | 140 EXPECT_EQ(1280, scaled_width); |
135 EXPECT_EQ(800, scaled_height); | 141 EXPECT_EQ(800, scaled_height); |
136 | 142 |
137 // Request too many pixels. Expect 1/2 size. | 143 // Request too many pixels. Expect 1/2 size. |
138 ComputeScale(4096, 2560, 15, &scaled_width, &scaled_height); | 144 ComputeScale(4096, 2560, 15, &scaled_width, &scaled_height); |
139 EXPECT_EQ(2048, scaled_width); | 145 EXPECT_EQ(2048, scaled_width); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 // Note that 640x1280 will be scaled down by video adapter to view request | 302 // Note that 640x1280 will be scaled down by video adapter to view request |
297 // of 640*360 and will end up using 320x640. | 303 // of 640*360 and will end up using 320x640. |
298 ComputeScaleToSquarePixels(640, 480, | 304 ComputeScaleToSquarePixels(640, 480, |
299 3, 8, // 4 x 3 pixel aspect ratio | 305 3, 8, // 4 x 3 pixel aspect ratio |
300 &scaled_width, &scaled_height); | 306 &scaled_width, &scaled_height); |
301 EXPECT_EQ(640, scaled_width); | 307 EXPECT_EQ(640, scaled_width); |
302 EXPECT_EQ(1280, scaled_height); | 308 EXPECT_EQ(1280, scaled_height); |
303 } | 309 } |
304 | 310 |
305 } // namespace cricket | 311 } // namespace cricket |
OLD | NEW |