| 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 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "media/gpu/media_gpu_export.h" | 12 #include "media/gpu/media_gpu_export.h" |
| 13 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 14 | 15 |
| 15 namespace media { | 16 namespace media { |
| 16 | 17 |
| 17 // An AcceleratedVideoDecoder is a video decoder that requires support from an | 18 // An AcceleratedVideoDecoder is a video decoder that requires support from an |
| 18 // external accelerator (typically a hardware accelerator) to partially offload | 19 // external accelerator (typically a hardware accelerator) to partially offload |
| 19 // the decode process after parsing stream headers, and performing reference | 20 // the decode process after parsing stream headers, and performing reference |
| 20 // frame and state management. | 21 // frame and state management. |
| 21 class MEDIA_GPU_EXPORT AcceleratedVideoDecoder { | 22 class MEDIA_GPU_EXPORT AcceleratedVideoDecoder { |
| 22 public: | 23 public: |
| (...skipping 27 matching lines...) Expand all Loading... |
| 50 | 51 |
| 51 // Try to decode more of the stream, returning decoded frames asynchronously. | 52 // Try to decode more of the stream, returning decoded frames asynchronously. |
| 52 // Return when more stream is needed, when we run out of free surfaces, when | 53 // Return when more stream is needed, when we run out of free surfaces, when |
| 53 // we need a new set of them, or when an error occurs. | 54 // we need a new set of them, or when an error occurs. |
| 54 virtual DecodeResult Decode() WARN_UNUSED_RESULT = 0; | 55 virtual DecodeResult Decode() WARN_UNUSED_RESULT = 0; |
| 55 | 56 |
| 56 // Return dimensions/required number of output surfaces that client should | 57 // Return dimensions/required number of output surfaces that client should |
| 57 // be ready to provide for the decoder to function properly. | 58 // be ready to provide for the decoder to function properly. |
| 58 // To be used after Decode() returns kAllocateNewSurfaces. | 59 // To be used after Decode() returns kAllocateNewSurfaces. |
| 59 virtual gfx::Size GetPicSize() const = 0; | 60 virtual gfx::Size GetPicSize() const = 0; |
| 61 virtual gfx::Rect GetVisibleRect() const = 0; |
| 60 virtual size_t GetRequiredNumOfPictures() const = 0; | 62 virtual size_t GetRequiredNumOfPictures() const = 0; |
| 61 | 63 |
| 62 private: | 64 private: |
| 63 DISALLOW_COPY_AND_ASSIGN(AcceleratedVideoDecoder); | 65 DISALLOW_COPY_AND_ASSIGN(AcceleratedVideoDecoder); |
| 64 }; | 66 }; |
| 65 | 67 |
| 66 } // namespace media | 68 } // namespace media |
| 67 | 69 |
| 68 #endif // MEDIA_GPU_ACCELERATED_VIDEO_DECODER_H_ | 70 #endif // MEDIA_GPU_ACCELERATED_VIDEO_DECODER_H_ |
| OLD | NEW |