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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 size_uv_(half_width_ * ((height_ + 1) / 2)), | 64 size_uv_(half_width_ * ((height_ + 1) / 2)), |
65 frame_length_(CalcBufferSize(kI420, width_, height_)) {} | 65 frame_length_(CalcBufferSize(kI420, width_, height_)) {} |
66 | 66 |
67 void VideoProcessingTest::SetUp() { | 67 void VideoProcessingTest::SetUp() { |
68 vp_ = VideoProcessing::Create(); | 68 vp_ = VideoProcessing::Create(); |
69 ASSERT_TRUE(vp_ != NULL); | 69 ASSERT_TRUE(vp_ != NULL); |
70 | 70 |
71 video_frame_.CreateEmptyFrame(width_, height_, width_, | 71 video_frame_.CreateEmptyFrame(width_, height_, width_, |
72 half_width_, half_width_); | 72 half_width_, half_width_); |
73 // Clear video frame so DrMemory/Valgrind will allow reads of the buffer. | 73 // Clear video frame so DrMemory/Valgrind will allow reads of the buffer. |
74 memset(video_frame_.buffer(kYPlane), 0, video_frame_.allocated_size(kYPlane)); | 74 memset(video_frame_.video_frame_buffer()->MutableDataY(), 0, |
75 memset(video_frame_.buffer(kUPlane), 0, video_frame_.allocated_size(kUPlane)); | 75 video_frame_.allocated_size(kYPlane)); |
76 memset(video_frame_.buffer(kVPlane), 0, video_frame_.allocated_size(kVPlane)); | 76 memset(video_frame_.video_frame_buffer()->MutableDataU(), 0, |
| 77 video_frame_.allocated_size(kUPlane)); |
| 78 memset(video_frame_.video_frame_buffer()->MutableDataV(), 0, |
| 79 video_frame_.allocated_size(kVPlane)); |
77 const std::string video_file = | 80 const std::string video_file = |
78 webrtc::test::ResourcePath("foreman_cif", "yuv"); | 81 webrtc::test::ResourcePath("foreman_cif", "yuv"); |
79 source_file_ = fopen(video_file.c_str(), "rb"); | 82 source_file_ = fopen(video_file.c_str(), "rb"); |
80 ASSERT_TRUE(source_file_ != NULL) | 83 ASSERT_TRUE(source_file_ != NULL) |
81 << "Cannot read source file: " + video_file + "\n"; | 84 << "Cannot read source file: " + video_file + "\n"; |
82 } | 85 } |
83 | 86 |
84 void VideoProcessingTest::TearDown() { | 87 void VideoProcessingTest::TearDown() { |
85 if (source_file_ != NULL) { | 88 if (source_file_ != NULL) { |
86 ASSERT_EQ(0, fclose(source_file_)); | 89 ASSERT_EQ(0, fclose(source_file_)); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 std::cout << "Watch " << filename.str() << " and verify that it is okay." | 290 std::cout << "Watch " << filename.str() << " and verify that it is okay." |
288 << std::endl; | 291 << std::endl; |
289 FILE* stand_alone_file = fopen(filename.str().c_str(), "wb"); | 292 FILE* stand_alone_file = fopen(filename.str().c_str(), "wb"); |
290 if (PrintVideoFrame(processed, stand_alone_file) < 0) | 293 if (PrintVideoFrame(processed, stand_alone_file) < 0) |
291 std::cerr << "Failed to write: " << filename.str() << std::endl; | 294 std::cerr << "Failed to write: " << filename.str() << std::endl; |
292 if (stand_alone_file) | 295 if (stand_alone_file) |
293 fclose(stand_alone_file); | 296 fclose(stand_alone_file); |
294 } | 297 } |
295 | 298 |
296 } // namespace webrtc | 299 } // namespace webrtc |
OLD | NEW |