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/linux/audio_manager_linux.h" | 5 #include "media/audio/linux/audio_manager_linux.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/nix/xdg_util.h" | 10 #include "base/nix/xdg_util.h" |
11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "media/audio/audio_output_dispatcher.h" | 13 #include "media/audio/audio_output_dispatcher.h" |
14 #include "media/audio/linux/alsa_input.h" | 14 #include "media/audio/linux/alsa_input.h" |
15 #include "media/audio/linux/alsa_output.h" | 15 #include "media/audio/linux/alsa_output.h" |
16 #include "media/audio/linux/alsa_wrapper.h" | 16 #include "media/audio/linux/alsa_wrapper.h" |
17 #if defined(USE_PULSEAUDIO) | 17 #if defined(USE_PULSEAUDIO) |
18 #include "media/audio/pulse/pulse_output.h" | 18 #include "media/audio/pulse/pulse_output.h" |
19 #endif | 19 #endif |
20 #if defined(USE_CRAS) | 20 #if defined(USE_CRAS) |
21 #include "media/audio/linux/cras_output.h" | 21 #include "media/audio/linux/cras_output.h" |
22 #endif | 22 #endif |
23 #include "media/base/limits.h" | 23 #include "media/base/limits.h" |
24 #include "media/base/media_switches.h" | 24 #include "media/base/media_switches.h" |
25 | 25 |
26 namespace media { | |
27 | |
28 // Maximum number of output streams that can be open simultaneously. | 26 // Maximum number of output streams that can be open simultaneously. |
29 static const int kMaxOutputStreams = 50; | 27 static const int kMaxOutputStreams = 50; |
30 | 28 |
31 // Since "default", "pulse" and "dmix" devices are virtual devices mapped to | 29 // Since "default", "pulse" and "dmix" devices are virtual devices mapped to |
32 // real devices, we remove them from the list to avoiding duplicate counting. | 30 // real devices, we remove them from the list to avoiding duplicate counting. |
33 // In addition, note that we support no more than 2 channels for recording, | 31 // In addition, note that we support no more than 2 channels for recording, |
34 // hence surround devices are not stored in the list. | 32 // hence surround devices are not stored in the list. |
35 static const char* kInvalidAudioInputDevices[] = { | 33 static const char* kInvalidAudioInputDevices[] = { |
36 "default", | 34 "default", |
37 "null", | 35 "null", |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 302 device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
305 switches::kAlsaInputDevice); | 303 switches::kAlsaInputDevice); |
306 } | 304 } |
307 | 305 |
308 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); | 306 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); |
309 } | 307 } |
310 | 308 |
311 AudioManager* CreateAudioManager() { | 309 AudioManager* CreateAudioManager() { |
312 return new AudioManagerLinux(); | 310 return new AudioManagerLinux(); |
313 } | 311 } |
314 | |
315 } // namespace media | |
OLD | NEW |