pcm_local.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * pcm_local.h - a local header file for snd-pcm module.
  3. *
  4. * Copyright (c) Takashi Sakamoto <o-takashi@sakamocchi.jp>
  5. *
  6. * Licensed under the terms of the GNU General Public License, version 2.
  7. */
  8. #ifndef __SOUND_CORE_PCM_LOCAL_H
  9. #define __SOUND_CORE_PCM_LOCAL_H
  10. extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates;
  11. void snd_interval_mul(const struct snd_interval *a,
  12. const struct snd_interval *b, struct snd_interval *c);
  13. void snd_interval_div(const struct snd_interval *a,
  14. const struct snd_interval *b, struct snd_interval *c);
  15. void snd_interval_muldivk(const struct snd_interval *a,
  16. const struct snd_interval *b,
  17. unsigned int k, struct snd_interval *c);
  18. void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k,
  19. const struct snd_interval *b, struct snd_interval *c);
  20. int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream);
  21. int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream);
  22. int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime,
  23. snd_pcm_hw_param_t var, u_int32_t mask);
  24. int pcm_lib_apply_appl_ptr(struct snd_pcm_substream *substream,
  25. snd_pcm_uframes_t appl_ptr);
  26. int snd_pcm_update_state(struct snd_pcm_substream *substream,
  27. struct snd_pcm_runtime *runtime);
  28. int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream);
  29. void snd_pcm_playback_silence(struct snd_pcm_substream *substream,
  30. snd_pcm_uframes_t new_hw_ptr);
  31. static inline snd_pcm_uframes_t
  32. snd_pcm_avail(struct snd_pcm_substream *substream)
  33. {
  34. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  35. return snd_pcm_playback_avail(substream->runtime);
  36. else
  37. return snd_pcm_capture_avail(substream->runtime);
  38. }
  39. static inline snd_pcm_uframes_t
  40. snd_pcm_hw_avail(struct snd_pcm_substream *substream)
  41. {
  42. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  43. return snd_pcm_playback_hw_avail(substream->runtime);
  44. else
  45. return snd_pcm_capture_hw_avail(substream->runtime);
  46. }
  47. #ifdef CONFIG_SND_PCM_TIMER
  48. void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream);
  49. void snd_pcm_timer_init(struct snd_pcm_substream *substream);
  50. void snd_pcm_timer_done(struct snd_pcm_substream *substream);
  51. #else
  52. static inline void
  53. snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream) {}
  54. static inline void snd_pcm_timer_init(struct snd_pcm_substream *substream) {}
  55. static inline void snd_pcm_timer_done(struct snd_pcm_substream *substream) {}
  56. #endif
  57. void __snd_pcm_xrun(struct snd_pcm_substream *substream);
  58. #endif /* __SOUND_CORE_PCM_LOCAL_H */