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

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

Issue 9718013: Merge FilterStatusCB into PipelineStatusCB. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 9 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_base.h ('k') | media/filters/audio_renderer_base_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_base.h" 5 #include "media/filters/audio_renderer_base.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 state_ = kStopped; 63 state_ = kStopped;
64 algorithm_.reset(NULL); 64 algorithm_.reset(NULL);
65 time_cb_.Reset(); 65 time_cb_.Reset();
66 underflow_cb_.Reset(); 66 underflow_cb_.Reset();
67 } 67 }
68 if (!callback.is_null()) { 68 if (!callback.is_null()) {
69 callback.Run(); 69 callback.Run();
70 } 70 }
71 } 71 }
72 72
73 void AudioRendererBase::Seek(base::TimeDelta time, const FilterStatusCB& cb) { 73 void AudioRendererBase::Seek(base::TimeDelta time, const PipelineStatusCB& cb) {
74 base::AutoLock auto_lock(lock_); 74 base::AutoLock auto_lock(lock_);
75 DCHECK_EQ(kPaused, state_); 75 DCHECK_EQ(kPaused, state_);
76 DCHECK(!pending_read_) << "Pending read must complete before seeking"; 76 DCHECK(!pending_read_) << "Pending read must complete before seeking";
77 DCHECK(pause_cb_.is_null()); 77 DCHECK(pause_cb_.is_null());
78 DCHECK(seek_cb_.is_null()); 78 DCHECK(seek_cb_.is_null());
79 state_ = kSeeking; 79 state_ = kSeeking;
80 seek_cb_ = cb; 80 seek_cb_ = cb;
81 seek_timestamp_ = time; 81 seek_timestamp_ = time;
82 82
83 // Throw away everything and schedule our reads. 83 // Throw away everything and schedule our reads.
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 base::AutoLock auto_lock(lock_); 303 base::AutoLock auto_lock(lock_);
304 return algorithm_->playback_rate(); 304 return algorithm_->playback_rate();
305 } 305 }
306 306
307 bool AudioRendererBase::IsBeforeSeekTime(const scoped_refptr<Buffer>& buffer) { 307 bool AudioRendererBase::IsBeforeSeekTime(const scoped_refptr<Buffer>& buffer) {
308 return (state_ == kSeeking) && buffer && !buffer->IsEndOfStream() && 308 return (state_ == kSeeking) && buffer && !buffer->IsEndOfStream() &&
309 (buffer->GetTimestamp() + buffer->GetDuration()) < seek_timestamp_; 309 (buffer->GetTimestamp() + buffer->GetDuration()) < seek_timestamp_;
310 } 310 }
311 311
312 } // namespace media 312 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/audio_renderer_base.h ('k') | media/filters/audio_renderer_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698