| 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_impl.h" | 5 #include "media/base/pipeline_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 | 749 |
| 750 state_ = next_state; | 750 state_ = next_state; |
| 751 media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(next_state)); | 751 media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(next_state)); |
| 752 } | 752 } |
| 753 | 753 |
| 754 void PipelineImpl::RendererWrapper::CompleteSeek(base::TimeDelta seek_time, | 754 void PipelineImpl::RendererWrapper::CompleteSeek(base::TimeDelta seek_time, |
| 755 PipelineStatus status) { | 755 PipelineStatus status) { |
| 756 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 756 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
| 757 DCHECK(state_ == kStarting || state_ == kSeeking || state_ == kResuming); | 757 DCHECK(state_ == kStarting || state_ == kSeeking || state_ == kResuming); |
| 758 | 758 |
| 759 if (state_ == kStarting) { |
| 760 UMA_HISTOGRAM_ENUMERATION("Media.PipelineStatus.Start", status, |
| 761 PIPELINE_STATUS_MAX + 1); |
| 762 } |
| 763 |
| 759 DCHECK(pending_callbacks_); | 764 DCHECK(pending_callbacks_); |
| 760 pending_callbacks_.reset(); | 765 pending_callbacks_.reset(); |
| 761 | 766 |
| 762 if (status != PIPELINE_OK) { | 767 if (status != PIPELINE_OK) { |
| 763 OnPipelineError(status); | 768 OnPipelineError(status); |
| 764 return; | 769 return; |
| 765 } | 770 } |
| 766 | 771 |
| 767 shared_state_.renderer->StartPlayingFrom( | 772 shared_state_.renderer->StartPlayingFrom( |
| 768 std::max(seek_time, demuxer_->GetStartTime())); | 773 std::max(seek_time, demuxer_->GetStartTime())); |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1253 void PipelineImpl::OnSuspendDone() { | 1258 void PipelineImpl::OnSuspendDone() { |
| 1254 DVLOG(3) << __func__; | 1259 DVLOG(3) << __func__; |
| 1255 DCHECK(thread_checker_.CalledOnValidThread()); | 1260 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1256 DCHECK(IsRunning()); | 1261 DCHECK(IsRunning()); |
| 1257 | 1262 |
| 1258 DCHECK(!suspend_cb_.is_null()); | 1263 DCHECK(!suspend_cb_.is_null()); |
| 1259 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); | 1264 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); |
| 1260 } | 1265 } |
| 1261 | 1266 |
| 1262 } // namespace media | 1267 } // namespace media |
| OLD | NEW |