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

Side by Side Diff: webrtc/common_video/video_frame_buffer.cc

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 | « webrtc/common_video/include/video_frame_buffer.h ('k') | webrtc/media/base/fakevideorenderer.h » ('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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 buffer->DataU(), buffer->StrideU(), 193 buffer->DataU(), buffer->StrideU(),
194 buffer->DataV(), buffer->StrideV(), 194 buffer->DataV(), buffer->StrideV(),
195 copy->MutableDataY(), copy->StrideY(), 195 copy->MutableDataY(), copy->StrideY(),
196 copy->MutableDataU(), copy->StrideU(), 196 copy->MutableDataU(), copy->StrideU(),
197 copy->MutableDataV(), copy->StrideV(), 197 copy->MutableDataV(), copy->StrideV(),
198 width, height) == 0); 198 width, height) == 0);
199 199
200 return copy; 200 return copy;
201 } 201 }
202 202
203 void I420Buffer::SetToBlack() {
204 RTC_CHECK(libyuv::I420Rect(MutableDataY(), StrideY(),
205 MutableDataU(), StrideU(),
206 MutableDataV(), StrideV(),
207 0, 0, width(), height(),
208 0, 128, 128) == 0);
209 }
210
203 NativeHandleBuffer::NativeHandleBuffer(void* native_handle, 211 NativeHandleBuffer::NativeHandleBuffer(void* native_handle,
204 int width, 212 int width,
205 int height) 213 int height)
206 : native_handle_(native_handle), width_(width), height_(height) { 214 : native_handle_(native_handle), width_(width), height_(height) {
207 RTC_DCHECK(native_handle != nullptr); 215 RTC_DCHECK(native_handle != nullptr);
208 RTC_DCHECK_GT(width, 0); 216 RTC_DCHECK_GT(width, 0);
209 RTC_DCHECK_GT(height, 0); 217 RTC_DCHECK_GT(height, 0);
210 } 218 }
211 219
212 int NativeHandleBuffer::width() const { 220 int NativeHandleBuffer::width() const {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 buffer->StrideV() * uv_offset_y + uv_offset_x; 341 buffer->StrideV() * uv_offset_y + uv_offset_x;
334 return new rtc::RefCountedObject<WrappedI420Buffer>( 342 return new rtc::RefCountedObject<WrappedI420Buffer>(
335 cropped_width, cropped_height, 343 cropped_width, cropped_height,
336 y_plane, buffer->StrideY(), 344 y_plane, buffer->StrideY(),
337 u_plane, buffer->StrideU(), 345 u_plane, buffer->StrideU(),
338 v_plane, buffer->StrideV(), 346 v_plane, buffer->StrideV(),
339 rtc::KeepRefUntilDone(buffer)); 347 rtc::KeepRefUntilDone(buffer));
340 } 348 }
341 349
342 } // namespace webrtc 350 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_video/include/video_frame_buffer.h ('k') | webrtc/media/base/fakevideorenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698