| 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/filters/video_renderer_impl.h" | 5 #include "media/filters/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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 buffering_state_cb_.Run(BUFFERING_HAVE_NOTHING); | 85 buffering_state_cb_.Run(BUFFERING_HAVE_NOTHING); |
| 86 } | 86 } |
| 87 received_end_of_stream_ = false; | 87 received_end_of_stream_ = false; |
| 88 rendered_end_of_stream_ = false; | 88 rendered_end_of_stream_ = false; |
| 89 | 89 |
| 90 video_frame_stream_->Reset( | 90 video_frame_stream_->Reset( |
| 91 base::Bind(&VideoRendererImpl::OnVideoFrameStreamResetDone, | 91 base::Bind(&VideoRendererImpl::OnVideoFrameStreamResetDone, |
| 92 weak_factory_.GetWeakPtr())); | 92 weak_factory_.GetWeakPtr())); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void VideoRendererImpl::StartPlaying() { | 95 void VideoRendererImpl::StartPlayingFrom(base::TimeDelta timestamp) { |
| 96 DVLOG(1) << __FUNCTION__; | 96 DVLOG(1) << __FUNCTION__ << "(" << timestamp.InMicroseconds() << ")"; |
| 97 DCHECK(task_runner_->BelongsToCurrentThread()); | 97 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 98 base::AutoLock auto_lock(lock_); | 98 base::AutoLock auto_lock(lock_); |
| 99 DCHECK_EQ(state_, kFlushed); | 99 DCHECK_EQ(state_, kFlushed); |
| 100 DCHECK(!pending_read_); | 100 DCHECK(!pending_read_); |
| 101 DCHECK(ready_frames_.empty()); | 101 DCHECK(ready_frames_.empty()); |
| 102 DCHECK_EQ(buffering_state_, BUFFERING_HAVE_NOTHING); | 102 DCHECK_EQ(buffering_state_, BUFFERING_HAVE_NOTHING); |
| 103 | 103 |
| 104 state_ = kPlaying; | 104 state_ = kPlaying; |
| 105 start_timestamp_ = get_time_cb_.Run(); | 105 start_timestamp_ = timestamp; |
| 106 AttemptRead_Locked(); | 106 AttemptRead_Locked(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void VideoRendererImpl::Initialize(DemuxerStream* stream, | 109 void VideoRendererImpl::Initialize(DemuxerStream* stream, |
| 110 bool low_delay, | 110 bool low_delay, |
| 111 const PipelineStatusCB& init_cb, | 111 const PipelineStatusCB& init_cb, |
| 112 const StatisticsCB& statistics_cb, | 112 const StatisticsCB& statistics_cb, |
| 113 const BufferingStateCB& buffering_state_cb, | 113 const BufferingStateCB& buffering_state_cb, |
| 114 const base::Closure& ended_cb, | 114 const base::Closure& ended_cb, |
| 115 const PipelineStatusCB& error_cb, | 115 const PipelineStatusCB& error_cb, |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 task_runner_->PostTask(FROM_HERE, base::Bind(statistics_cb_, statistics)); | 441 task_runner_->PostTask(FROM_HERE, base::Bind(statistics_cb_, statistics)); |
| 442 | 442 |
| 443 frames_decoded_ = 0; | 443 frames_decoded_ = 0; |
| 444 frames_dropped_ = 0; | 444 frames_dropped_ = 0; |
| 445 } | 445 } |
| 446 | 446 |
| 447 frame_available_.TimedWait(wait_duration); | 447 frame_available_.TimedWait(wait_duration); |
| 448 } | 448 } |
| 449 | 449 |
| 450 } // namespace media | 450 } // namespace media |
| OLD | NEW |