OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/fake_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/fake_video_decode_accelerator.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 weak_this_factory_.GetWeakPtr())); | 132 weak_this_factory_.GetWeakPtr())); |
133 } | 133 } |
134 | 134 |
135 void FakeVideoDecodeAccelerator::ReusePictureBuffer(int32_t picture_buffer_id) { | 135 void FakeVideoDecodeAccelerator::ReusePictureBuffer(int32_t picture_buffer_id) { |
136 free_output_buffers_.push(picture_buffer_id); | 136 free_output_buffers_.push(picture_buffer_id); |
137 child_task_runner_->PostTask( | 137 child_task_runner_->PostTask( |
138 FROM_HERE, base::Bind(&FakeVideoDecodeAccelerator::DoPictureReady, | 138 FROM_HERE, base::Bind(&FakeVideoDecodeAccelerator::DoPictureReady, |
139 weak_this_factory_.GetWeakPtr())); | 139 weak_this_factory_.GetWeakPtr())); |
140 } | 140 } |
141 | 141 |
142 void FakeVideoDecodeAccelerator::Flush() { | 142 void FakeVideoDecodeAccelerator::Flush(bool return_buffers) { |
kcwu
2016/03/22 09:47:42
how about adding DCHECK(!return_buffers) for VDAs
| |
143 flushing_ = true; | 143 flushing_ = true; |
144 child_task_runner_->PostTask( | 144 child_task_runner_->PostTask( |
145 FROM_HERE, base::Bind(&FakeVideoDecodeAccelerator::DoPictureReady, | 145 FROM_HERE, base::Bind(&FakeVideoDecodeAccelerator::DoPictureReady, |
146 weak_this_factory_.GetWeakPtr())); | 146 weak_this_factory_.GetWeakPtr())); |
147 } | 147 } |
148 | 148 |
149 void FakeVideoDecodeAccelerator::Reset() { | 149 void FakeVideoDecodeAccelerator::Reset() { |
150 while (!queued_bitstream_ids_.empty()) { | 150 while (!queued_bitstream_ids_.empty()) { |
151 client_->NotifyEndOfBitstreamBuffer(queued_bitstream_ids_.front()); | 151 client_->NotifyEndOfBitstreamBuffer(queued_bitstream_ids_.front()); |
152 queued_bitstream_ids_.pop(); | 152 queued_bitstream_ids_.pop(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 // Bitstream no longer needed. | 186 // Bitstream no longer needed. |
187 client_->NotifyEndOfBitstreamBuffer(bitstream_id); | 187 client_->NotifyEndOfBitstreamBuffer(bitstream_id); |
188 if (flushing_ && queued_bitstream_ids_.empty()) { | 188 if (flushing_ && queued_bitstream_ids_.empty()) { |
189 flushing_ = false; | 189 flushing_ = false; |
190 client_->NotifyFlushDone(); | 190 client_->NotifyFlushDone(); |
191 } | 191 } |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 } // namespace content | 195 } // namespace content |
OLD | NEW |