| 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_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/shared_memory.h" | 12 #include "base/memory/shared_memory.h" |
| 13 #include "content/common/gpu/gpu_command_buffer_stub.h" | 13 #include "content/common/gpu/gpu_command_buffer_stub.h" |
| 14 #include "content/common/gpu/media/video_decode_accelerator_impl.h" | 14 #include "content/common/gpu/media/video_decode_accelerator_impl.h" |
| 15 #include "ipc/ipc_listener.h" | 15 #include "ipc/ipc_listener.h" |
| 16 #include "ipc/ipc_sender.h" | 16 #include "ipc/ipc_sender.h" |
| 17 #include "media/video/video_decode_accelerator.h" | 17 #include "media/video/video_decode_accelerator.h" |
| 18 #include "ui/gfx/size.h" |
| 18 | 19 |
| 19 namespace base { | 20 namespace base { |
| 20 class MessageLoopProxy; | 21 class MessageLoopProxy; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace content { | 24 namespace content { |
| 24 | 25 |
| 25 class GpuVideoDecodeAccelerator | 26 class GpuVideoDecodeAccelerator |
| 26 : public IPC::Listener, | 27 : public IPC::Listener, |
| 27 public IPC::Sender, | 28 public IPC::Sender, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // Unowned pointer to the underlying GpuCommandBufferStub. | 95 // Unowned pointer to the underlying GpuCommandBufferStub. |
| 95 GpuCommandBufferStub* stub_; | 96 GpuCommandBufferStub* stub_; |
| 96 | 97 |
| 97 // The underlying VideoDecodeAccelerator. | 98 // The underlying VideoDecodeAccelerator. |
| 98 scoped_ptr<VideoDecodeAcceleratorImpl> video_decode_accelerator_; | 99 scoped_ptr<VideoDecodeAcceleratorImpl> video_decode_accelerator_; |
| 99 | 100 |
| 100 // Callback for making the relevant context current for GL calls. | 101 // Callback for making the relevant context current for GL calls. |
| 101 // Returns false if failed. | 102 // Returns false if failed. |
| 102 base::Callback<bool(void)> make_context_current_; | 103 base::Callback<bool(void)> make_context_current_; |
| 103 | 104 |
| 105 // The texture dimensions as requested by ProvidePictureBuffers(). |
| 106 gfx::Size texture_dimensions_; |
| 107 |
| 104 // The texture target as requested by ProvidePictureBuffers(). | 108 // The texture target as requested by ProvidePictureBuffers(). |
| 105 uint32 texture_target_; | 109 uint32 texture_target_; |
| 106 | 110 |
| 107 // The message filter to run VDA::Decode on IO thread if VDA supports it. | 111 // The message filter to run VDA::Decode on IO thread if VDA supports it. |
| 108 scoped_refptr<MessageFilter> filter_; | 112 scoped_refptr<MessageFilter> filter_; |
| 109 | 113 |
| 110 // GPU child message loop. | 114 // GPU child message loop. |
| 111 scoped_refptr<base::MessageLoopProxy> child_message_loop_; | 115 scoped_refptr<base::MessageLoopProxy> child_message_loop_; |
| 112 | 116 |
| 113 // GPU IO message loop. | 117 // GPU IO message loop. |
| 114 scoped_refptr<base::MessageLoopProxy> io_message_loop_; | 118 scoped_refptr<base::MessageLoopProxy> io_message_loop_; |
| 115 | 119 |
| 116 // Weak pointers will be invalidated on IO thread. | 120 // Weak pointers will be invalidated on IO thread. |
| 117 base::WeakPtrFactory<Client> weak_factory_for_io_; | 121 base::WeakPtrFactory<Client> weak_factory_for_io_; |
| 118 | 122 |
| 119 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); | 123 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); |
| 120 }; | 124 }; |
| 121 | 125 |
| 122 } // namespace content | 126 } // namespace content |
| 123 | 127 |
| 124 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 128 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |