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

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

Issue 9155003: Fix media timeline so that thumb never exceeds buffered data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase ToT, again Created 8 years, 10 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/base/pipeline_unittest.cc ('k') | media/filters/audio_renderer_base.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 // AudioRendererBase takes care of the tricky queuing work and provides simple 5 // AudioRendererBase takes care of the tricky queuing work and provides simple
6 // methods for subclasses to peek and poke at audio data. In addition to 6 // methods for subclasses to peek and poke at audio data. In addition to
7 // AudioRenderer interface methods this classes doesn't implement, subclasses 7 // AudioRenderer interface methods this classes doesn't implement, subclasses
8 // must also implement the following methods: 8 // must also implement the following methods:
9 // OnInitialized 9 // OnInitialized
10 // OnStop 10 // OnStop
(...skipping 25 matching lines...) Expand all
36 // Filter implementation. 36 // Filter implementation.
37 virtual void Play(const base::Closure& callback) OVERRIDE; 37 virtual void Play(const base::Closure& callback) OVERRIDE;
38 virtual void Pause(const base::Closure& callback) OVERRIDE; 38 virtual void Pause(const base::Closure& callback) OVERRIDE;
39 virtual void Stop(const base::Closure& callback) OVERRIDE; 39 virtual void Stop(const base::Closure& callback) OVERRIDE;
40 40
41 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb) OVERRIDE; 41 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb) OVERRIDE;
42 42
43 // AudioRenderer implementation. 43 // AudioRenderer implementation.
44 virtual void Initialize(AudioDecoder* decoder, 44 virtual void Initialize(AudioDecoder* decoder,
45 const PipelineStatusCB& init_callback, 45 const PipelineStatusCB& init_callback,
46 const base::Closure& underflow_callback) OVERRIDE; 46 const base::Closure& underflow_callback,
47 const AudioTimeCB& audio_time_cb) OVERRIDE;
47 virtual bool HasEnded() OVERRIDE; 48 virtual bool HasEnded() OVERRIDE;
48 virtual void ResumeAfterUnderflow(bool buffer_more_audio) OVERRIDE; 49 virtual void ResumeAfterUnderflow(bool buffer_more_audio) OVERRIDE;
49 50
50 protected: 51 protected:
51 FRIEND_TEST_ALL_PREFIXES(AudioRendererBaseTest, EndOfStream); 52 FRIEND_TEST_ALL_PREFIXES(AudioRendererBaseTest, EndOfStream);
52 FRIEND_TEST_ALL_PREFIXES(AudioRendererBaseTest, Underflow_EndOfStream); 53 FRIEND_TEST_ALL_PREFIXES(AudioRendererBaseTest, Underflow_EndOfStream);
53 54
54 // Subclasses should return true if they were able to initialize, false 55 // Subclasses should return true if they were able to initialize, false
55 // otherwise. 56 // otherwise.
56 virtual bool OnInitialize(int bits_per_channel, 57 virtual bool OnInitialize(int bits_per_channel,
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // Audio time at end of last call to FillBuffer(). 149 // Audio time at end of last call to FillBuffer().
149 // TODO(ralphl): Update this value after seeking. 150 // TODO(ralphl): Update this value after seeking.
150 base::TimeDelta last_fill_buffer_time_; 151 base::TimeDelta last_fill_buffer_time_;
151 152
152 // Filter callbacks. 153 // Filter callbacks.
153 base::Closure pause_callback_; 154 base::Closure pause_callback_;
154 FilterStatusCB seek_cb_; 155 FilterStatusCB seek_cb_;
155 156
156 base::Closure underflow_callback_; 157 base::Closure underflow_callback_;
157 158
159 AudioTimeCB audio_time_cb_;
160
158 base::TimeDelta seek_timestamp_; 161 base::TimeDelta seek_timestamp_;
159 162
160 AudioDecoder::ReadCB read_cb_; 163 AudioDecoder::ReadCB read_cb_;
161 164
162 DISALLOW_COPY_AND_ASSIGN(AudioRendererBase); 165 DISALLOW_COPY_AND_ASSIGN(AudioRendererBase);
163 }; 166 };
164 167
165 } // namespace media 168 } // namespace media
166 169
167 #endif // MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_ 170 #endif // MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_
OLDNEW
« no previous file with comments | « media/base/pipeline_unittest.cc ('k') | media/filters/audio_renderer_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698