| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMECAST_RENDERER_MEDIA_HOLE_FRAME_FACTORY_H_ | 5 #ifndef MEDIA_RENDERERS_VIDEO_OVERLAY_FACTORY_H_ |
| 6 #define CHROMECAST_RENDERER_MEDIA_HOLE_FRAME_FACTORY_H_ | 6 #define MEDIA_RENDERERS_VIDEO_OVERLAY_FACTORY_H_ |
| 7 | 7 |
| 8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "gpu/command_buffer/common/mailbox.h" | 12 #include "gpu/command_buffer/common/mailbox.h" |
| 13 #include "gpu/command_buffer/common/sync_token.h" | 13 #include "gpu/command_buffer/common/sync_token.h" |
| 14 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class Size; | 16 class Size; |
| 17 } | 17 } // namespace gfx |
| 18 | 18 |
| 19 namespace media { | 19 namespace media { |
| 20 |
| 20 class GpuVideoAcceleratorFactories; | 21 class GpuVideoAcceleratorFactories; |
| 21 class VideoFrame; | 22 class VideoFrame; |
| 22 } | |
| 23 | 23 |
| 24 namespace chromecast { | 24 // Creates video overlay frames - native textures that get turned into |
| 25 namespace media { | 25 // transparent holes in the browser compositor using overlay system. |
| 26 // This class must be used on GpuVideoAcceleratorFactories::GetTaskRunner(). |
| 27 class VideoOverlayFactory { |
| 28 public: |
| 29 explicit VideoOverlayFactory( |
| 30 ::media::GpuVideoAcceleratorFactories* gpu_factories); |
| 31 ~VideoOverlayFactory(); |
| 26 | 32 |
| 27 // Creates VideoFrames for CMA - native textures that get turned into | 33 scoped_refptr<::media::VideoFrame> CreateFrame(const gfx::Size& size); |
| 28 // transparent holes in the browser compositor using overlay system. | |
| 29 // All calls (including ctor/dtor) must be on media thread. | |
| 30 class HoleFrameFactory { | |
| 31 public: | |
| 32 explicit HoleFrameFactory( | |
| 33 ::media::GpuVideoAcceleratorFactories* gpu_factories); | |
| 34 ~HoleFrameFactory(); | |
| 35 | |
| 36 scoped_refptr<::media::VideoFrame> CreateHoleFrame(const gfx::Size& size); | |
| 37 | 34 |
| 38 private: | 35 private: |
| 39 ::media::GpuVideoAcceleratorFactories* gpu_factories_; | 36 ::media::GpuVideoAcceleratorFactories* gpu_factories_; |
| 40 gpu::Mailbox mailbox_; | 37 gpu::Mailbox mailbox_; |
| 41 gpu::SyncToken sync_token_; | 38 gpu::SyncToken sync_token_; |
| 42 GLuint texture_; | 39 GLuint texture_; |
| 43 GLuint image_id_; | 40 GLuint image_id_; |
| 44 | 41 |
| 45 DISALLOW_COPY_AND_ASSIGN(HoleFrameFactory); | 42 DISALLOW_COPY_AND_ASSIGN(VideoOverlayFactory); |
| 46 }; | 43 }; |
| 47 | 44 |
| 48 } // namespace media | 45 } // namespace media |
| 49 } // namespace chromecast | |
| 50 | 46 |
| 51 #endif // CHROMECAST_RENDERER_MEDIA_HOLE_FRAME_FACTORY_H_ | 47 #endif // MEDIA_RENDERERS_VIDEO_OVERLAY_FACTORY_H_ |
| OLD | NEW |