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

Unified Diff: webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc

Issue 2278883002: Move MutableDataY{,U,V} methods to I420Buffer only. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Update android capture and decoder code. Created 4 years, 4 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/modules/video_coding/codecs/vp8/vp8_impl.cc
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
index 179081ae333fef4b3cc0e6fcbbd42bd31c7bb80e..31d70cd0e46c70ea1aa3b1175ee122538706f320 100644
--- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
@@ -1346,18 +1346,18 @@ int VP8DecoderImpl::ReturnFrame(const vpx_image_t* img,
last_frame_width_ = img->d_w;
last_frame_height_ = img->d_h;
// Allocate memory for decoded image.
- VideoFrame decoded_image(buffer_pool_.CreateBuffer(img->d_w, img->d_h),
- timestamp, 0, kVideoRotation_0);
+ rtc::scoped_refptr<I420Buffer> buffer =
+ buffer_pool_.CreateBuffer(img->d_w, img->d_h);
+
libyuv::I420Copy(img->planes[VPX_PLANE_Y], img->stride[VPX_PLANE_Y],
img->planes[VPX_PLANE_U], img->stride[VPX_PLANE_U],
img->planes[VPX_PLANE_V], img->stride[VPX_PLANE_V],
- decoded_image.video_frame_buffer()->MutableDataY(),
- decoded_image.video_frame_buffer()->StrideY(),
- decoded_image.video_frame_buffer()->MutableDataU(),
- decoded_image.video_frame_buffer()->StrideU(),
- decoded_image.video_frame_buffer()->MutableDataV(),
- decoded_image.video_frame_buffer()->StrideV(),
+ buffer->MutableDataY(), buffer->StrideY(),
+ buffer->MutableDataU(), buffer->StrideU(),
+ buffer->MutableDataV(), buffer->StrideV(),
img->d_w, img->d_h);
+
+ VideoFrame decoded_image(buffer, timestamp, 0, kVideoRotation_0);
decoded_image.set_ntp_time_ms(ntp_time_ms);
int ret = decode_complete_callback_->Decoded(decoded_image);
if (ret != 0)

Powered by Google App Engine
This is Rietveld 408576698