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 | |
120 TEST(TestVideoFrame, WidthHeightValues) { | 114 TEST(TestVideoFrame, WidthHeightValues) { |
121 VideoFrame frame(I420Buffer::Create(10, 10, 10, 14, 90), | 115 VideoFrame frame(I420Buffer::Create(10, 10, 10, 14, 90), |
122 webrtc::kVideoRotation_0, | 116 webrtc::kVideoRotation_0, |
123 789 * rtc::kNumMicrosecsPerMillisec); | 117 789 * rtc::kNumMicrosecsPerMillisec); |
124 const int valid_value = 10; | 118 const int valid_value = 10; |
125 EXPECT_EQ(valid_value, frame.width()); | 119 EXPECT_EQ(valid_value, frame.width()); |
126 EXPECT_EQ(valid_value, frame.height()); | 120 EXPECT_EQ(valid_value, frame.height()); |
127 frame.set_timestamp(123u); | 121 frame.set_timestamp(123u); |
128 EXPECT_EQ(123u, frame.timestamp()); | 122 EXPECT_EQ(123u, frame.timestamp()); |
129 frame.set_ntp_time_ms(456); | 123 frame.set_ntp_time_ms(456); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 CheckRotate(640, 480, GetParam(), *rotated_buffer); | 284 CheckRotate(640, 480, GetParam(), *rotated_buffer); |
291 } | 285 } |
292 | 286 |
293 INSTANTIATE_TEST_CASE_P(Rotate, TestI420BufferRotate, | 287 INSTANTIATE_TEST_CASE_P(Rotate, TestI420BufferRotate, |
294 ::testing::Values(kVideoRotation_0, | 288 ::testing::Values(kVideoRotation_0, |
295 kVideoRotation_90, | 289 kVideoRotation_90, |
296 kVideoRotation_180, | 290 kVideoRotation_180, |
297 kVideoRotation_270)); | 291 kVideoRotation_270)); |
298 | 292 |
299 } // namespace webrtc | 293 } // namespace webrtc |
OLD | NEW |