Index: media/video/hybrid_video_frame_pool.h |
diff --git a/media/video/hybrid_video_frame_pool.h b/media/video/hybrid_video_frame_pool.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ac362e6e3e8ad304c301d37c013fa78d152d4c3f |
--- /dev/null |
+++ b/media/video/hybrid_video_frame_pool.h |
@@ -0,0 +1,40 @@ |
+// Copyright 2016 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_HYBRID_VIDEO_FRAME_POOL_H_ |
+#define MEDIA_VIDEO_HYBRID_VIDEO_FRAME_POOL_H_ |
+ |
+#include "base/macros.h" |
+#include "media/video/gpu_memory_buffer_video_frame_pool.h" |
+ |
+namespace media { |
+// Interface to a pool of VideoFrames backed by GpuMemoryBuffers/textures/images |
+// or system memory. When |format| is supported by GpuMemoryBuffers, it provides |
+// VideoFrameFuture backed by GpuMemoryBuffers. Otherwise, it provides |
+// VideoFrameFuture backed by system memory. |
+// TODO(dshwang): when GpuMemoryBufferVideoFramePool supports all YUV format, |
+// remove this class. |
+class MEDIA_EXPORT HybridVideoFramePool { |
+ public: |
+ explicit HybridVideoFramePool( |
+ std::unique_ptr<GpuMemoryBufferVideoFramePool> gpu_video_frame_pool); |
+ virtual ~HybridVideoFramePool(); |
+ |
+ // Create VideoFrameFuture backed by native textures or system memory. |
+ std::unique_ptr<VideoFrameFuture> CreateFrame(VideoPixelFormat format, |
+ const gfx::Size& coded_size, |
+ const gfx::Rect& visible_rect, |
+ const gfx::Size& natural_size, |
+ base::TimeDelta timestamp); |
+ |
+ private: |
+ class PoolImpl; |
+ std::unique_ptr<PoolImpl> pool_impl_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(HybridVideoFramePool); |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_VIDEO_HYBRID_VIDEO_FRAME_POOL_H_ |