| 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 #include <list> | 5 #include <list> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 virtual int OnMoreData(AudioBus* audio_bus, | 70 virtual int OnMoreData(AudioBus* audio_bus, |
| 71 AudioBuffersState audio_buffers) OVERRIDE { | 71 AudioBuffersState audio_buffers) OVERRIDE { |
| 72 const int ret = SineWaveAudioSource::OnMoreData(audio_bus, audio_buffers); | 72 const int ret = SineWaveAudioSource::OnMoreData(audio_bus, audio_buffers); |
| 73 data_pulled_.Signal(); | 73 data_pulled_.Signal(); |
| 74 return ret; | 74 return ret; |
| 75 } | 75 } |
| 76 | 76 |
| 77 virtual int OnMoreIOData(AudioBus* source, | 77 virtual int OnMoreIOData(AudioBus* source, |
| 78 AudioBus* dest, | 78 AudioBus* dest, |
| 79 AudioBuffersState audio_buffers) OVERRIDE { | 79 AudioBuffersState audio_buffers, |
| 80 double input_volume) OVERRIDE { |
| 80 const int ret = | 81 const int ret = |
| 81 SineWaveAudioSource::OnMoreIOData(source, dest, audio_buffers); | 82 SineWaveAudioSource::OnMoreIOData(source, dest, audio_buffers, 1.0); |
| 82 data_pulled_.Signal(); | 83 data_pulled_.Signal(); |
| 83 return ret; | 84 return ret; |
| 84 } | 85 } |
| 85 | 86 |
| 86 void WaitForDataPulls() { | 87 void WaitForDataPulls() { |
| 87 for (int i = 0; i < 3; ++i) { | 88 for (int i = 0; i < 3; ++i) { |
| 88 data_pulled_.Wait(); | 89 data_pulled_.Wait(); |
| 89 } | 90 } |
| 90 } | 91 } |
| 91 | 92 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 } | 329 } |
| 329 RUN_ON_AUDIO_THREAD(Stop); | 330 RUN_ON_AUDIO_THREAD(Stop); |
| 330 for (int i = 0; i < kHalfNumOutputs; ++i) { | 331 for (int i = 0; i < kHalfNumOutputs; ++i) { |
| 331 RUN_ON_AUDIO_THREAD(StopAndCloseOneOutputStream); | 332 RUN_ON_AUDIO_THREAD(StopAndCloseOneOutputStream); |
| 332 } | 333 } |
| 333 RUN_ON_AUDIO_THREAD(Close); | 334 RUN_ON_AUDIO_THREAD(Close); |
| 334 WaitUntilClosed(); | 335 WaitUntilClosed(); |
| 335 } | 336 } |
| 336 | 337 |
| 337 } // namespace media | 338 } // namespace media |
| OLD | NEW |