| 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_SIMPLE_SOURCES_H_ | 5 #ifndef MEDIA_AUDIO_SIMPLE_SOURCES_H_ |
| 6 #define MEDIA_AUDIO_SIMPLE_SOURCES_H_ | 6 #define MEDIA_AUDIO_SIMPLE_SOURCES_H_ |
| 7 | 7 |
| 8 #include "base/synchronization/lock.h" | 8 #include "base/synchronization/lock.h" |
| 9 #include "media/audio/audio_io.h" | 9 #include "media/audio/audio_io.h" |
| 10 #include "media/base/seekable_buffer.h" | 10 #include "media/base/seekable_buffer.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // allow more data to be served. | 25 // allow more data to be served. |
| 26 void CapSamples(int cap); | 26 void CapSamples(int cap); |
| 27 void Reset(); | 27 void Reset(); |
| 28 | 28 |
| 29 // Implementation of AudioSourceCallback. | 29 // Implementation of AudioSourceCallback. |
| 30 virtual int OnMoreData(AudioBus* audio_bus, | 30 virtual int OnMoreData(AudioBus* audio_bus, |
| 31 AudioBuffersState audio_buffers) OVERRIDE; | 31 AudioBuffersState audio_buffers) OVERRIDE; |
| 32 virtual int OnMoreIOData(AudioBus* source, | 32 virtual int OnMoreIOData(AudioBus* source, |
| 33 AudioBus* dest, | 33 AudioBus* dest, |
| 34 AudioBuffersState audio_buffers) OVERRIDE; | 34 AudioBuffersState audio_buffers) OVERRIDE; |
| 35 virtual void OnError(AudioOutputStream* stream, int code) OVERRIDE; | 35 virtual void OnError(AudioOutputStream* stream) OVERRIDE; |
| 36 | 36 |
| 37 // The number of OnMoreData()+OnMoreIOData() and OnError() calls respectively. | 37 // The number of OnMoreData()+OnMoreIOData() and OnError() calls respectively. |
| 38 int callbacks() { return callbacks_; } | 38 int callbacks() { return callbacks_; } |
| 39 int errors() { return errors_; } | 39 int errors() { return errors_; } |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 int channels_; | 42 int channels_; |
| 43 double f_; | 43 double f_; |
| 44 int time_state_; | 44 int time_state_; |
| 45 int cap_; | 45 int cap_; |
| 46 int callbacks_; | 46 int callbacks_; |
| 47 int errors_; | 47 int errors_; |
| 48 base::Lock time_lock_; | 48 base::Lock time_lock_; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace media | 51 } // namespace media |
| 52 | 52 |
| 53 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_ | 53 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_ |
| OLD | NEW |