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

Side by Side Diff: webrtc/common_video/include/video_frame_buffer.h

Issue 2029273004: New static method I420Buffer::SetToBlack. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add missing SetToBlack call. Created 4 years, 6 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 | « no previous file | webrtc/common_video/video_frame_buffer.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 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 protected: 81 protected:
82 virtual ~VideoFrameBuffer(); 82 virtual ~VideoFrameBuffer();
83 }; 83 };
84 84
85 // Plain I420 buffer in standard memory. 85 // Plain I420 buffer in standard memory.
86 class I420Buffer : public VideoFrameBuffer { 86 class I420Buffer : public VideoFrameBuffer {
87 public: 87 public:
88 I420Buffer(int width, int height); 88 I420Buffer(int width, int height);
89 I420Buffer(int width, int height, int stride_y, int stride_u, int stride_v); 89 I420Buffer(int width, int height, int stride_y, int stride_u, int stride_v);
90
91 // Sets all three planes to all zeros. Used to work around for
92 // quirks in memory checkers
93 // (https://bugs.chromium.org/p/libyuv/issues/detail?id=377) and
94 // ffmpeg (http://crbug.com/390941).
95 // TODO(nisse): Should be deleted if/when those issues are resolved
96 // in a better way.
90 void InitializeData(); 97 void InitializeData();
91 98
99 // Sets the frame buffer to all black.
100 void SetToBlack();
101
92 int width() const override; 102 int width() const override;
93 int height() const override; 103 int height() const override;
94 const uint8_t* DataY() const override; 104 const uint8_t* DataY() const override;
95 const uint8_t* DataU() const override; 105 const uint8_t* DataU() const override;
96 const uint8_t* DataV() const override; 106 const uint8_t* DataV() const override;
97 107
98 uint8_t* MutableDataY() override; 108 uint8_t* MutableDataY() override;
99 uint8_t* MutableDataU() override; 109 uint8_t* MutableDataU() override;
100 uint8_t* MutableDataV() override; 110 uint8_t* MutableDataV() override;
101 int StrideY() const override; 111 int StrideY() const override;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // Helper function to crop |buffer| without making a deep copy. May only be used 199 // Helper function to crop |buffer| without making a deep copy. May only be used
190 // for non-native frames. 200 // for non-native frames.
191 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop( 201 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop(
192 const rtc::scoped_refptr<VideoFrameBuffer>& buffer, 202 const rtc::scoped_refptr<VideoFrameBuffer>& buffer,
193 int cropped_width, 203 int cropped_width,
194 int cropped_height); 204 int cropped_height);
195 205
196 } // namespace webrtc 206 } // namespace webrtc
197 207
198 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ 208 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/common_video/video_frame_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698