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 "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 Loading... |
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 Loading... |
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 |
OLD | NEW |