| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| 6 #define CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // This class is executed in the GPU process. It takes decoding requests from | 22 // This class is executed in the GPU process. It takes decoding requests from |
| 23 // ARC via IPC channels and translates and sends those requests to an | 23 // ARC via IPC channels and translates and sends those requests to an |
| 24 // implementation of media::VideoDecodeAccelerator. It also returns the decoded | 24 // implementation of media::VideoDecodeAccelerator. It also returns the decoded |
| 25 // frames back to the ARC side. | 25 // frames back to the ARC side. |
| 26 class ArcGpuVideoDecodeAccelerator | 26 class ArcGpuVideoDecodeAccelerator |
| 27 : public ArcVideoAccelerator, | 27 : public ArcVideoAccelerator, |
| 28 public media::VideoDecodeAccelerator::Client, | 28 public media::VideoDecodeAccelerator::Client, |
| 29 public base::SupportsWeakPtr<ArcGpuVideoDecodeAccelerator> { | 29 public base::SupportsWeakPtr<ArcGpuVideoDecodeAccelerator> { |
| 30 public: | 30 public: |
| 31 ArcGpuVideoDecodeAccelerator(const gpu::GpuPreferences& gpu_preferences); | 31 ArcGpuVideoDecodeAccelerator(); |
| 32 ~ArcGpuVideoDecodeAccelerator() override; | 32 ~ArcGpuVideoDecodeAccelerator() override; |
| 33 | 33 |
| 34 // Implementation of the ArcVideoAccelerator interface. | 34 // Implementation of the ArcVideoAccelerator interface. |
| 35 bool Initialize(const Config& config, | 35 bool Initialize(const Config& config, |
| 36 ArcVideoAccelerator::Client* client) override; | 36 ArcVideoAccelerator::Client* client) override; |
| 37 void SetNumberOfOutputBuffers(size_t number) override; | 37 void SetNumberOfOutputBuffers(size_t number) override; |
| 38 void BindSharedMemory(PortType port, | 38 void BindSharedMemory(PortType port, |
| 39 uint32_t index, | 39 uint32_t index, |
| 40 int ashmem_fd, | 40 base::ScopedFD ashmem_fd, |
| 41 off_t offset, | 41 off_t offset, |
| 42 size_t length) override; | 42 size_t length) override; |
| 43 void BindDmabuf(PortType port, uint32_t index, int dmabuf_fd) override; | 43 void BindDmabuf(PortType port, |
| 44 uint32_t index, |
| 45 base::ScopedFD dmabuf_fd) override; |
| 44 void UseBuffer(PortType port, | 46 void UseBuffer(PortType port, |
| 45 uint32_t index, | 47 uint32_t index, |
| 46 const BufferMetadata& metadata) override; | 48 const BufferMetadata& metadata) override; |
| 47 void Reset() override; | 49 void Reset() override; |
| 48 | 50 |
| 49 // Implementation of the VideoDecodeAccelerator::Client interface. | 51 // Implementation of the VideoDecodeAccelerator::Client interface. |
| 50 void ProvidePictureBuffers(uint32_t requested_num_of_buffers, | 52 void ProvidePictureBuffers(uint32_t requested_num_of_buffers, |
| 51 const gfx::Size& dimensions, | 53 const gfx::Size& dimensions, |
| 52 uint32_t texture_target) override; | 54 uint32_t texture_target) override; |
| 53 void DismissPictureBuffer(int32_t picture_buffer) override; | 55 void DismissPictureBuffer(int32_t picture_buffer) override; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 138 |
| 137 gpu::GpuPreferences gpu_preferences_; | 139 gpu::GpuPreferences gpu_preferences_; |
| 138 | 140 |
| 139 DISALLOW_COPY_AND_ASSIGN(ArcGpuVideoDecodeAccelerator); | 141 DISALLOW_COPY_AND_ASSIGN(ArcGpuVideoDecodeAccelerator); |
| 140 }; | 142 }; |
| 141 | 143 |
| 142 } // namespace arc | 144 } // namespace arc |
| 143 } // namespace chromeos | 145 } // namespace chromeos |
| 144 | 146 |
| 145 #endif // CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 147 #endif // CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |