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

Side by Side Diff: media/mojo/clients/mojo_renderer.cc

Issue 2366373003: Not for submission. fastSeek prototype. (Closed)
Patch Set: Created 4 years, 2 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/clients/mojo_renderer.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/clients/mojo_renderer.h" 5 #include "media/mojo/clients/mojo_renderer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 base::AutoLock auto_lock(lock_); 178 base::AutoLock auto_lock(lock_);
179 if (media_time_interpolator_.interpolating()) 179 if (media_time_interpolator_.interpolating())
180 media_time_interpolator_.StopInterpolating(); 180 media_time_interpolator_.StopInterpolating();
181 } 181 }
182 182
183 flush_cb_ = flush_cb; 183 flush_cb_ = flush_cb;
184 remote_renderer_->Flush( 184 remote_renderer_->Flush(
185 base::Bind(&MojoRenderer::OnFlushed, base::Unretained(this))); 185 base::Bind(&MojoRenderer::OnFlushed, base::Unretained(this)));
186 } 186 }
187 187
188 void MojoRenderer::StartPlayingFrom(base::TimeDelta time) { 188 void MojoRenderer::StartPlayingFrom(StreamPosition position) {
189 DVLOG(2) << __FUNCTION__ << "(" << time << ")"; 189 DVLOG(2) << __FUNCTION__ << "(" << ToString(position) << ")";
190 DCHECK(task_runner_->BelongsToCurrentThread()); 190 DCHECK(task_runner_->BelongsToCurrentThread());
191 DCHECK(remote_renderer_.is_bound()); 191 DCHECK(remote_renderer_.is_bound());
192 192
193 { 193 {
194 base::AutoLock auto_lock(lock_); 194 base::AutoLock auto_lock(lock_);
195 media_time_interpolator_.SetBounds(time, time, media_clock_.NowTicks()); 195 media_time_interpolator_.SetBounds(position.time, position.time,
196 media_clock_.NowTicks());
196 media_time_interpolator_.StartInterpolating(); 197 media_time_interpolator_.StartInterpolating();
197 } 198 }
198 199
199 remote_renderer_->StartPlayingFrom(time); 200 remote_renderer_->StartPlayingFrom(position.time);
200 } 201 }
201 202
202 void MojoRenderer::SetPlaybackRate(double playback_rate) { 203 void MojoRenderer::SetPlaybackRate(double playback_rate) {
203 DVLOG(2) << __FUNCTION__ << "(" << playback_rate << ")"; 204 DVLOG(2) << __FUNCTION__ << "(" << playback_rate << ")";
204 DCHECK(task_runner_->BelongsToCurrentThread()); 205 DCHECK(task_runner_->BelongsToCurrentThread());
205 DCHECK(remote_renderer_.is_bound()); 206 DCHECK(remote_renderer_.is_bound());
206 207
207 remote_renderer_->SetPlaybackRate(playback_rate); 208 remote_renderer_->SetPlaybackRate(playback_rate);
208 209
209 { 210 {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_INITIALIZATION_FAILED); 402 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_INITIALIZATION_FAILED);
402 403
403 if (!flush_cb_.is_null()) 404 if (!flush_cb_.is_null())
404 base::ResetAndReturn(&flush_cb_).Run(); 405 base::ResetAndReturn(&flush_cb_).Run();
405 406
406 if (!cdm_attached_cb_.is_null()) 407 if (!cdm_attached_cb_.is_null())
407 base::ResetAndReturn(&cdm_attached_cb_).Run(false); 408 base::ResetAndReturn(&cdm_attached_cb_).Run(false);
408 } 409 }
409 410
410 } // namespace media 411 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/clients/mojo_renderer.h ('k') | media/renderers/audio_renderer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698