| 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 renderer_ended_ = false; | 599 renderer_ended_ = false; |
| 600 text_renderer_ended_ = false; | 600 text_renderer_ended_ = false; |
| 601 start_timestamp_ = seek_timestamp; | 601 start_timestamp_ = seek_timestamp; |
| 602 | 602 |
| 603 DoSeek(seek_timestamp, base::Bind(&Pipeline::StateTransitionTask, | 603 DoSeek(seek_timestamp, base::Bind(&Pipeline::StateTransitionTask, |
| 604 weak_factory_.GetWeakPtr())); | 604 weak_factory_.GetWeakPtr())); |
| 605 } | 605 } |
| 606 | 606 |
| 607 void Pipeline::SetCdmTask(CdmContext* cdm_context, | 607 void Pipeline::SetCdmTask(CdmContext* cdm_context, |
| 608 const CdmAttachedCB& cdm_attached_cb) { | 608 const CdmAttachedCB& cdm_attached_cb) { |
| 609 base::AutoLock auto_lock(lock_); |
| 609 if (!renderer_) { | 610 if (!renderer_) { |
| 610 pending_cdm_context_ = cdm_context; | 611 pending_cdm_context_ = cdm_context; |
| 611 cdm_attached_cb.Run(true); | 612 cdm_attached_cb.Run(true); |
| 612 return; | 613 return; |
| 613 } | 614 } |
| 614 | 615 |
| 615 renderer_->SetCdm(cdm_context, cdm_attached_cb); | 616 renderer_->SetCdm(cdm_context, cdm_attached_cb); |
| 616 } | 617 } |
| 617 | 618 |
| 618 void Pipeline::OnRendererEnded() { | 619 void Pipeline::OnRendererEnded() { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 metadata_cb_.Run(metadata); | 741 metadata_cb_.Run(metadata); |
| 741 } | 742 } |
| 742 | 743 |
| 743 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { | 744 void Pipeline::BufferingStateChanged(BufferingState new_buffering_state) { |
| 744 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; | 745 DVLOG(1) << __FUNCTION__ << "(" << new_buffering_state << ") "; |
| 745 DCHECK(task_runner_->BelongsToCurrentThread()); | 746 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 746 buffering_state_cb_.Run(new_buffering_state); | 747 buffering_state_cb_.Run(new_buffering_state); |
| 747 } | 748 } |
| 748 | 749 |
| 749 } // namespace media | 750 } // namespace media |
| OLD | NEW |