| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H264_DECODER_H_ | 5 #ifndef MEDIA_GPU_H264_DECODER_H_ |
| 6 #define MEDIA_GPU_H264_DECODER_H_ | 6 #define MEDIA_GPU_H264_DECODER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 H264Decoder(H264Accelerator* accelerator); | 103 H264Decoder(H264Accelerator* accelerator); |
| 104 ~H264Decoder() override; | 104 ~H264Decoder() override; |
| 105 | 105 |
| 106 // AcceleratedVideoDecoder implementation. | 106 // AcceleratedVideoDecoder implementation. |
| 107 bool Flush() override WARN_UNUSED_RESULT; | 107 bool Flush() override WARN_UNUSED_RESULT; |
| 108 void Reset() override; | 108 void Reset() override; |
| 109 void SetStream(const uint8_t* ptr, size_t size) override; | 109 void SetStream(const uint8_t* ptr, size_t size) override; |
| 110 DecodeResult Decode() override WARN_UNUSED_RESULT; | 110 DecodeResult Decode() override WARN_UNUSED_RESULT; |
| 111 gfx::Size GetPicSize() const override; | 111 gfx::Size GetPicSize() const override; |
| 112 gfx::Rect GetVisibleRect() const override; |
| 112 size_t GetRequiredNumOfPictures() const override; | 113 size_t GetRequiredNumOfPictures() const override; |
| 113 | 114 |
| 114 private: | 115 private: |
| 115 // We need to keep at most kDPBMaxSize pictures in DPB for | 116 // We need to keep at most kDPBMaxSize pictures in DPB for |
| 116 // reference/to display later and an additional one for the one currently | 117 // reference/to display later and an additional one for the one currently |
| 117 // being decoded. We also ask for some additional ones since VDA needs | 118 // being decoded. We also ask for some additional ones since VDA needs |
| 118 // to accumulate a few ready-to-output pictures before it actually starts | 119 // to accumulate a few ready-to-output pictures before it actually starts |
| 119 // displaying and giving them back. +2 instead of +1 because of subjective | 120 // displaying and giving them back. +2 instead of +1 because of subjective |
| 120 // smoothness improvement during testing. | 121 // smoothness improvement during testing. |
| 121 enum { | 122 enum { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // Currently active SPS and PPS. | 260 // Currently active SPS and PPS. |
| 260 int curr_sps_id_; | 261 int curr_sps_id_; |
| 261 int curr_pps_id_; | 262 int curr_pps_id_; |
| 262 | 263 |
| 263 // Current NALU and slice header being processed. | 264 // Current NALU and slice header being processed. |
| 264 std::unique_ptr<H264NALU> curr_nalu_; | 265 std::unique_ptr<H264NALU> curr_nalu_; |
| 265 std::unique_ptr<H264SliceHeader> curr_slice_hdr_; | 266 std::unique_ptr<H264SliceHeader> curr_slice_hdr_; |
| 266 | 267 |
| 267 // Output picture size. | 268 // Output picture size. |
| 268 gfx::Size pic_size_; | 269 gfx::Size pic_size_; |
| 270 // Output visible cropping rect. |
| 271 gfx::Rect visible_rect_; |
| 269 | 272 |
| 270 // PicOrderCount of the previously outputted frame. | 273 // PicOrderCount of the previously outputted frame. |
| 271 int last_output_poc_; | 274 int last_output_poc_; |
| 272 | 275 |
| 273 H264Accelerator* accelerator_; | 276 H264Accelerator* accelerator_; |
| 274 | 277 |
| 275 DISALLOW_COPY_AND_ASSIGN(H264Decoder); | 278 DISALLOW_COPY_AND_ASSIGN(H264Decoder); |
| 276 }; | 279 }; |
| 277 | 280 |
| 278 } // namespace media | 281 } // namespace media |
| 279 | 282 |
| 280 #endif // MEDIA_GPU_H264_DECODER_H_ | 283 #endif // MEDIA_GPU_H264_DECODER_H_ |
| OLD | NEW |