OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // |config| is the configuration on which the decoder should be initialized. | 248 // |config| is the configuration on which the decoder should be initialized. |
249 // | 249 // |
250 // Returns true when command successfully accepted. Otherwise false. | 250 // Returns true when command successfully accepted. Otherwise false. |
251 virtual bool Initialize(const std::vector<uint32>& config) = 0; | 251 virtual bool Initialize(const std::vector<uint32>& config) = 0; |
252 | 252 |
253 // Decodes given bitstream buffer. Once decoder is done with processing | 253 // Decodes given bitstream buffer. Once decoder is done with processing |
254 // |bitstream_buffer| it will call NotifyEndOfBitstreamBuffer() with the | 254 // |bitstream_buffer| it will call NotifyEndOfBitstreamBuffer() with the |
255 // bitstream buffer id. | 255 // bitstream buffer id. |
256 // Parameters: | 256 // Parameters: |
257 // |bitstream_buffer| is the input bitstream that is sent for decoding. | 257 // |bitstream_buffer| is the input bitstream that is sent for decoding. |
258 // | 258 virtual void Decode(const BitstreamBuffer& bitstream_buffer) = 0; |
259 // Returns true when command successfully accepted. Otherwise false. | |
260 virtual bool Decode(const BitstreamBuffer& bitstream_buffer) = 0; | |
261 | 259 |
262 // Assigns a set of picture buffers to the video decoder. | 260 // Assigns a set of picture buffers to the video decoder. |
263 // AssignGLESBuffers assigns texture-backed buffers. | 261 // AssignGLESBuffers assigns texture-backed buffers. |
264 // AssignSysmemBuffers assigns system memory-backed buffers. | 262 // AssignSysmemBuffers assigns system memory-backed buffers. |
265 // | 263 // |
266 // Ownership of each picture buffer remains with the client, but the client | 264 // Ownership of each picture buffer remains with the client, but the client |
267 // is not allowed to deallocate the buffer before the DismissPictureBuffer | 265 // is not allowed to deallocate the buffer before the DismissPictureBuffer |
268 // callback has been initiated for a given buffer. | 266 // callback has been initiated for a given buffer. |
269 // | 267 // |
270 // Parameters: | 268 // Parameters: |
271 // |buffers| contains the allocated picture buffers for the output. | 269 // |buffers| contains the allocated picture buffers for the output. |
272 virtual void AssignGLESBuffers(const std::vector<GLESBuffer>& buffers) = 0; | 270 virtual void AssignGLESBuffers(const std::vector<GLESBuffer>& buffers) = 0; |
273 virtual void AssignSysmemBuffers( | 271 virtual void AssignSysmemBuffers( |
274 const std::vector<SysmemBuffer>& buffers) = 0; | 272 const std::vector<SysmemBuffer>& buffers) = 0; |
275 | 273 |
276 // Sends picture buffers to be reused by the decoder. This needs to be called | 274 // Sends picture buffers to be reused by the decoder. This needs to be called |
277 // for each buffer that has been processed so that decoder may know onto which | 275 // for each buffer that has been processed so that decoder may know onto which |
278 // picture buffers it can write the output to. | 276 // picture buffers it can write the output to. |
279 // | 277 // |
280 // Parameters: | 278 // Parameters: |
281 // |picture_buffer_id| id of the picture buffer that is to be reused. | 279 // |picture_buffer_id| id of the picture buffer that is to be reused. |
282 virtual void ReusePictureBuffer(int32 picture_buffer_id) = 0; | 280 virtual void ReusePictureBuffer(int32 picture_buffer_id) = 0; |
283 | 281 |
284 // Flushes the decoder. Flushing will result in output of the | 282 // Flushes the decoder. Flushing will result in output of the |
285 // pictures and buffers held inside the decoder and returning of bitstream | 283 // pictures and buffers held inside the decoder and returning of bitstream |
286 // buffers using the callbacks implemented by the plug-in. Once done with | 284 // buffers using the callbacks implemented by the plug-in. Once done with |
287 // flushing, the decode will call NotifyFlushDone(). | 285 // flushing, the decode will call NotifyFlushDone(). |
288 // | 286 virtual void Flush() = 0; |
289 // Returns true when command successfully accepted. Otherwise false. | |
290 virtual bool Flush() = 0; | |
291 | 287 |
292 // Aborts the decoder. Decode will abort the decoding as soon as possible and | 288 // Aborts the decoder. Decode will abort the decoding as soon as possible and |
293 // will not output anything. NotifyAbortDone() is called as soon as abort has | 289 // will not output anything. NotifyAbortDone() is called as soon as abort has |
294 // been finished. After abort all buffers can be considered dismissed, even | 290 // been finished. After abort all buffers can be considered dismissed, even |
295 // when there has not been callbacks to dismiss them. | 291 // when there has not been callbacks to dismiss them. |
296 // | 292 virtual void Abort() = 0; |
297 // Returns true when command successfully accepted. Otherwise false. | |
298 virtual bool Abort() = 0; | |
299 }; | 293 }; |
300 | 294 |
301 } // namespace media | 295 } // namespace media |
302 | 296 |
303 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 297 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |