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

Side by Side Diff: media/mojo/services/mojo_renderer_service.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
« no previous file with comments | « media/mojo/services/mojo_renderer_service.h ('k') | media/renderers/audio_renderer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "media/mojo/services/mojo_renderer_service.h" 5 #include "media/mojo/services/mojo_renderer_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 base::Bind(&MojoRendererService::OnFlushCompleted, weak_this_, callback)); 87 base::Bind(&MojoRendererService::OnFlushCompleted, weak_this_, callback));
88 } 88 }
89 89
90 void MojoRendererService::StartPlayingFrom(int64_t time_delta_usec) { 90 void MojoRendererService::StartPlayingFrom(int64_t time_delta_usec) {
91 DVLOG(2) << __FUNCTION__ << ": " << time_delta_usec; 91 DVLOG(2) << __FUNCTION__ << ": " << time_delta_usec;
92 renderer_->StartPlayingFrom( 92 renderer_->StartPlayingFrom(
93 base::TimeDelta::FromMicroseconds(time_delta_usec)); 93 base::TimeDelta::FromMicroseconds(time_delta_usec));
94 SchedulePeriodicMediaTimeUpdates(); 94 SchedulePeriodicMediaTimeUpdates();
95 } 95 }
96 96
97 void MojoRendererService::SetPlaybackRate(float playback_rate) { 97 void MojoRendererService::SetPlaybackRate(double playback_rate) {
98 DVLOG(2) << __FUNCTION__ << ": " << playback_rate; 98 DVLOG(2) << __FUNCTION__ << ": " << playback_rate;
99 DCHECK_EQ(state_, STATE_PLAYING); 99 DCHECK_EQ(state_, STATE_PLAYING);
100 renderer_->SetPlaybackRate(playback_rate); 100 renderer_->SetPlaybackRate(playback_rate);
101 } 101 }
102 102
103 void MojoRendererService::SetVolume(float volume) { 103 void MojoRendererService::SetVolume(float volume) {
104 renderer_->SetVolume(volume); 104 renderer_->SetVolume(volume);
105 } 105 }
106 106
107 void MojoRendererService::OnStreamReady(const mojo::Closure& callback) { 107 void MojoRendererService::OnStreamReady(const mojo::Closure& callback) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 } 181 }
182 182
183 void MojoRendererService::OnFlushCompleted(const mojo::Closure& callback) { 183 void MojoRendererService::OnFlushCompleted(const mojo::Closure& callback) {
184 DVLOG(1) << __FUNCTION__; 184 DVLOG(1) << __FUNCTION__;
185 DCHECK_EQ(state_, STATE_FLUSHING); 185 DCHECK_EQ(state_, STATE_FLUSHING);
186 state_ = STATE_PLAYING; 186 state_ = STATE_PLAYING;
187 callback.Run(); 187 callback.Run();
188 } 188 }
189 189
190 } // namespace media 190 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_renderer_service.h ('k') | media/renderers/audio_renderer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698