Index: media/base/video_frame_pool.cc |
diff --git a/media/base/video_frame_pool.cc b/media/base/video_frame_pool.cc |
index 4951941d06be5d7ffe9e08e0959fb303ba7661c5..8c8870c7a80f928a0db28c07ef4fbb27014e21b0 100644 |
--- a/media/base/video_frame_pool.cc |
+++ b/media/base/video_frame_pool.cc |
@@ -17,14 +17,13 @@ class VideoFramePool::PoolImpl |
public: |
PoolImpl(); |
- // Returns a frame from the pool that matches the specified |
- // parameters or creates a new frame if no suitable frame exists in |
- // the pool. The pool is drained if no matching frame is found. |
+ // See VideoFramePool::CreateFrame() for usage. |
scoped_refptr<VideoFrame> CreateFrame(VideoPixelFormat format, |
const gfx::Size& coded_size, |
const gfx::Rect& visible_rect, |
const gfx::Size& natural_size, |
- base::TimeDelta timestamp); |
+ base::TimeDelta timestamp, |
+ bool zero_new_frames); |
// 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 +59,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_new_frames) { |
base::AutoLock auto_lock(lock_); |
DCHECK(!is_shutdown_); |
@@ -83,6 +83,8 @@ scoped_refptr<VideoFrame> VideoFramePool::PoolImpl::CreateFrame( |
if (!frame.get()) { |
frame = VideoFrame::CreateFrame( |
format, coded_size, visible_rect, natural_size, timestamp); |
+ if (zero_new_frames) |
+ memset(frame->data(0), 0, frame->allocated_size()); |
miu
2015/08/04 20:16:22
You have enough information to memset() all the me
DaleCurtis
2015/08/04 21:20:52
This doesn't include the padding around the frame
miu
2015/08/06 21:23:30
Okay, but is it enough to ensure FFMPEG isn't read
|
} |
scoped_refptr<VideoFrame> wrapped_frame = VideoFrame::WrapVideoFrame( |
@@ -119,9 +121,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_new_frames) { |
return pool_->CreateFrame(format, coded_size, visible_rect, natural_size, |
- timestamp); |
+ timestamp, zero_new_frames); |
} |
size_t VideoFramePool::GetPoolSizeForTesting() const { |