| 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 "chromecast/renderer/media/media_pipeline_proxy.h" | 5 #include "chromecast/renderer/media/media_pipeline_proxy.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| 9 #include "base/location.h" | 11 #include "base/location.h" |
| 10 #include "base/logging.h" | 12 #include "base/logging.h" |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 13 #include "chromecast/common/media/cma_messages.h" | 15 #include "chromecast/common/media/cma_messages.h" |
| 14 #include "chromecast/media/cma/base/coded_frame_provider.h" | 16 #include "chromecast/media/cma/base/coded_frame_provider.h" |
| 15 #include "chromecast/renderer/media/audio_pipeline_proxy.h" | 17 #include "chromecast/renderer/media/audio_pipeline_proxy.h" |
| 16 #include "chromecast/renderer/media/media_channel_proxy.h" | 18 #include "chromecast/renderer/media/media_channel_proxy.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 VideoPipelineProxy* MediaPipelineProxy::GetVideoPipeline() const { | 204 VideoPipelineProxy* MediaPipelineProxy::GetVideoPipeline() const { |
| 203 return video_pipeline_.get(); | 205 return video_pipeline_.get(); |
| 204 } | 206 } |
| 205 | 207 |
| 206 void MediaPipelineProxy::InitializeAudio( | 208 void MediaPipelineProxy::InitializeAudio( |
| 207 const ::media::AudioDecoderConfig& config, | 209 const ::media::AudioDecoderConfig& config, |
| 208 scoped_ptr<CodedFrameProvider> frame_provider, | 210 scoped_ptr<CodedFrameProvider> frame_provider, |
| 209 const ::media::PipelineStatusCB& status_cb) { | 211 const ::media::PipelineStatusCB& status_cb) { |
| 210 DCHECK(thread_checker_.CalledOnValidThread()); | 212 DCHECK(thread_checker_.CalledOnValidThread()); |
| 211 has_audio_ = true; | 213 has_audio_ = true; |
| 212 audio_pipeline_->Initialize(config, frame_provider.Pass(), status_cb); | 214 audio_pipeline_->Initialize(config, std::move(frame_provider), status_cb); |
| 213 } | 215 } |
| 214 | 216 |
| 215 void MediaPipelineProxy::InitializeVideo( | 217 void MediaPipelineProxy::InitializeVideo( |
| 216 const std::vector<::media::VideoDecoderConfig>& configs, | 218 const std::vector<::media::VideoDecoderConfig>& configs, |
| 217 scoped_ptr<CodedFrameProvider> frame_provider, | 219 scoped_ptr<CodedFrameProvider> frame_provider, |
| 218 const ::media::PipelineStatusCB& status_cb) { | 220 const ::media::PipelineStatusCB& status_cb) { |
| 219 DCHECK(thread_checker_.CalledOnValidThread()); | 221 DCHECK(thread_checker_.CalledOnValidThread()); |
| 220 has_video_ = true; | 222 has_video_ = true; |
| 221 video_pipeline_->Initialize(configs, frame_provider.Pass(), status_cb); | 223 video_pipeline_->Initialize(configs, std::move(frame_provider), status_cb); |
| 222 } | 224 } |
| 223 | 225 |
| 224 void MediaPipelineProxy::StartPlayingFrom(base::TimeDelta time) { | 226 void MediaPipelineProxy::StartPlayingFrom(base::TimeDelta time) { |
| 225 DCHECK(thread_checker_.CalledOnValidThread()); | 227 DCHECK(thread_checker_.CalledOnValidThread()); |
| 226 if (has_audio_) | 228 if (has_audio_) |
| 227 audio_pipeline_->StartFeeding(); | 229 audio_pipeline_->StartFeeding(); |
| 228 if (has_video_) | 230 if (has_video_) |
| 229 video_pipeline_->StartFeeding(); | 231 video_pipeline_->StartFeeding(); |
| 230 FORWARD_ON_IO_THREAD(StartPlayingFrom, time); | 232 FORWARD_ON_IO_THREAD(StartPlayingFrom, time); |
| 231 } | 233 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 FORWARD_ON_IO_THREAD(Stop); | 276 FORWARD_ON_IO_THREAD(Stop); |
| 275 } | 277 } |
| 276 | 278 |
| 277 void MediaPipelineProxy::SetPlaybackRate(double playback_rate) { | 279 void MediaPipelineProxy::SetPlaybackRate(double playback_rate) { |
| 278 DCHECK(thread_checker_.CalledOnValidThread()); | 280 DCHECK(thread_checker_.CalledOnValidThread()); |
| 279 FORWARD_ON_IO_THREAD(SetPlaybackRate, playback_rate); | 281 FORWARD_ON_IO_THREAD(SetPlaybackRate, playback_rate); |
| 280 } | 282 } |
| 281 | 283 |
| 282 } // namespace cma | 284 } // namespace cma |
| 283 } // namespace chromecast | 285 } // namespace chromecast |
| OLD | NEW |