henrike@webrtc.org | 66a3582 | 2014-08-26 22:04:04 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef WEBRTC_SOUND_LINUXSOUNDSYSTEM_H_ |
| 12 | #define WEBRTC_SOUND_LINUXSOUNDSYSTEM_H_ |
| 13 | |
| 14 | #include "webrtc/sound/automaticallychosensoundsystem.h" |
| 15 | |
| 16 | namespace rtc { |
| 17 | |
| 18 | extern const SoundSystemCreator kLinuxSoundSystemCreators[ |
| 19 | #ifdef HAVE_LIBPULSE |
| 20 | 2 |
| 21 | #else |
| 22 | 1 |
| 23 | #endif |
| 24 | ]; |
| 25 | |
| 26 | // The vast majority of Linux systems use ALSA for the device-level sound API, |
| 27 | // but an increasing number are using PulseAudio for the application API and |
| 28 | // only using ALSA internally in PulseAudio itself. But like everything on |
| 29 | // Linux this is user-configurable, so we need to support both and choose the |
| 30 | // right one at run-time. |
| 31 | // PulseAudioSoundSystem is designed to only successfully initialize if |
| 32 | // PulseAudio is installed and running, and if it is running then direct device |
| 33 | // access using ALSA typically won't work, so if PulseAudioSoundSystem |
| 34 | // initializes then we choose that. Otherwise we choose ALSA. |
| 35 | typedef AutomaticallyChosenSoundSystem< |
| 36 | kLinuxSoundSystemCreators, |
| 37 | ARRAY_SIZE(kLinuxSoundSystemCreators)> LinuxSoundSystem; |
| 38 | |
| 39 | } // namespace rtc |
| 40 | |
| 41 | #endif // WEBRTC_SOUND_LINUXSOUNDSYSTEM_H_ |