Chromium Code Reviews| Index: media/base/video_frame_pool.cc |
| diff --git a/media/base/video_frame_pool.cc b/media/base/video_frame_pool.cc |
| index ac021348c14e82d6fe6e2fcd011838fc23c0a58a..44bd349f4281cd5bd8f80c75dc3ece63e1147e13 100644 |
| --- a/media/base/video_frame_pool.cc |
| +++ b/media/base/video_frame_pool.cc |
| @@ -24,7 +24,8 @@ class VideoFramePool::PoolImpl |
| const gfx::Size& coded_size, |
| const gfx::Rect& visible_rect, |
| const gfx::Size& natural_size, |
| - base::TimeDelta timestamp); |
| + base::TimeDelta timestamp, |
| + bool zero_out_memory); |
|
DaleCurtis
2015/07/09 22:21:16
This is a bit confusing since it would only happen
emircan
2015/07/09 23:16:27
True, I will go with "zero_init_new_allocations".
|
| // Shuts down the frame pool and releases all frames in |frames_|. |
| // Once this is called frames will no longer be inserted back into |
| @@ -60,7 +61,8 @@ scoped_refptr<VideoFrame> VideoFramePool::PoolImpl::CreateFrame( |
| const gfx::Size& coded_size, |
| const gfx::Rect& visible_rect, |
| const gfx::Size& natural_size, |
| - base::TimeDelta timestamp) { |
| + base::TimeDelta timestamp, |
| + bool zero_out_memory) { |
| base::AutoLock auto_lock(lock_); |
| DCHECK(!is_shutdown_); |
| @@ -83,6 +85,8 @@ scoped_refptr<VideoFrame> VideoFramePool::PoolImpl::CreateFrame( |
| if (!frame.get()) { |
| frame = VideoFrame::CreateFrame( |
| format, coded_size, visible_rect, natural_size, timestamp); |
| + if (zero_out_memory) |
| + memset(frame->data(0), 0, VideoFrame::AlignedAllocationSize(frame)); |
| } |
| scoped_refptr<VideoFrame> wrapped_frame = VideoFrame::WrapVideoFrame( |
| @@ -119,9 +123,10 @@ scoped_refptr<VideoFrame> VideoFramePool::CreateFrame( |
| const gfx::Size& coded_size, |
| const gfx::Rect& visible_rect, |
| const gfx::Size& natural_size, |
| - base::TimeDelta timestamp) { |
| + base::TimeDelta timestamp, |
| + bool zero_out_memory) { |
| return pool_->CreateFrame(format, coded_size, visible_rect, natural_size, |
| - timestamp); |
| + timestamp, zero_out_memory); |
| } |
| size_t VideoFramePool::GetPoolSizeForTesting() const { |