OLD | NEW |
1 // Copyright (c) 2012 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 | |
18 ////////////////////////////////////////////////////////////////////////////// | 16 ////////////////////////////////////////////////////////////////////////////// |
19 // SineWaveAudioSource implementation. | 17 // SineWaveAudioSource implementation. |
20 | 18 |
21 SineWaveAudioSource::SineWaveAudioSource(Format format, int channels, | 19 SineWaveAudioSource::SineWaveAudioSource(Format format, int channels, |
22 double freq, double sample_freq) | 20 double freq, double sample_freq) |
23 : format_(format), | 21 : format_(format), |
24 channels_(channels), | 22 channels_(channels), |
25 freq_(freq), | 23 freq_(freq), |
26 sample_freq_(sample_freq), | 24 sample_freq_(sample_freq), |
27 time_state_(0) { | 25 time_state_(0) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 89 } |
92 | 90 |
93 void PushSource::ClearAll() { | 91 void PushSource::ClearAll() { |
94 // Cleanup() will discard all the data. | 92 // Cleanup() will discard all the data. |
95 CleanUp(); | 93 CleanUp(); |
96 } | 94 } |
97 | 95 |
98 void PushSource::CleanUp() { | 96 void PushSource::CleanUp() { |
99 buffer_.Clear(); | 97 buffer_.Clear(); |
100 } | 98 } |
101 | |
102 } // namespace media | |
OLD | NEW |