| 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 #include "media/base/audio_bus.h" | 10 #include "media/base/audio_bus.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 // Models an audio sink receiving recorded audio from the audio driver. | 104 // Models an audio sink receiving recorded audio from the audio driver. |
| 105 class MEDIA_EXPORT AudioInputStream { | 105 class MEDIA_EXPORT AudioInputStream { |
| 106 public: | 106 public: |
| 107 class MEDIA_EXPORT AudioInputCallback { | 107 class MEDIA_EXPORT AudioInputCallback { |
| 108 public: | 108 public: |
| 109 // Called by the audio recorder when a full packet of audio data is | 109 // Called by the audio recorder when a full packet of audio data is |
| 110 // available. This is called from a special audio thread and the | 110 // available. This is called from a special audio thread and the |
| 111 // implementation should return as soon as possible. | 111 // implementation should return as soon as possible. |
| 112 virtual void OnData(AudioInputStream* stream, const uint8* src, | 112 virtual void OnData(AudioInputStream* stream, |
| 113 uint32 size, uint32 hardware_delay_bytes, | 113 const AudioBus* source, |
| 114 uint32 hardware_delay_bytes, |
| 114 double volume) = 0; | 115 double volume) = 0; |
| 115 | 116 |
| 116 // There was an error while recording audio. The audio sink cannot be | 117 // There was an error while recording audio. The audio sink cannot be |
| 117 // destroyed yet. No direct action needed by the AudioInputStream, but it | 118 // destroyed yet. No direct action needed by the AudioInputStream, but it |
| 118 // is a good place to stop accumulating sound data since is is likely that | 119 // is a good place to stop accumulating sound data since is is likely that |
| 119 // recording will not continue. | 120 // recording will not continue. |
| 120 virtual void OnError(AudioInputStream* stream) = 0; | 121 virtual void OnError(AudioInputStream* stream) = 0; |
| 121 | 122 |
| 122 protected: | 123 protected: |
| 123 virtual ~AudioInputCallback() {} | 124 virtual ~AudioInputCallback() {} |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // Sets the Automatic Gain Control (AGC) state. | 156 // Sets the Automatic Gain Control (AGC) state. |
| 156 virtual void SetAutomaticGainControl(bool enabled) = 0; | 157 virtual void SetAutomaticGainControl(bool enabled) = 0; |
| 157 | 158 |
| 158 // Returns the Automatic Gain Control (AGC) state. | 159 // Returns the Automatic Gain Control (AGC) state. |
| 159 virtual bool GetAutomaticGainControl() = 0; | 160 virtual bool GetAutomaticGainControl() = 0; |
| 160 }; | 161 }; |
| 161 | 162 |
| 162 } // namespace media | 163 } // namespace media |
| 163 | 164 |
| 164 #endif // MEDIA_AUDIO_AUDIO_IO_H_ | 165 #endif // MEDIA_AUDIO_AUDIO_IO_H_ |
| OLD | NEW |