| 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 "media/audio/virtual_audio_input_stream.h" | 5 #include "media/audio/virtual_audio_input_stream.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 DCHECK_LE(0, num_attached_output_streams_); | 98 DCHECK_LE(0, num_attached_output_streams_); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void VirtualAudioInputStream::PumpAudio() { | 101 void VirtualAudioInputStream::PumpAudio() { |
| 102 DCHECK(worker_task_runner_->BelongsToCurrentThread()); | 102 DCHECK(worker_task_runner_->BelongsToCurrentThread()); |
| 103 | 103 |
| 104 { | 104 { |
| 105 base::AutoLock scoped_lock(converter_network_lock_); | 105 base::AutoLock scoped_lock(converter_network_lock_); |
| 106 // Because the audio is being looped-back, the delay until it will be played | 106 // Because the audio is being looped-back, the delay until it will be played |
| 107 // out is zero. | 107 // out is zero. |
| 108 mixer_.ConvertWithDelay(base::TimeDelta(), audio_bus_.get()); | 108 mixer_.ConvertWithDelay(0, audio_bus_.get()); |
| 109 } | 109 } |
| 110 // Because the audio is being looped-back, the delay since since it was | 110 // Because the audio is being looped-back, the delay since since it was |
| 111 // recorded is zero. | 111 // recorded is zero. |
| 112 callback_->OnData(this, audio_bus_.get(), 0, 1.0); | 112 callback_->OnData(this, audio_bus_.get(), 0, 1.0); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void VirtualAudioInputStream::Close() { | 115 void VirtualAudioInputStream::Close() { |
| 116 DCHECK(thread_checker_.CalledOnValidThread()); | 116 DCHECK(thread_checker_.CalledOnValidThread()); |
| 117 | 117 |
| 118 Stop(); // Make sure callback_ is no longer being used. | 118 Stop(); // Make sure callback_ is no longer being used. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 143 | 143 |
| 144 bool VirtualAudioInputStream::GetAutomaticGainControl() { | 144 bool VirtualAudioInputStream::GetAutomaticGainControl() { |
| 145 return false; | 145 return false; |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool VirtualAudioInputStream::IsMuted() { | 148 bool VirtualAudioInputStream::IsMuted() { |
| 149 return false; | 149 return false; |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace media | 152 } // namespace media |
| OLD | NEW |