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

Unified Diff: webrtc/common_video/libyuv/webrtc_libyuv.cc

Issue 2020593002: Refactor scaling. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Trivial rebase. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/common_video/libyuv/scaler_unittest.cc ('k') | webrtc/common_video/video_frame.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/libyuv/webrtc_libyuv.cc
diff --git a/webrtc/common_video/libyuv/webrtc_libyuv.cc b/webrtc/common_video/libyuv/webrtc_libyuv.cc
index 298c4960b1f90d972bdcfcd1dad34a28f2e32bff..44577e9ac8e6beac40001a87af737422d92da624 100644
--- a/webrtc/common_video/libyuv/webrtc_libyuv.cc
+++ b/webrtc/common_video/libyuv/webrtc_libyuv.cc
@@ -130,27 +130,28 @@ int PrintVideoFrame(const VideoFrame& frame, FILE* file) {
return 0;
}
-int ExtractBuffer(const VideoFrame& input_frame, size_t size, uint8_t* buffer) {
+int ExtractBuffer(const rtc::scoped_refptr<VideoFrameBuffer>& input_frame,
+ size_t size,
+ uint8_t* buffer) {
assert(buffer);
- if (input_frame.IsZeroSize())
+ if (!input_frame)
return -1;
- size_t length =
- CalcBufferSize(kI420, input_frame.width(), input_frame.height());
+ int width = input_frame->width();
+ int height = input_frame->height();
+ size_t length = CalcBufferSize(kI420, width, height);
if (size < length) {
return -1;
}
- int width = input_frame.video_frame_buffer()->width();
- int height = input_frame.video_frame_buffer()->height();
int chroma_width = (width + 1) / 2;
int chroma_height = (height + 1) / 2;
- libyuv::I420Copy(input_frame.video_frame_buffer()->DataY(),
- input_frame.video_frame_buffer()->StrideY(),
- input_frame.video_frame_buffer()->DataU(),
- input_frame.video_frame_buffer()->StrideU(),
- input_frame.video_frame_buffer()->DataV(),
- input_frame.video_frame_buffer()->StrideV(),
+ libyuv::I420Copy(input_frame->DataY(),
+ input_frame->StrideY(),
+ input_frame->DataU(),
+ input_frame->StrideU(),
+ input_frame->DataV(),
+ input_frame->StrideV(),
buffer, width,
buffer + width*height, chroma_width,
buffer + width*height + chroma_width*chroma_height,
@@ -160,6 +161,9 @@ int ExtractBuffer(const VideoFrame& input_frame, size_t size, uint8_t* buffer) {
return static_cast<int>(length);
}
+int ExtractBuffer(const VideoFrame& input_frame, size_t size, uint8_t* buffer) {
+ return ExtractBuffer(input_frame.video_frame_buffer(), size, buffer);
+}
int ConvertNV12ToRGB565(const uint8_t* src_frame,
uint8_t* dst_frame,
« no previous file with comments | « webrtc/common_video/libyuv/scaler_unittest.cc ('k') | webrtc/common_video/video_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698