| 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_VP9_DECODER_H_ | 5 #ifndef MEDIA_GPU_VP9_DECODER_H_ |
| 6 #define MEDIA_GPU_VP9_DECODER_H_ | 6 #define MEDIA_GPU_VP9_DECODER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 explicit VP9Decoder(VP9Accelerator* accelerator); | 95 explicit VP9Decoder(VP9Accelerator* accelerator); |
| 96 ~VP9Decoder() override; | 96 ~VP9Decoder() override; |
| 97 | 97 |
| 98 // AcceleratedVideoDecoder implementation. | 98 // AcceleratedVideoDecoder implementation. |
| 99 void SetStream(const uint8_t* ptr, size_t size) override; | 99 void SetStream(const uint8_t* ptr, size_t size) override; |
| 100 bool Flush() override WARN_UNUSED_RESULT; | 100 bool Flush() override WARN_UNUSED_RESULT; |
| 101 void Reset() override; | 101 void Reset() override; |
| 102 DecodeResult Decode() override WARN_UNUSED_RESULT; | 102 DecodeResult Decode() override WARN_UNUSED_RESULT; |
| 103 gfx::Size GetPicSize() const override; | 103 gfx::Size GetPicSize() const override; |
| 104 gfx::Rect GetVisibleRect() const override; |
| 104 size_t GetRequiredNumOfPictures() const override; | 105 size_t GetRequiredNumOfPictures() const override; |
| 105 | 106 |
| 106 private: | 107 private: |
| 107 // Update ref_frames_ based on the information in current frame header. | 108 // Update ref_frames_ based on the information in current frame header. |
| 108 void RefreshReferenceFrames(const scoped_refptr<VP9Picture>& pic); | 109 void RefreshReferenceFrames(const scoped_refptr<VP9Picture>& pic); |
| 109 | 110 |
| 110 // Decode and possibly output |pic| (if the picture is to be shown). | 111 // Decode and possibly output |pic| (if the picture is to be shown). |
| 111 // Return true on success, false otherwise. | 112 // Return true on success, false otherwise. |
| 112 bool DecodeAndOutputPicture(scoped_refptr<VP9Picture> pic); | 113 bool DecodeAndOutputPicture(scoped_refptr<VP9Picture> pic); |
| 113 | 114 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 132 State state_; | 133 State state_; |
| 133 | 134 |
| 134 // Current frame header to be used in decoding the next picture. | 135 // Current frame header to be used in decoding the next picture. |
| 135 std::unique_ptr<Vp9FrameHeader> curr_frame_hdr_; | 136 std::unique_ptr<Vp9FrameHeader> curr_frame_hdr_; |
| 136 | 137 |
| 137 // Reference frames currently in use. | 138 // Reference frames currently in use. |
| 138 std::vector<scoped_refptr<VP9Picture>> ref_frames_; | 139 std::vector<scoped_refptr<VP9Picture>> ref_frames_; |
| 139 | 140 |
| 140 // Current coded resolution. | 141 // Current coded resolution. |
| 141 gfx::Size pic_size_; | 142 gfx::Size pic_size_; |
| 143 // Current render resolution. |
| 144 gfx::Rect render_rect_; |
| 142 | 145 |
| 143 // VP9Accelerator instance owned by the client. | 146 // VP9Accelerator instance owned by the client. |
| 144 VP9Accelerator* accelerator_; | 147 VP9Accelerator* accelerator_; |
| 145 | 148 |
| 146 Vp9Parser parser_; | 149 Vp9Parser parser_; |
| 147 | 150 |
| 148 DISALLOW_COPY_AND_ASSIGN(VP9Decoder); | 151 DISALLOW_COPY_AND_ASSIGN(VP9Decoder); |
| 149 }; | 152 }; |
| 150 | 153 |
| 151 } // namespace media | 154 } // namespace media |
| 152 | 155 |
| 153 #endif // MEDIA_GPU_VP9_DECODER_H_ | 156 #endif // MEDIA_GPU_VP9_DECODER_H_ |
| OLD | NEW |