OLD | NEW |
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 // 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // Installs a permanent callback for passing decoded audio output. | 224 // Installs a permanent callback for passing decoded audio output. |
225 typedef base::Callback<void(scoped_refptr<Buffer>)> ConsumeAudioSamplesCB; | 225 typedef base::Callback<void(scoped_refptr<Buffer>)> ConsumeAudioSamplesCB; |
226 void set_consume_audio_samples_callback( | 226 void set_consume_audio_samples_callback( |
227 const ConsumeAudioSamplesCB& callback) { | 227 const ConsumeAudioSamplesCB& callback) { |
228 consume_audio_samples_callback_ = callback; | 228 consume_audio_samples_callback_ = callback; |
229 } | 229 } |
230 | 230 |
231 // Returns various information about the decoded audio format. | 231 // Returns various information about the decoded audio format. |
232 virtual int bits_per_channel() = 0; | 232 virtual int bits_per_channel() = 0; |
233 virtual ChannelLayout channel_layout() = 0; | 233 virtual ChannelLayout channel_layout() = 0; |
234 virtual int sample_rate() = 0; | 234 virtual int samples_per_second() = 0; |
235 | 235 |
236 protected: | 236 protected: |
237 AudioDecoder(); | 237 AudioDecoder(); |
238 virtual ~AudioDecoder(); | 238 virtual ~AudioDecoder(); |
239 | 239 |
240 // Executes the permanent callback to pass off decoded audio. | 240 // Executes the permanent callback to pass off decoded audio. |
241 void ConsumeAudioSamples(scoped_refptr<Buffer> buffer); | 241 void ConsumeAudioSamples(scoped_refptr<Buffer> buffer); |
242 | 242 |
243 private: | 243 private: |
244 ConsumeAudioSamplesCB consume_audio_samples_callback_; | 244 ConsumeAudioSamplesCB consume_audio_samples_callback_; |
(...skipping 23 matching lines...) Expand all Loading... |
268 // buffer. | 268 // buffer. |
269 virtual bool HasEnded() = 0; | 269 virtual bool HasEnded() = 0; |
270 | 270 |
271 // Sets the output volume. | 271 // Sets the output volume. |
272 virtual void SetVolume(float volume) = 0; | 272 virtual void SetVolume(float volume) = 0; |
273 }; | 273 }; |
274 | 274 |
275 } // namespace media | 275 } // namespace media |
276 | 276 |
277 #endif // MEDIA_BASE_FILTERS_H_ | 277 #endif // MEDIA_BASE_FILTERS_H_ |
OLD | NEW |