aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Wilson <simonrules@users.noreply.github.com>2020-09-03 08:05:11 -0600
committerGitHub <noreply@github.com>2020-09-03 08:05:11 -0600
commit563ee74ad551d08ea2b5e8dee2ac542c883b9f4b (patch)
tree2e1e7600db362b9642d035f11b986bda78dc7e71 /include
parentfd59e16f1893d8b49b0fae421d09df7161b52616 (diff)
parent9c7a358e0e4dbb447129b91d3633fb8d0cec2a85 (diff)
Merge pull request #174 from rohkkumar/mmap_plugin_support
Mmap plugin support
Diffstat (limited to 'include')
-rw-r--r--include/tinyalsa/pcm.h10
-rw-r--r--include/tinyalsa/plugin.h6
2 files changed, 16 insertions, 0 deletions
diff --git a/include/tinyalsa/pcm.h b/include/tinyalsa/pcm.h
index f4b7d73..1184d81 100644
--- a/include/tinyalsa/pcm.h
+++ b/include/tinyalsa/pcm.h
@@ -95,6 +95,16 @@
* */
#define PCM_NONBLOCK 0x00000010
+/** Means a PCM is opened
+ * @ingroup libtinyalsa-pcm
+ */
+#define PCM_STATE_OPEN 0x00
+
+/** Means a PCM HW_PARAMS is set
+ * @ingroup libtinyalsa-pcm
+ */
+#define PCM_STATE_SETUP 0x01
+
/** Means a PCM is prepared
* @ingroup libtinyalsa-pcm
*/
diff --git a/include/tinyalsa/plugin.h b/include/tinyalsa/plugin.h
index a140754..b2f97b9 100644
--- a/include/tinyalsa/plugin.h
+++ b/include/tinyalsa/plugin.h
@@ -30,6 +30,7 @@
#ifndef TINYALSA_PLUGIN_H
#define TINYALSA_PLUGIN_H
+#include <poll.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
@@ -128,6 +129,11 @@ struct pcm_plugin_ops {
/** Any custom or alsa specific ioctl implementation */
int (*ioctl) (struct pcm_plugin *plugin,
int cmd, void *arg);
+ void *(*mmap) (struct pcm_plugin *plugin, void *addr, size_t length,
+ int prot, int flags, off_t offset);
+ int (*munmap) (struct pcm_plugin *plugin, void *addr, size_t length);
+ int (*poll) (struct pcm_plugin *plugin, struct pollfd *pfd, nfds_t nfds,
+ int timeout);
};
/** Minimum and maximum values for hardware parameter constraints.