| 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 #include <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "content/common/gpu/media/h264_dpb.h" | 9 #include "content/common/gpu/media/h264_dpb.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 H264DPB::H264DPB() {} | 13 H264DPB::H264DPB() {} |
| 14 H264DPB::~H264DPB() {} | 14 H264DPB::~H264DPB() {} |
| 15 | 15 |
| 16 void H264DPB::Clear() { | 16 void H264DPB::Clear() { |
| 17 pics_.reset(); | 17 pics_.clear(); |
| 18 } | 18 } |
| 19 | 19 |
| 20 void H264DPB::RemoveByPOC(int poc) { | 20 void H264DPB::RemoveByPOC(int poc) { |
| 21 for (Pictures::iterator it = pics_.begin(); it != pics_.end(); ++it) { | 21 for (Pictures::iterator it = pics_.begin(); it != pics_.end(); ++it) { |
| 22 if ((*it)->pic_order_cnt == poc) { | 22 if ((*it)->pic_order_cnt == poc) { |
| 23 pics_.erase(it); | 23 pics_.erase(it); |
| 24 return; | 24 return; |
| 25 } | 25 } |
| 26 } | 26 } |
| 27 NOTREACHED() << "Missing POC: " << poc; | 27 NOTREACHED() << "Missing POC: " << poc; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 void H264DPB::GetLongTermRefPicsAppending(H264Picture::PtrVector& out) { | 109 void H264DPB::GetLongTermRefPicsAppending(H264Picture::PtrVector& out) { |
| 110 for (size_t i = 0; i < pics_.size(); ++i) { | 110 for (size_t i = 0; i < pics_.size(); ++i) { |
| 111 H264Picture* pic = pics_[i]; | 111 H264Picture* pic = pics_[i]; |
| 112 if (pic->ref && pic->long_term) | 112 if (pic->ref && pic->long_term) |
| 113 out.push_back(pic); | 113 out.push_back(pic); |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace content | 117 } // namespace content |
| 118 | |
| OLD | NEW |