pcm_plugin.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /**
  2. * \file include/pcm_plugin.h
  3. * \brief Common PCM plugin code
  4. * \author Abramo Bagnara <abramo@alsa-project.org>
  5. * \author Jaroslav Kysela <perex@perex.cz>
  6. * \date 2000-2001
  7. *
  8. * Application interface library for the ALSA driver.
  9. * See the \ref pcm_plugins page for more details.
  10. *
  11. * \warning Using of contents of this header file might be dangerous
  12. * in the sense of compatibility reasons. The contents might be
  13. * freely changed in future.
  14. */
  15. /*
  16. * This library is free software; you can redistribute it and/or modify
  17. * it under the terms of the GNU Lesser General Public License as
  18. * published by the Free Software Foundation; either version 2.1 of
  19. * the License, or (at your option) any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU Lesser General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU Lesser General Public
  27. * License along with this library; if not, write to the Free Software
  28. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  29. *
  30. */
  31. #ifndef __ALSA_PCM_PLUGIN_H
  32. /**
  33. * \defgroup PCM_Plugins PCM Plugins
  34. * \ingroup PCM
  35. * See the \ref pcm_plugins page for more details.
  36. * \{
  37. */
  38. #define SND_PCM_PLUGIN_RATE_MIN 4000 /**< minimal rate for the rate plugin */
  39. #define SND_PCM_PLUGIN_RATE_MAX 192000 /**< maximal rate for the rate plugin */
  40. /* ROUTE_FLOAT should be set to 0 for machines without FP unit - like iPAQ */
  41. #ifdef HAVE_SOFT_FLOAT
  42. #define SND_PCM_PLUGIN_ROUTE_FLOAT 0 /**< use integers for route plugin */
  43. #else
  44. #define SND_PCM_PLUGIN_ROUTE_FLOAT 1 /**< use floats for route plugin */
  45. #endif
  46. #define SND_PCM_PLUGIN_ROUTE_RESOLUTION 16 /**< integer resolution for route plugin */
  47. #if SND_PCM_PLUGIN_ROUTE_FLOAT
  48. /** route ttable entry type */
  49. typedef float snd_pcm_route_ttable_entry_t;
  50. #define SND_PCM_PLUGIN_ROUTE_HALF 0.5 /**< half value */
  51. #define SND_PCM_PLUGIN_ROUTE_FULL 1.0 /**< full value */
  52. #else
  53. /** route ttable entry type */
  54. typedef int snd_pcm_route_ttable_entry_t;
  55. #define SND_PCM_PLUGIN_ROUTE_HALF (SND_PCM_PLUGIN_ROUTE_RESOLUTION / 2) /**< half value */
  56. #define SND_PCM_PLUGIN_ROUTE_FULL SND_PCM_PLUGIN_ROUTE_RESOLUTION /**< full value */
  57. #endif
  58. /*
  59. * Hardware plugin
  60. */
  61. int snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
  62. int card, int device, int subdevice,
  63. snd_pcm_stream_t stream, int mode,
  64. int mmap_emulation, int sync_ptr_ioctl);
  65. int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name,
  66. snd_config_t *root ATTRIBUTE_UNUSED, snd_config_t *conf,
  67. snd_pcm_stream_t stream, int mode);
  68. /*
  69. * Copy plugin
  70. */
  71. int snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name,
  72. snd_pcm_t *slave, int close_slave);
  73. int _snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name,
  74. snd_config_t *root, snd_config_t *conf,
  75. snd_pcm_stream_t stream, int mode);
  76. /*
  77. * Linear conversion plugin
  78. */
  79. int snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name,
  80. snd_pcm_format_t sformat, snd_pcm_t *slave,
  81. int close_slave);
  82. int _snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name,
  83. snd_config_t *root, snd_config_t *conf,
  84. snd_pcm_stream_t stream, int mode);
  85. /*
  86. * Linear<->Float conversion plugin
  87. */
  88. int snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name,
  89. snd_pcm_format_t sformat, snd_pcm_t *slave,
  90. int close_slave);
  91. int _snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name,
  92. snd_config_t *root, snd_config_t *conf,
  93. snd_pcm_stream_t stream, int mode);
  94. /*
  95. * Linear<->mu-Law conversion plugin
  96. */
  97. int snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name,
  98. snd_pcm_format_t sformat, snd_pcm_t *slave,
  99. int close_slave);
  100. int _snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name,
  101. snd_config_t *root, snd_config_t *conf,
  102. snd_pcm_stream_t stream, int mode);
  103. /*
  104. * Linear<->a-Law conversion plugin
  105. */
  106. int snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name,
  107. snd_pcm_format_t sformat, snd_pcm_t *slave,
  108. int close_slave);
  109. int _snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name,
  110. snd_config_t *root, snd_config_t *conf,
  111. snd_pcm_stream_t stream, int mode);
  112. /*
  113. * Linear<->Ima-ADPCM conversion plugin
  114. */
  115. int snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name,
  116. snd_pcm_format_t sformat, snd_pcm_t *slave,
  117. int close_slave);
  118. int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name,
  119. snd_config_t *root, snd_config_t *conf,
  120. snd_pcm_stream_t stream, int mode);
  121. /*
  122. * Route plugin for linear formats
  123. */
  124. int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *ttable,
  125. unsigned int tt_csize, unsigned int tt_ssize,
  126. unsigned int *tt_cused, unsigned int *tt_sused,
  127. int schannels);
  128. int snd_pcm_route_determine_ttable(snd_config_t *tt,
  129. unsigned int *tt_csize,
  130. unsigned int *tt_ssize);
  131. int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
  132. snd_pcm_format_t sformat, int schannels,
  133. snd_pcm_route_ttable_entry_t *ttable,
  134. unsigned int tt_ssize,
  135. unsigned int tt_cused, unsigned int tt_sused,
  136. snd_pcm_t *slave, int close_slave);
  137. int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
  138. snd_config_t *root, snd_config_t *conf,
  139. snd_pcm_stream_t stream, int mode);
  140. /*
  141. * Rate plugin for linear formats
  142. */
  143. int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
  144. snd_pcm_format_t sformat, unsigned int srate,
  145. const snd_config_t *converter,
  146. snd_pcm_t *slave, int close_slave);
  147. int _snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
  148. snd_config_t *root, snd_config_t *conf,
  149. snd_pcm_stream_t stream, int mode);
  150. /*
  151. * Hooks plugin
  152. */
  153. int snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
  154. snd_pcm_t *slave, int close_slave);
  155. int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
  156. snd_config_t *root, snd_config_t *conf,
  157. snd_pcm_stream_t stream, int mode);
  158. /*
  159. * LADSPA plugin
  160. */
  161. int snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name,
  162. const char *ladspa_path,
  163. unsigned int channels,
  164. snd_config_t *ladspa_pplugins,
  165. snd_config_t *ladspa_cplugins,
  166. snd_pcm_t *slave, int close_slave);
  167. int _snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name,
  168. snd_config_t *root, snd_config_t *conf,
  169. snd_pcm_stream_t stream, int mode);
  170. /*
  171. * Jack plugin
  172. */
  173. int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
  174. snd_config_t *playback_conf,
  175. snd_config_t *capture_conf,
  176. snd_pcm_stream_t stream, int mode);
  177. int _snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
  178. snd_config_t *root, snd_config_t *conf,
  179. snd_pcm_stream_t stream, int mode);
  180. /** \} */
  181. #endif /* __ALSA_PCM_PLUGIN_H */