Chromium Code Reviews| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 | 239 |
| 240 void PipelineImpl::SetCdm(CdmContext* cdm_context, | 240 void PipelineImpl::SetCdm(CdmContext* cdm_context, |
| 241 const CdmAttachedCB& cdm_attached_cb) { | 241 const CdmAttachedCB& cdm_attached_cb) { |
| 242 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 242 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 243 | 243 |
| 244 media_task_runner_->PostTask( | 244 media_task_runner_->PostTask( |
| 245 FROM_HERE, base::Bind(&PipelineImpl::SetCdmTask, weak_this_, cdm_context, | 245 FROM_HERE, base::Bind(&PipelineImpl::SetCdmTask, weak_this_, cdm_context, |
| 246 cdm_attached_cb)); | 246 cdm_attached_cb)); |
| 247 } | 247 } |
| 248 | 248 |
| 249 bool PipelineImpl::CanSuspend() const { | |
| 250 DCHECK(media_task_runner_->BelongsToCurrentThread()); | |
| 251 DCHECK(renderer_); | |
|
sandersd (OOO until July 31)
2016/05/23 18:41:58
Since CanSuspend() can be called before Start(), a
alokp
2016/05/23 20:32:01
I am also working on a patch that moves the render
| |
| 252 return renderer_->AllowSuspend(); | |
| 253 } | |
| 254 | |
| 249 void PipelineImpl::SetErrorForTesting(PipelineStatus status) { | 255 void PipelineImpl::SetErrorForTesting(PipelineStatus status) { |
| 250 OnError(status); | 256 OnError(status); |
| 251 } | 257 } |
| 252 | 258 |
| 253 bool PipelineImpl::HasWeakPtrsForTesting() const { | 259 bool PipelineImpl::HasWeakPtrsForTesting() const { |
| 254 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 260 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
| 255 return weak_factory_.HasWeakPtrs(); | 261 return weak_factory_.HasWeakPtrs(); |
| 256 } | 262 } |
| 257 | 263 |
| 258 void PipelineImpl::SetState(State next_state) { | 264 void PipelineImpl::SetState(State next_state) { |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 939 void PipelineImpl::BufferingStateChanged(BufferingState new_buffering_state) { | 945 void PipelineImpl::BufferingStateChanged(BufferingState new_buffering_state) { |
| 940 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; | 946 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; |
| 941 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 947 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
| 942 | 948 |
| 943 main_task_runner_->PostTask( | 949 main_task_runner_->PostTask( |
| 944 FROM_HERE, base::Bind(&Pipeline::Client::OnBufferingStateChange, | 950 FROM_HERE, base::Bind(&Pipeline::Client::OnBufferingStateChange, |
| 945 weak_client_, new_buffering_state)); | 951 weak_client_, new_buffering_state)); |
| 946 } | 952 } |
| 947 | 953 |
| 948 } // namespace media | 954 } // namespace media |
| OLD | NEW |