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 |
48 class MEDIA_EXPORT AudioOutputStream { | 51 class MEDIA_EXPORT AudioOutputStream { |
49 public: | 52 public: |
50 // Audio sources must implement AudioSourceCallback. This interface will be | 53 // Audio sources must implement AudioSourceCallback. This interface will be |
51 // called in a random thread which very likely is a high priority thread. Do | 54 // called in a random thread which very likely is a high priority thread. Do |
52 // not rely on using this thread TLS or make calls that alter the thread | 55 // not rely on using this thread TLS or make calls that alter the thread |
53 // itself such as creating Windows or initializing COM. | 56 // itself such as creating Windows or initializing COM. |
54 class MEDIA_EXPORT AudioSourceCallback { | 57 class MEDIA_EXPORT AudioSourceCallback { |
55 public: | 58 public: |
56 virtual ~AudioSourceCallback() {} | 59 virtual ~AudioSourceCallback() {} |
57 | 60 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // have volume control. | 162 // have volume control. |
160 virtual double GetMaxVolume() = 0; | 163 virtual double GetMaxVolume() = 0; |
161 | 164 |
162 // Sets the microphone analog volume, with range [0, max_volume] inclusive. | 165 // Sets the microphone analog volume, with range [0, max_volume] inclusive. |
163 virtual void SetVolume(double volume) = 0; | 166 virtual void SetVolume(double volume) = 0; |
164 | 167 |
165 // Returns the microphone analog volume, with range [0, max_volume] inclusive. | 168 // Returns the microphone analog volume, with range [0, max_volume] inclusive. |
166 virtual double GetVolume() = 0; | 169 virtual double GetVolume() = 0; |
167 }; | 170 }; |
168 | 171 |
| 172 } // namespace media |
| 173 |
169 #endif // MEDIA_AUDIO_AUDIO_IO_H_ | 174 #endif // MEDIA_AUDIO_AUDIO_IO_H_ |
OLD | NEW |