| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 class MEDIA_EXPORT AudioInputStream { | 115 class MEDIA_EXPORT AudioInputStream { |
| 116 public: | 116 public: |
| 117 class MEDIA_EXPORT AudioInputCallback { | 117 class MEDIA_EXPORT AudioInputCallback { |
| 118 public: | 118 public: |
| 119 virtual ~AudioInputCallback() {} | 119 virtual ~AudioInputCallback() {} |
| 120 | 120 |
| 121 // Called by the audio recorder when a full packet of audio data is | 121 // Called by the audio recorder when a full packet of audio data is |
| 122 // available. This is called from a special audio thread and the | 122 // available. This is called from a special audio thread and the |
| 123 // implementation should return as soon as possible. | 123 // implementation should return as soon as possible. |
| 124 virtual void OnData(AudioInputStream* stream, const uint8* src, | 124 virtual void OnData(AudioInputStream* stream, const uint8* src, |
| 125 uint32 size, uint32 hardware_delay_bytes) = 0; | 125 uint32 size, uint32 hardware_delay_bytes, |
| 126 double volume) = 0; |
| 126 | 127 |
| 127 // The stream is done with this callback, the last call received by this | 128 // The stream is done with this callback, the last call received by this |
| 128 // audio sink. | 129 // audio sink. |
| 129 virtual void OnClose(AudioInputStream* stream) = 0; | 130 virtual void OnClose(AudioInputStream* stream) = 0; |
| 130 | 131 |
| 131 // There was an error while recording audio. The audio sink cannot be | 132 // There was an error while recording audio. The audio sink cannot be |
| 132 // destroyed yet. No direct action needed by the AudioInputStream, but it | 133 // destroyed yet. No direct action needed by the AudioInputStream, but it |
| 133 // is a good place to stop accumulating sound data since is is likely that | 134 // is a good place to stop accumulating sound data since is is likely that |
| 134 // recording will not continue. |code| is an error code that is platform | 135 // recording will not continue. |code| is an error code that is platform |
| 135 // specific. | 136 // specific. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 157 | 158 |
| 158 // Returns the maximum microphone analog volume or 0.0 if device does not | 159 // Returns the maximum microphone analog volume or 0.0 if device does not |
| 159 // have volume control. | 160 // have volume control. |
| 160 virtual double GetMaxVolume() = 0; | 161 virtual double GetMaxVolume() = 0; |
| 161 | 162 |
| 162 // Sets the microphone analog volume, with range [0, max_volume] inclusive. | 163 // Sets the microphone analog volume, with range [0, max_volume] inclusive. |
| 163 virtual void SetVolume(double volume) = 0; | 164 virtual void SetVolume(double volume) = 0; |
| 164 | 165 |
| 165 // Returns the microphone analog volume, with range [0, max_volume] inclusive. | 166 // Returns the microphone analog volume, with range [0, max_volume] inclusive. |
| 166 virtual double GetVolume() = 0; | 167 virtual double GetVolume() = 0; |
| 168 |
| 169 // Sets the Automatic Gain Control (AGC) state. |
| 170 virtual void SetAutomaticGainControl(bool enabled) = 0; |
| 171 |
| 172 // Returns the Automatic Gain Control (AGC) state. |
| 173 virtual bool GetAutomaticGainControl() = 0; |
| 167 }; | 174 }; |
| 168 | 175 |
| 169 #endif // MEDIA_AUDIO_AUDIO_IO_H_ | 176 #endif // MEDIA_AUDIO_AUDIO_IO_H_ |
| OLD | NEW |