Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: webrtc/modules/video_processing/test/video_processing_unittest.cc

Issue 1963413004: Reland of Delete webrtc::VideoFrame methods buffer and stride. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc ('k') | webrtc/modules/video_processing/video_denoiser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698