| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 DCHECK(worker_task_runner_->BelongsToCurrentThread()); | 104 DCHECK(worker_task_runner_->BelongsToCurrentThread()); |
| 105 | 105 |
| 106 { | 106 { |
| 107 base::AutoLock scoped_lock(converter_network_lock_); | 107 base::AutoLock scoped_lock(converter_network_lock_); |
| 108 // Because the audio is being looped-back, the delay until it will be played | 108 // Because the audio is being looped-back, the delay until it will be played |
| 109 // out is zero. | 109 // out is zero. |
| 110 mixer_.ConvertWithDelay(0, audio_bus_.get()); | 110 mixer_.ConvertWithDelay(0, audio_bus_.get()); |
| 111 } | 111 } |
| 112 // Because the audio is being looped-back, the delay since since it was | 112 // Because the audio is being looped-back, the delay since since it was |
| 113 // recorded is zero. | 113 // recorded is zero. |
| 114 callback_->OnData(this, audio_bus_.get(), 0, 1.0); | 114 callback_->OnData(this, audio_bus_.get(), base::TimeDelta(), |
| 115 base::TimeTicks::Now(), 1.0); |
| 115 } | 116 } |
| 116 | 117 |
| 117 void VirtualAudioInputStream::Close() { | 118 void VirtualAudioInputStream::Close() { |
| 118 DCHECK(thread_checker_.CalledOnValidThread()); | 119 DCHECK(thread_checker_.CalledOnValidThread()); |
| 119 | 120 |
| 120 Stop(); // Make sure callback_ is no longer being used. | 121 Stop(); // Make sure callback_ is no longer being used. |
| 121 | 122 |
| 122 // If a non-null AfterCloseCallback was provided to the constructor, invoke it | 123 // If a non-null AfterCloseCallback was provided to the constructor, invoke it |
| 123 // here. The callback is moved to a stack-local first since |this| could be | 124 // here. The callback is moved to a stack-local first since |this| could be |
| 124 // destroyed during Run(). | 125 // destroyed during Run(). |
| (...skipping 20 matching lines...) Expand all Loading... |
| 145 | 146 |
| 146 bool VirtualAudioInputStream::GetAutomaticGainControl() { | 147 bool VirtualAudioInputStream::GetAutomaticGainControl() { |
| 147 return false; | 148 return false; |
| 148 } | 149 } |
| 149 | 150 |
| 150 bool VirtualAudioInputStream::IsMuted() { | 151 bool VirtualAudioInputStream::IsMuted() { |
| 151 return false; | 152 return false; |
| 152 } | 153 } |
| 153 | 154 |
| 154 } // namespace media | 155 } // namespace media |
| OLD | NEW |