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

Side by Side Diff: content/renderer/media/webrtc_audio_device_impl.cc

Issue 12310102: Change GetVolume() to be asynchronous when being called by pulse thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated the comments Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/audio/pulse/pulse.sigs » ('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 "content/renderer/media/webrtc_audio_device_impl.h" 5 #include "content/renderer/media/webrtc_audio_device_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/win/windows_version.h" 10 #include "base/win/windows_version.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 int audio_delay_milliseconds, 137 int audio_delay_milliseconds,
138 double volume) { 138 double volume) {
139 DCHECK_LE(number_of_frames, input_buffer_size()); 139 DCHECK_LE(number_of_frames, input_buffer_size());
140 #if defined(OS_WIN) || defined(OS_MACOSX) 140 #if defined(OS_WIN) || defined(OS_MACOSX)
141 DCHECK_LE(volume, 1.0); 141 DCHECK_LE(volume, 1.0);
142 #elif defined(OS_LINUX) || defined(OS_OPENBSD) 142 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
143 // We have a special situation on Linux where the microphone volume can be 143 // We have a special situation on Linux where the microphone volume can be
144 // "higher than maximum". The input volume slider in the sound preference 144 // "higher than maximum". The input volume slider in the sound preference
145 // allows the user to set a scaling that is higher than 100%. It means that 145 // allows the user to set a scaling that is higher than 100%. It means that
146 // even if the reported maximum levels is N, the actual microphone level can 146 // even if the reported maximum levels is N, the actual microphone level can
147 // go up to 1.5*N and that corresponds to a normalized |volume| of 1.5. 147 // go up to 1.5x*N and that corresponds to a normalized |volume| of 1.5x.
148 DCHECK_LE(volume, 1.5); 148 DCHECK_LE(volume, 1.6);
149 #endif 149 #endif
150 150
151 int output_delay_ms = 0; 151 int output_delay_ms = 0;
152 { 152 {
153 base::AutoLock auto_lock(lock_); 153 base::AutoLock auto_lock(lock_);
154 // Store the reported audio delay locally. 154 // Store the reported audio delay locally.
155 input_delay_ms_ = audio_delay_milliseconds; 155 input_delay_ms_ = audio_delay_milliseconds;
156 output_delay_ms = output_delay_ms_; 156 output_delay_ms = output_delay_ms_;
157 } 157 }
158 158
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 NOTIMPLEMENTED(); 849 NOTIMPLEMENTED();
850 return -1; 850 return -1;
851 } 851 }
852 852
853 int32_t WebRtcAudioDeviceImpl::GetLoudspeakerStatus(bool* enabled) const { 853 int32_t WebRtcAudioDeviceImpl::GetLoudspeakerStatus(bool* enabled) const {
854 NOTIMPLEMENTED(); 854 NOTIMPLEMENTED();
855 return -1; 855 return -1;
856 } 856 }
857 857
858 } // namespace content 858 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | media/audio/pulse/pulse.sigs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698