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 <list> | 8 #include <list> |
9 | 9 |
10 #include "media/audio/audio_io.h" | 10 #include "media/audio/audio_io.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 // Return the total number of bytes not given to the audio device yet. | 72 // Return the total number of bytes not given to the audio device yet. |
73 virtual uint32 UnProcessedBytes() OVERRIDE; | 73 virtual uint32 UnProcessedBytes() OVERRIDE; |
74 | 74 |
75 // Implementation of AudioSourceCallback. | 75 // Implementation of AudioSourceCallback. |
76 virtual uint32 OnMoreData(uint8* dest, | 76 virtual uint32 OnMoreData(uint8* dest, |
77 uint32 max_size, | 77 uint32 max_size, |
78 AudioBuffersState buffers_state) OVERRIDE; | 78 AudioBuffersState buffers_state) OVERRIDE; |
79 virtual void OnError(AudioOutputStream* stream, int code) OVERRIDE; | 79 virtual void OnError(AudioOutputStream* stream, int code) OVERRIDE; |
80 | 80 |
81 // Discard all buffered data and reset to initial state. | |
82 void ClearAll(); | |
83 | |
84 private: | 81 private: |
85 // Free acquired resources. | 82 // Free acquired resources. |
86 void CleanUp(); | 83 void CleanUp(); |
87 | 84 |
88 media::SeekableBuffer buffer_; | 85 media::SeekableBuffer buffer_; |
89 }; | 86 }; |
90 | 87 |
91 } // namespace media | 88 } // namespace media |
92 | 89 |
93 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_ | 90 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_ |
OLD | NEW |