summaryrefslogtreecommitdiff
path: root/media/audio/alsa/alsa_util.h
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2013-11-28 11:55:43 +0000
committerTorne (Richard Coles) <torne@google.com>2013-11-28 11:55:43 +0000
commitf2477e01787aa58f445919b809d89e252beef54f (patch)
tree2db962b4af39f0db3a5f83b314373d0530c484b8 /media/audio/alsa/alsa_util.h
parent7daea1dd5ff7e419322de831b642d81af3247912 (diff)
downloadchromium_org-f2477e01787aa58f445919b809d89e252beef54f.tar.gz
Merge from Chromium at DEPS revision 237746
This commit was generated by merge_to_master.py. Change-Id: I8997af4cddfeb09a7c26f7e8e672c712cab461ea
Diffstat (limited to 'media/audio/alsa/alsa_util.h')
-rw-r--r--media/audio/alsa/alsa_util.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/media/audio/alsa/alsa_util.h b/media/audio/alsa/alsa_util.h
new file mode 100644
index 0000000000..a23ab317dd
--- /dev/null
+++ b/media/audio/alsa/alsa_util.h
@@ -0,0 +1,47 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_AUDIO_ALSA_ALSA_UTIL_H_
+#define MEDIA_AUDIO_ALSA_ALSA_UTIL_H_
+
+#include <alsa/asoundlib.h>
+#include <string>
+
+namespace media {
+class AlsaWrapper;
+}
+
+namespace alsa_util {
+
+snd_pcm_format_t BitsToFormat(int bits_per_sample);
+
+snd_pcm_t* OpenCaptureDevice(media::AlsaWrapper* wrapper,
+ const char* device_name,
+ int channels,
+ int sample_rate,
+ snd_pcm_format_t pcm_format,
+ int latency_us);
+
+snd_pcm_t* OpenPlaybackDevice(media::AlsaWrapper* wrapper,
+ const char* device_name,
+ int channels,
+ int sample_rate,
+ snd_pcm_format_t pcm_format,
+ int latency_us);
+
+int CloseDevice(media::AlsaWrapper* wrapper, snd_pcm_t* handle);
+
+snd_mixer_t* OpenMixer(media::AlsaWrapper* wrapper,
+ const std::string& device_name);
+
+void CloseMixer(media::AlsaWrapper* wrapper,
+ snd_mixer_t* mixer,
+ const std::string& device_name);
+
+snd_mixer_elem_t* LoadCaptureMixerElement(media::AlsaWrapper* wrapper,
+ snd_mixer_t* mixer);
+
+} // namespace alsa_util
+
+#endif // MEDIA_AUDIO_ALSA_ALSA_UTIL_H_