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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 } | 239 } |
240 | 240 |
241 TEST(TestVideoFrame, TextureInitialValues) { | 241 TEST(TestVideoFrame, TextureInitialValues) { |
242 test::FakeNativeHandle* handle = new test::FakeNativeHandle(); | 242 test::FakeNativeHandle* handle = new test::FakeNativeHandle(); |
243 VideoFrame frame = test::FakeNativeHandle::CreateFrame( | 243 VideoFrame frame = test::FakeNativeHandle::CreateFrame( |
244 handle, 640, 480, 100, 10, webrtc::kVideoRotation_0); | 244 handle, 640, 480, 100, 10, webrtc::kVideoRotation_0); |
245 EXPECT_EQ(640, frame.width()); | 245 EXPECT_EQ(640, frame.width()); |
246 EXPECT_EQ(480, frame.height()); | 246 EXPECT_EQ(480, frame.height()); |
247 EXPECT_EQ(100u, frame.timestamp()); | 247 EXPECT_EQ(100u, frame.timestamp()); |
248 EXPECT_EQ(10, frame.render_time_ms()); | 248 EXPECT_EQ(10, frame.render_time_ms()); |
249 EXPECT_EQ(handle, frame.native_handle()); | 249 ASSERT_TRUE(frame.video_frame_buffer() != nullptr); |
| 250 EXPECT_EQ(handle, frame.video_frame_buffer()->native_handle()); |
250 | 251 |
251 frame.set_timestamp(200); | 252 frame.set_timestamp(200); |
252 EXPECT_EQ(200u, frame.timestamp()); | 253 EXPECT_EQ(200u, frame.timestamp()); |
253 frame.set_render_time_ms(20); | 254 frame.set_render_time_ms(20); |
254 EXPECT_EQ(20, frame.render_time_ms()); | 255 EXPECT_EQ(20, frame.render_time_ms()); |
255 } | 256 } |
256 | 257 |
257 TEST(TestI420FrameBuffer, Copy) { | 258 TEST(TestI420FrameBuffer, Copy) { |
258 rtc::scoped_refptr<I420Buffer> buf1( | 259 rtc::scoped_refptr<I420Buffer> buf1( |
259 new rtc::RefCountedObject<I420Buffer>(20, 10)); | 260 new rtc::RefCountedObject<I420Buffer>(20, 10)); |
260 memset(buf1->MutableData(kYPlane), 1, 200); | 261 memset(buf1->MutableData(kYPlane), 1, 200); |
261 memset(buf1->MutableData(kUPlane), 2, 50); | 262 memset(buf1->MutableData(kUPlane), 2, 50); |
262 memset(buf1->MutableData(kVPlane), 3, 50); | 263 memset(buf1->MutableData(kVPlane), 3, 50); |
263 rtc::scoped_refptr<I420Buffer> buf2 = I420Buffer::Copy(buf1); | 264 rtc::scoped_refptr<I420Buffer> buf2 = I420Buffer::Copy(buf1); |
264 EXPECT_TRUE(test::FrameBufsEqual(buf1, buf2)); | 265 EXPECT_TRUE(test::FrameBufsEqual(buf1, buf2)); |
265 } | 266 } |
266 | 267 |
267 } // namespace webrtc | 268 } // namespace webrtc |
OLD | NEW |