| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // must always be followed by a call to Close() even if Open() fails. | 87 // must always be followed by a call to Close() even if Open() fails. |
| 88 virtual bool Open() = 0; | 88 virtual bool Open() = 0; |
| 89 | 89 |
| 90 // Starts playing audio and generating AudioSourceCallback::OnMoreData(). | 90 // Starts playing audio and generating AudioSourceCallback::OnMoreData(). |
| 91 // Since implementor of AudioOutputStream may have internal buffers, right | 91 // Since implementor of AudioOutputStream may have internal buffers, right |
| 92 // after calling this method initial buffers are fetched. | 92 // after calling this method initial buffers are fetched. |
| 93 // | 93 // |
| 94 // The output stream does not take ownership of this callback. | 94 // The output stream does not take ownership of this callback. |
| 95 virtual void Start(AudioSourceCallback* callback) = 0; | 95 virtual void Start(AudioSourceCallback* callback) = 0; |
| 96 | 96 |
| 97 // Stops playing audio. Effect might not be instantaneous as the hardware | 97 // Stops playing audio. The operation completes synchronously meaning that |
| 98 // might have locked audio data that is processing. | 98 // once Stop() has completed executing, no further callbacks will be made to |
| 99 // the callback object that was supplied to Start() and it can be safely |
| 100 // deleted. |
| 99 virtual void Stop() = 0; | 101 virtual void Stop() = 0; |
| 100 | 102 |
| 101 // Sets the relative volume, with range [0.0, 1.0] inclusive. | 103 // Sets the relative volume, with range [0.0, 1.0] inclusive. |
| 102 virtual void SetVolume(double volume) = 0; | 104 virtual void SetVolume(double volume) = 0; |
| 103 | 105 |
| 104 // Gets the relative volume, with range [0.0, 1.0] inclusive. | 106 // Gets the relative volume, with range [0.0, 1.0] inclusive. |
| 105 virtual void GetVolume(double* volume) = 0; | 107 virtual void GetVolume(double* volume) = 0; |
| 106 | 108 |
| 107 // Close the stream. This also generates AudioSourceCallback::OnClose(). | 109 // Close the stream. This also generates AudioSourceCallback::OnClose(). |
| 108 // After calling this method, the object should not be used anymore. | 110 // After calling this method, the object should not be used anymore. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // Returns the Automatic Gain Control (AGC) state. | 177 // Returns the Automatic Gain Control (AGC) state. |
| 176 virtual bool GetAutomaticGainControl() = 0; | 178 virtual bool GetAutomaticGainControl() = 0; |
| 177 | 179 |
| 178 // Returns the current muting state for the microphone. | 180 // Returns the current muting state for the microphone. |
| 179 virtual bool IsMuted() = 0; | 181 virtual bool IsMuted() = 0; |
| 180 }; | 182 }; |
| 181 | 183 |
| 182 } // namespace media | 184 } // namespace media |
| 183 | 185 |
| 184 #endif // MEDIA_AUDIO_AUDIO_IO_H_ | 186 #endif // MEDIA_AUDIO_AUDIO_IO_H_ |
| OLD | NEW |