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

Unified Diff: webrtc/common_video/video_frame_buffer.cc

Issue 2005733003: Refactor VideoDenoiser to work with I420Buffer, not VideoFrame. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/common_video/video_frame_buffer.cc
diff --git a/webrtc/common_video/video_frame_buffer.cc b/webrtc/common_video/video_frame_buffer.cc
index 700dcaf02b7af098798eb51e344f065b232a8700..91c288778e7149199db3989d79557fbc9bd0c211 100644
--- a/webrtc/common_video/video_frame_buffer.cc
+++ b/webrtc/common_video/video_frame_buffer.cc
@@ -207,6 +207,26 @@ rtc::scoped_refptr<I420Buffer> I420Buffer::Copy(
return copy;
}
+rtc::scoped_refptr<I420Buffer> I420Buffer::CopyKeepStride(
+ const rtc::scoped_refptr<VideoFrameBuffer>& buffer) {
+ int width = buffer->width();
+ int height = buffer->height();
+ int stride_y = buffer->StrideY();
+ int stride_u = buffer->StrideU();
+ int stride_v = buffer->StrideV();
+ rtc::scoped_refptr<I420Buffer> copy = new rtc::RefCountedObject<I420Buffer>(
+ width, height, stride_y, stride_u, stride_v);
+ RTC_CHECK(libyuv::I420Copy(buffer->DataY(), stride_y,
+ buffer->DataU(), stride_u,
+ buffer->DataV(), stride_v,
+ copy->MutableDataY(), stride_y,
+ copy->MutableDataU(), stride_u,
+ copy->MutableDataV(), stride_v,
+ width, height) == 0);
+
+ return copy;
jackychen 2016/06/09 19:08:36 Could you use a better name instead of copy? At le
nisse-webrtc 2016/06/10 11:09:19 To me, "copy" seems quite clear from the context,
+}
+
NativeHandleBuffer::NativeHandleBuffer(void* native_handle,
int width,
int height)
« no previous file with comments | « webrtc/common_video/include/video_frame_buffer.h ('k') | webrtc/modules/video_processing/frame_preprocessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698