Report errors from ChromiumEnv::GetChildren in Posix.
[chromium-blink-merge.git] / media / audio / linux / alsa_util.h
blob53cf80af84c271ecba2b83f41afc09f0432d7ab0
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
3 // found in the LICENSE file.
5 #ifndef MEDIA_AUDIO_LINUX_ALSA_UTIL_H_
6 #define MEDIA_AUDIO_LINUX_ALSA_UTIL_H_
8 #include <alsa/asoundlib.h>
9 #include <string>
11 namespace media {
12 class AlsaWrapper;
15 namespace alsa_util {
17 snd_pcm_format_t BitsToFormat(int bits_per_sample);
19 snd_pcm_t* OpenCaptureDevice(media::AlsaWrapper* wrapper,
20 const char* device_name,
21 int channels,
22 int sample_rate,
23 snd_pcm_format_t pcm_format,
24 int latency_us);
26 snd_pcm_t* OpenPlaybackDevice(media::AlsaWrapper* wrapper,
27 const char* device_name,
28 int channels,
29 int sample_rate,
30 snd_pcm_format_t pcm_format,
31 int latency_us);
33 int CloseDevice(media::AlsaWrapper* wrapper, snd_pcm_t* handle);
35 snd_mixer_t* OpenMixer(media::AlsaWrapper* wrapper,
36 const std::string& device_name);
38 void CloseMixer(media::AlsaWrapper* wrapper,
39 snd_mixer_t* mixer,
40 const std::string& device_name);
42 snd_mixer_elem_t* LoadCaptureMixerElement(media::AlsaWrapper* wrapper,
43 snd_mixer_t* mixer);
45 } // namespace alsa_util
47 #endif // MEDIA_AUDIO_LINUX_ALSA_UTIL_H_