OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "media/base/video_frame_pool.h" | 5 #include "media/base/video_frame_pool.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 break; | 79 break; |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 if (!frame) { | 83 if (!frame) { |
84 frame = VideoFrame::CreateFrame( | 84 frame = VideoFrame::CreateFrame( |
85 format, coded_size, visible_rect, natural_size, timestamp); | 85 format, coded_size, visible_rect, natural_size, timestamp); |
86 } | 86 } |
87 | 87 |
88 return VideoFrame::WrapVideoFrame( | 88 return VideoFrame::WrapVideoFrame( |
89 frame, frame->visible_rect(), | 89 frame, frame->visible_rect(), frame->natural_size(), |
90 base::Bind(&VideoFramePool::PoolImpl::FrameReleased, this, frame)); | 90 base::Bind(&VideoFramePool::PoolImpl::FrameReleased, this, frame)); |
91 } | 91 } |
92 | 92 |
93 void VideoFramePool::PoolImpl::Shutdown() { | 93 void VideoFramePool::PoolImpl::Shutdown() { |
94 base::AutoLock auto_lock(lock_); | 94 base::AutoLock auto_lock(lock_); |
95 is_shutdown_ = true; | 95 is_shutdown_ = true; |
96 frames_.clear(); | 96 frames_.clear(); |
97 } | 97 } |
98 | 98 |
99 void VideoFramePool::PoolImpl::FrameReleased( | 99 void VideoFramePool::PoolImpl::FrameReleased( |
(...skipping 20 matching lines...) Expand all Loading... |
120 base::TimeDelta timestamp) { | 120 base::TimeDelta timestamp) { |
121 return pool_->CreateFrame(format, coded_size, visible_rect, natural_size, | 121 return pool_->CreateFrame(format, coded_size, visible_rect, natural_size, |
122 timestamp); | 122 timestamp); |
123 } | 123 } |
124 | 124 |
125 size_t VideoFramePool::GetPoolSizeForTesting() const { | 125 size_t VideoFramePool::GetPoolSizeForTesting() const { |
126 return pool_->GetPoolSizeForTesting(); | 126 return pool_->GetPoolSizeForTesting(); |
127 } | 127 } |
128 | 128 |
129 } // namespace media | 129 } // namespace media |
OLD | NEW |