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

Side by Side Diff: webrtc/test/fake_texture_frame.h

Issue 2343083002: Revert of Update test code to use I420Buffer when writing pixel data. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « webrtc/common_video/libyuv/webrtc_libyuv.cc ('k') | webrtc/test/frame_generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef WEBRTC_TEST_FAKE_TEXTURE_FRAME_H_ 10 #ifndef WEBRTC_TEST_FAKE_TEXTURE_FRAME_H_
(...skipping 20 matching lines...) Expand all
31 public: 31 public:
32 FakeNativeHandleBuffer(void* native_handle, int width, int height) 32 FakeNativeHandleBuffer(void* native_handle, int width, int height)
33 : NativeHandleBuffer(native_handle, width, height) {} 33 : NativeHandleBuffer(native_handle, width, height) {}
34 34
35 ~FakeNativeHandleBuffer() { 35 ~FakeNativeHandleBuffer() {
36 delete reinterpret_cast<FakeNativeHandle*>(native_handle_); 36 delete reinterpret_cast<FakeNativeHandle*>(native_handle_);
37 } 37 }
38 38
39 private: 39 private:
40 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override { 40 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override {
41 rtc::scoped_refptr<I420Buffer> buffer = I420Buffer::Create(width_, height_); 41 rtc::scoped_refptr<VideoFrameBuffer> buffer(
42 I420Buffer::Create(width_, height_));
42 int half_height = (height_ + 1) / 2; 43 int half_height = (height_ + 1) / 2;
43 int half_width = (width_ + 1) / 2; 44 int half_width = (width_ + 1) / 2;
44 memset(buffer->MutableDataY(), 0, height_ * width_); 45 memset(buffer->MutableDataY(), 0, height_ * width_);
45 memset(buffer->MutableDataU(), 0, half_height * half_width); 46 memset(buffer->MutableDataU(), 0, half_height * half_width);
46 memset(buffer->MutableDataV(), 0, half_height * half_width); 47 memset(buffer->MutableDataV(), 0, half_height * half_width);
47 return buffer; 48 return buffer;
48 } 49 }
49 }; 50 };
50 51
51 } // namespace test 52 } // namespace test
52 } // namespace webrtc 53 } // namespace webrtc
53 #endif // WEBRTC_TEST_FAKE_TEXTURE_FRAME_H_ 54 #endif // WEBRTC_TEST_FAKE_TEXTURE_FRAME_H_
OLDNEW
« no previous file with comments | « webrtc/common_video/libyuv/webrtc_libyuv.cc ('k') | webrtc/test/frame_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698