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_VP8_DECODER_H_ | 5 #ifndef MEDIA_GPU_VP8_DECODER_H_ |
6 #define MEDIA_GPU_VP8_DECODER_H_ | 6 #define MEDIA_GPU_VP8_DECODER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "media/filters/vp8_parser.h" | 15 #include "media/filters/vp8_parser.h" |
16 #include "media/gpu/accelerated_video_decoder.h" | 16 #include "media/gpu/accelerated_video_decoder.h" |
17 #include "media/gpu/vp8_picture.h" | 17 #include "media/gpu/vp8_picture.h" |
| 18 #include "ui/gfx/geometry/rect.h" |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 // Clients of this class are expected to pass raw VP8 stream and are expected | 22 // Clients of this class are expected to pass raw VP8 stream and are expected |
22 // to provide an implementation of VP8Accelerator for offloading final steps | 23 // to provide an implementation of VP8Accelerator for offloading final steps |
23 // of the decoding process. | 24 // of the decoding process. |
24 // | 25 // |
25 // This class must be created, called and destroyed on a single thread, and | 26 // This class must be created, called and destroyed on a single thread, and |
26 // does nothing internally on any other thread. | 27 // does nothing internally on any other thread. |
27 class MEDIA_GPU_EXPORT VP8Decoder : public AcceleratedVideoDecoder { | 28 class MEDIA_GPU_EXPORT VP8Decoder : public AcceleratedVideoDecoder { |
(...skipping 22 matching lines...) Expand all Loading... |
50 const scoped_refptr<VP8Picture>& last_frame, | 51 const scoped_refptr<VP8Picture>& last_frame, |
51 const scoped_refptr<VP8Picture>& golden_frame, | 52 const scoped_refptr<VP8Picture>& golden_frame, |
52 const scoped_refptr<VP8Picture>& alt_frame) = 0; | 53 const scoped_refptr<VP8Picture>& alt_frame) = 0; |
53 | 54 |
54 // Schedule output (display) of |pic|. Note that returning from this | 55 // Schedule output (display) of |pic|. Note that returning from this |
55 // method does not mean that |pic| has already been outputted (displayed), | 56 // method does not mean that |pic| has already been outputted (displayed), |
56 // but guarantees that all pictures will be outputted in the same order | 57 // but guarantees that all pictures will be outputted in the same order |
57 // as this method was called for them. Decoder may drop its reference | 58 // as this method was called for them. Decoder may drop its reference |
58 // to |pic| after calling this method. | 59 // to |pic| after calling this method. |
59 // Return true if successful. | 60 // Return true if successful. |
60 virtual bool OutputPicture(const scoped_refptr<VP8Picture>& pic) = 0; | 61 virtual bool OutputPicture(const scoped_refptr<VP8Picture>& pic, |
| 62 const gfx::Rect& visible_rect) = 0; |
61 | 63 |
62 private: | 64 private: |
63 DISALLOW_COPY_AND_ASSIGN(VP8Accelerator); | 65 DISALLOW_COPY_AND_ASSIGN(VP8Accelerator); |
64 }; | 66 }; |
65 | 67 |
66 VP8Decoder(VP8Accelerator* accelerator); | 68 VP8Decoder(VP8Accelerator* accelerator); |
67 ~VP8Decoder() override; | 69 ~VP8Decoder() override; |
68 | 70 |
69 // AcceleratedVideoDecoder implementation. | 71 // AcceleratedVideoDecoder implementation. |
70 bool Flush() override WARN_UNUSED_RESULT; | 72 bool Flush() override WARN_UNUSED_RESULT; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 int vertical_scale_; | 105 int vertical_scale_; |
104 | 106 |
105 VP8Accelerator* accelerator_; | 107 VP8Accelerator* accelerator_; |
106 | 108 |
107 DISALLOW_COPY_AND_ASSIGN(VP8Decoder); | 109 DISALLOW_COPY_AND_ASSIGN(VP8Decoder); |
108 }; | 110 }; |
109 | 111 |
110 } // namespace media | 112 } // namespace media |
111 | 113 |
112 #endif // MEDIA_GPU_VP8_DECODER_H_ | 114 #endif // MEDIA_GPU_VP8_DECODER_H_ |
OLD | NEW |