Chromium Code Reviews| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 // Models an audio sink receiving recorded audio from the audio driver. | 114 // Models an audio sink receiving recorded audio from the audio driver. |
| 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 // Called by the audio recorder when a full packet of audio data is | 119 // Called by the audio recorder when a full packet of audio data is |
| 120 // available. This is called from a special audio thread and the | 120 // available. This is called from a special audio thread and the |
| 121 // implementation should return as soon as possible. | 121 // implementation should return as soon as possible. |
| 122 // TODO(henrika): should be pure virtual when old OnData() is phased out. | |
| 123 virtual void OnData(AudioInputStream* stream, | 122 virtual void OnData(AudioInputStream* stream, |
| 124 const AudioBus* source, | 123 const AudioBus* source, |
| 125 uint32_t hardware_delay_bytes, | 124 base::TimeDelta delay, |
|
o1ka
2017/02/10 13:28:50
Are we expecting that TimeTicks::IsHighResolution(
| |
| 126 double volume) {} | 125 base::TimeTicks delay_timestamp, |
|
o1ka
2017/02/10 13:28:50
It's hard for me to interpret what "delay timestam
| |
| 127 | 126 double volume) = 0; |
| 128 // TODO(henrika): don't use; to be removed. | |
| 129 virtual void OnData(AudioInputStream* stream, | |
| 130 const uint8_t* src, | |
| 131 uint32_t size, | |
| 132 uint32_t hardware_delay_bytes, | |
| 133 double volume) {} | |
| 134 | 127 |
| 135 // There was an error while recording audio. The audio sink cannot be | 128 // There was an error while recording audio. The audio sink cannot be |
| 136 // destroyed yet. No direct action needed by the AudioInputStream, but it | 129 // destroyed yet. No direct action needed by the AudioInputStream, but it |
| 137 // is a good place to stop accumulating sound data since is is likely that | 130 // is a good place to stop accumulating sound data since is is likely that |
| 138 // recording will not continue. | 131 // recording will not continue. |
| 139 virtual void OnError(AudioInputStream* stream) = 0; | 132 virtual void OnError(AudioInputStream* stream) = 0; |
| 140 | 133 |
| 141 protected: | 134 protected: |
| 142 virtual ~AudioInputCallback() {} | 135 virtual ~AudioInputCallback() {} |
| 143 }; | 136 }; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 // Returns the Automatic Gain Control (AGC) state. | 170 // Returns the Automatic Gain Control (AGC) state. |
| 178 virtual bool GetAutomaticGainControl() = 0; | 171 virtual bool GetAutomaticGainControl() = 0; |
| 179 | 172 |
| 180 // Returns the current muting state for the microphone. | 173 // Returns the current muting state for the microphone. |
| 181 virtual bool IsMuted() = 0; | 174 virtual bool IsMuted() = 0; |
| 182 }; | 175 }; |
| 183 | 176 |
| 184 } // namespace media | 177 } // namespace media |
| 185 | 178 |
| 186 #endif // MEDIA_AUDIO_AUDIO_IO_H_ | 179 #endif // MEDIA_AUDIO_AUDIO_IO_H_ |
| OLD | NEW |