OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "media/audio/simple_sources.h" | 5 #include "media/audio/simple_sources.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <math.h> | 8 #include <math.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "media/audio/audio_io.h" | 13 #include "media/audio/audio_io.h" |
14 #include "media/base/data_buffer.h" | 14 #include "media/base/data_buffer.h" |
15 | 15 |
| 16 namespace media { |
| 17 |
16 ////////////////////////////////////////////////////////////////////////////// | 18 ////////////////////////////////////////////////////////////////////////////// |
17 // SineWaveAudioSource implementation. | 19 // SineWaveAudioSource implementation. |
18 | 20 |
19 SineWaveAudioSource::SineWaveAudioSource(Format format, int channels, | 21 SineWaveAudioSource::SineWaveAudioSource(Format format, int channels, |
20 double freq, double sample_freq) | 22 double freq, double sample_freq) |
21 : format_(format), | 23 : format_(format), |
22 channels_(channels), | 24 channels_(channels), |
23 freq_(freq), | 25 freq_(freq), |
24 sample_freq_(sample_freq), | 26 sample_freq_(sample_freq), |
25 time_state_(0) { | 27 time_state_(0) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 91 } |
90 | 92 |
91 void PushSource::ClearAll() { | 93 void PushSource::ClearAll() { |
92 // Cleanup() will discard all the data. | 94 // Cleanup() will discard all the data. |
93 CleanUp(); | 95 CleanUp(); |
94 } | 96 } |
95 | 97 |
96 void PushSource::CleanUp() { | 98 void PushSource::CleanUp() { |
97 buffer_.Clear(); | 99 buffer_.Clear(); |
98 } | 100 } |
| 101 |
| 102 } // namespace media |
OLD | NEW |