OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 11 matching lines...) Expand all Loading... |
22 WebRtcVideoFrameFactoryTest() {} | 22 WebRtcVideoFrameFactoryTest() {} |
23 | 23 |
24 void InitFrame(webrtc::VideoRotation frame_rotation) { | 24 void InitFrame(webrtc::VideoRotation frame_rotation) { |
25 const int frame_width = 1920; | 25 const int frame_width = 1920; |
26 const int frame_height = 1080; | 26 const int frame_height = 1080; |
27 | 27 |
28 // Build the CapturedFrame. | 28 // Build the CapturedFrame. |
29 captured_frame_.fourcc = cricket::FOURCC_I420; | 29 captured_frame_.fourcc = cricket::FOURCC_I420; |
30 captured_frame_.pixel_width = 1; | 30 captured_frame_.pixel_width = 1; |
31 captured_frame_.pixel_height = 1; | 31 captured_frame_.pixel_height = 1; |
32 captured_frame_.time_stamp = rtc::TimeNanos(); | 32 captured_frame_.time_stamp = 5678; |
33 captured_frame_.rotation = frame_rotation; | 33 captured_frame_.rotation = frame_rotation; |
34 captured_frame_.width = frame_width; | 34 captured_frame_.width = frame_width; |
35 captured_frame_.height = frame_height; | 35 captured_frame_.height = frame_height; |
36 captured_frame_.data_size = | 36 captured_frame_.data_size = |
37 (frame_width * frame_height) + | 37 (frame_width * frame_height) + |
38 ((frame_width + 1) / 2) * ((frame_height + 1) / 2) * 2; | 38 ((frame_width + 1) / 2) * ((frame_height + 1) / 2) * 2; |
39 captured_frame_buffer_.reset(new uint8_t[captured_frame_.data_size]); | 39 captured_frame_buffer_.reset(new uint8_t[captured_frame_.data_size]); |
40 // Initialize memory to satisfy DrMemory tests. | 40 // Initialize memory to satisfy DrMemory tests. |
41 memset(captured_frame_buffer_.get(), 0, captured_frame_.data_size); | 41 memset(captured_frame_buffer_.get(), 0, captured_frame_.data_size); |
42 captured_frame_.data = captured_frame_buffer_.get(); | 42 captured_frame_.data = captured_frame_buffer_.get(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 cricket::WebRtcVideoFrameFactory factory_; | 100 cricket::WebRtcVideoFrameFactory factory_; |
101 }; | 101 }; |
102 | 102 |
103 TEST_F(WebRtcVideoFrameFactoryTest, NoApplyRotation) { | 103 TEST_F(WebRtcVideoFrameFactoryTest, NoApplyRotation) { |
104 TestCreateAliasedFrame(false); | 104 TestCreateAliasedFrame(false); |
105 } | 105 } |
106 | 106 |
107 TEST_F(WebRtcVideoFrameFactoryTest, ApplyRotation) { | 107 TEST_F(WebRtcVideoFrameFactoryTest, ApplyRotation) { |
108 TestCreateAliasedFrame(true); | 108 TestCreateAliasedFrame(true); |
109 } | 109 } |
OLD | NEW |