Chromium Code Reviews| Index: media/filters/fake_video_decoder.cc |
| diff --git a/media/filters/fake_video_decoder.cc b/media/filters/fake_video_decoder.cc |
| index f3c4ef112d765173aed83226ed57f2835470b1e0..d8658c80c8cfeeab50a0efc14bf5ac3e679eb165 100644 |
| --- a/media/filters/fake_video_decoder.cc |
| +++ b/media/filters/fake_video_decoder.cc |
| @@ -18,7 +18,8 @@ FakeVideoDecoder::FakeVideoDecoder(int decoding_delay) |
| weak_factory_(this), |
| decoding_delay_(decoding_delay), |
| state_(UNINITIALIZED), |
| - total_bytes_decoded_(0) { |
| + total_bytes_decoded_(0), |
| + reads_queued_(0) { |
| DCHECK_GE(decoding_delay, 0); |
| } |
| @@ -103,6 +104,19 @@ void FakeVideoDecoder::Stop(const base::Closure& closure) { |
| DoStop(); |
| } |
| +scoped_refptr<VideoFrame> FakeVideoDecoder::GetDecodeOutput() { |
| + DCHECK(task_runner_->BelongsToCurrentThread()); |
| + if (!reads_queued_) { |
| + return NULL; |
| + } |
|
xhwang
2014/03/06 23:32:40
nit: no need for braces.
|
| + --reads_queued_; |
| + return VideoFrame::CreateEOSFrame(); |
|
xhwang
2014/03/06 23:32:40
This isn't quite right. Even though this decoder i
|
| +} |
| + |
| +void FakeVideoDecoder::QueueRead() { |
| + ++reads_queued_; |
| +} |
| + |
| void FakeVideoDecoder::HoldNextInit() { |
| DCHECK(task_runner_->BelongsToCurrentThread()); |
| init_cb_.HoldCallback(); |