OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |