| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 virtual int OnMoreData(AudioBus* dest, | 63 virtual int OnMoreData(AudioBus* dest, |
| 64 AudioBuffersState buffers_state) = 0; | 64 AudioBuffersState buffers_state) = 0; |
| 65 | 65 |
| 66 virtual int OnMoreIOData(AudioBus* source, | 66 virtual int OnMoreIOData(AudioBus* source, |
| 67 AudioBus* dest, | 67 AudioBus* dest, |
| 68 AudioBuffersState buffers_state) = 0; | 68 AudioBuffersState buffers_state) = 0; |
| 69 | 69 |
| 70 // There was an error while playing a buffer. Audio source cannot be | 70 // There was an error while playing a buffer. Audio source cannot be |
| 71 // destroyed yet. No direct action needed by the AudioStream, but it is | 71 // destroyed yet. No direct action needed by the AudioStream, but it is |
| 72 // a good place to stop accumulating sound data since is is likely that | 72 // a good place to stop accumulating sound data since is is likely that |
| 73 // playback will not continue. |code| is an error code that is platform | 73 // playback will not continue. |
| 74 // specific. | 74 virtual void OnError(AudioOutputStream* stream) = 0; |
| 75 virtual void OnError(AudioOutputStream* stream, int code) = 0; | |
| 76 | 75 |
| 77 // Will block until the client has written its audio data or 1.5 seconds | 76 // Will block until the client has written its audio data or 1.5 seconds |
| 78 // have elapsed. | 77 // have elapsed. |
| 79 virtual void WaitTillDataReady() {} | 78 virtual void WaitTillDataReady() {} |
| 80 | 79 |
| 81 protected: | 80 protected: |
| 82 virtual ~AudioSourceCallback() {} | 81 virtual ~AudioSourceCallback() {} |
| 83 }; | 82 }; |
| 84 | 83 |
| 85 virtual ~AudioOutputStream() {} | 84 virtual ~AudioOutputStream() {} |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 uint32 size, uint32 hardware_delay_bytes, | 121 uint32 size, uint32 hardware_delay_bytes, |
| 123 double volume) = 0; | 122 double volume) = 0; |
| 124 | 123 |
| 125 // The stream is done with this callback, the last call received by this | 124 // The stream is done with this callback, the last call received by this |
| 126 // audio sink. | 125 // audio sink. |
| 127 virtual void OnClose(AudioInputStream* stream) = 0; | 126 virtual void OnClose(AudioInputStream* stream) = 0; |
| 128 | 127 |
| 129 // 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 |
| 130 // destroyed yet. No direct action needed by the AudioInputStream, but it | 129 // destroyed yet. No direct action needed by the AudioInputStream, but it |
| 131 // 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 |
| 132 // recording will not continue. |code| is an error code that is platform | 131 // recording will not continue. |
| 133 // specific. | 132 virtual void OnError(AudioInputStream* stream) = 0; |
| 134 virtual void OnError(AudioInputStream* stream, int code) = 0; | |
| 135 | 133 |
| 136 protected: | 134 protected: |
| 137 virtual ~AudioInputCallback() {} | 135 virtual ~AudioInputCallback() {} |
| 138 }; | 136 }; |
| 139 | 137 |
| 140 virtual ~AudioInputStream() {} | 138 virtual ~AudioInputStream() {} |
| 141 | 139 |
| 142 // Open the stream and prepares it for recording. Call Start() to actually | 140 // Open the stream and prepares it for recording. Call Start() to actually |
| 143 // begin recording. | 141 // begin recording. |
| 144 virtual bool Open() = 0; | 142 virtual bool Open() = 0; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 169 // Sets the Automatic Gain Control (AGC) state. | 167 // Sets the Automatic Gain Control (AGC) state. |
| 170 virtual void SetAutomaticGainControl(bool enabled) = 0; | 168 virtual void SetAutomaticGainControl(bool enabled) = 0; |
| 171 | 169 |
| 172 // Returns the Automatic Gain Control (AGC) state. | 170 // Returns the Automatic Gain Control (AGC) state. |
| 173 virtual bool GetAutomaticGainControl() = 0; | 171 virtual bool GetAutomaticGainControl() = 0; |
| 174 }; | 172 }; |
| 175 | 173 |
| 176 } // namespace media | 174 } // namespace media |
| 177 | 175 |
| 178 #endif // MEDIA_AUDIO_AUDIO_IO_H_ | 176 #endif // MEDIA_AUDIO_AUDIO_IO_H_ |
| OLD | NEW |