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 "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/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
10 #include "content/renderer/media/audio_hardware.h" | 10 #include "content/renderer/media/audio_hardware.h" |
11 #include "content/renderer/render_thread_impl.h" | 11 #include "content/renderer/render_thread_impl.h" |
12 #include "media/audio/audio_util.h" | 12 #include "media/audio/audio_util.h" |
13 | 13 |
| 14 using media::AudioParameters; |
| 15 |
14 static const int64 kMillisecondsBetweenProcessCalls = 5000; | 16 static const int64 kMillisecondsBetweenProcessCalls = 5000; |
15 static const double kMaxVolumeLevel = 255.0; | 17 static const double kMaxVolumeLevel = 255.0; |
16 | 18 |
17 // Supported hardware sample rates for input and output sides. | 19 // Supported hardware sample rates for input and output sides. |
18 #if defined(OS_WIN) || defined(OS_MACOSX) | 20 #if defined(OS_WIN) || defined(OS_MACOSX) |
19 // media::GetAudioInput[Output]HardwareSampleRate() asks the audio layer | 21 // media::GetAudioInput[Output]HardwareSampleRate() asks the audio layer |
20 // for its current sample rate (set by the user) on Windows and Mac OS X. | 22 // for its current sample rate (set by the user) on Windows and Mac OS X. |
21 // The listed rates below adds restrictions and WebRtcAudioDeviceImpl::Init() | 23 // The listed rates below adds restrictions and WebRtcAudioDeviceImpl::Init() |
22 // will fail if the user selects any rate outside these ranges. | 24 // will fail if the user selects any rate outside these ranges. |
23 static int kValidInputRates[] = {96000, 48000, 44100, 32000, 16000}; | 25 static int kValidInputRates[] = {96000, 48000, 44100, 32000, 16000}; |
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 } | 1037 } |
1036 | 1038 |
1037 int32_t WebRtcAudioDeviceImpl::GetLoudspeakerStatus(bool* enabled) const { | 1039 int32_t WebRtcAudioDeviceImpl::GetLoudspeakerStatus(bool* enabled) const { |
1038 NOTIMPLEMENTED(); | 1040 NOTIMPLEMENTED(); |
1039 return -1; | 1041 return -1; |
1040 } | 1042 } |
1041 | 1043 |
1042 void WebRtcAudioDeviceImpl::SetSessionId(int session_id) { | 1044 void WebRtcAudioDeviceImpl::SetSessionId(int session_id) { |
1043 session_id_ = session_id; | 1045 session_id_ = session_id; |
1044 } | 1046 } |
OLD | NEW |