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 #ifndef MEDIA_AUDIO_AUDIO_IO_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_IO_H_ |
6 #define MEDIA_AUDIO_AUDIO_IO_H_ | 6 #define MEDIA_AUDIO_AUDIO_IO_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "media/audio/audio_buffers_state.h" | 9 #include "media/audio/audio_buffers_state.h" |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 | 39 |
40 // Models an audio stream that gets rendered to the audio hardware output. | 40 // Models an audio stream that gets rendered to the audio hardware output. |
41 // Because we support more audio streams than physically available channels | 41 // Because we support more audio streams than physically available channels |
42 // a given AudioOutputStream might or might not talk directly to hardware. | 42 // a given AudioOutputStream might or might not talk directly to hardware. |
43 // An audio stream allocates several buffers for audio data and calls | 43 // An audio stream allocates several buffers for audio data and calls |
44 // AudioSourceCallback::OnModeData() periodically to fill these buffers, | 44 // AudioSourceCallback::OnModeData() periodically to fill these buffers, |
45 // as the data is written to the audio device. Size of each packet is determined | 45 // as the data is written to the audio device. Size of each packet is determined |
46 // by |samples_per_packet| specified in AudioParameters when the stream is | 46 // by |samples_per_packet| specified in AudioParameters when the stream is |
47 // created. | 47 // created. |
48 | |
49 namespace media { | |
50 | |
51 class MEDIA_EXPORT AudioOutputStream { | 48 class MEDIA_EXPORT AudioOutputStream { |
52 public: | 49 public: |
53 // Audio sources must implement AudioSourceCallback. This interface will be | 50 // Audio sources must implement AudioSourceCallback. This interface will be |
54 // called in a random thread which very likely is a high priority thread. Do | 51 // called in a random thread which very likely is a high priority thread. Do |
55 // not rely on using this thread TLS or make calls that alter the thread | 52 // not rely on using this thread TLS or make calls that alter the thread |
56 // itself such as creating Windows or initializing COM. | 53 // itself such as creating Windows or initializing COM. |
57 class MEDIA_EXPORT AudioSourceCallback { | 54 class MEDIA_EXPORT AudioSourceCallback { |
58 public: | 55 public: |
59 virtual ~AudioSourceCallback() {} | 56 virtual ~AudioSourceCallback() {} |
60 | 57 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // Returns the microphone analog volume, with range [0, max_volume] inclusive. | 166 // Returns the microphone analog volume, with range [0, max_volume] inclusive. |
170 virtual double GetVolume() = 0; | 167 virtual double GetVolume() = 0; |
171 | 168 |
172 // Sets the Automatic Gain Control (AGC) state. | 169 // Sets the Automatic Gain Control (AGC) state. |
173 virtual void SetAutomaticGainControl(bool enabled) = 0; | 170 virtual void SetAutomaticGainControl(bool enabled) = 0; |
174 | 171 |
175 // Returns the Automatic Gain Control (AGC) state. | 172 // Returns the Automatic Gain Control (AGC) state. |
176 virtual bool GetAutomaticGainControl() = 0; | 173 virtual bool GetAutomaticGainControl() = 0; |
177 }; | 174 }; |
178 | 175 |
179 } // namespace media | |
180 | |
181 #endif // MEDIA_AUDIO_AUDIO_IO_H_ | 176 #endif // MEDIA_AUDIO_AUDIO_IO_H_ |
OLD | NEW |