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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // Make a shallow copy of |frame1|. | 236 // Make a shallow copy of |frame1|. |
237 VideoFrame frame2(frame1.video_frame_buffer(), 0, 0, kVideoRotation_0); | 237 VideoFrame frame2(frame1.video_frame_buffer(), 0, 0, kVideoRotation_0); |
238 frame1.CreateEmptyFrame(640, 320, 640, 320, 320); | 238 frame1.CreateEmptyFrame(640, 320, 640, 320, 320); |
239 EXPECT_NE(y, frame1.buffer(kYPlane)); | 239 EXPECT_NE(y, frame1.buffer(kYPlane)); |
240 EXPECT_NE(u, frame1.buffer(kUPlane)); | 240 EXPECT_NE(u, frame1.buffer(kUPlane)); |
241 EXPECT_NE(v, frame1.buffer(kVPlane)); | 241 EXPECT_NE(v, frame1.buffer(kVPlane)); |
242 } | 242 } |
243 | 243 |
244 TEST(TestVideoFrame, TextureInitialValues) { | 244 TEST(TestVideoFrame, TextureInitialValues) { |
245 test::FakeNativeHandle* handle = new test::FakeNativeHandle(); | 245 test::FakeNativeHandle* handle = new test::FakeNativeHandle(); |
246 VideoFrame frame = test::CreateFakeNativeHandleFrame( | 246 VideoFrame frame = test::FakeNativeHandle::CreateFrame( |
247 handle, 640, 480, 100, 10, webrtc::kVideoRotation_0); | 247 handle, 640, 480, 100, 10, webrtc::kVideoRotation_0); |
248 EXPECT_EQ(640, frame.width()); | 248 EXPECT_EQ(640, frame.width()); |
249 EXPECT_EQ(480, frame.height()); | 249 EXPECT_EQ(480, frame.height()); |
250 EXPECT_EQ(100u, frame.timestamp()); | 250 EXPECT_EQ(100u, frame.timestamp()); |
251 EXPECT_EQ(10, frame.render_time_ms()); | 251 EXPECT_EQ(10, frame.render_time_ms()); |
252 EXPECT_EQ(handle, frame.native_handle()); | 252 EXPECT_EQ(handle, frame.native_handle()); |
253 | 253 |
254 frame.set_timestamp(200); | 254 frame.set_timestamp(200); |
255 EXPECT_EQ(200u, frame.timestamp()); | 255 EXPECT_EQ(200u, frame.timestamp()); |
256 frame.set_render_time_ms(20); | 256 frame.set_render_time_ms(20); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 int ExpectedSize(int plane_stride, int image_height, PlaneType type) { | 295 int ExpectedSize(int plane_stride, int image_height, PlaneType type) { |
296 if (type == kYPlane) { | 296 if (type == kYPlane) { |
297 return (plane_stride * image_height); | 297 return (plane_stride * image_height); |
298 } else { | 298 } else { |
299 int half_height = (image_height + 1) / 2; | 299 int half_height = (image_height + 1) / 2; |
300 return (plane_stride * half_height); | 300 return (plane_stride * half_height); |
301 } | 301 } |
302 } | 302 } |
303 | 303 |
304 } // namespace webrtc | 304 } // namespace webrtc |
OLD | NEW |