OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer_impl.h" | 5 #include "media/renderers/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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 void RendererImpl::EnableClocklessVideoPlaybackForTesting() { | 222 void RendererImpl::EnableClocklessVideoPlaybackForTesting() { |
223 DVLOG(1) << __FUNCTION__; | 223 DVLOG(1) << __FUNCTION__; |
224 DCHECK(task_runner_->BelongsToCurrentThread()); | 224 DCHECK(task_runner_->BelongsToCurrentThread()); |
225 DCHECK_EQ(state_, STATE_UNINITIALIZED); | 225 DCHECK_EQ(state_, STATE_UNINITIALIZED); |
226 DCHECK(underflow_disabled_for_testing_) | 226 DCHECK(underflow_disabled_for_testing_) |
227 << "Underflow must be disabled for clockless video playback"; | 227 << "Underflow must be disabled for clockless video playback"; |
228 | 228 |
229 clockless_video_playback_enabled_for_testing_ = true; | 229 clockless_video_playback_enabled_for_testing_ = true; |
230 } | 230 } |
231 | 231 |
232 base::TimeTicks RendererImpl::GetWallClockTime(base::TimeDelta time) { | 232 base::TimeTicks RendererImpl::GetWallClockTime(base::TimeDelta time, |
| 233 int request_flags) { |
233 // No BelongsToCurrentThread() checking because this can be called from other | 234 // No BelongsToCurrentThread() checking because this can be called from other |
234 // threads. | 235 // threads. |
235 // | 236 // |
236 // TODO(scherkus): Currently called from VideoRendererImpl's internal thread, | 237 // TODO(scherkus): Currently called from VideoRendererImpl's internal thread, |
237 // which should go away at some point http://crbug.com/110814 | 238 // which should go away at some point http://crbug.com/110814 |
238 if (clockless_video_playback_enabled_for_testing_) | 239 if (clockless_video_playback_enabled_for_testing_) |
239 return base::TimeTicks::Now(); | 240 return base::TimeTicks::Now(); |
240 | 241 |
241 return time_source_->GetWallClockTime(time); | 242 return time_source_->GetWallClockTime(time, request_flags); |
242 } | 243 } |
243 | 244 |
244 void RendererImpl::SetDecryptorReadyCallback( | 245 void RendererImpl::SetDecryptorReadyCallback( |
245 const DecryptorReadyCB& decryptor_ready_cb) { | 246 const DecryptorReadyCB& decryptor_ready_cb) { |
246 // Cancels the previous decryptor request. | 247 // Cancels the previous decryptor request. |
247 if (decryptor_ready_cb.is_null()) { | 248 if (decryptor_ready_cb.is_null()) { |
248 if (!decryptor_ready_cb_.is_null()) { | 249 if (!decryptor_ready_cb_.is_null()) { |
249 base::ResetAndReturn(&decryptor_ready_cb_) | 250 base::ResetAndReturn(&decryptor_ready_cb_) |
250 .Run(nullptr, base::Bind(IgnoreCdmAttached)); | 251 .Run(nullptr, base::Bind(IgnoreCdmAttached)); |
251 } | 252 } |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 } | 627 } |
627 | 628 |
628 // After OnError() returns, the pipeline may destroy |this|. | 629 // After OnError() returns, the pipeline may destroy |this|. |
629 base::ResetAndReturn(&error_cb_).Run(error); | 630 base::ResetAndReturn(&error_cb_).Run(error); |
630 | 631 |
631 if (!flush_cb_.is_null()) | 632 if (!flush_cb_.is_null()) |
632 base::ResetAndReturn(&flush_cb_).Run(); | 633 base::ResetAndReturn(&flush_cb_).Run(); |
633 } | 634 } |
634 | 635 |
635 } // namespace media | 636 } // namespace media |
OLD | NEW |