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_REFERENCE_AUDIO_RENDERER_H_ | 5 #ifndef MEDIA_FILTERS_REFERENCE_AUDIO_RENDERER_H_ |
6 #define MEDIA_FILTERS_REFERENCE_AUDIO_RENDERER_H_ | 6 #define MEDIA_FILTERS_REFERENCE_AUDIO_RENDERER_H_ |
7 | 7 |
8 // This is the reference implementation of AudioRenderer, which uses the audio | 8 // This is the reference implementation of AudioRenderer, which uses the audio |
9 // interfaces to open an audio device. It cannot be used in the sandbox, but is | 9 // interfaces to open an audio device. It cannot be used in the sandbox, but is |
10 // used in other applications such as the test player. | 10 // used in other applications such as the test player. |
(...skipping 13 matching lines...) Expand all Loading... |
24 namespace media { | 24 namespace media { |
25 | 25 |
26 class MEDIA_EXPORT ReferenceAudioRenderer | 26 class MEDIA_EXPORT ReferenceAudioRenderer |
27 : public AudioRendererBase, | 27 : public AudioRendererBase, |
28 public AudioOutputStream::AudioSourceCallback { | 28 public AudioOutputStream::AudioSourceCallback { |
29 public: | 29 public: |
30 ReferenceAudioRenderer(); | 30 ReferenceAudioRenderer(); |
31 virtual ~ReferenceAudioRenderer(); | 31 virtual ~ReferenceAudioRenderer(); |
32 | 32 |
33 // Filter implementation. | 33 // Filter implementation. |
34 virtual void SetPlaybackRate(float playback_rate); | 34 virtual void SetPlaybackRate(float playback_rate) OVERRIDE; |
35 | 35 |
36 // AudioRenderer implementation. | 36 // AudioRenderer implementation. |
37 virtual void SetVolume(float volume); | 37 virtual void SetVolume(float volume) OVERRIDE; |
38 | 38 |
39 // AudioSourceCallback implementation. | 39 // AudioSourceCallback implementation. |
40 virtual uint32 OnMoreData(AudioOutputStream* stream, uint8* dest, | 40 virtual uint32 OnMoreData(AudioOutputStream* stream, uint8* dest, |
41 uint32 len, AudioBuffersState buffers_state); | 41 uint32 len, |
| 42 AudioBuffersState buffers_state) OVERRIDE; |
42 virtual void OnClose(AudioOutputStream* stream); | 43 virtual void OnClose(AudioOutputStream* stream); |
43 virtual void OnError(AudioOutputStream* stream, int code); | 44 virtual void OnError(AudioOutputStream* stream, int code) OVERRIDE; |
44 | 45 |
45 protected: | 46 protected: |
46 // AudioRendererBase implementation. | 47 // AudioRendererBase implementation. |
47 virtual bool OnInitialize(int bits_per_channel, | 48 virtual bool OnInitialize(int bits_per_channel, |
48 ChannelLayout channel_layout, | 49 ChannelLayout channel_layout, |
49 int sample_rate); | 50 int sample_rate) OVERRIDE; |
50 virtual void OnStop(); | 51 virtual void OnStop() OVERRIDE; |
51 | 52 |
52 private: | 53 private: |
53 // Audio output stream device. | 54 // Audio output stream device. |
54 AudioOutputStream* stream_; | 55 AudioOutputStream* stream_; |
55 int bytes_per_second_; | 56 int bytes_per_second_; |
56 | 57 |
57 DISALLOW_COPY_AND_ASSIGN(ReferenceAudioRenderer); | 58 DISALLOW_COPY_AND_ASSIGN(ReferenceAudioRenderer); |
58 }; | 59 }; |
59 | 60 |
60 } // namespace media | 61 } // namespace media |
61 | 62 |
62 #endif // MEDIA_FILTERS_REFERENCE_AUDIO_RENDERER_H_ | 63 #endif // MEDIA_FILTERS_REFERENCE_AUDIO_RENDERER_H_ |
OLD | NEW |