| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "media/filters/gpu_video_decoder.h" | 13 #include "media/filters/gpu_video_decoder.h" |
| 14 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
| 15 | 15 |
| 16 class GpuChannelHost; | 16 class GpuChannelHost; |
| 17 class RendererGLContext; | 17 class ContentGLContext; |
| 18 namespace base { | 18 namespace base { |
| 19 class WaitableEvent; | 19 class WaitableEvent; |
| 20 } | 20 } |
| 21 | 21 |
| 22 // Glue code to expose functionality needed by media::GpuVideoDecoder to | 22 // Glue code to expose functionality needed by media::GpuVideoDecoder to |
| 23 // RenderViewImpl. This class is entirely an implementation detail of | 23 // RenderViewImpl. This class is entirely an implementation detail of |
| 24 // RenderViewImpl and only has its own header to allow extraction of its | 24 // RenderViewImpl and only has its own header to allow extraction of its |
| 25 // implementation from render_view_impl.cc which is already far too large. | 25 // implementation from render_view_impl.cc which is already far too large. |
| 26 // | 26 // |
| 27 // The public methods of the class can be called from any thread, and are | 27 // The public methods of the class can be called from any thread, and are |
| 28 // internally trampolined to the thread on which the class was constructed | 28 // internally trampolined to the thread on which the class was constructed |
| 29 // (de-facto, the renderer thread) if called from a different thread. | 29 // (de-facto, the renderer thread) if called from a different thread. |
| 30 class CONTENT_EXPORT RendererGpuVideoDecoderFactories | 30 class CONTENT_EXPORT RendererGpuVideoDecoderFactories |
| 31 : public media::GpuVideoDecoder::Factories { | 31 : public media::GpuVideoDecoder::Factories { |
| 32 public: | 32 public: |
| 33 // Takes a ref on |gpu_channel_host| and tests |context| for NULL before each | 33 // Takes a ref on |gpu_channel_host| and tests |context| for NULL before each |
| 34 // use. | 34 // use. |
| 35 RendererGpuVideoDecoderFactories(GpuChannelHost* gpu_channel_host, | 35 RendererGpuVideoDecoderFactories(GpuChannelHost* gpu_channel_host, |
| 36 base::WeakPtr<RendererGLContext> context); | 36 base::WeakPtr<ContentGLContext> context); |
| 37 | 37 |
| 38 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator( | 38 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator( |
| 39 media::VideoDecodeAccelerator::Profile profile, | 39 media::VideoDecodeAccelerator::Profile profile, |
| 40 media::VideoDecodeAccelerator::Client* client) OVERRIDE; | 40 media::VideoDecodeAccelerator::Client* client) OVERRIDE; |
| 41 | 41 |
| 42 virtual bool CreateTextures(int32 count, const gfx::Size& size, | 42 virtual bool CreateTextures(int32 count, const gfx::Size& size, |
| 43 std::vector<uint32>* texture_ids) OVERRIDE; | 43 std::vector<uint32>* texture_ids) OVERRIDE; |
| 44 | 44 |
| 45 virtual void DeleteTexture(uint32 texture_id) OVERRIDE; | 45 virtual void DeleteTexture(uint32 texture_id) OVERRIDE; |
| 46 | 46 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 62 base::WaitableEvent* waiter); | 62 base::WaitableEvent* waiter); |
| 63 void AsyncCreateTextures( | 63 void AsyncCreateTextures( |
| 64 int32 count, const gfx::Size& size, std::vector<uint32>* texture_ids, | 64 int32 count, const gfx::Size& size, std::vector<uint32>* texture_ids, |
| 65 bool* success, base::WaitableEvent* waiter); | 65 bool* success, base::WaitableEvent* waiter); |
| 66 void AsyncDeleteTexture(uint32 texture_id); | 66 void AsyncDeleteTexture(uint32 texture_id); |
| 67 void AsyncCreateSharedMemory( | 67 void AsyncCreateSharedMemory( |
| 68 size_t size, base::SharedMemory** shm, base::WaitableEvent* waiter); | 68 size_t size, base::SharedMemory** shm, base::WaitableEvent* waiter); |
| 69 | 69 |
| 70 MessageLoop* message_loop_; | 70 MessageLoop* message_loop_; |
| 71 scoped_refptr<GpuChannelHost> gpu_channel_host_; | 71 scoped_refptr<GpuChannelHost> gpu_channel_host_; |
| 72 base::WeakPtr<RendererGLContext> context_; | 72 base::WeakPtr<ContentGLContext> context_; |
| 73 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); | 73 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ | 76 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ |
| OLD | NEW |