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

Unified Diff: webrtc/common_video/video_frame.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/webrtc_libyuv.cc ('k') | webrtc/common_video/video_frame_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/video_frame.cc
diff --git a/webrtc/common_video/video_frame.cc b/webrtc/common_video/video_frame.cc
index 4b29be9d16b0b65a0302b92db32ffe3dcba2b92c..e00ca27b8a9a63e6d385f44a6febcc06312e9bd4 100644
--- a/webrtc/common_video/video_frame.cc
+++ b/webrtc/common_video/video_frame.cc
@@ -87,18 +87,10 @@
const int expected_size_y = height * stride_y;
const int expected_size_u = half_height * stride_u;
const int expected_size_v = half_height * stride_v;
- // Allocate a new buffer.
- rtc::scoped_refptr<I420Buffer> buffer_ =
- I420Buffer::Create(width, height, stride_y, stride_u, stride_v);
-
- memcpy(buffer_->MutableDataY(), buffer_y, expected_size_y);
- memcpy(buffer_->MutableDataU(), buffer_u, expected_size_u);
- memcpy(buffer_->MutableDataV(), buffer_v, expected_size_v);
-
- video_frame_buffer_ = buffer_;
- timestamp_rtp_ = 0;
- ntp_time_ms_ = 0;
- timestamp_us_ = 0;
+ CreateEmptyFrame(width, height, stride_y, stride_u, stride_v);
+ memcpy(video_frame_buffer_->MutableDataY(), buffer_y, expected_size_y);
+ memcpy(video_frame_buffer_->MutableDataU(), buffer_u, expected_size_u);
+ memcpy(video_frame_buffer_->MutableDataV(), buffer_v, expected_size_v);
rotation_ = rotation;
}
« no previous file with comments | « webrtc/common_video/libyuv/webrtc_libyuv.cc ('k') | webrtc/common_video/video_frame_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698