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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // plugins. In any case, data is usually immediately available, | 83 // plugins. In any case, data is usually immediately available, |
84 // so there would be no delay. | 84 // so there would be no delay. |
85 virtual void WaitTillDataReady() {} | 85 virtual void WaitTillDataReady() {} |
86 | 86 |
87 protected: | 87 protected: |
88 virtual ~AudioSourceCallback() {} | 88 virtual ~AudioSourceCallback() {} |
89 }; | 89 }; |
90 | 90 |
91 virtual ~AudioOutputStream() {} | 91 virtual ~AudioOutputStream() {} |
92 | 92 |
93 // Open the stream. false is returned if the stream cannot be opened. | 93 // Open the stream. false is returned if the stream cannot be opened. Open() |
| 94 // must always be followed by a call to Close() even if Open() fails. |
94 virtual bool Open() = 0; | 95 virtual bool Open() = 0; |
95 | 96 |
96 // Starts playing audio and generating AudioSourceCallback::OnMoreData(). | 97 // Starts playing audio and generating AudioSourceCallback::OnMoreData(). |
97 // Since implementor of AudioOutputStream may have internal buffers, right | 98 // Since implementor of AudioOutputStream may have internal buffers, right |
98 // after calling this method initial buffers are fetched. | 99 // after calling this method initial buffers are fetched. |
99 // | 100 // |
100 // The output stream does not take ownership of this callback. | 101 // The output stream does not take ownership of this callback. |
101 virtual void Start(AudioSourceCallback* callback) = 0; | 102 virtual void Start(AudioSourceCallback* callback) = 0; |
102 | 103 |
103 // Stops playing audio. Effect might not be instantaneous as the hardware | 104 // Stops playing audio. Effect might not be instantaneous as the hardware |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // Sets the Automatic Gain Control (AGC) state. | 175 // Sets the Automatic Gain Control (AGC) state. |
175 virtual void SetAutomaticGainControl(bool enabled) = 0; | 176 virtual void SetAutomaticGainControl(bool enabled) = 0; |
176 | 177 |
177 // Returns the Automatic Gain Control (AGC) state. | 178 // Returns the Automatic Gain Control (AGC) state. |
178 virtual bool GetAutomaticGainControl() = 0; | 179 virtual bool GetAutomaticGainControl() = 0; |
179 }; | 180 }; |
180 | 181 |
181 } // namespace media | 182 } // namespace media |
182 | 183 |
183 #endif // MEDIA_AUDIO_AUDIO_IO_H_ | 184 #endif // MEDIA_AUDIO_AUDIO_IO_H_ |
OLD | NEW |