| 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 VDAs from the set of VDAs supported for current platform until | 62 // Initialize the accelerator with the given profile and send the |
| 63 // one of them succeeds for given |profile|. Send the |init_done_msg| when | 63 // |init_done_msg| when done. |
| 64 // done. filter_ is passed to GpuCommandBufferStub channel only if the chosen | |
| 65 // VDA can decode on IO thread. | |
| 66 void Initialize(const media::VideoCodecProfile profile, | 64 void Initialize(const media::VideoCodecProfile profile, |
| 67 IPC::Message* init_done_msg); | 65 IPC::Message* init_done_msg); |
| 68 | 66 |
| 69 private: | 67 private: |
| 70 typedef scoped_ptr<media::VideoDecodeAccelerator>( | |
| 71 GpuVideoDecodeAccelerator::*CreateVDAFp)(); | |
| 72 | |
| 73 class MessageFilter; | 68 class MessageFilter; |
| 74 | 69 |
| 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 | |
| 85 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. | 70 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. |
| 86 ~GpuVideoDecodeAccelerator() override; | 71 ~GpuVideoDecodeAccelerator() override; |
| 87 | 72 |
| 88 // Handlers for IPC messages. | 73 // Handlers for IPC messages. |
| 89 void OnDecode(base::SharedMemoryHandle handle, int32 id, uint32 size); | 74 void OnDecode(base::SharedMemoryHandle handle, int32 id, uint32 size); |
| 90 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, | 75 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, |
| 91 const std::vector<uint32>& texture_ids); | 76 const std::vector<uint32>& texture_ids); |
| 92 void OnReusePictureBuffer(int32 picture_buffer_id); | 77 void OnReusePictureBuffer(int32 picture_buffer_id); |
| 93 void OnFlush(); | 78 void OnFlush(); |
| 94 void OnReset(); | 79 void OnReset(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 132 |
| 148 // A map from picture buffer ID to TextureRef that have not been cleared. | 133 // A map from picture buffer ID to TextureRef that have not been cleared. |
| 149 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; | 134 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; |
| 150 | 135 |
| 151 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); | 136 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); |
| 152 }; | 137 }; |
| 153 | 138 |
| 154 } // namespace content | 139 } // namespace content |
| 155 | 140 |
| 156 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 141 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |