Index: media/base/video_frame_pool.h |
diff --git a/media/base/video_frame_pool.h b/media/base/video_frame_pool.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6aac12a34d801aeebf3a63ef7250fdc7dc623678 |
--- /dev/null |
+++ b/media/base/video_frame_pool.h |
@@ -0,0 +1,38 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MEDIA_BASE_VIDEO_FRAME_POOL_H_ |
+#define MEDIA_BASE_VIDEO_FRAME_POOL_H_ |
+ |
+#include "media/base/media_export.h" |
+#include "media/base/video_frame.h" |
+ |
+namespace media { |
+ |
+// Simple VideoFrame pool used to avoid unnecessarily allocating and destroying |
+// VideoFrame objects. |
DaleCurtis
2013/12/09 20:48:25
Needs some comments about the lifetime of frames i
acolwell GONE FROM CHROMIUM
2013/12/09 21:42:11
Done.
|
+class MEDIA_EXPORT VideoFramePool { |
+ public: |
+ VideoFramePool(); |
+ ~VideoFramePool(); |
+ |
+ // Returns a frame from the pool that matches the specified |
+ // parameters or creates a new frame if no suitable frame exists in |
+ // the pool. |
+ scoped_refptr<VideoFrame> CreateFrame(VideoFrame::Format format, |
+ const gfx::Size& coded_size, |
+ const gfx::Rect& visible_rect, |
+ const gfx::Size& natural_size, |
+ base::TimeDelta timestamp); |
+ |
+ private: |
+ class PoolImpl; |
+ scoped_refptr<PoolImpl> pool_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(VideoFramePool); |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_BASE_VIDEO_FRAME_POOL_H_ |