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/geometry/size.h" | 21 #include "ui/gfx/geometry/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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 VDAs from the set of VDAs supported for current platform until | 63 // Initialize VDAs from the set of VDAs supported for current platform until |
63 // one of them succeeds for given |profile|. Send the |init_done_msg| when | 64 // one of them succeeds for given |profile|. Send the |init_done_msg| when |
64 // done. filter_ is passed to GpuCommandBufferStub channel only if the chosen | 65 // done. filter_ is passed to GpuCommandBufferStub channel only if the chosen |
65 // VDA can decode on IO thread. | 66 // VDA can decode on IO thread. |
66 void Initialize(const media::VideoCodecProfile profile, | 67 void Initialize(const media::VideoCodecProfile profile, |
67 IPC::Message* init_done_msg); | 68 IPC::Message* init_done_msg); |
68 | 69 |
| 70 // Static query for supported profiles. This query calls the appropriate |
| 71 // platform-specific version. The returned supported profiles vector would |
| 72 // not have duplicate codec profile. |
| 73 static std::vector<gpu::VideoDecodeAcceleratorSupportedProfile> |
| 74 GetSupportedProfiles(); |
| 75 |
69 private: | 76 private: |
70 typedef scoped_ptr<media::VideoDecodeAccelerator>( | 77 typedef scoped_ptr<media::VideoDecodeAccelerator>( |
71 GpuVideoDecodeAccelerator::*CreateVDAFp)(); | 78 GpuVideoDecodeAccelerator::*CreateVDAFp)(); |
72 | 79 |
73 class MessageFilter; | 80 class MessageFilter; |
74 | 81 |
75 // Return a set of VDA Create function pointers applicable to the current | 82 // Return a set of VDA Create function pointers applicable to the current |
76 // platform. | 83 // platform. |
77 std::vector<CreateVDAFp> CreateVDAFps(); | 84 std::vector<CreateVDAFp> CreateVDAFps(); |
78 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA(); | 85 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 160 |
154 // A map from picture buffer ID to TextureRef that have not been cleared. | 161 // A map from picture buffer ID to TextureRef that have not been cleared. |
155 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; | 162 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; |
156 | 163 |
157 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); | 164 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); |
158 }; | 165 }; |
159 | 166 |
160 } // namespace content | 167 } // namespace content |
161 | 168 |
162 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 169 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |