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

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: . Created 8 years, 11 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 24 matching lines...) Expand all
35 // Filter implementation. 35 // Filter implementation.
36 virtual void Play(const base::Closure& callback) OVERRIDE; 36 virtual void Play(const base::Closure& callback) OVERRIDE;
37 virtual void Pause(const base::Closure& callback) OVERRIDE; 37 virtual void Pause(const base::Closure& callback) OVERRIDE;
38 virtual void Stop(const base::Closure& callback) OVERRIDE; 38 virtual void Stop(const base::Closure& callback) OVERRIDE;
39 39
40 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb) OVERRIDE; 40 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb) OVERRIDE;
41 41
42 // AudioRenderer implementation. 42 // AudioRenderer implementation.
43 virtual void Initialize(AudioDecoder* decoder, 43 virtual void Initialize(AudioDecoder* decoder,
44 const base::Closure& init_callback, 44 const base::Closure& init_callback,
45 const base::Closure& underflow_callback) OVERRIDE; 45 const base::Closure& underflow_callback,
46 const AudioTimeCB& audio_time_cb) OVERRIDE;
46 virtual bool HasEnded() OVERRIDE; 47 virtual bool HasEnded() OVERRIDE;
47 virtual void ResumeAfterUnderflow(bool buffer_more_audio) OVERRIDE; 48 virtual void ResumeAfterUnderflow(bool buffer_more_audio) OVERRIDE;
48 49
49 protected: 50 protected:
50 // Subclasses should return true if they were able to initialize, false 51 // Subclasses should return true if they were able to initialize, false
51 // otherwise. 52 // otherwise.
52 virtual bool OnInitialize(int bits_per_channel, 53 virtual bool OnInitialize(int bits_per_channel,
53 ChannelLayout channel_layout, 54 ChannelLayout channel_layout,
54 int sample_rate) = 0; 55 int sample_rate) = 0;
55 56
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // Audio time at end of last call to FillBuffer(). 131 // Audio time at end of last call to FillBuffer().
131 // TODO(ralphl): Update this value after seeking. 132 // TODO(ralphl): Update this value after seeking.
132 base::TimeDelta last_fill_buffer_time_; 133 base::TimeDelta last_fill_buffer_time_;
133 134
134 // Filter callbacks. 135 // Filter callbacks.
135 base::Closure pause_callback_; 136 base::Closure pause_callback_;
136 FilterStatusCB seek_cb_; 137 FilterStatusCB seek_cb_;
137 138
138 base::Closure underflow_callback_; 139 base::Closure underflow_callback_;
139 140
141 AudioTimeCB audio_time_cb_;
142
140 base::TimeDelta seek_timestamp_; 143 base::TimeDelta seek_timestamp_;
141 144
142 AudioDecoder::ReadCB read_cb_; 145 AudioDecoder::ReadCB read_cb_;
143 146
144 DISALLOW_COPY_AND_ASSIGN(AudioRendererBase); 147 DISALLOW_COPY_AND_ASSIGN(AudioRendererBase);
145 }; 148 };
146 149
147 } // namespace media 150 } // namespace media
148 151
149 #endif // MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_ 152 #endif // MEDIA_FILTERS_AUDIO_RENDERER_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698