Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1922)

Side by Side Diff: media/audio/virtual_audio_input_stream.cc

Issue 2004283002: AudioConverter: Express delay in frames rather than msec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed files & removed rounding Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/audio/simple_sources.cc ('k') | media/audio/virtual_audio_output_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/audio/simple_sources.cc ('k') | media/audio/virtual_audio_output_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698