| 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 "content/common/gpu/media/vp8_decoder.h" |
| 6 #include "media/base/limits.h" | 6 #include "media/base/limits.h" |
| 7 | 7 |
| 8 namespace content { | 8 namespace content { |
| 9 | 9 |
| 10 VP8Decoder::VP8Accelerator::VP8Accelerator() { | 10 VP8Decoder::VP8Accelerator::VP8Accelerator() { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } | 68 } |
| 69 | 69 |
| 70 if (curr_frame_hdr_->IsKeyframe()) { | 70 if (curr_frame_hdr_->IsKeyframe()) { |
| 71 gfx::Size new_pic_size(curr_frame_hdr_->width, curr_frame_hdr_->height); | 71 gfx::Size new_pic_size(curr_frame_hdr_->width, curr_frame_hdr_->height); |
| 72 if (new_pic_size.IsEmpty()) | 72 if (new_pic_size.IsEmpty()) |
| 73 return kDecodeError; | 73 return kDecodeError; |
| 74 | 74 |
| 75 if (new_pic_size != pic_size_) { | 75 if (new_pic_size != pic_size_) { |
| 76 DVLOG(2) << "New resolution: " << new_pic_size.ToString(); | 76 DVLOG(2) << "New resolution: " << new_pic_size.ToString(); |
| 77 pic_size_ = new_pic_size; | 77 pic_size_ = new_pic_size; |
| 78 |
| 79 DCHECK(!curr_pic_); |
| 80 last_frame_ = nullptr; |
| 81 golden_frame_ = nullptr; |
| 82 alt_frame_ = nullptr; |
| 83 |
| 78 return kAllocateNewSurfaces; | 84 return kAllocateNewSurfaces; |
| 79 } | 85 } |
| 80 | 86 |
| 81 state_ = kDecoding; | 87 state_ = kDecoding; |
| 82 } else { | 88 } else { |
| 83 if (state_ != kDecoding) { | 89 if (state_ != kDecoding) { |
| 84 // Need a resume point. | 90 // Need a resume point. |
| 85 curr_frame_hdr_.reset(); | 91 curr_frame_hdr_.reset(); |
| 86 return kRanOutOfStreamData; | 92 return kRanOutOfStreamData; |
| 87 } | 93 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 return true; | 183 return true; |
| 178 } | 184 } |
| 179 | 185 |
| 180 size_t VP8Decoder::GetRequiredNumOfPictures() const { | 186 size_t VP8Decoder::GetRequiredNumOfPictures() const { |
| 181 const size_t kVP8NumFramesActive = 4; | 187 const size_t kVP8NumFramesActive = 4; |
| 182 const size_t kPicsInPipeline = media::limits::kMaxVideoFrames + 2; | 188 const size_t kPicsInPipeline = media::limits::kMaxVideoFrames + 2; |
| 183 return kVP8NumFramesActive + kPicsInPipeline; | 189 return kVP8NumFramesActive + kPicsInPipeline; |
| 184 } | 190 } |
| 185 | 191 |
| 186 } // namespace content | 192 } // namespace content |
| OLD | NEW |