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

Unified Diff: webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc

Issue 2927943003: Return WrappedI444Buffer in VP9Impl (Closed)
Patch Set: Fix Windows compile error Created 3 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
Index: webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
index 8e4560a720b67117f2fe48c589c3ff5543047085..14ea6d245fc5fa9c6d313558ecdf160e067e79d5 100644
--- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
+++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
@@ -964,18 +964,22 @@ int VP9DecoderImpl::ReturnFrame(const vpx_image_t* img,
// vpx_codec_decode calls or vpx_codec_destroy).
Vp9FrameBufferPool::Vp9FrameBuffer* img_buffer =
static_cast<Vp9FrameBufferPool::Vp9FrameBuffer*>(img->fb_priv);
+
+ VideoFrameBuffer::Type type = img->fmt == VPX_IMG_FMT_I444
+ ? VideoFrameBuffer::Type::kI444
+ : VideoFrameBuffer::Type::kI420;
+
// The buffer can be used directly by the VideoFrame (without copy) by
- // using a WrappedI420Buffer.
- rtc::scoped_refptr<WrappedI420Buffer> img_wrapped_buffer(
- new rtc::RefCountedObject<webrtc::WrappedI420Buffer>(
- img->d_w, img->d_h, 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],
- // WrappedI420Buffer's mechanism for allowing the release of its frame
- // buffer is through a callback function. This is where we should
- // release |img_buffer|.
- rtc::KeepRefUntilDone(img_buffer)));
+ // using a WrappedI4??Buffer.
magjed_webrtc 2017/06/20 09:01:15 Use WrapYuvBuffer instead of WrappedI4??Buffer now
Yuwei 2017/06/22 01:17:24 Done.
+ rtc::scoped_refptr<VideoFrameBuffer> img_wrapped_buffer = WrapYuvBuffer(
+ type, img->d_w, img->d_h, 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],
+ // WrappedI4??Buffer's mechanism for allowing the release of its frame
magjed_webrtc 2017/06/20 09:01:15 ditto, use WrapYuvBuffer instead of WrappedI4??Buf
Yuwei 2017/06/22 01:17:24 Done.
+ // buffer is through a callback function. This is where we should
+ // release |img_buffer|.
+ rtc::KeepRefUntilDone(img_buffer));
VideoFrame decoded_image(img_wrapped_buffer, timestamp,
0 /* render_time_ms */, webrtc::kVideoRotation_0);

Powered by Google App Engine
This is Rietveld 408576698