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 // Static query for supported profiles. This query calls the appropriate |
| 69 // platform-specific version. |
| 70 static std::vector<gpu::VideoDecodeAcceleratorSupportedProfile> |
| 71 GetSupportedProfiles(); |
| 72 static std::vector<gpu::VideoDecodeAcceleratorSupportedProfile> |
| 73 ConvertMediaToGpuProfiles(const std::vector< |
| 74 media::VideoDecodeAccelerator::SupportedProfile>& media_profiles); |
| 75 |
67 private: | 76 private: |
68 class MessageFilter; | 77 class MessageFilter; |
69 | 78 |
70 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. | 79 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. |
71 ~GpuVideoDecodeAccelerator() override; | 80 ~GpuVideoDecodeAccelerator() override; |
72 | 81 |
73 // Handlers for IPC messages. | 82 // Handlers for IPC messages. |
74 void OnDecode(base::SharedMemoryHandle handle, int32 id, uint32 size); | 83 void OnDecode(base::SharedMemoryHandle handle, int32 id, uint32 size); |
75 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, | 84 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, |
76 const std::vector<uint32>& texture_ids); | 85 const std::vector<uint32>& texture_ids); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 141 |
133 // A map from picture buffer ID to TextureRef that have not been cleared. | 142 // A map from picture buffer ID to TextureRef that have not been cleared. |
134 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; | 143 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; |
135 | 144 |
136 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); | 145 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); |
137 }; | 146 }; |
138 | 147 |
139 } // namespace content | 148 } // namespace content |
140 | 149 |
141 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 150 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |