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/renderers/video_renderer_impl.h" | 5 #include "media/renderers/video_renderer_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // rendering. | 268 // rendering. |
269 PaintNextReadyFrame_Locked(); | 269 PaintNextReadyFrame_Locked(); |
270 } | 270 } |
271 } | 271 } |
272 | 272 |
273 void VideoRendererImpl::SetTickClockForTesting( | 273 void VideoRendererImpl::SetTickClockForTesting( |
274 scoped_ptr<base::TickClock> tick_clock) { | 274 scoped_ptr<base::TickClock> tick_clock) { |
275 tick_clock_.swap(tick_clock); | 275 tick_clock_.swap(tick_clock); |
276 } | 276 } |
277 | 277 |
| 278 void VideoRendererImpl::OnTimeStateChanged(bool time_progressing) { |
| 279 // TODO(dalecurtis): Wire up to the VideoRendererSink once it's implemented. |
| 280 } |
| 281 |
278 void VideoRendererImpl::PaintNextReadyFrame_Locked() { | 282 void VideoRendererImpl::PaintNextReadyFrame_Locked() { |
279 lock_.AssertAcquired(); | 283 lock_.AssertAcquired(); |
280 | 284 |
281 scoped_refptr<VideoFrame> next_frame = ready_frames_.front(); | 285 scoped_refptr<VideoFrame> next_frame = ready_frames_.front(); |
282 ready_frames_.pop_front(); | 286 ready_frames_.pop_front(); |
283 frames_decoded_++; | 287 frames_decoded_++; |
284 | 288 |
285 last_media_time_ = wall_clock_time_cb_.Run(next_frame->timestamp()); | 289 last_media_time_ = wall_clock_time_cb_.Run(next_frame->timestamp()); |
286 | 290 |
287 paint_cb_.Run(next_frame); | 291 paint_cb_.Run(next_frame); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 task_runner_->PostTask(FROM_HERE, base::Bind(statistics_cb_, statistics)); | 460 task_runner_->PostTask(FROM_HERE, base::Bind(statistics_cb_, statistics)); |
457 | 461 |
458 frames_decoded_ = 0; | 462 frames_decoded_ = 0; |
459 frames_dropped_ = 0; | 463 frames_dropped_ = 0; |
460 } | 464 } |
461 | 465 |
462 frame_available_.TimedWait(wait_duration); | 466 frame_available_.TimedWait(wait_duration); |
463 } | 467 } |
464 | 468 |
465 } // namespace media | 469 } // namespace media |
OLD | NEW |