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

Unified Diff: webrtc/media/engine/webrtcvideoframe.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
Index: webrtc/media/engine/webrtcvideoframe.cc
diff --git a/webrtc/media/engine/webrtcvideoframe.cc b/webrtc/media/engine/webrtcvideoframe.cc
index 7b5a68064f4277989cf339fac54554d2ad9350eb..f35a45ac6c3a767f2d8b7a0c3c6cbeda5dfcdad5 100644
--- a/webrtc/media/engine/webrtcvideoframe.cc
+++ b/webrtc/media/engine/webrtcvideoframe.cc
@@ -129,9 +129,7 @@
new_height = dw;
}
- rtc::scoped_refptr<webrtc::I420Buffer> buffer =
- webrtc::I420Buffer::Create(new_width, new_height);
- video_frame_buffer_ = buffer;
+ InitToEmptyBuffer(new_width, new_height);
rotation_ = apply_rotation ? webrtc::kVideoRotation_0 : rotation;
int horiz_crop = ((w - dw) / 2) & ~1;
@@ -142,10 +140,15 @@
int idh = (h < 0) ? -dh : dh;
int r = libyuv::ConvertToI420(
sample, sample_size,
- buffer->MutableDataY(), buffer->StrideY(),
- buffer->MutableDataU(), buffer->StrideU(),
- buffer->MutableDataV(), buffer->StrideV(),
- horiz_crop, vert_crop, w, h, dw, idh,
+ video_frame_buffer_->MutableDataY(),
+ video_frame_buffer_->StrideY(),
+ video_frame_buffer_->MutableDataU(),
+ video_frame_buffer_->StrideU(),
+ video_frame_buffer_->MutableDataV(),
+ video_frame_buffer_->StrideV(),
+ horiz_crop, vert_crop,
+ w, h,
+ dw, idh,
static_cast<libyuv::RotationMode>(
apply_rotation ? rotation : webrtc::kVideoRotation_0),
format);
@@ -159,7 +162,7 @@
}
void WebRtcVideoFrame::InitToEmptyBuffer(int w, int h) {
- video_frame_buffer_ = webrtc::I420Buffer::Create(w, h);
+ video_frame_buffer_ = new rtc::RefCountedObject<webrtc::I420Buffer>(w, h);
rotation_ = webrtc::kVideoRotation_0;
}
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2_unittest.cc ('k') | webrtc/modules/video_capture/test/video_capture_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698