OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 EXPECT_EQ(colors[i].y, rotated.DataY()[x + y * rotated.StrideY()]); | 104 EXPECT_EQ(colors[i].y, rotated.DataY()[x + y * rotated.StrideY()]); |
105 EXPECT_EQ(colors[i].u, | 105 EXPECT_EQ(colors[i].u, |
106 rotated.DataU()[(x / 2) + (y / 2) * rotated.StrideU()]); | 106 rotated.DataU()[(x / 2) + (y / 2) * rotated.StrideU()]); |
107 EXPECT_EQ(colors[i].v, | 107 EXPECT_EQ(colors[i].v, |
108 rotated.DataV()[(x / 2) + (y / 2) * rotated.StrideV()]); | 108 rotated.DataV()[(x / 2) + (y / 2) * rotated.StrideV()]); |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 } // namespace | 112 } // namespace |
113 | 113 |
| 114 TEST(TestVideoFrame, InitialValues) { |
| 115 VideoFrame frame; |
| 116 EXPECT_TRUE(frame.IsZeroSize()); |
| 117 EXPECT_EQ(kVideoRotation_0, frame.rotation()); |
| 118 } |
| 119 |
114 TEST(TestVideoFrame, WidthHeightValues) { | 120 TEST(TestVideoFrame, WidthHeightValues) { |
115 VideoFrame frame(I420Buffer::Create(10, 10, 10, 14, 90), | 121 VideoFrame frame(I420Buffer::Create(10, 10, 10, 14, 90), |
116 webrtc::kVideoRotation_0, | 122 webrtc::kVideoRotation_0, |
117 789 * rtc::kNumMicrosecsPerMillisec); | 123 789 * rtc::kNumMicrosecsPerMillisec); |
118 const int valid_value = 10; | 124 const int valid_value = 10; |
119 EXPECT_EQ(valid_value, frame.width()); | 125 EXPECT_EQ(valid_value, frame.width()); |
120 EXPECT_EQ(valid_value, frame.height()); | 126 EXPECT_EQ(valid_value, frame.height()); |
121 frame.set_timestamp(123u); | 127 frame.set_timestamp(123u); |
122 EXPECT_EQ(123u, frame.timestamp()); | 128 EXPECT_EQ(123u, frame.timestamp()); |
123 frame.set_ntp_time_ms(456); | 129 frame.set_ntp_time_ms(456); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 CheckRotate(640, 480, GetParam(), *rotated_buffer); | 290 CheckRotate(640, 480, GetParam(), *rotated_buffer); |
285 } | 291 } |
286 | 292 |
287 INSTANTIATE_TEST_CASE_P(Rotate, TestI420BufferRotate, | 293 INSTANTIATE_TEST_CASE_P(Rotate, TestI420BufferRotate, |
288 ::testing::Values(kVideoRotation_0, | 294 ::testing::Values(kVideoRotation_0, |
289 kVideoRotation_90, | 295 kVideoRotation_90, |
290 kVideoRotation_180, | 296 kVideoRotation_180, |
291 kVideoRotation_270)); | 297 kVideoRotation_270)); |
292 | 298 |
293 } // namespace webrtc | 299 } // namespace webrtc |
OLD | NEW |