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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // not rely on using this thread TLS or make calls that alter the thread | 56 // not rely on using this thread TLS or make calls that alter the thread |
57 // itself such as creating Windows or initializing COM. | 57 // itself such as creating Windows or initializing COM. |
58 class MEDIA_EXPORT AudioSourceCallback { | 58 class MEDIA_EXPORT AudioSourceCallback { |
59 public: | 59 public: |
60 // Provide more data by fully filling |dest|. The source will return | 60 // Provide more data by fully filling |dest|. The source will return |
61 // the number of frames it filled. |buffers_state| contains current state | 61 // the number of frames it filled. |buffers_state| contains current state |
62 // of the buffers, and can be used by the source to calculate delay. | 62 // of the buffers, and can be used by the source to calculate delay. |
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, | |
67 AudioBus* dest, | |
68 AudioBuffersState buffers_state) = 0; | |
69 | |
70 // There was an error while playing a buffer. Audio source cannot be | 66 // 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 | 67 // 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 | 68 // a good place to stop accumulating sound data since is is likely that |
73 // playback will not continue. | 69 // playback will not continue. |
74 virtual void OnError(AudioOutputStream* stream) = 0; | 70 virtual void OnError(AudioOutputStream* stream) = 0; |
75 | 71 |
76 protected: | 72 protected: |
77 virtual ~AudioSourceCallback() {} | 73 virtual ~AudioSourceCallback() {} |
78 }; | 74 }; |
79 | 75 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // Sets the Automatic Gain Control (AGC) state. | 155 // Sets the Automatic Gain Control (AGC) state. |
160 virtual void SetAutomaticGainControl(bool enabled) = 0; | 156 virtual void SetAutomaticGainControl(bool enabled) = 0; |
161 | 157 |
162 // Returns the Automatic Gain Control (AGC) state. | 158 // Returns the Automatic Gain Control (AGC) state. |
163 virtual bool GetAutomaticGainControl() = 0; | 159 virtual bool GetAutomaticGainControl() = 0; |
164 }; | 160 }; |
165 | 161 |
166 } // namespace media | 162 } // namespace media |
167 | 163 |
168 #endif // MEDIA_AUDIO_AUDIO_IO_H_ | 164 #endif // MEDIA_AUDIO_AUDIO_IO_H_ |
OLD | NEW |