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

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

Issue 1094783002: Switch to double for time calculations using playback rate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Making changes at chromecast side to fix trybots Created 5 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 if (clock_device_->GetState() == MediaClockDevice::kStateIdle) 256 if (clock_device_->GetState() == MediaClockDevice::kStateIdle)
257 clock_device_->SetState(MediaClockDevice::kStateUninitialized); 257 clock_device_->SetState(MediaClockDevice::kStateUninitialized);
258 258
259 // Stop both the audio and video pipeline. 259 // Stop both the audio and video pipeline.
260 if (has_audio_) 260 if (has_audio_)
261 audio_pipeline_->Stop(); 261 audio_pipeline_->Stop();
262 if (has_video_) 262 if (has_video_)
263 video_pipeline_->Stop(); 263 video_pipeline_->Stop();
264 } 264 }
265 265
266 void MediaPipelineImpl::SetPlaybackRate(float rate) { 266 void MediaPipelineImpl::SetPlaybackRate(double rate) {
267 CMALOG(kLogControl) << __FUNCTION__ << " rate=" << rate; 267 CMALOG(kLogControl) << __FUNCTION__ << " rate=" << rate;
268 DCHECK(thread_checker_.CalledOnValidThread()); 268 DCHECK(thread_checker_.CalledOnValidThread());
269 target_playback_rate_ = rate; 269 target_playback_rate_ = rate;
270 if (!buffering_controller_ || !buffering_controller_->IsBuffering()) 270 if (!buffering_controller_ || !buffering_controller_->IsBuffering())
271 media_pipeline_device_->GetMediaClockDevice()->SetRate(rate); 271 media_pipeline_device_->GetMediaClockDevice()->SetRate(rate);
272 } 272 }
273 273
274 AudioPipelineImpl* MediaPipelineImpl::GetAudioPipelineImpl() const { 274 AudioPipelineImpl* MediaPipelineImpl::GetAudioPipelineImpl() const {
275 return audio_pipeline_.get(); 275 return audio_pipeline_.get();
276 } 276 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 364
365 void MediaPipelineImpl::OnError(::media::PipelineStatus error) { 365 void MediaPipelineImpl::OnError(::media::PipelineStatus error) {
366 DCHECK(thread_checker_.CalledOnValidThread()); 366 DCHECK(thread_checker_.CalledOnValidThread());
367 DCHECK_NE(error, ::media::PIPELINE_OK) << "PIPELINE_OK is not an error!"; 367 DCHECK_NE(error, ::media::PIPELINE_OK) << "PIPELINE_OK is not an error!";
368 if (!client_.error_cb.is_null()) 368 if (!client_.error_cb.is_null())
369 client_.error_cb.Run(error); 369 client_.error_cb.Run(error);
370 } 370 }
371 371
372 } // namespace media 372 } // namespace media
373 } // namespace chromecast 373 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/media/cma/pipeline/media_pipeline_impl.h ('k') | chromecast/renderer/media/media_pipeline_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698