Chromium Code Reviews| 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 <memory> | 9 #include <memory> |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 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(); | 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 ArcVideoAccelerator::Error Initialize( |
| 36 ArcVideoAccelerator::Client* client) override; | 36 const Config& config, |
| 37 ArcVideoAccelerator::Client* client) override; | |
| 37 void SetNumberOfOutputBuffers(size_t number) override; | 38 void SetNumberOfOutputBuffers(size_t number) override; |
| 38 void BindSharedMemory(PortType port, | 39 void BindSharedMemory(PortType port, |
| 39 uint32_t index, | 40 uint32_t index, |
| 40 base::ScopedFD ashmem_fd, | 41 base::ScopedFD ashmem_fd, |
| 41 off_t offset, | 42 off_t offset, |
| 42 size_t length) override; | 43 size_t length) override; |
| 43 void BindDmabuf(PortType port, | 44 void BindDmabuf(PortType port, |
| 44 uint32_t index, | 45 uint32_t index, |
| 45 base::ScopedFD dmabuf_fd, | 46 base::ScopedFD dmabuf_fd, |
| 46 int32_t stride) override; | 47 int32_t stride) override; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 // |buffer_index| is the index of the associated input buffer. The |timestamp| | 113 // |buffer_index| is the index of the associated input buffer. The |timestamp| |
| 113 // is the time the video frame should be displayed. | 114 // is the time the video frame should be displayed. |
| 114 void CreateInputRecord(int32_t bitstream_buffer_id, | 115 void CreateInputRecord(int32_t bitstream_buffer_id, |
| 115 uint32_t buffer_index, | 116 uint32_t buffer_index, |
| 116 int64_t timestamp); | 117 int64_t timestamp); |
| 117 | 118 |
| 118 // Finds the InputRecord which matches to given |bitstream_buffer_id|. | 119 // Finds the InputRecord which matches to given |bitstream_buffer_id|. |
| 119 // Returns |nullptr| if it cannot be found. | 120 // Returns |nullptr| if it cannot be found. |
| 120 InputRecord* FindInputRecord(int32_t bitstream_buffer_id); | 121 InputRecord* FindInputRecord(int32_t bitstream_buffer_id); |
| 121 | 122 |
| 123 // Global counter that keeps track how many VDAs in use for ARC. | |
|
Pawel Osciak
2016/06/03 03:56:18
I think we mean ArcVideoDecodeAccelerator instead
kcwu
2016/06/03 13:14:15
I revised all variable name and comments. 'client
| |
| 124 static int arc_codec_count_; | |
|
Pawel Osciak
2016/06/03 03:56:18
Please add a comment about locking here.
kcwu
2016/06/03 13:14:15
Done.
| |
| 125 | |
| 122 std::unique_ptr<media::VideoDecodeAccelerator> vda_; | 126 std::unique_ptr<media::VideoDecodeAccelerator> vda_; |
| 123 | 127 |
| 124 // It's safe to use the pointer here, the life cycle of the |arc_client_| | 128 // It's safe to use the pointer here, the life cycle of the |arc_client_| |
| 125 // is longer than this ArcGpuVideoDecodeAccelerator. | 129 // is longer than this ArcGpuVideoDecodeAccelerator. |
| 126 ArcVideoAccelerator::Client* arc_client_; | 130 ArcVideoAccelerator::Client* arc_client_; |
| 127 | 131 |
| 128 // The next ID for the bitstream buffer, started from 0. | 132 // The next ID for the bitstream buffer, started from 0. |
| 129 int32_t next_bitstream_buffer_id_; | 133 int32_t next_bitstream_buffer_id_; |
| 130 | 134 |
| 131 gfx::Size coded_size_; | 135 gfx::Size coded_size_; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 148 | 152 |
| 149 gpu::GpuPreferences gpu_preferences_; | 153 gpu::GpuPreferences gpu_preferences_; |
| 150 | 154 |
| 151 DISALLOW_COPY_AND_ASSIGN(ArcGpuVideoDecodeAccelerator); | 155 DISALLOW_COPY_AND_ASSIGN(ArcGpuVideoDecodeAccelerator); |
| 152 }; | 156 }; |
| 153 | 157 |
| 154 } // namespace arc | 158 } // namespace arc |
| 155 } // namespace chromeos | 159 } // namespace chromeos |
| 156 | 160 |
| 157 #endif // CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 161 #endif // CHROME_GPU_ARC_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |