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

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

Issue 2354223002: Revert of Move MutableDataY{,U,V} methods to I420Buffer only. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 3 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/libyuv_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 6a7ba15dd2d5ac8f4b448a827f147dc37eebe0df..d05b64462596bfc8e086d0a38d05ebee8708de30 100644
--- a/webrtc/common_video/libyuv/webrtc_libyuv.cc
+++ b/webrtc/common_video/libyuv/webrtc_libyuv.cc
@@ -103,33 +103,31 @@
}
// TODO(nisse): Belongs with the test code?
-int PrintVideoFrame(const VideoFrameBuffer& frame, FILE* file) {
- int width = frame.width();
- int height = frame.height();
+int PrintVideoFrame(const VideoFrame& frame, FILE* file) {
+ if (file == NULL)
+ return -1;
+ if (frame.IsZeroSize())
+ return -1;
+ int width = frame.video_frame_buffer()->width();
+ int height = frame.video_frame_buffer()->height();
int chroma_width = (width + 1) / 2;
int chroma_height = (height + 1) / 2;
- if (PrintPlane(frame.DataY(), width, height,
- frame.StrideY(), file) < 0) {
- return -1;
- }
- if (PrintPlane(frame.DataU(),
+ if (PrintPlane(frame.video_frame_buffer()->DataY(), width, height,
+ frame.video_frame_buffer()->StrideY(), file) < 0) {
+ return -1;
+ }
+ if (PrintPlane(frame.video_frame_buffer()->DataU(),
chroma_width, chroma_height,
- frame.StrideU(), file) < 0) {
- return -1;
- }
- if (PrintPlane(frame.DataV(),
+ frame.video_frame_buffer()->StrideU(), file) < 0) {
+ return -1;
+ }
+ if (PrintPlane(frame.video_frame_buffer()->DataV(),
chroma_width, chroma_height,
- frame.StrideV(), file) < 0) {
+ frame.video_frame_buffer()->StrideV(), file) < 0) {
return -1;
}
return 0;
-}
-
-int PrintVideoFrame(const VideoFrame& frame, FILE* file) {
- if (frame.IsZeroSize())
- return -1;
- return PrintVideoFrame(*frame.video_frame_buffer(), file);
}
int ExtractBuffer(const rtc::scoped_refptr<VideoFrameBuffer>& input_frame,
@@ -251,19 +249,23 @@
int src_height,
size_t sample_size,
VideoRotation rotation,
- I420Buffer* dst_buffer) {
- int dst_width = dst_buffer->width();
- int dst_height = dst_buffer->height();
+ VideoFrame* dst_frame) {
+ int dst_width = dst_frame->width();
+ int dst_height = dst_frame->height();
// LibYuv expects pre-rotation values for dst.
// Stride values should correspond to the destination values.
if (rotation == kVideoRotation_90 || rotation == kVideoRotation_270) {
- std::swap(dst_width, dst_height);
+ dst_width = dst_frame->height();
+ dst_height = dst_frame->width();
}
return libyuv::ConvertToI420(
src_frame, sample_size,
- dst_buffer->MutableDataY(), dst_buffer->StrideY(),
- dst_buffer->MutableDataU(), dst_buffer->StrideU(),
- dst_buffer->MutableDataV(), dst_buffer->StrideV(),
+ dst_frame->video_frame_buffer()->MutableDataY(),
+ dst_frame->video_frame_buffer()->StrideY(),
+ dst_frame->video_frame_buffer()->MutableDataU(),
+ dst_frame->video_frame_buffer()->StrideU(),
+ dst_frame->video_frame_buffer()->MutableDataV(),
+ dst_frame->video_frame_buffer()->StrideV(),
crop_x, crop_y,
src_width, src_height,
dst_width, dst_height,
« no previous file with comments | « webrtc/common_video/libyuv/libyuv_unittest.cc ('k') | webrtc/common_video/video_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698