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