jpayne@69: /** jpayne@69: * \file include/pcm_plugin.h jpayne@69: * \brief Common PCM plugin code jpayne@69: * \author Abramo Bagnara jpayne@69: * \author Jaroslav Kysela jpayne@69: * \date 2000-2001 jpayne@69: * jpayne@69: * Application interface library for the ALSA driver. jpayne@69: * See the \ref pcm_plugins page for more details. jpayne@69: * jpayne@69: * \warning Using of contents of this header file might be dangerous jpayne@69: * in the sense of compatibility reasons. The contents might be jpayne@69: * freely changed in future. jpayne@69: */ jpayne@69: /* jpayne@69: * This library is free software; you can redistribute it and/or modify jpayne@69: * it under the terms of the GNU Lesser General Public License as jpayne@69: * published by the Free Software Foundation; either version 2.1 of jpayne@69: * the License, or (at your option) any later version. jpayne@69: * jpayne@69: * This program is distributed in the hope that it will be useful, jpayne@69: * but WITHOUT ANY WARRANTY; without even the implied warranty of jpayne@69: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jpayne@69: * GNU Lesser General Public License for more details. jpayne@69: * jpayne@69: * You should have received a copy of the GNU Lesser General Public jpayne@69: * License along with this library; if not, write to the Free Software jpayne@69: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: #ifndef __ALSA_PCM_PLUGIN_H jpayne@69: #define __ALSA_PCM_PLUGIN_H jpayne@69: jpayne@69: /** jpayne@69: * \defgroup PCM_Plugins PCM Plugins jpayne@69: * \ingroup PCM jpayne@69: * See the \ref pcm_plugins page for more details. jpayne@69: * \{ jpayne@69: */ jpayne@69: jpayne@69: #define SND_PCM_PLUGIN_RATE_MIN 4000 /**< minimal rate for the rate plugin */ jpayne@69: #define SND_PCM_PLUGIN_RATE_MAX 768000 /**< maximal rate for the rate plugin */ jpayne@69: jpayne@69: /* ROUTE_FLOAT should be set to 0 for machines without FP unit - like iPAQ */ jpayne@69: #ifdef HAVE_SOFT_FLOAT jpayne@69: #define SND_PCM_PLUGIN_ROUTE_FLOAT 0 /**< use integers for route plugin */ jpayne@69: #else jpayne@69: #define SND_PCM_PLUGIN_ROUTE_FLOAT 1 /**< use floats for route plugin */ jpayne@69: #endif jpayne@69: jpayne@69: #define SND_PCM_PLUGIN_ROUTE_RESOLUTION 16 /**< integer resolution for route plugin */ jpayne@69: jpayne@69: #if SND_PCM_PLUGIN_ROUTE_FLOAT jpayne@69: /** route ttable entry type */ jpayne@69: typedef float snd_pcm_route_ttable_entry_t; jpayne@69: #define SND_PCM_PLUGIN_ROUTE_HALF 0.5 /**< half value */ jpayne@69: #define SND_PCM_PLUGIN_ROUTE_FULL 1.0 /**< full value */ jpayne@69: #else jpayne@69: /** route ttable entry type */ jpayne@69: typedef int snd_pcm_route_ttable_entry_t; jpayne@69: #define SND_PCM_PLUGIN_ROUTE_HALF (SND_PCM_PLUGIN_ROUTE_RESOLUTION / 2) /**< half value */ jpayne@69: #define SND_PCM_PLUGIN_ROUTE_FULL SND_PCM_PLUGIN_ROUTE_RESOLUTION /**< full value */ jpayne@69: #endif jpayne@69: jpayne@69: /* jpayne@69: * Hardware plugin jpayne@69: */ jpayne@69: int snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name, jpayne@69: int card, int device, int subdevice, jpayne@69: snd_pcm_stream_t stream, int mode, jpayne@69: int mmap_emulation, int sync_ptr_ioctl); jpayne@69: int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *root ATTRIBUTE_UNUSED, snd_config_t *conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: jpayne@69: /* jpayne@69: * Copy plugin jpayne@69: */ jpayne@69: int snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_pcm_t *slave, int close_slave); jpayne@69: int _snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *root, snd_config_t *conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: jpayne@69: /* jpayne@69: * Linear conversion plugin jpayne@69: */ jpayne@69: int snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_pcm_format_t sformat, snd_pcm_t *slave, jpayne@69: int close_slave); jpayne@69: int _snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *root, snd_config_t *conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: jpayne@69: /* jpayne@69: * Linear<->Float conversion plugin jpayne@69: */ jpayne@69: int snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_pcm_format_t sformat, snd_pcm_t *slave, jpayne@69: int close_slave); jpayne@69: int _snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *root, snd_config_t *conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: jpayne@69: /* jpayne@69: * Linear<->mu-Law conversion plugin jpayne@69: */ jpayne@69: int snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_pcm_format_t sformat, snd_pcm_t *slave, jpayne@69: int close_slave); jpayne@69: int _snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *root, snd_config_t *conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: jpayne@69: /* jpayne@69: * Linear<->a-Law conversion plugin jpayne@69: */ jpayne@69: int snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_pcm_format_t sformat, snd_pcm_t *slave, jpayne@69: int close_slave); jpayne@69: int _snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *root, snd_config_t *conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: jpayne@69: /* jpayne@69: * Linear<->Ima-ADPCM conversion plugin jpayne@69: */ jpayne@69: int snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_pcm_format_t sformat, snd_pcm_t *slave, jpayne@69: int close_slave); jpayne@69: int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *root, snd_config_t *conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: jpayne@69: /* jpayne@69: * Route plugin for linear formats jpayne@69: */ jpayne@69: int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *ttable, jpayne@69: unsigned int tt_csize, unsigned int tt_ssize, jpayne@69: unsigned int *tt_cused, unsigned int *tt_sused, jpayne@69: int schannels); jpayne@69: int snd_pcm_route_determine_ttable(snd_config_t *tt, jpayne@69: unsigned int *tt_csize, jpayne@69: unsigned int *tt_ssize); jpayne@69: int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_pcm_format_t sformat, int schannels, jpayne@69: snd_pcm_route_ttable_entry_t *ttable, jpayne@69: unsigned int tt_ssize, jpayne@69: unsigned int tt_cused, unsigned int tt_sused, jpayne@69: snd_pcm_t *slave, int close_slave); jpayne@69: int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *root, snd_config_t *conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: jpayne@69: /* jpayne@69: * Rate plugin for linear formats jpayne@69: */ jpayne@69: int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_pcm_format_t sformat, unsigned int srate, jpayne@69: const snd_config_t *converter, jpayne@69: snd_pcm_t *slave, int close_slave); jpayne@69: int _snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *root, snd_config_t *conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: jpayne@69: /* jpayne@69: * Hooks plugin jpayne@69: */ jpayne@69: int snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_pcm_t *slave, int close_slave); jpayne@69: int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *root, snd_config_t *conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: jpayne@69: /* jpayne@69: * LADSPA plugin jpayne@69: */ jpayne@69: int snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name, jpayne@69: const char *ladspa_path, jpayne@69: unsigned int channels, jpayne@69: snd_config_t *ladspa_pplugins, jpayne@69: snd_config_t *ladspa_cplugins, jpayne@69: snd_pcm_t *slave, int close_slave); jpayne@69: int _snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *root, snd_config_t *conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: jpayne@69: /* jpayne@69: * Jack plugin jpayne@69: */ jpayne@69: int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *playback_conf, jpayne@69: snd_config_t *capture_conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: int _snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name, jpayne@69: snd_config_t *root, snd_config_t *conf, jpayne@69: snd_pcm_stream_t stream, int mode); jpayne@69: jpayne@69: jpayne@69: /** \} */ jpayne@69: jpayne@69: #endif /* __ALSA_PCM_PLUGIN_H */