| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ | 6 #define CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/synchronization/waitable_event.h" | 13 #include "base/synchronization/waitable_event.h" |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "media/filters/gpu_video_decoder.h" | 15 #include "media/filters/gpu_video_decoder_factories.h" |
| 16 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
| 17 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class MessageLoopProxy; | 20 class MessageLoopProxy; |
| 21 class WaitableEvent; | 21 class WaitableEvent; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace content { | 24 namespace content { |
| 25 class GpuChannelHost; | 25 class GpuChannelHost; |
| 26 class WebGraphicsContext3DCommandBufferImpl; | 26 class WebGraphicsContext3DCommandBufferImpl; |
| 27 | 27 |
| 28 // Glue code to expose functionality needed by media::GpuVideoDecoder to | 28 // Glue code to expose functionality needed by media::GpuVideoDecoder to |
| 29 // RenderViewImpl. This class is entirely an implementation detail of | 29 // RenderViewImpl. This class is entirely an implementation detail of |
| 30 // RenderViewImpl and only has its own header to allow extraction of its | 30 // RenderViewImpl and only has its own header to allow extraction of its |
| 31 // implementation from render_view_impl.cc which is already far too large. | 31 // implementation from render_view_impl.cc which is already far too large. |
| 32 // | 32 // |
| 33 // The public methods of the class can be called from any thread, and are | 33 // The public methods of the class can be called from any thread, and are |
| 34 // internally trampolined to the appropriate thread. GPU/GL-related calls go to | 34 // internally trampolined to the appropriate thread. GPU/GL-related calls go to |
| 35 // the constructor-argument loop (mostly that's the compositor thread, or the | 35 // the constructor-argument loop (mostly that's the compositor thread, or the |
| 36 // renderer thread if threaded compositing is disabled), and shmem-related calls | 36 // renderer thread if threaded compositing is disabled), and shmem-related calls |
| 37 // go to the render thread. | 37 // go to the render thread. |
| 38 class CONTENT_EXPORT RendererGpuVideoDecoderFactories | 38 class CONTENT_EXPORT RendererGpuVideoDecoderFactories |
| 39 : public media::GpuVideoDecoder::Factories { | 39 : public media::GpuVideoDecoderFactories { |
| 40 public: | 40 public: |
| 41 // Takes a ref on |gpu_channel_host| and tests |context| for loss before each | 41 // Takes a ref on |gpu_channel_host| and tests |context| for loss before each |
| 42 // use. | 42 // use. |
| 43 RendererGpuVideoDecoderFactories( | 43 RendererGpuVideoDecoderFactories( |
| 44 GpuChannelHost* gpu_channel_host, | 44 GpuChannelHost* gpu_channel_host, |
| 45 const scoped_refptr<base::MessageLoopProxy>& compositor_message_loop, | 45 const scoped_refptr<base::MessageLoopProxy>& compositor_message_loop, |
| 46 WebGraphicsContext3DCommandBufferImpl* wgc3dcbi); | 46 WebGraphicsContext3DCommandBufferImpl* wgc3dcbi); |
| 47 | 47 |
| 48 // media::GpuVideoDecoder::Factories implementation. | 48 // media::GpuVideoDecoderFactories implementation. |
| 49 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator( | 49 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator( |
| 50 media::VideoCodecProfile profile, | 50 media::VideoCodecProfile profile, |
| 51 media::VideoDecodeAccelerator::Client* client) OVERRIDE; | 51 media::VideoDecodeAccelerator::Client* client) OVERRIDE; |
| 52 // Creates textures and produces them into mailboxes. Returns a sync point to | 52 // Creates textures and produces them into mailboxes. Returns a sync point to |
| 53 // wait on before using the mailboxes, or 0 on failure. | 53 // wait on before using the mailboxes, or 0 on failure. |
| 54 virtual uint32 CreateTextures( | 54 virtual uint32 CreateTextures( |
| 55 int32 count, const gfx::Size& size, | 55 int32 count, const gfx::Size& size, |
| 56 std::vector<uint32>* texture_ids, | 56 std::vector<uint32>* texture_ids, |
| 57 std::vector<gpu::Mailbox>* texture_mailboxes, | 57 std::vector<gpu::Mailbox>* texture_mailboxes, |
| 58 uint32 texture_target) OVERRIDE; | 58 uint32 texture_target) OVERRIDE; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // Textures returned by the CreateTexture() function. | 125 // Textures returned by the CreateTexture() function. |
| 126 std::vector<uint32> created_textures_; | 126 std::vector<uint32> created_textures_; |
| 127 std::vector<gpu::Mailbox> created_texture_mailboxes_; | 127 std::vector<gpu::Mailbox> created_texture_mailboxes_; |
| 128 | 128 |
| 129 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); | 129 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 } // namespace content | 132 } // namespace content |
| 133 | 133 |
| 134 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ | 134 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ |
| OLD | NEW |