| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <memory> | 5 #include <memory> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 ASSERT_EQ(::media::PIPELINE_OK, status); | 127 ASSERT_EQ(::media::PIPELINE_OK, status); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 | 130 |
| 131 void Start(const base::Closure& eos_cb) { | 131 void Start(const base::Closure& eos_cb) { |
| 132 eos_cb_ = eos_cb; | 132 eos_cb_ = eos_cb; |
| 133 eos_[STREAM_AUDIO] = !media_pipeline_.HasAudio(); | 133 eos_[STREAM_AUDIO] = !media_pipeline_.HasAudio(); |
| 134 eos_[STREAM_VIDEO] = !media_pipeline_.HasVideo(); | 134 eos_[STREAM_VIDEO] = !media_pipeline_.HasVideo(); |
| 135 base::TimeDelta start_time = base::TimeDelta::FromMilliseconds(0); | 135 base::TimeDelta start_time = base::TimeDelta::FromMilliseconds(0); |
| 136 media_pipeline_.StartPlayingFrom(start_time); | 136 media_pipeline_.StartPlayingFrom(start_time); |
| 137 media_pipeline_.SetPlaybackRate(1.0); |
| 137 } | 138 } |
| 138 void SetCdm() { media_pipeline_.SetCdm(cdm_context_.get()); } | 139 void SetCdm() { media_pipeline_.SetCdm(cdm_context_.get()); } |
| 139 void Flush(const base::Closure& flush_cb) { media_pipeline_.Flush(flush_cb); } | 140 void Flush(const base::Closure& flush_cb) { media_pipeline_.Flush(flush_cb); } |
| 140 void Stop() { | 141 void Stop() { |
| 141 media_pipeline_.Stop(); | 142 media_pipeline_.Stop(); |
| 142 base::MessageLoop::current()->QuitWhenIdle(); | 143 base::MessageLoop::current()->QuitWhenIdle(); |
| 143 } | 144 } |
| 144 void SetCdmLicenseInstalled() { cdm_context_->SetLicenseInstalled(); } | 145 void SetCdmLicenseInstalled() { cdm_context_->SetLicenseInstalled(); } |
| 145 | 146 |
| 146 MediaPipelineBackendDefault* pipeline_backend() { return pipeline_backend_; } | 147 MediaPipelineBackendDefault* pipeline_backend() { return pipeline_backend_; } |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 366 |
| 366 message_loop_.RunUntilIdle(); | 367 message_loop_.RunUntilIdle(); |
| 367 message_loop_.PostTask(FROM_HERE, | 368 message_loop_.PostTask(FROM_HERE, |
| 368 base::Bind(&PipelineHelper::SetCdmLicenseInstalled, | 369 base::Bind(&PipelineHelper::SetCdmLicenseInstalled, |
| 369 base::Unretained(pipeline_helper_.get()))); | 370 base::Unretained(pipeline_helper_.get()))); |
| 370 message_loop_.Run(); | 371 message_loop_.Run(); |
| 371 } | 372 } |
| 372 | 373 |
| 373 } // namespace media | 374 } // namespace media |
| 374 } // namespace chromecast | 375 } // namespace chromecast |
| OLD | NEW |