OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/threading/platform_thread.h" | 7 #include "base/threading/platform_thread.h" |
8 #include "media/base/buffers.h" | 8 #include "media/base/buffers.h" |
9 #include "media/base/filter_host.h" | 9 #include "media/base/filter_host.h" |
10 #include "media/base/limits.h" | 10 #include "media/base/limits.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 base::PlatformThread::Join(thread_to_join); | 82 base::PlatformThread::Join(thread_to_join); |
83 | 83 |
84 callback.Run(); | 84 callback.Run(); |
85 } | 85 } |
86 | 86 |
87 void VideoRendererBase::SetPlaybackRate(float playback_rate) { | 87 void VideoRendererBase::SetPlaybackRate(float playback_rate) { |
88 base::AutoLock auto_lock(lock_); | 88 base::AutoLock auto_lock(lock_); |
89 playback_rate_ = playback_rate; | 89 playback_rate_ = playback_rate; |
90 } | 90 } |
91 | 91 |
92 void VideoRendererBase::Seek(base::TimeDelta time, const FilterStatusCB& cb) { | 92 void VideoRendererBase::Seek(base::TimeDelta time, const PipelineStatusCB& cb) { |
93 base::AutoLock auto_lock(lock_); | 93 base::AutoLock auto_lock(lock_); |
94 DCHECK_EQ(state_, kFlushed) << "Must flush prior to seeking."; | 94 DCHECK_EQ(state_, kFlushed) << "Must flush prior to seeking."; |
95 DCHECK(!cb.is_null()); | 95 DCHECK(!cb.is_null()); |
96 DCHECK(seek_cb_.is_null()); | 96 DCHECK(seek_cb_.is_null()); |
97 | 97 |
98 state_ = kSeeking; | 98 state_ = kSeeking; |
99 seek_cb_ = cb; | 99 seek_cb_ = cb; |
100 seek_timestamp_ = time; | 100 seek_timestamp_ = time; |
101 AttemptRead_Locked(); | 101 AttemptRead_Locked(); |
102 } | 102 } |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 | 486 |
487 int VideoRendererBase::NumFrames_Locked() const { | 487 int VideoRendererBase::NumFrames_Locked() const { |
488 lock_.AssertAcquired(); | 488 lock_.AssertAcquired(); |
489 int outstanding_frames = | 489 int outstanding_frames = |
490 (current_frame_ ? 1 : 0) + (last_available_frame_ ? 1 : 0) + | 490 (current_frame_ ? 1 : 0) + (last_available_frame_ ? 1 : 0) + |
491 (current_frame_ && (current_frame_ == last_available_frame_) ? -1 : 0); | 491 (current_frame_ && (current_frame_ == last_available_frame_) ? -1 : 0); |
492 return ready_frames_.size() + outstanding_frames; | 492 return ready_frames_.size() + outstanding_frames; |
493 } | 493 } |
494 | 494 |
495 } // namespace media | 495 } // namespace media |
OLD | NEW |