1 // Copyright 2013 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_ALSA_ALSA_UTIL_H_
6 #define MEDIA_AUDIO_ALSA_ALSA_UTIL_H_
8 #include <alsa/asoundlib.h>
17 snd_pcm_format_t
BitsToFormat(int bits_per_sample
);
19 snd_pcm_t
* OpenCaptureDevice(media::AlsaWrapper
* wrapper
,
20 const char* device_name
,
23 snd_pcm_format_t pcm_format
,
26 snd_pcm_t
* OpenPlaybackDevice(media::AlsaWrapper
* wrapper
,
27 const char* device_name
,
30 snd_pcm_format_t pcm_format
,
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
,
40 const std::string
& device_name
);
42 snd_mixer_elem_t
* LoadCaptureMixerElement(media::AlsaWrapper
* wrapper
,
45 } // namespace alsa_util
47 #endif // MEDIA_AUDIO_ALSA_ALSA_UTIL_H_