| 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 <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
| 14 #include "base/synchronization/waitable_event.h" | 14 #include "base/synchronization/waitable_event.h" |
| 15 #include "content/common/gpu/gpu_command_buffer_stub.h" | 15 #include "content/common/gpu/gpu_command_buffer_stub.h" |
| 16 #include "gpu/command_buffer/service/texture_manager.h" | 16 #include "gpu/command_buffer/service/texture_manager.h" |
| 17 #include "gpu/config/gpu_info.h" |
| 17 #include "ipc/ipc_listener.h" | 18 #include "ipc/ipc_listener.h" |
| 18 #include "ipc/ipc_sender.h" | 19 #include "ipc/ipc_sender.h" |
| 19 #include "media/video/video_decode_accelerator.h" | 20 #include "media/video/video_decode_accelerator.h" |
| 20 #include "ui/gfx/size.h" | 21 #include "ui/gfx/size.h" |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class MessageLoopProxy; | 24 class MessageLoopProxy; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace content { | 27 namespace content { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 57 void OnWillDestroyStub() override; | 58 void OnWillDestroyStub() override; |
| 58 | 59 |
| 59 // Function to delegate sending to actual sender. | 60 // Function to delegate sending to actual sender. |
| 60 bool Send(IPC::Message* message) override; | 61 bool Send(IPC::Message* message) override; |
| 61 | 62 |
| 62 // Initialize the accelerator with the given profile and send the | 63 // Initialize the accelerator with the given profile and send the |
| 63 // |init_done_msg| when done. | 64 // |init_done_msg| when done. |
| 64 void Initialize(const media::VideoCodecProfile profile, | 65 void Initialize(const media::VideoCodecProfile profile, |
| 65 IPC::Message* init_done_msg); | 66 IPC::Message* init_done_msg); |
| 66 | 67 |
| 68 // Get the minimum and maximum supported decode resolution. |
| 69 static gpu::VideoDecodeAcceleratorSupportedResolution |
| 70 GetSupportedResolution(); |
| 71 |
| 67 private: | 72 private: |
| 68 class MessageFilter; | 73 class MessageFilter; |
| 69 | 74 |
| 70 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. | 75 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. |
| 71 ~GpuVideoDecodeAccelerator() override; | 76 ~GpuVideoDecodeAccelerator() override; |
| 72 | 77 |
| 73 // Handlers for IPC messages. | 78 // Handlers for IPC messages. |
| 74 void OnDecode(base::SharedMemoryHandle handle, int32 id, uint32 size); | 79 void OnDecode(base::SharedMemoryHandle handle, int32 id, uint32 size); |
| 75 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, | 80 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, |
| 76 const std::vector<uint32>& texture_ids); | 81 const std::vector<uint32>& texture_ids); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 137 |
| 133 // A map from picture buffer ID to TextureRef that have not been cleared. | 138 // A map from picture buffer ID to TextureRef that have not been cleared. |
| 134 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; | 139 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; |
| 135 | 140 |
| 136 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); | 141 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); |
| 137 }; | 142 }; |
| 138 | 143 |
| 139 } // namespace content | 144 } // namespace content |
| 140 | 145 |
| 141 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 146 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |