| 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 // MSVC++ requires this to be set before any other includes to get M_PI. | 4 // MSVC++ requires this to be set before any other includes to get M_PI. |
| 5 #define _USE_MATH_DEFINES | 5 #define _USE_MATH_DEFINES |
| 6 #include <cmath> | 6 #include <cmath> |
| 7 | 7 |
| 8 #include "media/audio/simple_sources.h" | 8 #include "media/audio/simple_sources.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 return max_frames; | 49 return max_frames; |
| 50 } | 50 } |
| 51 | 51 |
| 52 int SineWaveAudioSource::OnMoreIOData(AudioBus* source, | 52 int SineWaveAudioSource::OnMoreIOData(AudioBus* source, |
| 53 AudioBus* dest, | 53 AudioBus* dest, |
| 54 AudioBuffersState audio_buffers) { | 54 AudioBuffersState audio_buffers) { |
| 55 return OnMoreData(dest, audio_buffers); | 55 return OnMoreData(dest, audio_buffers); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void SineWaveAudioSource::OnError(AudioOutputStream* stream, int code) { | 58 void SineWaveAudioSource::OnError(AudioOutputStream* stream) { |
| 59 errors_++; | 59 errors_++; |
| 60 } | 60 } |
| 61 | 61 |
| 62 void SineWaveAudioSource::CapSamples(int cap) { | 62 void SineWaveAudioSource::CapSamples(int cap) { |
| 63 base::AutoLock auto_lock(time_lock_); | 63 base::AutoLock auto_lock(time_lock_); |
| 64 DCHECK_GT(cap, 0); | 64 DCHECK_GT(cap, 0); |
| 65 cap_ = cap; | 65 cap_ = cap; |
| 66 } | 66 } |
| 67 | 67 |
| 68 void SineWaveAudioSource::Reset() { | 68 void SineWaveAudioSource::Reset() { |
| 69 base::AutoLock auto_lock(time_lock_); | 69 base::AutoLock auto_lock(time_lock_); |
| 70 time_state_ = 0; | 70 time_state_ = 0; |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace media | 73 } // namespace media |
| OLD | NEW |