Index: media/renderers/video_overlay_factory.h |
diff --git a/media/renderers/video_overlay_factory.h b/media/renderers/video_overlay_factory.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..19e5e4fbca4623a32c33b3904c3a9e15e3d8e802 |
--- /dev/null |
+++ b/media/renderers/video_overlay_factory.h |
@@ -0,0 +1,45 @@ |
+// 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_RENDERERS_VIDEO_OVERLAY_FACTORY_H_ |
+#define MEDIA_RENDERERS_VIDEO_OVERLAY_FACTORY_H_ |
+ |
+#include <GLES2/gl2.h> |
+ |
+#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
+#include "gpu/command_buffer/common/mailbox.h" |
+#include "gpu/command_buffer/common/sync_token.h" |
+ |
+namespace gfx { |
+class Size; |
+} // namespace gfx |
+ |
+namespace media { |
+class GpuVideoAcceleratorFactories; |
+class VideoFrame; |
+ |
+// Creates video overlay frame - native textures that get turned into |
+// transparent quads in the browser compositor using overlay system. |
+// This class must be used on GpuVideoAcceleratorFactories::GetTaskRunner(). |
+class VideoOverlayFactory { |
+ public: |
+ explicit VideoOverlayFactory(GpuVideoAcceleratorFactories* gpu_factories); |
+ ~VideoOverlayFactory(); |
+ |
+ scoped_refptr<VideoFrame> CreateFrame(const gfx::Size& size); |
+ |
+ private: |
+ GpuVideoAcceleratorFactories* gpu_factories_; |
+ gpu::Mailbox mailbox_; |
+ gpu::SyncToken sync_token_; |
+ GLuint texture_; |
+ GLuint image_id_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(VideoOverlayFactory); |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_RENDERERS_VIDEO_OVERLAY_FACTORY_H_ |