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 // Filters are connected in a strongly typed manner, with downstream filters | 5 // Filters are connected in a strongly typed manner, with downstream filters |
6 // always reading data from upstream filters. Upstream filters have no clue | 6 // always reading data from upstream filters. Upstream filters have no clue |
7 // who is actually reading from them, and return the results via callbacks. | 7 // who is actually reading from them, and return the results via callbacks. |
8 // | 8 // |
9 // DemuxerStream(Video) <- VideoDecoder <- VideoRenderer | 9 // DemuxerStream(Video) <- VideoDecoder <- VideoRenderer |
10 // DataSource <- Demuxer < | 10 // DataSource <- Demuxer < |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // Initialize a VideoRenderer with the given VideoDecoder, executing the | 174 // Initialize a VideoRenderer with the given VideoDecoder, executing the |
175 // callback upon completion. | 175 // callback upon completion. |
176 virtual void Initialize(const scoped_refptr<VideoDecoder>& decoder, | 176 virtual void Initialize(const scoped_refptr<VideoDecoder>& decoder, |
177 const PipelineStatusCB& status_cb, | 177 const PipelineStatusCB& status_cb, |
178 const StatisticsCB& statistics_cb, | 178 const StatisticsCB& statistics_cb, |
179 const TimeCB& time_cb) = 0; | 179 const TimeCB& time_cb) = 0; |
180 | 180 |
181 // Returns true if this filter has received and processed an end-of-stream | 181 // Returns true if this filter has received and processed an end-of-stream |
182 // buffer. | 182 // buffer. |
183 virtual bool HasEnded() = 0; | 183 virtual bool HasEnded() = 0; |
| 184 |
| 185 protected: |
| 186 virtual ~VideoRenderer() {} |
184 }; | 187 }; |
185 | 188 |
186 class MEDIA_EXPORT AudioRenderer : public Filter { | 189 class MEDIA_EXPORT AudioRenderer : public Filter { |
187 public: | 190 public: |
188 // Used to update the pipeline's clock time. The first parameter is the | 191 // Used to update the pipeline's clock time. The first parameter is the |
189 // current time, and the second parameter is the time that the clock must not | 192 // current time, and the second parameter is the time that the clock must not |
190 // exceed. | 193 // exceed. |
191 typedef base::Callback<void(base::TimeDelta, base::TimeDelta)> TimeCB; | 194 typedef base::Callback<void(base::TimeDelta, base::TimeDelta)> TimeCB; |
192 | 195 |
193 // Initialize a AudioRenderer with the given AudioDecoder, executing the | 196 // Initialize a AudioRenderer with the given AudioDecoder, executing the |
(...skipping 11 matching lines...) Expand all Loading... |
205 // buffer. | 208 // buffer. |
206 virtual bool HasEnded() = 0; | 209 virtual bool HasEnded() = 0; |
207 | 210 |
208 // Sets the output volume. | 211 // Sets the output volume. |
209 virtual void SetVolume(float volume) = 0; | 212 virtual void SetVolume(float volume) = 0; |
210 | 213 |
211 // Resumes playback after underflow occurs. | 214 // Resumes playback after underflow occurs. |
212 // |buffer_more_audio| is set to true if you want to increase the size of the | 215 // |buffer_more_audio| is set to true if you want to increase the size of the |
213 // decoded audio buffer. | 216 // decoded audio buffer. |
214 virtual void ResumeAfterUnderflow(bool buffer_more_audio) = 0; | 217 virtual void ResumeAfterUnderflow(bool buffer_more_audio) = 0; |
| 218 |
| 219 protected: |
| 220 virtual ~AudioRenderer() {} |
215 }; | 221 }; |
216 | 222 |
217 } // namespace media | 223 } // namespace media |
218 | 224 |
219 #endif // MEDIA_BASE_FILTERS_H_ | 225 #endif // MEDIA_BASE_FILTERS_H_ |
OLD | NEW |