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

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

Issue 2689483006: Switch browser side audio capture path to use base time primitives. (Closed)
Patch Set: Bloop Created 3 years, 10 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
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698