| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/callback.h" | 5 #include "base/callback.h" |
| 6 #include "media/base/buffers.h" | 6 #include "media/base/buffers.h" |
| 7 #include "media/base/callback.h" | 7 #include "media/base/callback.h" |
| 8 #include "media/base/filter_host.h" | 8 #include "media/base/filter_host.h" |
| 9 #include "media/base/limits.h" | 9 #include "media/base/limits.h" |
| 10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 if ((seek_callback_.get())) { | 423 if ((seek_callback_.get())) { |
| 424 seek_callback_->Run(); | 424 seek_callback_->Run(); |
| 425 seek_callback_.reset(); | 425 seek_callback_.reset(); |
| 426 } | 426 } |
| 427 } | 427 } |
| 428 } else if (state_ == kFlushing && pending_reads_ == 0 && !pending_paint_) { | 428 } else if (state_ == kFlushing && pending_reads_ == 0 && !pending_paint_) { |
| 429 OnFlushDone(); | 429 OnFlushDone(); |
| 430 } | 430 } |
| 431 } | 431 } |
| 432 | 432 |
| 433 VideoDecoder* VideoRendererBase::GetDecoder() { |
| 434 return decoder_.get(); |
| 435 } |
| 436 |
| 433 void VideoRendererBase::ReadInput(scoped_refptr<VideoFrame> frame) { | 437 void VideoRendererBase::ReadInput(scoped_refptr<VideoFrame> frame) { |
| 434 // We should never return empty frames or EOS frame. | 438 // We should never return empty frames or EOS frame. |
| 435 DCHECK(frame.get() && !frame->IsEndOfStream()); | 439 DCHECK(frame.get() && !frame->IsEndOfStream()); |
| 436 | 440 |
| 437 decoder_->ProduceVideoFrame(frame); | 441 decoder_->ProduceVideoFrame(frame); |
| 438 ++pending_reads_; | 442 ++pending_reads_; |
| 439 } | 443 } |
| 440 | 444 |
| 441 void VideoRendererBase::ScheduleRead_Locked() { | 445 void VideoRendererBase::ScheduleRead_Locked() { |
| 442 lock_.AssertAcquired(); | 446 lock_.AssertAcquired(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 previous_time_ = now; | 521 previous_time_ = now; |
| 518 } | 522 } |
| 519 | 523 |
| 520 // Scale our sleep based on the playback rate. | 524 // Scale our sleep based on the playback rate. |
| 521 // TODO(scherkus): floating point badness and degrade gracefully. | 525 // TODO(scherkus): floating point badness and degrade gracefully. |
| 522 return base::TimeDelta::FromMicroseconds( | 526 return base::TimeDelta::FromMicroseconds( |
| 523 static_cast<int64>(sleep.InMicroseconds() / playback_rate)); | 527 static_cast<int64>(sleep.InMicroseconds() / playback_rate)); |
| 524 } | 528 } |
| 525 | 529 |
| 526 } // namespace media | 530 } // namespace media |
| OLD | NEW |