Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: chromecast/media/cma/pipeline/media_pipeline_impl.cc

Issue 1553503002: Convert Pass()→std::move() in //chromecast (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/media/cma/pipeline/media_pipeline_impl.h" 5 #include "chromecast/media/cma/pipeline/media_pipeline_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility>
8 9
9 #include "base/bind.h" 10 #include "base/bind.h"
10 #include "base/callback.h" 11 #include "base/callback.h"
11 #include "base/callback_helpers.h" 12 #include "base/callback_helpers.h"
12 #include "base/location.h" 13 #include "base/location.h"
13 #include "base/logging.h" 14 #include "base/logging.h"
14 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
15 #include "base/thread_task_runner_handle.h" 16 #include "base/thread_task_runner_handle.h"
16 #include "base/time/time.h" 17 #include "base/time/time.h"
17 #include "chromecast/media/cdm/browser_cdm_cast.h" 18 #include "chromecast/media/cdm/browser_cdm_cast.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 MediaPipelineBackend::AudioDecoder* backend_audio_decoder = 149 MediaPipelineBackend::AudioDecoder* backend_audio_decoder =
149 media_pipeline_backend_->CreateAudioDecoder(); 150 media_pipeline_backend_->CreateAudioDecoder();
150 if (!backend_audio_decoder) { 151 if (!backend_audio_decoder) {
151 status_cb.Run(::media::PIPELINE_ERROR_ABORT); 152 status_cb.Run(::media::PIPELINE_ERROR_ABORT);
152 return; 153 return;
153 } 154 }
154 audio_decoder_.reset(new AudioDecoderSoftwareWrapper(backend_audio_decoder)); 155 audio_decoder_.reset(new AudioDecoderSoftwareWrapper(backend_audio_decoder));
155 audio_pipeline_.reset(new AudioPipelineImpl(audio_decoder_.get(), client)); 156 audio_pipeline_.reset(new AudioPipelineImpl(audio_decoder_.get(), client));
156 if (cdm_) 157 if (cdm_)
157 audio_pipeline_->SetCdm(cdm_); 158 audio_pipeline_->SetCdm(cdm_);
158 audio_pipeline_->Initialize(config, frame_provider.Pass(), status_cb); 159 audio_pipeline_->Initialize(config, std::move(frame_provider), status_cb);
159 } 160 }
160 161
161 void MediaPipelineImpl::InitializeVideo( 162 void MediaPipelineImpl::InitializeVideo(
162 const std::vector<::media::VideoDecoderConfig>& configs, 163 const std::vector<::media::VideoDecoderConfig>& configs,
163 const VideoPipelineClient& client, 164 const VideoPipelineClient& client,
164 scoped_ptr<CodedFrameProvider> frame_provider, 165 scoped_ptr<CodedFrameProvider> frame_provider,
165 const ::media::PipelineStatusCB& status_cb) { 166 const ::media::PipelineStatusCB& status_cb) {
166 DCHECK(thread_checker_.CalledOnValidThread()); 167 DCHECK(thread_checker_.CalledOnValidThread());
167 DCHECK(!video_decoder_); 168 DCHECK(!video_decoder_);
168 169
169 video_decoder_ = media_pipeline_backend_->CreateVideoDecoder(); 170 video_decoder_ = media_pipeline_backend_->CreateVideoDecoder();
170 if (!video_decoder_) { 171 if (!video_decoder_) {
171 status_cb.Run(::media::PIPELINE_ERROR_ABORT); 172 status_cb.Run(::media::PIPELINE_ERROR_ABORT);
172 return; 173 return;
173 } 174 }
174 video_pipeline_.reset(new VideoPipelineImpl(video_decoder_, client)); 175 video_pipeline_.reset(new VideoPipelineImpl(video_decoder_, client));
175 if (cdm_) 176 if (cdm_)
176 video_pipeline_->SetCdm(cdm_); 177 video_pipeline_->SetCdm(cdm_);
177 video_pipeline_->Initialize(configs, frame_provider.Pass(), status_cb); 178 video_pipeline_->Initialize(configs, std::move(frame_provider), status_cb);
178 } 179 }
179 180
180 void MediaPipelineImpl::StartPlayingFrom(base::TimeDelta time) { 181 void MediaPipelineImpl::StartPlayingFrom(base::TimeDelta time) {
181 CMALOG(kLogControl) << __FUNCTION__ << " t0=" << time.InMilliseconds(); 182 CMALOG(kLogControl) << __FUNCTION__ << " t0=" << time.InMilliseconds();
182 DCHECK(thread_checker_.CalledOnValidThread()); 183 DCHECK(thread_checker_.CalledOnValidThread());
183 DCHECK(audio_pipeline_ || video_pipeline_); 184 DCHECK(audio_pipeline_ || video_pipeline_);
184 DCHECK(!pending_flush_callbacks_); 185 DCHECK(!pending_flush_callbacks_);
185 // When starting, we always enter the "playing" state (not paused). 186 // When starting, we always enter the "playing" state (not paused).
186 paused_ = false; 187 paused_ = false;
187 188
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 422
422 void MediaPipelineImpl::OnError(::media::PipelineStatus error) { 423 void MediaPipelineImpl::OnError(::media::PipelineStatus error) {
423 DCHECK(thread_checker_.CalledOnValidThread()); 424 DCHECK(thread_checker_.CalledOnValidThread());
424 DCHECK_NE(error, ::media::PIPELINE_OK) << "PIPELINE_OK is not an error!"; 425 DCHECK_NE(error, ::media::PIPELINE_OK) << "PIPELINE_OK is not an error!";
425 if (!client_.error_cb.is_null()) 426 if (!client_.error_cb.is_null())
426 client_.error_cb.Run(error); 427 client_.error_cb.Run(error);
427 } 428 }
428 429
429 } // namespace media 430 } // namespace media
430 } // namespace chromecast 431 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/media/cma/pipeline/av_pipeline_impl.cc ('k') | chromecast/media/cma/pipeline/video_pipeline_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698