summaryrefslogtreecommitdiffstats
path: root/audio_hw.h
diff options
context:
space:
mode:
Diffstat (limited to 'audio_hw.h')
-rw-r--r--audio_hw.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/audio_hw.h b/audio_hw.h
new file mode 100644
index 0000000..d8beb81
--- /dev/null
+++ b/audio_hw.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2012 Paul Kocialkowski <contact@paulk.fr>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TINYALSA_AUDIO_HW_H
+#define TINYALSA_AUDIO_HW_H
+
+#include <hardware/hardware.h>
+#include <hardware/audio.h>
+#include <system/audio.h>
+
+struct tinyalsa_audio_stream_out {
+ struct audio_stream_out stream;
+ struct tinyalsa_audio_device *dev;
+};
+
+struct tinyalsa_audio_stream_in {
+ struct audio_stream_in stream;
+ struct tinyalsa_audio_device *dev;
+};
+
+struct tinyalsa_audio_device {
+ struct audio_hw_device device;
+
+ struct tinyalsa_audio_stream_out *stream_out;
+ struct tinyalsa_audio_stream_in *stream_in;
+};
+
+int audio_hw_open_output_stream(struct audio_hw_device *dev,
+ uint32_t devices, int *format, uint32_t *channels, uint32_t *sample_rate,
+ struct audio_stream_out **stream_out);
+
+void audio_hw_close_output_stream(struct audio_hw_device *dev,
+ struct audio_stream_out *stream);
+
+#endif