| 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 #ifndef MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ | 5 #ifndef MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ |
| 6 #define MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ | 6 #define MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ |
| 7 | 7 |
| 8 // This is the default implementation of AudioRenderer, which uses the audio | 8 // This is the default implementation of AudioRenderer, which uses the audio |
| 9 // interfaces to open an audio device. Although it cannot be used in the | 9 // interfaces to open an audio device. Although it cannot be used in the |
| 10 // sandbox, it serves as a reference implementation and can be used in other | 10 // sandbox, it serves as a reference implementation and can be used in other |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 virtual void SetVolume(float volume); | 38 virtual void SetVolume(float volume); |
| 39 | 39 |
| 40 // AudioSourceCallback implementation. | 40 // AudioSourceCallback implementation. |
| 41 virtual uint32 OnMoreData(AudioOutputStream* stream, uint8* dest, | 41 virtual uint32 OnMoreData(AudioOutputStream* stream, uint8* dest, |
| 42 uint32 len, AudioBuffersState buffers_state); | 42 uint32 len, AudioBuffersState buffers_state); |
| 43 virtual void OnClose(AudioOutputStream* stream); | 43 virtual void OnClose(AudioOutputStream* stream); |
| 44 virtual void OnError(AudioOutputStream* stream, int code); | 44 virtual void OnError(AudioOutputStream* stream, int code); |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 // AudioRendererBase implementation. | 47 // AudioRendererBase implementation. |
| 48 virtual bool OnInitialize(const AudioDecoderConfig& config); | 48 virtual bool OnInitialize(int bits_per_channel, |
| 49 ChannelLayout channel_layout, |
| 50 int sample_rate); |
| 49 virtual void OnStop(); | 51 virtual void OnStop(); |
| 50 | 52 |
| 51 private: | 53 private: |
| 52 // Audio output stream device. | 54 // Audio output stream device. |
| 53 AudioOutputStream* stream_; | 55 AudioOutputStream* stream_; |
| 54 int bytes_per_second_; | 56 int bytes_per_second_; |
| 55 | 57 |
| 56 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 58 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 } // namespace media | 61 } // namespace media |
| 60 | 62 |
| 61 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ | 63 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ |
| OLD | NEW |