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 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 public: | 58 public: |
59 virtual ~AudioSourceCallback() {} | 59 virtual ~AudioSourceCallback() {} |
60 | 60 |
61 // Provide more data by filling |dest| up to |max_size| bytes. The provided | 61 // Provide more data by filling |dest| up to |max_size| bytes. The provided |
62 // buffer size is determined by the |samples_per_packet| specified in | 62 // buffer size is determined by the |samples_per_packet| specified in |
63 // AudioParameters when the stream is created. The source will return | 63 // AudioParameters when the stream is created. The source will return |
64 // the number of bytes it filled. The expected structure of |dest| is | 64 // the number of bytes it filled. The expected structure of |dest| is |
65 // platform and format specific. | 65 // platform and format specific. |
66 // |buffers_state| contains current state of the buffers, and can be used | 66 // |buffers_state| contains current state of the buffers, and can be used |
67 // by the source to calculate delay. | 67 // by the source to calculate delay. |
68 virtual uint32 OnMoreData( | 68 virtual uint32 OnMoreData(uint8* dest, |
69 AudioOutputStream* stream, uint8* dest, uint32 max_size, | 69 uint32 max_size, |
70 AudioBuffersState buffers_state) = 0; | 70 AudioBuffersState buffers_state) = 0; |
71 | 71 |
72 // There was an error while playing a buffer. Audio source cannot be | 72 // There was an error while playing a buffer. Audio source cannot be |
73 // destroyed yet. No direct action needed by the AudioStream, but it is | 73 // destroyed yet. No direct action needed by the AudioStream, but it is |
74 // a good place to stop accumulating sound data since is is likely that | 74 // a good place to stop accumulating sound data since is is likely that |
75 // playback will not continue. |code| is an error code that is platform | 75 // playback will not continue. |code| is an error code that is platform |
76 // specific. | 76 // specific. |
77 virtual void OnError(AudioOutputStream* stream, int code) = 0; | 77 virtual void OnError(AudioOutputStream* stream, int code) = 0; |
78 | 78 |
79 // Waits till data becomes available. Used when buffering data starting | 79 // Waits till data becomes available. Used when buffering data starting |
80 // new audio stream. | 80 // new audio stream. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // Sets the Automatic Gain Control (AGC) state. | 172 // Sets the Automatic Gain Control (AGC) state. |
173 virtual void SetAutomaticGainControl(bool enabled) = 0; | 173 virtual void SetAutomaticGainControl(bool enabled) = 0; |
174 | 174 |
175 // Returns the Automatic Gain Control (AGC) state. | 175 // Returns the Automatic Gain Control (AGC) state. |
176 virtual bool GetAutomaticGainControl() = 0; | 176 virtual bool GetAutomaticGainControl() = 0; |
177 }; | 177 }; |
178 | 178 |
179 } // namespace media | 179 } // namespace media |
180 | 180 |
181 #endif // MEDIA_AUDIO_AUDIO_IO_H_ | 181 #endif // MEDIA_AUDIO_AUDIO_IO_H_ |
OLD | NEW |