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/base/arraysize.h"
15 #include "webrtc/sound/automaticallychosensoundsystem.h"
16 
17 namespace rtc {
18 
19 extern const SoundSystemCreator kLinuxSoundSystemCreators[
20 #ifdef HAVE_LIBPULSE
21     2
22 #else
23     1
24 #endif
25     ];
26 
27 // The vast majority of Linux systems use ALSA for the device-level sound API,
28 // but an increasing number are using PulseAudio for the application API and
29 // only using ALSA internally in PulseAudio itself. But like everything on
30 // Linux this is user-configurable, so we need to support both and choose the
31 // right one at run-time.
32 // PulseAudioSoundSystem is designed to only successfully initialize if
33 // PulseAudio is installed and running, and if it is running then direct device
34 // access using ALSA typically won't work, so if PulseAudioSoundSystem
35 // initializes then we choose that. Otherwise we choose ALSA.
36 typedef AutomaticallyChosenSoundSystem<
37     kLinuxSoundSystemCreators,
38     arraysize(kLinuxSoundSystemCreators)> LinuxSoundSystem;
39 
40 }  // namespace rtc
41 
42 #endif  // WEBRTC_SOUND_LINUXSOUNDSYSTEM_H_
43