Index: media/video/gpu_memory_buffer_video_frame_pool.h |
diff --git a/media/video/gpu_memory_buffer_video_frame_pool.h b/media/video/gpu_memory_buffer_video_frame_pool.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..15de7539c7acf4e1b716490621b8f731156715c8 |
--- /dev/null |
+++ b/media/video/gpu_memory_buffer_video_frame_pool.h |
@@ -0,0 +1,43 @@ |
+// Copyright (c) 2015 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_VIDEO_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_ |
+#define MEDIA_VIDEO_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_ |
+ |
+#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
+#include "media/base/video_frame.h" |
+ |
+namespace base { |
+class SingleThreadTaskRunner; |
+} |
+ |
+namespace media { |
+class GpuVideoAcceleratorFactories; |
+ |
+// Interface to a pool of GpuMemoryBuffers that can be used to back VideoFrames. |
+// Calling the method MaybeCreateHardwareFrame with a software frame will |
+// create and return a VideoFrame containing only mailboxes to the native |
+// resources needed to draw. If it's not possible to create an hardware |
+// VideoFrame the object passed as parameter will be returned. |
+class MEDIA_EXPORT GpuMemoryBufferVideoFramePool { |
+ public: |
+ GpuMemoryBufferVideoFramePool( |
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
+ const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories); |
+ ~GpuMemoryBufferVideoFramePool(); |
+ |
+ scoped_refptr<VideoFrame> MaybeCreateHardwareFrame( |
DaleCurtis
2015/05/14 00:58:58
Method needs comment.
Daniele Castagna
2015/05/14 17:30:27
Done.
Also rephrased the class comment.
|
+ const scoped_refptr<VideoFrame>& video_frame); |
+ |
+ private: |
+ class PoolImpl; |
+ scoped_refptr<PoolImpl> pool_impl_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferVideoFramePool); |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_VIDEO_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_ |