annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/alsa/pcm_extplug.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
rev   line source
jpayne@69 1 /**
jpayne@69 2 * \file include/pcm_extplug.h
jpayne@69 3 * \brief External Filter-Plugin SDK
jpayne@69 4 * \author Takashi Iwai <tiwai@suse.de>
jpayne@69 5 * \date 2005
jpayne@69 6 *
jpayne@69 7 * External Filter-Plugin SDK
jpayne@69 8 */
jpayne@69 9
jpayne@69 10 /*
jpayne@69 11 * ALSA external PCM plugin SDK (draft version)
jpayne@69 12 *
jpayne@69 13 * Copyright (c) 2005 Takashi Iwai <tiwai@suse.de>
jpayne@69 14 *
jpayne@69 15 * This library is free software; you can redistribute it and/or modify
jpayne@69 16 * it under the terms of the GNU Lesser General Public License as
jpayne@69 17 * published by the Free Software Foundation; either version 2.1 of
jpayne@69 18 * the License, or (at your option) any later version.
jpayne@69 19 *
jpayne@69 20 * This program is distributed in the hope that it will be useful,
jpayne@69 21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jpayne@69 22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
jpayne@69 23 * GNU Lesser General Public License for more details.
jpayne@69 24 *
jpayne@69 25 * You should have received a copy of the GNU Lesser General Public
jpayne@69 26 * License along with this library; if not, write to the Free Software
jpayne@69 27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
jpayne@69 28 *
jpayne@69 29 */
jpayne@69 30
jpayne@69 31 #ifndef __ALSA_PCM_EXTPLUG_H
jpayne@69 32 #define __ALSA_PCM_EXTPLUG_H
jpayne@69 33
jpayne@69 34 /**
jpayne@69 35 * \defgroup PCM_ExtPlug External Filter plugin SDK
jpayne@69 36 * \ingroup Plugin_SDK
jpayne@69 37 * See the \ref pcm page for more details.
jpayne@69 38 * \{
jpayne@69 39 */
jpayne@69 40
jpayne@69 41 /** hw constraints for extplug */
jpayne@69 42 enum {
jpayne@69 43 SND_PCM_EXTPLUG_HW_FORMAT, /**< format */
jpayne@69 44 SND_PCM_EXTPLUG_HW_CHANNELS, /**< channels */
jpayne@69 45 SND_PCM_EXTPLUG_HW_PARAMS /**< max number of hw constraints */
jpayne@69 46 };
jpayne@69 47
jpayne@69 48 /** Handle of external filter plugin */
jpayne@69 49 typedef struct snd_pcm_extplug snd_pcm_extplug_t;
jpayne@69 50 /** Callback table of extplug */
jpayne@69 51 typedef struct snd_pcm_extplug_callback snd_pcm_extplug_callback_t;
jpayne@69 52 #ifdef DOC_HIDDEN
jpayne@69 53 /* redefine typedefs for stupid doxygen */
jpayne@69 54 typedef snd_pcm_extplug snd_pcm_extplug_t;
jpayne@69 55 typedef snd_pcm_extplug_callback snd_pcm_extplug_callback_t;
jpayne@69 56 #endif
jpayne@69 57
jpayne@69 58 /*
jpayne@69 59 * Protocol version
jpayne@69 60 */
jpayne@69 61 #define SND_PCM_EXTPLUG_VERSION_MAJOR 1 /**< Protocol major version */
jpayne@69 62 #define SND_PCM_EXTPLUG_VERSION_MINOR 0 /**< Protocol minor version */
jpayne@69 63 #define SND_PCM_EXTPLUG_VERSION_TINY 2 /**< Protocol tiny version */
jpayne@69 64 /**
jpayne@69 65 * Filter-plugin protocol version
jpayne@69 66 */
jpayne@69 67 #define SND_PCM_EXTPLUG_VERSION ((SND_PCM_EXTPLUG_VERSION_MAJOR<<16) |\
jpayne@69 68 (SND_PCM_EXTPLUG_VERSION_MINOR<<8) |\
jpayne@69 69 (SND_PCM_EXTPLUG_VERSION_TINY))
jpayne@69 70
jpayne@69 71 /** Handle of extplug */
jpayne@69 72 struct snd_pcm_extplug {
jpayne@69 73 /**
jpayne@69 74 * protocol version; #SND_PCM_EXTPLUG_VERSION must be filled here
jpayne@69 75 * before calling #snd_pcm_extplug_create()
jpayne@69 76 */
jpayne@69 77 unsigned int version;
jpayne@69 78 /**
jpayne@69 79 * name of this plugin; must be filled before calling #snd_pcm_extplug_create()
jpayne@69 80 */
jpayne@69 81 const char *name;
jpayne@69 82 /**
jpayne@69 83 * callbacks of this plugin; must be filled before calling #snd_pcm_extplug_create()
jpayne@69 84 */
jpayne@69 85 const snd_pcm_extplug_callback_t *callback;
jpayne@69 86 /**
jpayne@69 87 * private data, which can be used freely in the driver callbacks
jpayne@69 88 */
jpayne@69 89 void *private_data;
jpayne@69 90 /**
jpayne@69 91 * PCM handle filled by #snd_pcm_extplug_create()
jpayne@69 92 */
jpayne@69 93 snd_pcm_t *pcm;
jpayne@69 94 /**
jpayne@69 95 * stream direction; read-only status
jpayne@69 96 */
jpayne@69 97 snd_pcm_stream_t stream;
jpayne@69 98 /**
jpayne@69 99 * format hw parameter; filled after hw_params is caled
jpayne@69 100 */
jpayne@69 101 snd_pcm_format_t format;
jpayne@69 102 /**
jpayne@69 103 * subformat hw parameter; filled after hw_params is caled
jpayne@69 104 */
jpayne@69 105 snd_pcm_subformat_t subformat;
jpayne@69 106 /**
jpayne@69 107 * channels hw parameter; filled after hw_params is caled
jpayne@69 108 */
jpayne@69 109 unsigned int channels;
jpayne@69 110 /**
jpayne@69 111 * rate hw parameter; filled after hw_params is caled
jpayne@69 112 */
jpayne@69 113 unsigned int rate;
jpayne@69 114 /**
jpayne@69 115 * slave_format hw parameter; filled after hw_params is caled
jpayne@69 116 */
jpayne@69 117 snd_pcm_format_t slave_format;
jpayne@69 118 /**
jpayne@69 119 * slave_subformat hw parameter; filled after hw_params is caled
jpayne@69 120 */
jpayne@69 121 snd_pcm_subformat_t slave_subformat;
jpayne@69 122 /**
jpayne@69 123 * slave_channels hw parameter; filled after hw_params is caled
jpayne@69 124 */
jpayne@69 125 unsigned int slave_channels;
jpayne@69 126 };
jpayne@69 127
jpayne@69 128 /** Callback table of extplug */
jpayne@69 129 struct snd_pcm_extplug_callback {
jpayne@69 130 /**
jpayne@69 131 * transfer between source and destination; this is a required callback
jpayne@69 132 */
jpayne@69 133 snd_pcm_sframes_t (*transfer)(snd_pcm_extplug_t *ext,
jpayne@69 134 const snd_pcm_channel_area_t *dst_areas,
jpayne@69 135 snd_pcm_uframes_t dst_offset,
jpayne@69 136 const snd_pcm_channel_area_t *src_areas,
jpayne@69 137 snd_pcm_uframes_t src_offset,
jpayne@69 138 snd_pcm_uframes_t size);
jpayne@69 139 /**
jpayne@69 140 * close the PCM; optional
jpayne@69 141 */
jpayne@69 142 int (*close)(snd_pcm_extplug_t *ext);
jpayne@69 143 /**
jpayne@69 144 * hw_params; optional
jpayne@69 145 */
jpayne@69 146 int (*hw_params)(snd_pcm_extplug_t *ext, snd_pcm_hw_params_t *params);
jpayne@69 147 /**
jpayne@69 148 * hw_free; optional
jpayne@69 149 */
jpayne@69 150 int (*hw_free)(snd_pcm_extplug_t *ext);
jpayne@69 151 /**
jpayne@69 152 * dump; optional
jpayne@69 153 */
jpayne@69 154 void (*dump)(snd_pcm_extplug_t *ext, snd_output_t *out);
jpayne@69 155 /**
jpayne@69 156 * init; optional initialization called at prepare or reset
jpayne@69 157 */
jpayne@69 158 int (*init)(snd_pcm_extplug_t *ext);
jpayne@69 159 /**
jpayne@69 160 * query the channel maps; optional; since v1.0.2
jpayne@69 161 */
jpayne@69 162 snd_pcm_chmap_query_t **(*query_chmaps)(snd_pcm_extplug_t *ext);
jpayne@69 163 /**
jpayne@69 164 * get the channel map; optional; since v1.0.2
jpayne@69 165 */
jpayne@69 166 snd_pcm_chmap_t *(*get_chmap)(snd_pcm_extplug_t *ext);
jpayne@69 167 /**
jpayne@69 168 * set the channel map; optional; since v1.0.2
jpayne@69 169 */
jpayne@69 170 int (*set_chmap)(snd_pcm_extplug_t *ext, const snd_pcm_chmap_t *map);
jpayne@69 171 };
jpayne@69 172
jpayne@69 173
jpayne@69 174 int snd_pcm_extplug_create(snd_pcm_extplug_t *ext, const char *name,
jpayne@69 175 snd_config_t *root, snd_config_t *slave_conf,
jpayne@69 176 snd_pcm_stream_t stream, int mode);
jpayne@69 177 int snd_pcm_extplug_delete(snd_pcm_extplug_t *ext);
jpayne@69 178
jpayne@69 179 /* clear hw_parameter setting */
jpayne@69 180 void snd_pcm_extplug_params_reset(snd_pcm_extplug_t *ext);
jpayne@69 181
jpayne@69 182 /* hw_parameter setting */
jpayne@69 183 int snd_pcm_extplug_set_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list);
jpayne@69 184 int snd_pcm_extplug_set_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max);
jpayne@69 185 int snd_pcm_extplug_set_slave_param_list(snd_pcm_extplug_t *extplug, int type, unsigned int num_list, const unsigned int *list);
jpayne@69 186 int snd_pcm_extplug_set_slave_param_minmax(snd_pcm_extplug_t *extplug, int type, unsigned int min, unsigned int max);
jpayne@69 187 int snd_pcm_extplug_set_param_link(snd_pcm_extplug_t *extplug, int type,
jpayne@69 188 int keep_link);
jpayne@69 189
jpayne@69 190 /**
jpayne@69 191 * set the parameter constraint with a single value
jpayne@69 192 */
jpayne@69 193 static __inline__ int snd_pcm_extplug_set_param(snd_pcm_extplug_t *extplug, int type, unsigned int val)
jpayne@69 194 {
jpayne@69 195 return snd_pcm_extplug_set_param_list(extplug, type, 1, &val);
jpayne@69 196 }
jpayne@69 197
jpayne@69 198 /**
jpayne@69 199 * set the parameter constraint for slave PCM with a single value
jpayne@69 200 */
jpayne@69 201 static __inline__ int snd_pcm_extplug_set_slave_param(snd_pcm_extplug_t *extplug, int type, unsigned int val)
jpayne@69 202 {
jpayne@69 203 return snd_pcm_extplug_set_slave_param_list(extplug, type, 1, &val);
jpayne@69 204 }
jpayne@69 205
jpayne@69 206 /** \} */
jpayne@69 207
jpayne@69 208 #endif /* __ALSA_PCM_EXTPLUG_H */