pcm_oss.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef __SOUND_PCM_OSS_H
  2. #define __SOUND_PCM_OSS_H
  3. /*
  4. * Digital Audio (PCM) - OSS compatibility abstract layer
  5. * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. */
  23. typedef struct _snd_pcm_plugin snd_pcm_plugin_t;
  24. typedef struct _snd_pcm_oss_setup snd_pcm_oss_setup_t;
  25. struct _snd_pcm_oss_setup {
  26. char *task_name;
  27. unsigned int disable:1,
  28. direct:1,
  29. block:1,
  30. nonblock:1,
  31. partialfrag:1,
  32. nosilence:1,
  33. buggyptr:1;
  34. unsigned int periods;
  35. unsigned int period_size;
  36. snd_pcm_oss_setup_t *next;
  37. };
  38. typedef struct _snd_pcm_oss_runtime {
  39. unsigned params: 1, /* format/parameter change */
  40. prepare: 1, /* need to prepare the operation */
  41. trigger: 1, /* trigger flag */
  42. sync_trigger: 1; /* sync trigger flag */
  43. int rate; /* requested rate */
  44. int format; /* requested OSS format */
  45. unsigned int channels; /* requested channels */
  46. unsigned int fragshift;
  47. unsigned int maxfrags;
  48. unsigned int subdivision; /* requested subdivision */
  49. size_t period_bytes; /* requested period size */
  50. size_t period_frames; /* period frames for poll */
  51. size_t period_ptr; /* actual write pointer to period */
  52. unsigned int periods;
  53. size_t buffer_bytes; /* requested buffer size */
  54. size_t bytes; /* total # bytes processed */
  55. size_t mmap_bytes;
  56. char *buffer; /* vmallocated period */
  57. size_t buffer_used; /* used length from period buffer */
  58. snd_pcm_plugin_t *plugin_first;
  59. snd_pcm_plugin_t *plugin_last;
  60. unsigned int prev_hw_ptr_interrupt;
  61. } snd_pcm_oss_runtime_t;
  62. typedef struct _snd_pcm_oss_file {
  63. snd_pcm_substream_t *streams[2];
  64. } snd_pcm_oss_file_t;
  65. typedef struct _snd_pcm_oss_substream {
  66. unsigned oss: 1; /* oss mode */
  67. snd_pcm_oss_setup_t *setup; /* active setup */
  68. snd_pcm_oss_file_t *file;
  69. } snd_pcm_oss_substream_t;
  70. typedef struct _snd_pcm_oss_stream {
  71. snd_pcm_oss_setup_t *setup_list; /* setup list */
  72. struct semaphore setup_mutex;
  73. snd_info_entry_t *proc_entry;
  74. } snd_pcm_oss_stream_t;
  75. typedef struct _snd_pcm_oss {
  76. int reg;
  77. unsigned int reg_mask;
  78. } snd_pcm_oss_t;
  79. #endif /* __SOUND_PCM_OSS_H */