| 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 const std::vector<MediaTrack::Id>& enabledTrackIds) { | 571 const std::vector<MediaTrack::Id>& enabledTrackIds) { |
| 572 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 572 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
| 573 | 573 |
| 574 // Track status notifications might be delivered asynchronously. If we receive | 574 // Track status notifications might be delivered asynchronously. If we receive |
| 575 // a notification when pipeline is stopped/shut down, it's safe to ignore it. | 575 // a notification when pipeline is stopped/shut down, it's safe to ignore it. |
| 576 if (state_ == kStopping || state_ == kStopped) { | 576 if (state_ == kStopping || state_ == kStopped) { |
| 577 return; | 577 return; |
| 578 } | 578 } |
| 579 | 579 |
| 580 DCHECK(demuxer_); | 580 DCHECK(demuxer_); |
| 581 DCHECK(shared_state_.renderer); | 581 DCHECK(shared_state_.renderer || (state_ != kPlaying)); |
| 582 | 582 |
| 583 base::TimeDelta currTime = (state_ == kPlaying) | 583 base::TimeDelta currTime = (state_ == kPlaying) |
| 584 ? shared_state_.renderer->GetMediaTime() | 584 ? shared_state_.renderer->GetMediaTime() |
| 585 : demuxer_->GetStartTime(); | 585 : demuxer_->GetStartTime(); |
| 586 demuxer_->OnEnabledAudioTracksChanged(enabledTrackIds, currTime); | 586 demuxer_->OnEnabledAudioTracksChanged(enabledTrackIds, currTime); |
| 587 } | 587 } |
| 588 | 588 |
| 589 void PipelineImpl::RendererWrapper::OnSelectedVideoTrackChanged( | 589 void PipelineImpl::RendererWrapper::OnSelectedVideoTrackChanged( |
| 590 const std::vector<MediaTrack::Id>& selectedTrackId) { | 590 const std::vector<MediaTrack::Id>& selectedTrackId) { |
| 591 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 591 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
| 592 | 592 |
| 593 // Track status notifications might be delivered asynchronously. If we receive | 593 // Track status notifications might be delivered asynchronously. If we receive |
| 594 // a notification when pipeline is stopped/shut down, it's safe to ignore it. | 594 // a notification when pipeline is stopped/shut down, it's safe to ignore it. |
| 595 if (state_ == kStopping || state_ == kStopped) { | 595 if (state_ == kStopping || state_ == kStopped) { |
| 596 return; | 596 return; |
| 597 } | 597 } |
| 598 | 598 |
| 599 DCHECK(demuxer_); | 599 DCHECK(demuxer_); |
| 600 DCHECK(shared_state_.renderer); | 600 DCHECK(shared_state_.renderer || (state_ != kPlaying)); |
| 601 | 601 |
| 602 base::TimeDelta currTime = (state_ == kPlaying) | 602 base::TimeDelta currTime = (state_ == kPlaying) |
| 603 ? shared_state_.renderer->GetMediaTime() | 603 ? shared_state_.renderer->GetMediaTime() |
| 604 : demuxer_->GetStartTime(); | 604 : demuxer_->GetStartTime(); |
| 605 demuxer_->OnSelectedVideoTrackChanged(selectedTrackId, currTime); | 605 demuxer_->OnSelectedVideoTrackChanged(selectedTrackId, currTime); |
| 606 } | 606 } |
| 607 | 607 |
| 608 void PipelineImpl::RendererWrapper::OnStatisticsUpdate( | 608 void PipelineImpl::RendererWrapper::OnStatisticsUpdate( |
| 609 const PipelineStatistics& stats) { | 609 const PipelineStatistics& stats) { |
| 610 DVLOG(3) << __func__; | 610 DVLOG(3) << __func__; |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1253 void PipelineImpl::OnSuspendDone() { | 1253 void PipelineImpl::OnSuspendDone() { |
| 1254 DVLOG(3) << __func__; | 1254 DVLOG(3) << __func__; |
| 1255 DCHECK(thread_checker_.CalledOnValidThread()); | 1255 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1256 DCHECK(IsRunning()); | 1256 DCHECK(IsRunning()); |
| 1257 | 1257 |
| 1258 DCHECK(!suspend_cb_.is_null()); | 1258 DCHECK(!suspend_cb_.is_null()); |
| 1259 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); | 1259 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); |
| 1260 } | 1260 } |
| 1261 | 1261 |
| 1262 } // namespace media | 1262 } // namespace media |
| OLD | NEW |