| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_GPU_ACCELERATED_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_GPU_ACCELERATED_VIDEO_DECODER_H_ |
| 6 #define MEDIA_GPU_ACCELERATED_VIDEO_DECODER_H_ | 6 #define MEDIA_GPU_ACCELERATED_VIDEO_DECODER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 enum DecodeResult { | 38 enum DecodeResult { |
| 39 kDecodeError, // Error while decoding. | 39 kDecodeError, // Error while decoding. |
| 40 // TODO(posciak): unsupported streams are currently treated as error | 40 // TODO(posciak): unsupported streams are currently treated as error |
| 41 // in decoding; in future it could perhaps be possible to fall back | 41 // in decoding; in future it could perhaps be possible to fall back |
| 42 // to software decoding instead. | 42 // to software decoding instead. |
| 43 // kStreamError, // Error in stream. | 43 // kStreamError, // Error in stream. |
| 44 kAllocateNewSurfaces, // Need a new set of surfaces to be allocated. | 44 kAllocateNewSurfaces, // Need a new set of surfaces to be allocated. |
| 45 kRanOutOfStreamData, // Need more stream data to proceed. | 45 kRanOutOfStreamData, // Need more stream data to proceed. |
| 46 kRanOutOfSurfaces, // Waiting for the client to free up output surfaces. | 46 kRanOutOfSurfaces, // Waiting for the client to free up output surfaces. |
| 47 kNeedContextUpdate, // Waiting for the client to update decoding context |
| 48 // with data acquired from the accelerator. |
| 47 }; | 49 }; |
| 48 | 50 |
| 49 // Try to decode more of the stream, returning decoded frames asynchronously. | 51 // Try to decode more of the stream, returning decoded frames asynchronously. |
| 50 // Return when more stream is needed, when we run out of free surfaces, when | 52 // Return when more stream is needed, when we run out of free surfaces, when |
| 51 // we need a new set of them, or when an error occurs. | 53 // we need a new set of them, or when an error occurs. |
| 52 virtual DecodeResult Decode() WARN_UNUSED_RESULT = 0; | 54 virtual DecodeResult Decode() WARN_UNUSED_RESULT = 0; |
| 53 | 55 |
| 54 // Return dimensions/required number of output surfaces that client should | 56 // Return dimensions/required number of output surfaces that client should |
| 55 // be ready to provide for the decoder to function properly. | 57 // be ready to provide for the decoder to function properly. |
| 56 // To be used after Decode() returns kAllocateNewSurfaces. | 58 // To be used after Decode() returns kAllocateNewSurfaces. |
| 57 virtual gfx::Size GetPicSize() const = 0; | 59 virtual gfx::Size GetPicSize() const = 0; |
| 58 virtual size_t GetRequiredNumOfPictures() const = 0; | 60 virtual size_t GetRequiredNumOfPictures() const = 0; |
| 59 | 61 |
| 60 private: | 62 private: |
| 61 DISALLOW_COPY_AND_ASSIGN(AcceleratedVideoDecoder); | 63 DISALLOW_COPY_AND_ASSIGN(AcceleratedVideoDecoder); |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 } // namespace media | 66 } // namespace media |
| 65 | 67 |
| 66 #endif // MEDIA_GPU_ACCELERATED_VIDEO_DECODER_H_ | 68 #endif // MEDIA_GPU_ACCELERATED_VIDEO_DECODER_H_ |
| OLD | NEW |