| 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 "media/base/pipeline.h" | 5 #include "media/base/pipeline.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 task_runner_->PostTask(FROM_HERE, base::Bind( | 152 task_runner_->PostTask(FROM_HERE, base::Bind( |
| 153 &Pipeline::VolumeChangedTask, base::Unretained(this), volume)); | 153 &Pipeline::VolumeChangedTask, base::Unretained(this), volume)); |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 | 156 |
| 157 TimeDelta Pipeline::GetMediaTime() const { | 157 TimeDelta Pipeline::GetMediaTime() const { |
| 158 base::AutoLock auto_lock(lock_); | 158 base::AutoLock auto_lock(lock_); |
| 159 return clock_->Elapsed(); | 159 return clock_->Elapsed(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 Ranges<TimeDelta> Pipeline::GetBufferedTimeRanges() { | 162 Ranges<TimeDelta> Pipeline::GetBufferedTimeRanges() const { |
| 163 base::AutoLock auto_lock(lock_); | 163 base::AutoLock auto_lock(lock_); |
| 164 return buffered_time_ranges_; | 164 return buffered_time_ranges_; |
| 165 } | 165 } |
| 166 | 166 |
| 167 TimeDelta Pipeline::GetMediaDuration() const { | 167 TimeDelta Pipeline::GetMediaDuration() const { |
| 168 base::AutoLock auto_lock(lock_); | 168 base::AutoLock auto_lock(lock_); |
| 169 return clock_->Duration(); | 169 return clock_->Duration(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 bool Pipeline::DidLoadingProgress() { | 172 bool Pipeline::DidLoadingProgress() { |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { | 964 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { |
| 965 lock_.AssertAcquired(); | 965 lock_.AssertAcquired(); |
| 966 if (!waiting_for_clock_update_) | 966 if (!waiting_for_clock_update_) |
| 967 return; | 967 return; |
| 968 | 968 |
| 969 waiting_for_clock_update_ = false; | 969 waiting_for_clock_update_ = false; |
| 970 clock_->Play(); | 970 clock_->Play(); |
| 971 } | 971 } |
| 972 | 972 |
| 973 } // namespace media | 973 } // namespace media |
| OLD | NEW |