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/macros.h" | 10 #include "base/macros.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 if (!frame.get()) { | 82 if (!frame.get()) { |
83 frame = VideoFrame::CreateZeroInitializedFrame( | 83 frame = VideoFrame::CreateZeroInitializedFrame( |
84 format, coded_size, visible_rect, natural_size, timestamp); | 84 format, coded_size, visible_rect, natural_size, timestamp); |
85 LOG_IF(ERROR, !frame.get()) << "Failed to create a video frame"; | 85 LOG_IF(ERROR, !frame.get()) << "Failed to create a video frame"; |
86 } | 86 } |
87 | 87 |
88 scoped_refptr<VideoFrame> wrapped_frame = VideoFrame::WrapVideoFrame( | 88 scoped_refptr<VideoFrame> wrapped_frame = VideoFrame::WrapVideoFrame( |
89 frame, frame->visible_rect(), frame->natural_size()); | 89 frame, frame->format(), frame->visible_rect(), frame->natural_size()); |
90 wrapped_frame->AddDestructionObserver( | 90 wrapped_frame->AddDestructionObserver( |
91 base::Bind(&VideoFramePool::PoolImpl::FrameReleased, this, frame)); | 91 base::Bind(&VideoFramePool::PoolImpl::FrameReleased, this, frame)); |
92 return wrapped_frame; | 92 return wrapped_frame; |
93 } | 93 } |
94 | 94 |
95 void VideoFramePool::PoolImpl::Shutdown() { | 95 void VideoFramePool::PoolImpl::Shutdown() { |
96 base::AutoLock auto_lock(lock_); | 96 base::AutoLock auto_lock(lock_); |
97 is_shutdown_ = true; | 97 is_shutdown_ = true; |
98 frames_.clear(); | 98 frames_.clear(); |
99 } | 99 } |
(...skipping 22 matching lines...) Expand all Loading... |
122 base::TimeDelta timestamp) { | 122 base::TimeDelta timestamp) { |
123 return pool_->CreateFrame(format, coded_size, visible_rect, natural_size, | 123 return pool_->CreateFrame(format, coded_size, visible_rect, natural_size, |
124 timestamp); | 124 timestamp); |
125 } | 125 } |
126 | 126 |
127 size_t VideoFramePool::GetPoolSizeForTesting() const { | 127 size_t VideoFramePool::GetPoolSizeForTesting() const { |
128 return pool_->GetPoolSizeForTesting(); | 128 return pool_->GetPoolSizeForTesting(); |
129 } | 129 } |
130 | 130 |
131 } // namespace media | 131 } // namespace media |
OLD | NEW |