| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 if (!thread_to_join.is_null()) { | 102 if (!thread_to_join.is_null()) { |
| 103 base::AutoUnlock auto_unlock(lock_); | 103 base::AutoUnlock auto_unlock(lock_); |
| 104 base::PlatformThread::Join(thread_to_join); | 104 base::PlatformThread::Join(thread_to_join); |
| 105 } | 105 } |
| 106 | 106 |
| 107 video_frame_stream_.reset(); | 107 video_frame_stream_.reset(); |
| 108 task_runner_->PostTask(FROM_HERE, callback); | 108 task_runner_->PostTask(FROM_HERE, callback); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void VideoRendererImpl::StartPlayingFrom(base::TimeDelta timestamp) { | 111 void VideoRendererImpl::StartPlaying() { |
| 112 DCHECK(task_runner_->BelongsToCurrentThread()); | 112 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 113 base::AutoLock auto_lock(lock_); | 113 base::AutoLock auto_lock(lock_); |
| 114 DCHECK_EQ(state_, kFlushed); | 114 DCHECK_EQ(state_, kFlushed); |
| 115 DCHECK(!pending_read_); | 115 DCHECK(!pending_read_); |
| 116 DCHECK(ready_frames_.empty()); | 116 DCHECK(ready_frames_.empty()); |
| 117 DCHECK_EQ(buffering_state_, BUFFERING_HAVE_NOTHING); | 117 DCHECK_EQ(buffering_state_, BUFFERING_HAVE_NOTHING); |
| 118 | 118 |
| 119 state_ = kPlaying; | 119 state_ = kPlaying; |
| 120 start_timestamp_ = timestamp; | 120 start_timestamp_ = get_time_cb_.Run(); |
| 121 AttemptRead_Locked(); | 121 AttemptRead_Locked(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void VideoRendererImpl::Initialize(DemuxerStream* stream, | 124 void VideoRendererImpl::Initialize(DemuxerStream* stream, |
| 125 bool low_delay, | 125 bool low_delay, |
| 126 const PipelineStatusCB& init_cb, | 126 const PipelineStatusCB& init_cb, |
| 127 const StatisticsCB& statistics_cb, | 127 const StatisticsCB& statistics_cb, |
| 128 const TimeCB& max_time_cb, | 128 const TimeCB& max_time_cb, |
| 129 const BufferingStateCB& buffering_state_cb, | 129 const BufferingStateCB& buffering_state_cb, |
| 130 const base::Closure& ended_cb, | 130 const base::Closure& ended_cb, |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 statistics_cb_.Run(statistics); | 492 statistics_cb_.Run(statistics); |
| 493 | 493 |
| 494 frames_decoded_ = 0; | 494 frames_decoded_ = 0; |
| 495 frames_dropped_ = 0; | 495 frames_dropped_ = 0; |
| 496 } | 496 } |
| 497 | 497 |
| 498 frame_available_.TimedWait(wait_duration); | 498 frame_available_.TimedWait(wait_duration); |
| 499 } | 499 } |
| 500 | 500 |
| 501 } // namespace media | 501 } // namespace media |
| OLD | NEW |