| 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 #include "content/common/gpu/media/vp8_decoder.h" | 5 #include "media/gpu/vp8_decoder.h" |
| 6 #include "media/base/limits.h" | 6 #include "media/base/limits.h" |
| 7 | 7 |
| 8 namespace content { | 8 namespace media { |
| 9 | 9 |
| 10 VP8Decoder::VP8Accelerator::VP8Accelerator() { | 10 VP8Decoder::VP8Accelerator::VP8Accelerator() {} |
| 11 } | |
| 12 | 11 |
| 13 VP8Decoder::VP8Accelerator::~VP8Accelerator() { | 12 VP8Decoder::VP8Accelerator::~VP8Accelerator() {} |
| 14 } | |
| 15 | 13 |
| 16 VP8Decoder::VP8Decoder(VP8Accelerator* accelerator) | 14 VP8Decoder::VP8Decoder(VP8Accelerator* accelerator) |
| 17 : state_(kNeedStreamMetadata), | 15 : state_(kNeedStreamMetadata), |
| 18 curr_frame_start_(nullptr), | 16 curr_frame_start_(nullptr), |
| 19 frame_size_(0), | 17 frame_size_(0), |
| 20 accelerator_(accelerator) { | 18 accelerator_(accelerator) { |
| 21 DCHECK(accelerator_); | 19 DCHECK(accelerator_); |
| 22 } | 20 } |
| 23 | 21 |
| 24 VP8Decoder::~VP8Decoder() { | 22 VP8Decoder::~VP8Decoder() {} |
| 25 } | |
| 26 | 23 |
| 27 bool VP8Decoder::Flush() { | 24 bool VP8Decoder::Flush() { |
| 28 DVLOG(2) << "Decoder flush"; | 25 DVLOG(2) << "Decoder flush"; |
| 29 Reset(); | 26 Reset(); |
| 30 return true; | 27 return true; |
| 31 } | 28 } |
| 32 | 29 |
| 33 void VP8Decoder::SetStream(const uint8_t* ptr, size_t size) { | 30 void VP8Decoder::SetStream(const uint8_t* ptr, size_t size) { |
| 34 DCHECK(ptr); | 31 DCHECK(ptr); |
| 35 DCHECK(size); | 32 DCHECK(size); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 gfx::Size VP8Decoder::GetPicSize() const { | 184 gfx::Size VP8Decoder::GetPicSize() const { |
| 188 return pic_size_; | 185 return pic_size_; |
| 189 } | 186 } |
| 190 | 187 |
| 191 size_t VP8Decoder::GetRequiredNumOfPictures() const { | 188 size_t VP8Decoder::GetRequiredNumOfPictures() const { |
| 192 const size_t kVP8NumFramesActive = 4; | 189 const size_t kVP8NumFramesActive = 4; |
| 193 const size_t kPicsInPipeline = media::limits::kMaxVideoFrames + 2; | 190 const size_t kPicsInPipeline = media::limits::kMaxVideoFrames + 2; |
| 194 return kVP8NumFramesActive + kPicsInPipeline; | 191 return kVP8NumFramesActive + kPicsInPipeline; |
| 195 } | 192 } |
| 196 | 193 |
| 197 } // namespace content | 194 } // namespace media |
| OLD | NEW |