From 1d72910d90d4b0b3d5719c865461a7637f4cc467 Mon Sep 17 00:00:00 2001 From: Rohit kumar Date: Wed, 19 Aug 2020 14:59:38 +0530 Subject: include: tinyalsa: Add PCM state macros Add PCM_STATE_OPEN and PCM_STATE_SETUP macros so that it can be utilized by plugin to update sync_ptr state. --- include/tinyalsa/pcm.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') 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 */ -- cgit v1.2.3 From f29b8df6261e72d9a426d6d8c175a896931654e2 Mon Sep 17 00:00:00 2001 From: Rohit kumar Date: Wed, 19 Aug 2020 15:19:33 +0530 Subject: tinyalsa: add plugin support for mmap/poll ops --- include/tinyalsa/plugin.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') 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 #include #include #include @@ -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. -- cgit v1.2.3