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

Unified Diff: media/base/video_frame_pool.cc

Issue 1313413010: Add VideoFrame::CreateZeroInitializedFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « media/base/video_frame.cc ('k') | media/base/video_frame_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame_pool.cc
diff --git a/media/base/video_frame_pool.cc b/media/base/video_frame_pool.cc
index b834f82838b9d31c0ae0c60d9a0668444ecd5067..dc9cdf370e249d02f17f978abf698206ad6e6a4c 100644
--- a/media/base/video_frame_pool.cc
+++ b/media/base/video_frame_pool.cc
@@ -63,7 +63,6 @@ scoped_refptr<VideoFrame> VideoFramePool::PoolImpl::CreateFrame(
DCHECK(!is_shutdown_);
scoped_refptr<VideoFrame> frame;
-
while (!frame.get() && !frames_.empty()) {
scoped_refptr<VideoFrame> pool_frame = frames_.front();
frames_.pop_front();
@@ -79,18 +78,8 @@ scoped_refptr<VideoFrame> VideoFramePool::PoolImpl::CreateFrame(
}
if (!frame.get()) {
- frame = VideoFrame::CreateFrame(format, coded_size, visible_rect,
- natural_size, timestamp);
-
- // Zero-initialize each plane of the buffer.
- const size_t num_planes = VideoFrame::NumPlanes(frame->format());
- for (size_t i = 0; i < num_planes; ++i) {
- memset(frame->data(i),
- 0,
- VideoFrame::PlaneSize(frame->format(),
- i,
- frame->coded_size()).GetArea());
- }
+ frame = VideoFrame::CreateZeroInitializedFrame(
+ format, coded_size, visible_rect, natural_size, timestamp);
}
scoped_refptr<VideoFrame> wrapped_frame = VideoFrame::WrapVideoFrame(
« no previous file with comments | « media/base/video_frame.cc ('k') | media/base/video_frame_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698