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 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) override; | 52 void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) override; |
53 void NotifyFlushDone() override; | 53 void NotifyFlushDone() override; |
54 void NotifyResetDone() override; | 54 void NotifyResetDone() override; |
55 | 55 |
56 // GpuCommandBufferStub::DestructionObserver implementation. | 56 // GpuCommandBufferStub::DestructionObserver implementation. |
57 void OnWillDestroyStub() override; | 57 void OnWillDestroyStub() override; |
58 | 58 |
59 // Function to delegate sending to actual sender. | 59 // Function to delegate sending to actual sender. |
60 bool Send(IPC::Message* message) override; | 60 bool Send(IPC::Message* message) override; |
61 | 61 |
62 // Initialize the accelerator with the given profile and send the | 62 // Initialize VDAs from the set of VDAs supported for current platform until |
63 // |init_done_msg| when done. | 63 // 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 // VDA can decode on IO thread. |
64 void Initialize(const media::VideoCodecProfile profile, | 66 void Initialize(const media::VideoCodecProfile profile, |
65 IPC::Message* init_done_msg); | 67 IPC::Message* init_done_msg); |
66 | 68 |
67 private: | 69 private: |
| 70 typedef scoped_ptr<media::VideoDecodeAccelerator>( |
| 71 GpuVideoDecodeAccelerator::*CreateVDAFp)(); |
| 72 |
68 class MessageFilter; | 73 class MessageFilter; |
69 | 74 |
| 75 // Return a set of VDA Create function pointers applicable to the current |
| 76 // platform. |
| 77 std::vector<CreateVDAFp> CreateVDAFps(); |
| 78 scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA(); |
| 79 scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2VDA(); |
| 80 scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA(); |
| 81 scoped_ptr<media::VideoDecodeAccelerator> CreateVTVDA(); |
| 82 scoped_ptr<media::VideoDecodeAccelerator> CreateOzoneVDA(); |
| 83 scoped_ptr<media::VideoDecodeAccelerator> CreateAndroidVDA(); |
| 84 |
70 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. | 85 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. |
71 ~GpuVideoDecodeAccelerator() override; | 86 ~GpuVideoDecodeAccelerator() override; |
72 | 87 |
73 // Handlers for IPC messages. | 88 // Handlers for IPC messages. |
74 void OnDecode(base::SharedMemoryHandle handle, int32 id, uint32 size); | 89 void OnDecode(base::SharedMemoryHandle handle, int32 id, uint32 size); |
75 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, | 90 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, |
76 const std::vector<uint32>& texture_ids); | 91 const std::vector<uint32>& texture_ids); |
77 void OnReusePictureBuffer(int32 picture_buffer_id); | 92 void OnReusePictureBuffer(int32 picture_buffer_id); |
78 void OnFlush(); | 93 void OnFlush(); |
79 void OnReset(); | 94 void OnReset(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 147 |
133 // A map from picture buffer ID to TextureRef that have not been cleared. | 148 // A map from picture buffer ID to TextureRef that have not been cleared. |
134 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; | 149 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; |
135 | 150 |
136 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); | 151 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); |
137 }; | 152 }; |
138 | 153 |
139 } // namespace content | 154 } // namespace content |
140 | 155 |
141 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 156 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |