1d5ac70f0Sopenharmony_ci/*
2d5ac70f0Sopenharmony_ci *  PCM - Common generic plugin code
3d5ac70f0Sopenharmony_ci *  Copyright (c) 2004 by Jaroslav Kysela <perex@perex.cz>
4d5ac70f0Sopenharmony_ci *
5d5ac70f0Sopenharmony_ci *
6d5ac70f0Sopenharmony_ci *   This library is free software; you can redistribute it and/or modify
7d5ac70f0Sopenharmony_ci *   it under the terms of the GNU Lesser General Public License as
8d5ac70f0Sopenharmony_ci *   published by the Free Software Foundation; either version 2.1 of
9d5ac70f0Sopenharmony_ci *   the License, or (at your option) any later version.
10d5ac70f0Sopenharmony_ci *
11d5ac70f0Sopenharmony_ci *   This program is distributed in the hope that it will be useful,
12d5ac70f0Sopenharmony_ci *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13d5ac70f0Sopenharmony_ci *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14d5ac70f0Sopenharmony_ci *   GNU Lesser General Public License for more details.
15d5ac70f0Sopenharmony_ci *
16d5ac70f0Sopenharmony_ci *   You should have received a copy of the GNU Lesser General Public
17d5ac70f0Sopenharmony_ci *   License along with this library; if not, write to the Free Software
18d5ac70f0Sopenharmony_ci *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19d5ac70f0Sopenharmony_ci *
20d5ac70f0Sopenharmony_ci */
21d5ac70f0Sopenharmony_ci
22d5ac70f0Sopenharmony_citypedef struct {
23d5ac70f0Sopenharmony_ci	snd_pcm_t *slave;
24d5ac70f0Sopenharmony_ci	int close_slave;
25d5ac70f0Sopenharmony_ci} snd_pcm_generic_t;
26d5ac70f0Sopenharmony_ci
27d5ac70f0Sopenharmony_ci/* make local functions really local */
28d5ac70f0Sopenharmony_ci#define snd_pcm_generic_close \
29d5ac70f0Sopenharmony_ci	snd1_pcm_generic_close
30d5ac70f0Sopenharmony_ci#define snd_pcm_generic_nonblock \
31d5ac70f0Sopenharmony_ci	snd1_pcm_generic_nonblock
32d5ac70f0Sopenharmony_ci#define snd_pcm_generic_async \
33d5ac70f0Sopenharmony_ci	snd1_pcm_generic_async
34d5ac70f0Sopenharmony_ci#define snd_pcm_generic_poll_descriptors_count \
35d5ac70f0Sopenharmony_ci	snd1_pcm_generic_poll_descriptors_count
36d5ac70f0Sopenharmony_ci#define snd_pcm_generic_poll_descriptors \
37d5ac70f0Sopenharmony_ci	snd1_pcm_generic_poll_descriptors
38d5ac70f0Sopenharmony_ci#define snd_pcm_generic_poll_revents \
39d5ac70f0Sopenharmony_ci	snd1_pcm_generic_poll_revents
40d5ac70f0Sopenharmony_ci#define snd_pcm_generic_info \
41d5ac70f0Sopenharmony_ci	snd1_pcm_generic_info
42d5ac70f0Sopenharmony_ci#define snd_pcm_generic_hw_free \
43d5ac70f0Sopenharmony_ci	snd1_pcm_generic_hw_free
44d5ac70f0Sopenharmony_ci#define snd_pcm_generic_sw_params \
45d5ac70f0Sopenharmony_ci	snd1_pcm_generic_sw_params
46d5ac70f0Sopenharmony_ci#define snd_pcm_generic_hw_refine \
47d5ac70f0Sopenharmony_ci	snd1_pcm_generic_hw_refine
48d5ac70f0Sopenharmony_ci#define snd_pcm_generic_hw_params \
49d5ac70f0Sopenharmony_ci	snd1_pcm_generic_hw_params
50d5ac70f0Sopenharmony_ci#define snd_pcm_generic_channel_info \
51d5ac70f0Sopenharmony_ci	snd1_pcm_generic_channel_info
52d5ac70f0Sopenharmony_ci#define snd_pcm_generic_channel_info_no_buffer \
53d5ac70f0Sopenharmony_ci	snd1_pcm_generic_channel_info_no_buffer
54d5ac70f0Sopenharmony_ci#define snd_pcm_generic_status \
55d5ac70f0Sopenharmony_ci	snd1_pcm_generic_status
56d5ac70f0Sopenharmony_ci#define snd_pcm_generic_state \
57d5ac70f0Sopenharmony_ci	snd1_pcm_generic_state
58d5ac70f0Sopenharmony_ci#define snd_pcm_generic_prepare \
59d5ac70f0Sopenharmony_ci	snd1_pcm_generic_prepare
60d5ac70f0Sopenharmony_ci#define snd_pcm_generic_hwsync \
61d5ac70f0Sopenharmony_ci	snd1_pcm_generic_hwsync
62d5ac70f0Sopenharmony_ci#define snd_pcm_generic_reset \
63d5ac70f0Sopenharmony_ci	snd1_pcm_generic_reset
64d5ac70f0Sopenharmony_ci#define snd_pcm_generic_start \
65d5ac70f0Sopenharmony_ci	snd1_pcm_generic_start
66d5ac70f0Sopenharmony_ci#define snd_pcm_generic_drop \
67d5ac70f0Sopenharmony_ci	snd1_pcm_generic_drop
68d5ac70f0Sopenharmony_ci#define snd_pcm_generic_drain \
69d5ac70f0Sopenharmony_ci	snd1_pcm_generic_drain
70d5ac70f0Sopenharmony_ci#define snd_pcm_generic_pause \
71d5ac70f0Sopenharmony_ci	snd1_pcm_generic_pause
72d5ac70f0Sopenharmony_ci#define snd_pcm_generic_resume \
73d5ac70f0Sopenharmony_ci	snd1_pcm_generic_resume
74d5ac70f0Sopenharmony_ci#define snd_pcm_generic_delay \
75d5ac70f0Sopenharmony_ci	snd1_pcm_generic_delay
76d5ac70f0Sopenharmony_ci#define snd_pcm_generic_forwardable \
77d5ac70f0Sopenharmony_ci	snd1_pcm_generic_forwardable
78d5ac70f0Sopenharmony_ci#define snd_pcm_generic_forward \
79d5ac70f0Sopenharmony_ci	snd1_pcm_generic_forward
80d5ac70f0Sopenharmony_ci#define snd_pcm_generic_rewindable \
81d5ac70f0Sopenharmony_ci	snd1_pcm_generic_rewindable
82d5ac70f0Sopenharmony_ci#define snd_pcm_generic_rewind \
83d5ac70f0Sopenharmony_ci	snd1_pcm_generic_rewind
84d5ac70f0Sopenharmony_ci#define snd_pcm_generic_link \
85d5ac70f0Sopenharmony_ci	snd1_pcm_generic_link
86d5ac70f0Sopenharmony_ci#define snd_pcm_generic_link_slaves \
87d5ac70f0Sopenharmony_ci	snd1_pcm_generic_link_slaves
88d5ac70f0Sopenharmony_ci#define snd_pcm_generic_unlink \
89d5ac70f0Sopenharmony_ci	snd1_pcm_generic_unlink
90d5ac70f0Sopenharmony_ci#define snd_pcm_generic_writei \
91d5ac70f0Sopenharmony_ci	snd1_pcm_generic_writei
92d5ac70f0Sopenharmony_ci#define snd_pcm_generic_writen \
93d5ac70f0Sopenharmony_ci	snd1_pcm_generic_writen
94d5ac70f0Sopenharmony_ci#define snd_pcm_generic_readi \
95d5ac70f0Sopenharmony_ci	snd1_pcm_generic_readi
96d5ac70f0Sopenharmony_ci#define snd_pcm_generic_readn \
97d5ac70f0Sopenharmony_ci	snd1_pcm_generic_readn
98d5ac70f0Sopenharmony_ci#define snd_pcm_generic_mmap_commit \
99d5ac70f0Sopenharmony_ci	snd1_pcm_generic_mmap_commit
100d5ac70f0Sopenharmony_ci#define snd_pcm_generic_avail_update	\
101d5ac70f0Sopenharmony_ci	snd1_pcm_generic_avail_update
102d5ac70f0Sopenharmony_ci#define snd_pcm_generic_mmap \
103d5ac70f0Sopenharmony_ci	snd1_pcm_generic_mmap
104d5ac70f0Sopenharmony_ci#define snd_pcm_generic_munmap \
105d5ac70f0Sopenharmony_ci	snd1_pcm_generic_munmap
106d5ac70f0Sopenharmony_ci#define snd_pcm_generic_query_chmaps \
107d5ac70f0Sopenharmony_ci	snd1_pcm_generic_query_chmaps
108d5ac70f0Sopenharmony_ci#define snd_pcm_generic_get_chmap \
109d5ac70f0Sopenharmony_ci	snd1_pcm_generic_get_chmap
110d5ac70f0Sopenharmony_ci#define snd_pcm_generic_set_chmap \
111d5ac70f0Sopenharmony_ci	snd1_pcm_generic_set_chmap
112d5ac70f0Sopenharmony_ci#define snd_pcm_generic_may_wait_for_avail_min \
113d5ac70f0Sopenharmony_ci	snd1_pcm_generic_may_wait_for_avail_min
114d5ac70f0Sopenharmony_ci
115d5ac70f0Sopenharmony_ciint snd_pcm_generic_close(snd_pcm_t *pcm);
116d5ac70f0Sopenharmony_ciint snd_pcm_generic_nonblock(snd_pcm_t *pcm, int nonblock);
117d5ac70f0Sopenharmony_ciint snd_pcm_generic_async(snd_pcm_t *pcm, int sig, pid_t pid);
118d5ac70f0Sopenharmony_ciint snd_pcm_generic_poll_descriptors_count(snd_pcm_t *pcm);
119d5ac70f0Sopenharmony_ciint snd_pcm_generic_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space);
120d5ac70f0Sopenharmony_ciint snd_pcm_generic_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
121d5ac70f0Sopenharmony_ciint snd_pcm_generic_info(snd_pcm_t *pcm, snd_pcm_info_t * info);
122d5ac70f0Sopenharmony_ciint snd_pcm_generic_hw_free(snd_pcm_t *pcm);
123d5ac70f0Sopenharmony_ciint snd_pcm_generic_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params);
124d5ac70f0Sopenharmony_ciint snd_pcm_generic_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
125d5ac70f0Sopenharmony_ciint snd_pcm_generic_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params);
126d5ac70f0Sopenharmony_ciint snd_pcm_generic_channel_info(snd_pcm_t *pcm, snd_pcm_channel_info_t * info);
127d5ac70f0Sopenharmony_ciint snd_pcm_generic_channel_info_no_buffer(snd_pcm_t *pcm, snd_pcm_channel_info_t * info);
128d5ac70f0Sopenharmony_ciint snd_pcm_generic_status(snd_pcm_t *pcm, snd_pcm_status_t * status);
129d5ac70f0Sopenharmony_cisnd_pcm_state_t snd_pcm_generic_state(snd_pcm_t *pcm);
130d5ac70f0Sopenharmony_ciint snd_pcm_generic_prepare(snd_pcm_t *pcm);
131d5ac70f0Sopenharmony_ciint snd_pcm_generic_hwsync(snd_pcm_t *pcm);
132d5ac70f0Sopenharmony_ciint snd_pcm_generic_reset(snd_pcm_t *pcm);
133d5ac70f0Sopenharmony_ciint snd_pcm_generic_start(snd_pcm_t *pcm);
134d5ac70f0Sopenharmony_ciint snd_pcm_generic_drop(snd_pcm_t *pcm);
135d5ac70f0Sopenharmony_ciint snd_pcm_generic_drain(snd_pcm_t *pcm);
136d5ac70f0Sopenharmony_ciint snd_pcm_generic_pause(snd_pcm_t *pcm, int enable);
137d5ac70f0Sopenharmony_ciint snd_pcm_generic_resume(snd_pcm_t *pcm);
138d5ac70f0Sopenharmony_ciint snd_pcm_generic_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
139d5ac70f0Sopenharmony_cisnd_pcm_sframes_t snd_pcm_generic_forwardable(snd_pcm_t *pcm);
140d5ac70f0Sopenharmony_cisnd_pcm_sframes_t snd_pcm_generic_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
141d5ac70f0Sopenharmony_cisnd_pcm_sframes_t snd_pcm_generic_rewindable(snd_pcm_t *pcm);
142d5ac70f0Sopenharmony_cisnd_pcm_sframes_t snd_pcm_generic_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
143d5ac70f0Sopenharmony_ciint snd_pcm_generic_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2);
144d5ac70f0Sopenharmony_ciint snd_pcm_generic_link_slaves(snd_pcm_t *pcm, snd_pcm_t *master);
145d5ac70f0Sopenharmony_ciint snd_pcm_generic_unlink(snd_pcm_t *pcm);
146d5ac70f0Sopenharmony_cisnd_pcm_sframes_t snd_pcm_generic_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size);
147d5ac70f0Sopenharmony_cisnd_pcm_sframes_t snd_pcm_generic_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
148d5ac70f0Sopenharmony_cisnd_pcm_sframes_t snd_pcm_generic_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size);
149d5ac70f0Sopenharmony_cisnd_pcm_sframes_t snd_pcm_generic_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size);
150d5ac70f0Sopenharmony_cisnd_pcm_sframes_t snd_pcm_generic_mmap_commit(snd_pcm_t *pcm,
151d5ac70f0Sopenharmony_ci					      snd_pcm_uframes_t offset,
152d5ac70f0Sopenharmony_ci					      snd_pcm_uframes_t size);
153d5ac70f0Sopenharmony_cisnd_pcm_sframes_t snd_pcm_generic_avail_update(snd_pcm_t *pcm);
154d5ac70f0Sopenharmony_ciint snd_pcm_generic_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail,
155d5ac70f0Sopenharmony_ci			       snd_htimestamp_t *timestamp);
156d5ac70f0Sopenharmony_ciint snd_pcm_generic_real_htimestamp(snd_pcm_t *pcm, snd_pcm_uframes_t *avail,
157d5ac70f0Sopenharmony_ci				    snd_htimestamp_t *tstamp);
158d5ac70f0Sopenharmony_ciint snd_pcm_generic_mmap(snd_pcm_t *pcm);
159d5ac70f0Sopenharmony_ciint snd_pcm_generic_munmap(snd_pcm_t *pcm);
160d5ac70f0Sopenharmony_cisnd_pcm_chmap_query_t **snd_pcm_generic_query_chmaps(snd_pcm_t *pcm);
161d5ac70f0Sopenharmony_cisnd_pcm_chmap_t *snd_pcm_generic_get_chmap(snd_pcm_t *pcm);
162d5ac70f0Sopenharmony_ciint snd_pcm_generic_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map);
163d5ac70f0Sopenharmony_ciint snd_pcm_generic_may_wait_for_avail_min(snd_pcm_t *pcm, snd_pcm_uframes_t avail);
164d5ac70f0Sopenharmony_ci
165