| 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/filter_host.h" | 7 #include "media/base/filter_host.h" |
| 8 #include "media/base/video_frame.h" | 8 #include "media/base/video_frame.h" |
| 9 #include "media/filters/video_renderer_base.h" | 9 #include "media/filters/video_renderer_base.h" |
| 10 | 10 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 callback->Run(); | 206 callback->Run(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 bool VideoRendererBase::HasEnded() { | 209 bool VideoRendererBase::HasEnded() { |
| 210 AutoLock auto_lock(lock_); | 210 AutoLock auto_lock(lock_); |
| 211 return state_ == kEnded; | 211 return state_ == kEnded; |
| 212 } | 212 } |
| 213 | 213 |
| 214 // PlatformThread::Delegate implementation. | 214 // PlatformThread::Delegate implementation. |
| 215 void VideoRendererBase::ThreadMain() { | 215 void VideoRendererBase::ThreadMain() { |
| 216 PlatformThread::SetName("VideoThread"); | 216 PlatformThread::SetName("CrVideoRenderer"); |
| 217 for (;;) { | 217 for (;;) { |
| 218 // State and playback rate to assume for this iteration of the loop. | 218 // State and playback rate to assume for this iteration of the loop. |
| 219 State state; | 219 State state; |
| 220 float playback_rate; | 220 float playback_rate; |
| 221 base::TimeDelta remaining_time; | 221 base::TimeDelta remaining_time; |
| 222 { | 222 { |
| 223 AutoLock auto_lock(lock_); | 223 AutoLock auto_lock(lock_); |
| 224 state = state_; | 224 state = state_; |
| 225 playback_rate = playback_rate_; | 225 playback_rate = playback_rate_; |
| 226 | 226 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 previous_time_ = now; | 421 previous_time_ = now; |
| 422 } | 422 } |
| 423 | 423 |
| 424 // Scale our sleep based on the playback rate. | 424 // Scale our sleep based on the playback rate. |
| 425 // TODO(scherkus): floating point badness and degrade gracefully. | 425 // TODO(scherkus): floating point badness and degrade gracefully. |
| 426 return base::TimeDelta::FromMicroseconds( | 426 return base::TimeDelta::FromMicroseconds( |
| 427 static_cast<int64>(sleep.InMicroseconds() / playback_rate)); | 427 static_cast<int64>(sleep.InMicroseconds() / playback_rate)); |
| 428 } | 428 } |
| 429 | 429 |
| 430 } // namespace media | 430 } // namespace media |
| OLD | NEW |