| 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/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" |
| 11 #include "content/renderer/media/audio_device_factory.h" | 11 #include "content/renderer/media/audio_device_factory.h" |
| 12 #include "content/renderer/media/audio_hardware.h" | 12 #include "content/renderer/media/audio_hardware.h" |
| 13 #include "content/renderer/render_thread_impl.h" | 13 #include "content/renderer/render_thread_impl.h" |
| 14 #include "media/audio/audio_parameters.h" | 14 #include "media/audio/audio_parameters.h" |
| 15 #include "media/audio/audio_util.h" | 15 #include "media/audio/audio_util.h" |
| 16 #include "media/audio/sample_rates.h" | 16 #include "media/audio/sample_rates.h" |
| 17 | 17 |
| 18 using content::AudioDeviceFactory; | 18 using content::AudioDeviceFactory; |
| 19 using media::AudioParameters; | 19 using media::AudioParameters; |
| 20 using media::ChannelLayout; |
| 21 using media::CHANNEL_LAYOUT_MAX; |
| 22 using media::CHANNEL_LAYOUT_MONO; |
| 23 using media::CHANNEL_LAYOUT_STEREO; |
| 20 | 24 |
| 21 static const int64 kMillisecondsBetweenProcessCalls = 5000; | 25 static const int64 kMillisecondsBetweenProcessCalls = 5000; |
| 22 static const double kMaxVolumeLevel = 255.0; | 26 static const double kMaxVolumeLevel = 255.0; |
| 23 | 27 |
| 24 // Supported hardware sample rates for input and output sides. | 28 // Supported hardware sample rates for input and output sides. |
| 25 #if defined(OS_WIN) || defined(OS_MACOSX) | 29 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 26 // media::GetAudioInput[Output]HardwareSampleRate() asks the audio layer | 30 // media::GetAudioInput[Output]HardwareSampleRate() asks the audio layer |
| 27 // for its current sample rate (set by the user) on Windows and Mac OS X. | 31 // for its current sample rate (set by the user) on Windows and Mac OS X. |
| 28 // The listed rates below adds restrictions and WebRtcAudioDeviceImpl::Init() | 32 // The listed rates below adds restrictions and WebRtcAudioDeviceImpl::Init() |
| 29 // will fail if the user selects any rate outside these ranges. | 33 // will fail if the user selects any rate outside these ranges. |
| (...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 } | 1160 } |
| 1157 | 1161 |
| 1158 int32_t WebRtcAudioDeviceImpl::GetLoudspeakerStatus(bool* enabled) const { | 1162 int32_t WebRtcAudioDeviceImpl::GetLoudspeakerStatus(bool* enabled) const { |
| 1159 NOTIMPLEMENTED(); | 1163 NOTIMPLEMENTED(); |
| 1160 return -1; | 1164 return -1; |
| 1161 } | 1165 } |
| 1162 | 1166 |
| 1163 void WebRtcAudioDeviceImpl::SetSessionId(int session_id) { | 1167 void WebRtcAudioDeviceImpl::SetSessionId(int session_id) { |
| 1164 session_id_ = session_id; | 1168 session_id_ = session_id; |
| 1165 } | 1169 } |
| OLD | NEW |