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/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "media/audio/audio_io.h" | 10 #include "media/audio/audio_io.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 // Implementation of AudioSourceCallback. | 93 // Implementation of AudioSourceCallback. |
94 int OnMoreData(AudioBus* audio_bus, | 94 int OnMoreData(AudioBus* audio_bus, |
95 uint32_t total_bytes_delay, | 95 uint32_t total_bytes_delay, |
96 uint32_t frames_skipped) override; | 96 uint32_t frames_skipped) override; |
97 void OnError(AudioOutputStream* stream) override; | 97 void OnError(AudioOutputStream* stream) override; |
98 | 98 |
99 static void BeepOnce(); | 99 static void BeepOnce(); |
100 private: | 100 private: |
101 int buffer_size_; | 101 int buffer_size_; |
102 scoped_ptr<uint8[]> buffer_; | 102 scoped_ptr<uint8_t[]> buffer_; |
103 AudioParameters params_; | 103 AudioParameters params_; |
104 base::TimeTicks last_callback_time_; | 104 base::TimeTicks last_callback_time_; |
105 base::TimeDelta interval_from_last_beep_; | 105 base::TimeDelta interval_from_last_beep_; |
106 int beep_duration_in_buffers_; | 106 int beep_duration_in_buffers_; |
107 int beep_generated_in_buffers_; | 107 int beep_generated_in_buffers_; |
108 int beep_period_in_frames_; | 108 int beep_period_in_frames_; |
109 }; | 109 }; |
110 | 110 |
111 } // namespace media | 111 } // namespace media |
112 | 112 |
113 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_ | 113 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_ |
OLD | NEW |