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

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: 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
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 int StrideU() const override; 102 int StrideU() const override;
103 int StrideV() const override; 103 int StrideV() const override;
104 104
105 void* native_handle() const override; 105 void* native_handle() const override;
106 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; 106 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override;
107 107
108 // Create a new buffer and copy the pixel data. 108 // Create a new buffer and copy the pixel data.
109 static rtc::scoped_refptr<I420Buffer> Copy( 109 static rtc::scoped_refptr<I420Buffer> Copy(
110 const rtc::scoped_refptr<VideoFrameBuffer>& buffer); 110 const rtc::scoped_refptr<VideoFrameBuffer>& buffer);
111 111
112 // Sets the frame buffer to all black.
113 static void SetToBlack(
114 const rtc::scoped_refptr<VideoFrameBuffer>& buffer);
perkj_webrtc 2016/06/02 13:20:04 Why not make a member and put after InitializeData
nisse-webrtc 2016/06/03 14:22:50 Done.
115
112 protected: 116 protected:
113 ~I420Buffer() override; 117 ~I420Buffer() override;
114 118
115 private: 119 private:
116 const int width_; 120 const int width_;
117 const int height_; 121 const int height_;
118 const int stride_y_; 122 const int stride_y_;
119 const int stride_u_; 123 const int stride_u_;
120 const int stride_v_; 124 const int stride_v_;
121 const std::unique_ptr<uint8_t, AlignedFreeDeleter> data_; 125 const std::unique_ptr<uint8_t, AlignedFreeDeleter> data_;
(...skipping 67 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 193 // Helper function to crop |buffer| without making a deep copy. May only be used
190 // for non-native frames. 194 // for non-native frames.
191 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop( 195 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop(
192 const rtc::scoped_refptr<VideoFrameBuffer>& buffer, 196 const rtc::scoped_refptr<VideoFrameBuffer>& buffer,
193 int cropped_width, 197 int cropped_width,
194 int cropped_height); 198 int cropped_height);
195 199
196 } // namespace webrtc 200 } // namespace webrtc
197 201
198 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ 202 #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') | webrtc/media/base/fakevideorenderer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698