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_VIDEO_ACCELERATOR_H_ | 5 #ifndef CHROME_GPU_ARC_VIDEO_ACCELERATOR_H_ |
6 #define CHROME_GPU_ARC_VIDEO_ACCELERATOR_H_ | 6 #define CHROME_GPU_ARC_VIDEO_ACCELERATOR_H_ |
7 | 7 |
8 #include "base/files/scoped_file.h" | 8 #include "base/files/scoped_file.h" |
9 | 9 |
10 namespace chromeos { | 10 namespace chromeos { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // multiple times without additional bindings. | 114 // multiple times without additional bindings. |
115 virtual void BindSharedMemory(PortType port, | 115 virtual void BindSharedMemory(PortType port, |
116 uint32_t index, | 116 uint32_t index, |
117 base::ScopedFD ashmem_fd, | 117 base::ScopedFD ashmem_fd, |
118 off_t offset, | 118 off_t offset, |
119 size_t length) = 0; | 119 size_t length) = 0; |
120 | 120 |
121 // Assigns a buffer to be used for the accelerator at the specified | 121 // Assigns a buffer to be used for the accelerator at the specified |
122 // port and index. A buffer must be successfully bound before it can be | 122 // port and index. A buffer must be successfully bound before it can be |
123 // passed to the accelerator via UseBuffer(). Already bound buffers may be | 123 // passed to the accelerator via UseBuffer(). Already bound buffers may be |
124 // reused multiple times without additional bindings. | 124 // reused multiple times without additional bindings. |stride| is counted in |
| 125 // bytes. |
125 virtual void BindDmabuf(PortType port, | 126 virtual void BindDmabuf(PortType port, |
126 uint32_t index, | 127 uint32_t index, |
127 base::ScopedFD dmabuf_fd) = 0; | 128 base::ScopedFD dmabuf_fd, |
| 129 int32_t stride) = 0; |
128 | 130 |
129 // Passes a buffer to the accelerator. For input buffer, the accelerator | 131 // Passes a buffer to the accelerator. For input buffer, the accelerator |
130 // will process it. For output buffer, the accelerator will output content | 132 // will process it. For output buffer, the accelerator will output content |
131 // to it. | 133 // to it. |
132 virtual void UseBuffer(PortType port, | 134 virtual void UseBuffer(PortType port, |
133 uint32_t index, | 135 uint32_t index, |
134 const BufferMetadata& metadata) = 0; | 136 const BufferMetadata& metadata) = 0; |
135 | 137 |
136 // Sets the number of output buffers. When it fails, Client::OnError() will | 138 // Sets the number of output buffers. When it fails, Client::OnError() will |
137 // be called. | 139 // be called. |
138 virtual void SetNumberOfOutputBuffers(size_t number) = 0; | 140 virtual void SetNumberOfOutputBuffers(size_t number) = 0; |
139 | 141 |
140 // Resets the accelerator. When it is done, Client::OnResetDone() will | 142 // Resets the accelerator. When it is done, Client::OnResetDone() will |
141 // be called. Afterwards, all buffers won't be accessed by the accelerator | 143 // be called. Afterwards, all buffers won't be accessed by the accelerator |
142 // and there won't be more callbacks. | 144 // and there won't be more callbacks. |
143 virtual void Reset() = 0; | 145 virtual void Reset() = 0; |
144 | 146 |
145 virtual ~ArcVideoAccelerator() {} | 147 virtual ~ArcVideoAccelerator() {} |
146 }; | 148 }; |
147 | 149 |
148 } // namespace arc | 150 } // namespace arc |
149 } // namespace chromeos | 151 } // namespace chromeos |
150 | 152 |
151 #endif // CHROME_GPU_ARC_VIDEO_ACCELERATOR_H_ | 153 #endif // CHROME_GPU_ARC_VIDEO_ACCELERATOR_H_ |
OLD | NEW |