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

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

Issue 1875623002: Convert //chromecast from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 video_pipeline_.reset(); 109 video_pipeline_.reset();
110 audio_pipeline_.reset(); 110 audio_pipeline_.reset();
111 audio_decoder_.reset(); 111 audio_decoder_.reset();
112 media_pipeline_backend_.reset(); 112 media_pipeline_backend_.reset();
113 if (!client_.pipeline_backend_destroyed_cb.is_null()) 113 if (!client_.pipeline_backend_destroyed_cb.is_null())
114 client_.pipeline_backend_destroyed_cb.Run(); 114 client_.pipeline_backend_destroyed_cb.Run();
115 } 115 }
116 116
117 void MediaPipelineImpl::Initialize( 117 void MediaPipelineImpl::Initialize(
118 LoadType load_type, 118 LoadType load_type,
119 scoped_ptr<MediaPipelineBackend> media_pipeline_backend) { 119 std::unique_ptr<MediaPipelineBackend> media_pipeline_backend) {
120 CMALOG(kLogControl) << __FUNCTION__; 120 CMALOG(kLogControl) << __FUNCTION__;
121 DCHECK(thread_checker_.CalledOnValidThread()); 121 DCHECK(thread_checker_.CalledOnValidThread());
122 audio_decoder_.reset(); 122 audio_decoder_.reset();
123 media_pipeline_backend_.reset(media_pipeline_backend.release()); 123 media_pipeline_backend_.reset(media_pipeline_backend.release());
124 if (!client_.pipeline_backend_created_cb.is_null()) 124 if (!client_.pipeline_backend_created_cb.is_null())
125 client_.pipeline_backend_created_cb.Run(); 125 client_.pipeline_backend_created_cb.Run();
126 126
127 if (load_type == kLoadTypeURL || load_type == kLoadTypeMediaSource) { 127 if (load_type == kLoadTypeURL || load_type == kLoadTypeMediaSource) {
128 base::TimeDelta low_threshold(kLowBufferThresholdURL); 128 base::TimeDelta low_threshold(kLowBufferThresholdURL);
129 base::TimeDelta high_threshold(kHighBufferThresholdURL); 129 base::TimeDelta high_threshold(kHighBufferThresholdURL);
(...skipping 30 matching lines...) Expand all
160 cdm_ = cdm; 160 cdm_ = cdm;
161 if (audio_pipeline_) 161 if (audio_pipeline_)
162 audio_pipeline_->SetCdm(cdm); 162 audio_pipeline_->SetCdm(cdm);
163 if (video_pipeline_) 163 if (video_pipeline_)
164 video_pipeline_->SetCdm(cdm); 164 video_pipeline_->SetCdm(cdm);
165 } 165 }
166 166
167 ::media::PipelineStatus MediaPipelineImpl::InitializeAudio( 167 ::media::PipelineStatus MediaPipelineImpl::InitializeAudio(
168 const ::media::AudioDecoderConfig& config, 168 const ::media::AudioDecoderConfig& config,
169 const AvPipelineClient& client, 169 const AvPipelineClient& client,
170 scoped_ptr<CodedFrameProvider> frame_provider) { 170 std::unique_ptr<CodedFrameProvider> frame_provider) {
171 DCHECK(thread_checker_.CalledOnValidThread()); 171 DCHECK(thread_checker_.CalledOnValidThread());
172 DCHECK(!audio_decoder_); 172 DCHECK(!audio_decoder_);
173 173
174 MediaPipelineBackend::AudioDecoder* backend_audio_decoder = 174 MediaPipelineBackend::AudioDecoder* backend_audio_decoder =
175 media_pipeline_backend_->CreateAudioDecoder(); 175 media_pipeline_backend_->CreateAudioDecoder();
176 if (!backend_audio_decoder) { 176 if (!backend_audio_decoder) {
177 return ::media::PIPELINE_ERROR_ABORT; 177 return ::media::PIPELINE_ERROR_ABORT;
178 } 178 }
179 audio_decoder_.reset(new AudioDecoderSoftwareWrapper(backend_audio_decoder)); 179 audio_decoder_.reset(new AudioDecoderSoftwareWrapper(backend_audio_decoder));
180 audio_pipeline_.reset(new AudioPipelineImpl(audio_decoder_.get(), client)); 180 audio_pipeline_.reset(new AudioPipelineImpl(audio_decoder_.get(), client));
181 if (cdm_) 181 if (cdm_)
182 audio_pipeline_->SetCdm(cdm_); 182 audio_pipeline_->SetCdm(cdm_);
183 return audio_pipeline_->Initialize(config, std::move(frame_provider)); 183 return audio_pipeline_->Initialize(config, std::move(frame_provider));
184 } 184 }
185 185
186 ::media::PipelineStatus MediaPipelineImpl::InitializeVideo( 186 ::media::PipelineStatus MediaPipelineImpl::InitializeVideo(
187 const std::vector<::media::VideoDecoderConfig>& configs, 187 const std::vector<::media::VideoDecoderConfig>& configs,
188 const VideoPipelineClient& client, 188 const VideoPipelineClient& client,
189 scoped_ptr<CodedFrameProvider> frame_provider) { 189 std::unique_ptr<CodedFrameProvider> frame_provider) {
190 DCHECK(thread_checker_.CalledOnValidThread()); 190 DCHECK(thread_checker_.CalledOnValidThread());
191 DCHECK(!video_decoder_); 191 DCHECK(!video_decoder_);
192 192
193 video_decoder_ = media_pipeline_backend_->CreateVideoDecoder(); 193 video_decoder_ = media_pipeline_backend_->CreateVideoDecoder();
194 if (!video_decoder_) { 194 if (!video_decoder_) {
195 return ::media::PIPELINE_ERROR_ABORT; 195 return ::media::PIPELINE_ERROR_ABORT;
196 } 196 }
197 video_pipeline_.reset(new VideoPipelineImpl(video_decoder_, client)); 197 video_pipeline_.reset(new VideoPipelineImpl(video_decoder_, client));
198 if (cdm_) 198 if (cdm_)
199 video_pipeline_->SetCdm(cdm_); 199 video_pipeline_->SetCdm(cdm_);
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 513
514 void MediaPipelineImpl::ResetBitrateState() { 514 void MediaPipelineImpl::ResetBitrateState() {
515 elapsed_time_delta_ = base::TimeDelta::FromSeconds(0); 515 elapsed_time_delta_ = base::TimeDelta::FromSeconds(0);
516 audio_bytes_for_bitrate_estimation_ = 0; 516 audio_bytes_for_bitrate_estimation_ = 0;
517 video_bytes_for_bitrate_estimation_ = 0; 517 video_bytes_for_bitrate_estimation_ = 0;
518 last_sample_time_ = base::TimeTicks::Now(); 518 last_sample_time_ = base::TimeTicks::Now();
519 } 519 }
520 520
521 } // namespace media 521 } // namespace media
522 } // namespace chromecast 522 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/media/cma/pipeline/media_pipeline_impl.h ('k') | chromecast/media/cma/pipeline/video_pipeline_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698