Index: media/base/video_frame_pool.h |
diff --git a/media/base/video_frame_pool.h b/media/base/video_frame_pool.h |
index ebd0e249af2e7a9d4f792c4ccb23657c7b5a214c..1a9855d3a787b7a9c69214166e7a1cfba53b1ed4 100644 |
--- a/media/base/video_frame_pool.h |
+++ b/media/base/video_frame_pool.h |
@@ -13,6 +13,20 @@ |
namespace media { |
+class VideoFramePoolDelegate { |
sandersd (OOO until July 31)
2016/12/15 00:38:01
I am opposed to the name Delegate on the grounds t
|
+ public: |
+ virtual ~VideoFramePoolDelegate() {} |
+ virtual scoped_refptr<VideoFrame> CreateZeroInitializedFrame( |
+ VideoPixelFormat format, |
+ const gfx::Size& coded_size, |
+ const gfx::Rect& visible_rect, |
+ const gfx::Size& natural_size, |
+ base::TimeDelta timestamp) = 0; |
+ |
+ virtual scoped_refptr<VideoFrame> WrapVideoFrame( |
+ const scoped_refptr<VideoFrame>& frame) = 0; |
+}; |
+ |
// Simple VideoFrame pool used to avoid unnecessarily allocating and destroying |
// VideoFrame objects. The pool manages the memory for the VideoFrame |
// returned by CreateFrame(). When one of these VideoFrames is destroyed, |
@@ -37,7 +51,9 @@ class MEDIA_EXPORT VideoFramePool { |
const gfx::Size& natural_size, |
base::TimeDelta timestamp); |
-protected: |
+ void SetDelegate(std::unique_ptr<VideoFramePoolDelegate> delegate); |
sandersd (OOO until July 31)
2016/12/15 00:38:01
It seems like the pool doesn't work without callin
|
+ |
+ protected: |
friend class VideoFramePoolTest; |
// Returns the number of frames in the pool for testing purposes. |
@@ -46,6 +62,7 @@ protected: |
private: |
class PoolImpl; |
scoped_refptr<PoolImpl> pool_; |
+ std::unique_ptr<VideoFramePoolDelegate> delegate_; |
DISALLOW_COPY_AND_ASSIGN(VideoFramePool); |
}; |