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

Side by Side Diff: media/filters/audio_renderer_impl.cc

Issue 400853002: Drop time from media::{Audio,Video}Renderer::StartPlayingFrom(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « media/filters/audio_renderer_impl.h ('k') | media/filters/audio_renderer_impl_unittest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/filters/audio_renderer_impl.h" 5 #include "media/filters/audio_renderer_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 DCHECK_EQ(state_, kPlaying); 123 DCHECK_EQ(state_, kPlaying);
124 DCHECK(sink_playing_); 124 DCHECK(sink_playing_);
125 lock_.AssertAcquired(); 125 lock_.AssertAcquired();
126 126
127 sink_playing_ = false; 127 sink_playing_ = false;
128 128
129 base::AutoUnlock auto_unlock(lock_); 129 base::AutoUnlock auto_unlock(lock_);
130 sink_->Pause(); 130 sink_->Pause();
131 } 131 }
132 132
133 void AudioRendererImpl::SetMediaTime(base::TimeDelta time) {
134 DVLOG(1) << __FUNCTION__ << "(" << time.InMicroseconds() << ")";
135 DCHECK(task_runner_->BelongsToCurrentThread());
136
137 base::AutoLock auto_lock(lock_);
138 DCHECK(!rendering_);
139 DCHECK_EQ(state_, kFlushed);
140
141 start_timestamp_ = time;
142 }
143
133 void AudioRendererImpl::Flush(const base::Closure& callback) { 144 void AudioRendererImpl::Flush(const base::Closure& callback) {
134 DVLOG(1) << __FUNCTION__; 145 DVLOG(1) << __FUNCTION__;
135 DCHECK(task_runner_->BelongsToCurrentThread()); 146 DCHECK(task_runner_->BelongsToCurrentThread());
136 147
137 base::AutoLock auto_lock(lock_); 148 base::AutoLock auto_lock(lock_);
138 DCHECK_EQ(state_, kPlaying); 149 DCHECK_EQ(state_, kPlaying);
139 DCHECK(flush_cb_.is_null()); 150 DCHECK(flush_cb_.is_null());
140 151
141 flush_cb_ = callback; 152 flush_cb_ = callback;
142 ChangeState_Locked(kFlushing); 153 ChangeState_Locked(kFlushing);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 223
213 if (sink_) { 224 if (sink_) {
214 sink_->Stop(); 225 sink_->Stop();
215 sink_ = NULL; 226 sink_ = NULL;
216 } 227 }
217 228
218 audio_buffer_stream_.reset(); 229 audio_buffer_stream_.reset();
219 task_runner_->PostTask(FROM_HERE, callback); 230 task_runner_->PostTask(FROM_HERE, callback);
220 } 231 }
221 232
222 void AudioRendererImpl::StartPlayingFrom(base::TimeDelta timestamp) { 233 void AudioRendererImpl::StartPlaying() {
223 DVLOG(1) << __FUNCTION__ << "(" << timestamp.InMicroseconds() << ")"; 234 DVLOG(1) << __FUNCTION__;
224 DCHECK(task_runner_->BelongsToCurrentThread()); 235 DCHECK(task_runner_->BelongsToCurrentThread());
225 236
226 base::AutoLock auto_lock(lock_); 237 base::AutoLock auto_lock(lock_);
227 DCHECK(!sink_playing_); 238 DCHECK(!sink_playing_);
228 DCHECK_EQ(state_, kFlushed); 239 DCHECK_EQ(state_, kFlushed);
229 DCHECK_EQ(buffering_state_, BUFFERING_HAVE_NOTHING); 240 DCHECK_EQ(buffering_state_, BUFFERING_HAVE_NOTHING);
230 DCHECK(!pending_read_) << "Pending read must complete before seeking"; 241 DCHECK(!pending_read_) << "Pending read must complete before seeking";
231 242
232 ChangeState_Locked(kPlaying); 243 ChangeState_Locked(kPlaying);
233 start_timestamp_ = timestamp;
234
235 AttemptRead_Locked(); 244 AttemptRead_Locked();
236 } 245 }
237 246
238 void AudioRendererImpl::Initialize(DemuxerStream* stream, 247 void AudioRendererImpl::Initialize(DemuxerStream* stream,
239 const PipelineStatusCB& init_cb, 248 const PipelineStatusCB& init_cb,
240 const StatisticsCB& statistics_cb, 249 const StatisticsCB& statistics_cb,
241 const TimeCB& time_cb, 250 const TimeCB& time_cb,
242 const BufferingStateCB& buffering_state_cb, 251 const BufferingStateCB& buffering_state_cb,
243 const base::Closure& ended_cb, 252 const base::Closure& ended_cb,
244 const PipelineStatusCB& error_cb) { 253 const PipelineStatusCB& error_cb) {
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 << buffering_state; 710 << buffering_state;
702 DCHECK_NE(buffering_state_, buffering_state); 711 DCHECK_NE(buffering_state_, buffering_state);
703 lock_.AssertAcquired(); 712 lock_.AssertAcquired();
704 buffering_state_ = buffering_state; 713 buffering_state_ = buffering_state;
705 714
706 task_runner_->PostTask(FROM_HERE, 715 task_runner_->PostTask(FROM_HERE,
707 base::Bind(buffering_state_cb_, buffering_state_)); 716 base::Bind(buffering_state_cb_, buffering_state_));
708 } 717 }
709 718
710 } // namespace media 719 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/audio_renderer_impl.h ('k') | media/filters/audio_renderer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698