| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 base::AutoLock auto_lock(lock_); | 158 base::AutoLock auto_lock(lock_); |
| 159 return renderer_ ? std::min(renderer_->GetMediaTime(), duration_) | 159 return renderer_ ? std::min(renderer_->GetMediaTime(), duration_) |
| 160 : TimeDelta(); | 160 : TimeDelta(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 Ranges<TimeDelta> Pipeline::GetBufferedTimeRanges() const { | 163 Ranges<TimeDelta> Pipeline::GetBufferedTimeRanges() const { |
| 164 base::AutoLock auto_lock(lock_); | 164 base::AutoLock auto_lock(lock_); |
| 165 return buffered_time_ranges_; | 165 return buffered_time_ranges_; |
| 166 } | 166 } |
| 167 | 167 |
| 168 base::TimeDelta Pipeline::GetMediaStartTime() const { |
| 169 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 170 return demuxer_->GetStartTime(); |
| 171 } |
| 172 |
| 168 TimeDelta Pipeline::GetMediaDuration() const { | 173 TimeDelta Pipeline::GetMediaDuration() const { |
| 169 base::AutoLock auto_lock(lock_); | 174 base::AutoLock auto_lock(lock_); |
| 170 return duration_; | 175 return duration_; |
| 171 } | 176 } |
| 172 | 177 |
| 173 bool Pipeline::DidLoadingProgress() { | 178 bool Pipeline::DidLoadingProgress() { |
| 174 base::AutoLock auto_lock(lock_); | 179 base::AutoLock auto_lock(lock_); |
| 175 bool ret = did_loading_progress_; | 180 bool ret = did_loading_progress_; |
| 176 did_loading_progress_ = false; | 181 did_loading_progress_ = false; |
| 177 return ret; | 182 return ret; |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 metadata_cb_.Run(metadata); | 734 metadata_cb_.Run(metadata); |
| 730 } | 735 } |
| 731 | 736 |
| 732 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { | 737 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { |
| 733 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; | 738 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; |
| 734 DCHECK(task_runner_->BelongsToCurrentThread()); | 739 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 735 buffering_state_cb_.Run(new_buffering_state); | 740 buffering_state_cb_.Run(new_buffering_state); |
| 736 } | 741 } |
| 737 | 742 |
| 738 } // namespace media | 743 } // namespace media |
| OLD | NEW |