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 #include "media/base/limits.h" | 20 #include "media/base/limits.h" |
21 #include "media/base/media_switches.h" | 21 #include "media/base/media_switches.h" |
22 | 22 |
| 23 namespace media { |
| 24 |
23 // Maximum number of output streams that can be open simultaneously. | 25 // Maximum number of output streams that can be open simultaneously. |
24 static const int kMaxOutputStreams = 50; | 26 static const int kMaxOutputStreams = 50; |
25 | 27 |
26 // Since "default", "pulse" and "dmix" devices are virtual devices mapped to | 28 // Since "default", "pulse" and "dmix" devices are virtual devices mapped to |
27 // real devices, we remove them from the list to avoiding duplicate counting. | 29 // real devices, we remove them from the list to avoiding duplicate counting. |
28 // In addition, note that we support no more than 2 channels for recording, | 30 // In addition, note that we support no more than 2 channels for recording, |
29 // hence surround devices are not stored in the list. | 31 // hence surround devices are not stored in the list. |
30 static const char* kInvalidAudioInputDevices[] = { | 32 static const char* kInvalidAudioInputDevices[] = { |
31 "default", | 33 "default", |
32 "null", | 34 "null", |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 293 device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
292 switches::kAlsaInputDevice); | 294 switches::kAlsaInputDevice); |
293 } | 295 } |
294 | 296 |
295 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); | 297 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); |
296 } | 298 } |
297 | 299 |
298 AudioManager* CreateAudioManager() { | 300 AudioManager* CreateAudioManager() { |
299 return new AudioManagerLinux(); | 301 return new AudioManagerLinux(); |
300 } | 302 } |
| 303 |
| 304 } // namespace media |
OLD | NEW |