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/cras/cras_input.h" | 5 #include "media/audio/cras/cras_input.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" |
10 #include "base/time/time.h" | 11 #include "base/time/time.h" |
11 #include "media/audio/audio_manager.h" | 12 #include "media/audio/audio_manager.h" |
12 #include "media/audio/cras/audio_manager_cras.h" | 13 #include "media/audio/cras/audio_manager_cras.h" |
13 | 14 |
14 namespace media { | 15 namespace media { |
15 | 16 |
16 CrasInputStream::CrasInputStream(const AudioParameters& params, | 17 CrasInputStream::CrasInputStream(const AudioParameters& params, |
17 AudioManagerCras* manager, | 18 AudioManagerCras* manager, |
18 const std::string& device_id) | 19 const std::string& device_id) |
19 : audio_manager_(manager), | 20 : audio_manager_(manager), |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 | 332 |
332 double CrasInputStream::GetVolumeRatioFromDecibels(double dB) const { | 333 double CrasInputStream::GetVolumeRatioFromDecibels(double dB) const { |
333 return pow(10, dB / 20.0); | 334 return pow(10, dB / 20.0); |
334 } | 335 } |
335 | 336 |
336 double CrasInputStream::GetDecibelsFromVolumeRatio(double volume_ratio) const { | 337 double CrasInputStream::GetDecibelsFromVolumeRatio(double volume_ratio) const { |
337 return 20 * log10(volume_ratio); | 338 return 20 * log10(volume_ratio); |
338 } | 339 } |
339 | 340 |
340 } // namespace media | 341 } // namespace media |
OLD | NEW |