diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 08:01:49 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:17:48 -0500 |
commit | 6ac77bc180fbd985988015020c2e2347e802959d (patch) | |
tree | 1959127176dbc937fe4646d94e48f14cc013d087 /sound/core/oss/pcm_plugin.c | |
parent | f956b4a3ae790e1bdde865ac42dd1b99b64a6256 (diff) |
[ALSA] Remove xxx_t typedefs: PCM OSS-emulation
Modules: ALSA<-OSS emulation
Remove xxx_t typedefs from the core PCM OSS-emulation codes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/oss/pcm_plugin.c')
-rw-r--r-- | sound/core/oss/pcm_plugin.c | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c index 312ae1f2bfc..7e8676880dd 100644 --- a/sound/core/oss/pcm_plugin.c +++ b/sound/core/oss/pcm_plugin.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #define snd_pcm_plug_first(plug) ((plug)->runtime->oss.plugin_first) | 36 | #define snd_pcm_plug_first(plug) ((plug)->runtime->oss.plugin_first) |
37 | #define snd_pcm_plug_last(plug) ((plug)->runtime->oss.plugin_last) | 37 | #define snd_pcm_plug_last(plug) ((plug)->runtime->oss.plugin_last) |
38 | 38 | ||
39 | static int snd_pcm_plugin_src_channels_mask(snd_pcm_plugin_t *plugin, | 39 | static int snd_pcm_plugin_src_channels_mask(struct snd_pcm_plugin *plugin, |
40 | unsigned long *dst_vmask, | 40 | unsigned long *dst_vmask, |
41 | unsigned long **src_vmask) | 41 | unsigned long **src_vmask) |
42 | { | 42 | { |
@@ -46,7 +46,7 @@ static int snd_pcm_plugin_src_channels_mask(snd_pcm_plugin_t *plugin, | |||
46 | return 0; | 46 | return 0; |
47 | } | 47 | } |
48 | 48 | ||
49 | static int snd_pcm_plugin_dst_channels_mask(snd_pcm_plugin_t *plugin, | 49 | static int snd_pcm_plugin_dst_channels_mask(struct snd_pcm_plugin *plugin, |
50 | unsigned long *src_vmask, | 50 | unsigned long *src_vmask, |
51 | unsigned long **dst_vmask) | 51 | unsigned long **dst_vmask) |
52 | { | 52 | { |
@@ -67,13 +67,13 @@ static int rate_match(unsigned int src_rate, unsigned int dst_rate) | |||
67 | return dst_rate >= low && dst_rate <= high; | 67 | return dst_rate >= low && dst_rate <= high; |
68 | } | 68 | } |
69 | 69 | ||
70 | static int snd_pcm_plugin_alloc(snd_pcm_plugin_t *plugin, snd_pcm_uframes_t frames) | 70 | static int snd_pcm_plugin_alloc(struct snd_pcm_plugin *plugin, snd_pcm_uframes_t frames) |
71 | { | 71 | { |
72 | snd_pcm_plugin_format_t *format; | 72 | struct snd_pcm_plugin_format *format; |
73 | ssize_t width; | 73 | ssize_t width; |
74 | size_t size; | 74 | size_t size; |
75 | unsigned int channel; | 75 | unsigned int channel; |
76 | snd_pcm_plugin_channel_t *c; | 76 | struct snd_pcm_plugin_channel *c; |
77 | 77 | ||
78 | if (plugin->stream == SNDRV_PCM_STREAM_PLAYBACK) { | 78 | if (plugin->stream == SNDRV_PCM_STREAM_PLAYBACK) { |
79 | format = &plugin->src_format; | 79 | format = &plugin->src_format; |
@@ -120,12 +120,12 @@ static int snd_pcm_plugin_alloc(snd_pcm_plugin_t *plugin, snd_pcm_uframes_t fram | |||
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | 122 | ||
123 | int snd_pcm_plug_alloc(snd_pcm_plug_t *plug, snd_pcm_uframes_t frames) | 123 | int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames) |
124 | { | 124 | { |
125 | int err; | 125 | int err; |
126 | snd_assert(snd_pcm_plug_first(plug) != NULL, return -ENXIO); | 126 | snd_assert(snd_pcm_plug_first(plug) != NULL, return -ENXIO); |
127 | if (snd_pcm_plug_stream(plug) == SNDRV_PCM_STREAM_PLAYBACK) { | 127 | if (snd_pcm_plug_stream(plug) == SNDRV_PCM_STREAM_PLAYBACK) { |
128 | snd_pcm_plugin_t *plugin = snd_pcm_plug_first(plug); | 128 | struct snd_pcm_plugin *plugin = snd_pcm_plug_first(plug); |
129 | while (plugin->next) { | 129 | while (plugin->next) { |
130 | if (plugin->dst_frames) | 130 | if (plugin->dst_frames) |
131 | frames = plugin->dst_frames(plugin, frames); | 131 | frames = plugin->dst_frames(plugin, frames); |
@@ -136,7 +136,7 @@ int snd_pcm_plug_alloc(snd_pcm_plug_t *plug, snd_pcm_uframes_t frames) | |||
136 | return err; | 136 | return err; |
137 | } | 137 | } |
138 | } else { | 138 | } else { |
139 | snd_pcm_plugin_t *plugin = snd_pcm_plug_last(plug); | 139 | struct snd_pcm_plugin *plugin = snd_pcm_plug_last(plug); |
140 | while (plugin->prev) { | 140 | while (plugin->prev) { |
141 | if (plugin->src_frames) | 141 | if (plugin->src_frames) |
142 | frames = plugin->src_frames(plugin, frames); | 142 | frames = plugin->src_frames(plugin, frames); |
@@ -151,22 +151,22 @@ int snd_pcm_plug_alloc(snd_pcm_plug_t *plug, snd_pcm_uframes_t frames) | |||
151 | } | 151 | } |
152 | 152 | ||
153 | 153 | ||
154 | snd_pcm_sframes_t snd_pcm_plugin_client_channels(snd_pcm_plugin_t *plugin, | 154 | snd_pcm_sframes_t snd_pcm_plugin_client_channels(struct snd_pcm_plugin *plugin, |
155 | snd_pcm_uframes_t frames, | 155 | snd_pcm_uframes_t frames, |
156 | snd_pcm_plugin_channel_t **channels) | 156 | struct snd_pcm_plugin_channel **channels) |
157 | { | 157 | { |
158 | *channels = plugin->buf_channels; | 158 | *channels = plugin->buf_channels; |
159 | return frames; | 159 | return frames; |
160 | } | 160 | } |
161 | 161 | ||
162 | int snd_pcm_plugin_build(snd_pcm_plug_t *plug, | 162 | int snd_pcm_plugin_build(struct snd_pcm_substream *plug, |
163 | const char *name, | 163 | const char *name, |
164 | snd_pcm_plugin_format_t *src_format, | 164 | struct snd_pcm_plugin_format *src_format, |
165 | snd_pcm_plugin_format_t *dst_format, | 165 | struct snd_pcm_plugin_format *dst_format, |
166 | size_t extra, | 166 | size_t extra, |
167 | snd_pcm_plugin_t **ret) | 167 | struct snd_pcm_plugin **ret) |
168 | { | 168 | { |
169 | snd_pcm_plugin_t *plugin; | 169 | struct snd_pcm_plugin *plugin; |
170 | unsigned int channels; | 170 | unsigned int channels; |
171 | 171 | ||
172 | snd_assert(plug != NULL, return -ENXIO); | 172 | snd_assert(plug != NULL, return -ENXIO); |
@@ -210,7 +210,7 @@ int snd_pcm_plugin_build(snd_pcm_plug_t *plug, | |||
210 | return 0; | 210 | return 0; |
211 | } | 211 | } |
212 | 212 | ||
213 | int snd_pcm_plugin_free(snd_pcm_plugin_t *plugin) | 213 | int snd_pcm_plugin_free(struct snd_pcm_plugin *plugin) |
214 | { | 214 | { |
215 | if (! plugin) | 215 | if (! plugin) |
216 | return 0; | 216 | return 0; |
@@ -224,9 +224,9 @@ int snd_pcm_plugin_free(snd_pcm_plugin_t *plugin) | |||
224 | return 0; | 224 | return 0; |
225 | } | 225 | } |
226 | 226 | ||
227 | snd_pcm_sframes_t snd_pcm_plug_client_size(snd_pcm_plug_t *plug, snd_pcm_uframes_t drv_frames) | 227 | snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_pcm_uframes_t drv_frames) |
228 | { | 228 | { |
229 | snd_pcm_plugin_t *plugin, *plugin_prev, *plugin_next; | 229 | struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next; |
230 | int stream = snd_pcm_plug_stream(plug); | 230 | int stream = snd_pcm_plug_stream(plug); |
231 | 231 | ||
232 | snd_assert(plug != NULL, return -ENXIO); | 232 | snd_assert(plug != NULL, return -ENXIO); |
@@ -253,9 +253,9 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(snd_pcm_plug_t *plug, snd_pcm_uframes | |||
253 | return drv_frames; | 253 | return drv_frames; |
254 | } | 254 | } |
255 | 255 | ||
256 | snd_pcm_sframes_t snd_pcm_plug_slave_size(snd_pcm_plug_t *plug, snd_pcm_uframes_t clt_frames) | 256 | snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pcm_uframes_t clt_frames) |
257 | { | 257 | { |
258 | snd_pcm_plugin_t *plugin, *plugin_prev, *plugin_next; | 258 | struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next; |
259 | snd_pcm_sframes_t frames; | 259 | snd_pcm_sframes_t frames; |
260 | int stream = snd_pcm_plug_stream(plug); | 260 | int stream = snd_pcm_plug_stream(plug); |
261 | 261 | ||
@@ -290,9 +290,9 @@ snd_pcm_sframes_t snd_pcm_plug_slave_size(snd_pcm_plug_t *plug, snd_pcm_uframes_ | |||
290 | return frames; | 290 | return frames; |
291 | } | 291 | } |
292 | 292 | ||
293 | static int snd_pcm_plug_formats(snd_mask_t *mask, int format) | 293 | static int snd_pcm_plug_formats(struct snd_mask *mask, int format) |
294 | { | 294 | { |
295 | snd_mask_t formats = *mask; | 295 | struct snd_mask formats = *mask; |
296 | u64 linfmts = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 | | 296 | u64 linfmts = (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S8 | |
297 | SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_S16_LE | | 297 | SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_S16_LE | |
298 | SNDRV_PCM_FMTBIT_U16_BE | SNDRV_PCM_FMTBIT_S16_BE | | 298 | SNDRV_PCM_FMTBIT_U16_BE | SNDRV_PCM_FMTBIT_S16_BE | |
@@ -326,7 +326,7 @@ static int preferred_formats[] = { | |||
326 | SNDRV_PCM_FORMAT_U8 | 326 | SNDRV_PCM_FORMAT_U8 |
327 | }; | 327 | }; |
328 | 328 | ||
329 | int snd_pcm_plug_slave_format(int format, snd_mask_t *format_mask) | 329 | int snd_pcm_plug_slave_format(int format, struct snd_mask *format_mask) |
330 | { | 330 | { |
331 | if (snd_mask_test(format_mask, format)) | 331 | if (snd_mask_test(format_mask, format)) |
332 | return format; | 332 | return format; |
@@ -376,15 +376,15 @@ int snd_pcm_plug_slave_format(int format, snd_mask_t *format_mask) | |||
376 | } | 376 | } |
377 | } | 377 | } |
378 | 378 | ||
379 | int snd_pcm_plug_format_plugins(snd_pcm_plug_t *plug, | 379 | int snd_pcm_plug_format_plugins(struct snd_pcm_substream *plug, |
380 | snd_pcm_hw_params_t *params, | 380 | struct snd_pcm_hw_params *params, |
381 | snd_pcm_hw_params_t *slave_params) | 381 | struct snd_pcm_hw_params *slave_params) |
382 | { | 382 | { |
383 | snd_pcm_plugin_format_t tmpformat; | 383 | struct snd_pcm_plugin_format tmpformat; |
384 | snd_pcm_plugin_format_t dstformat; | 384 | struct snd_pcm_plugin_format dstformat; |
385 | snd_pcm_plugin_format_t srcformat; | 385 | struct snd_pcm_plugin_format srcformat; |
386 | int src_access, dst_access; | 386 | int src_access, dst_access; |
387 | snd_pcm_plugin_t *plugin = NULL; | 387 | struct snd_pcm_plugin *plugin = NULL; |
388 | int err; | 388 | int err; |
389 | int stream = snd_pcm_plug_stream(plug); | 389 | int stream = snd_pcm_plug_stream(plug); |
390 | int slave_interleaved = (params_channels(slave_params) == 1 || | 390 | int slave_interleaved = (params_channels(slave_params) == 1 || |
@@ -462,7 +462,7 @@ int snd_pcm_plug_format_plugins(snd_pcm_plug_t *plug, | |||
462 | if (srcformat.channels > dstformat.channels) { | 462 | if (srcformat.channels > dstformat.channels) { |
463 | int sv = srcformat.channels; | 463 | int sv = srcformat.channels; |
464 | int dv = dstformat.channels; | 464 | int dv = dstformat.channels; |
465 | route_ttable_entry_t *ttable = kcalloc(dv * sv, sizeof(*ttable), GFP_KERNEL); | 465 | int *ttable = kcalloc(dv * sv, sizeof(*ttable), GFP_KERNEL); |
466 | if (ttable == NULL) | 466 | if (ttable == NULL) |
467 | return -ENOMEM; | 467 | return -ENOMEM; |
468 | #if 1 | 468 | #if 1 |
@@ -525,7 +525,7 @@ int snd_pcm_plug_format_plugins(snd_pcm_plug_t *plug, | |||
525 | if (srcformat.channels < dstformat.channels) { | 525 | if (srcformat.channels < dstformat.channels) { |
526 | int sv = srcformat.channels; | 526 | int sv = srcformat.channels; |
527 | int dv = dstformat.channels; | 527 | int dv = dstformat.channels; |
528 | route_ttable_entry_t *ttable = kcalloc(dv * sv, sizeof(*ttable), GFP_KERNEL); | 528 | int *ttable = kcalloc(dv * sv, sizeof(*ttable), GFP_KERNEL); |
529 | if (ttable == NULL) | 529 | if (ttable == NULL) |
530 | return -ENOMEM; | 530 | return -ENOMEM; |
531 | #if 0 | 531 | #if 0 |
@@ -614,14 +614,14 @@ int snd_pcm_plug_format_plugins(snd_pcm_plug_t *plug, | |||
614 | return 0; | 614 | return 0; |
615 | } | 615 | } |
616 | 616 | ||
617 | snd_pcm_sframes_t snd_pcm_plug_client_channels_buf(snd_pcm_plug_t *plug, | 617 | snd_pcm_sframes_t snd_pcm_plug_client_channels_buf(struct snd_pcm_substream *plug, |
618 | char *buf, | 618 | char *buf, |
619 | snd_pcm_uframes_t count, | 619 | snd_pcm_uframes_t count, |
620 | snd_pcm_plugin_channel_t **channels) | 620 | struct snd_pcm_plugin_channel **channels) |
621 | { | 621 | { |
622 | snd_pcm_plugin_t *plugin; | 622 | struct snd_pcm_plugin *plugin; |
623 | snd_pcm_plugin_channel_t *v; | 623 | struct snd_pcm_plugin_channel *v; |
624 | snd_pcm_plugin_format_t *format; | 624 | struct snd_pcm_plugin_format *format; |
625 | int width, nchannels, channel; | 625 | int width, nchannels, channel; |
626 | int stream = snd_pcm_plug_stream(plug); | 626 | int stream = snd_pcm_plug_stream(plug); |
627 | 627 | ||
@@ -650,10 +650,10 @@ snd_pcm_sframes_t snd_pcm_plug_client_channels_buf(snd_pcm_plug_t *plug, | |||
650 | return count; | 650 | return count; |
651 | } | 651 | } |
652 | 652 | ||
653 | static int snd_pcm_plug_playback_channels_mask(snd_pcm_plug_t *plug, | 653 | static int snd_pcm_plug_playback_channels_mask(struct snd_pcm_substream *plug, |
654 | unsigned long *client_vmask) | 654 | unsigned long *client_vmask) |
655 | { | 655 | { |
656 | snd_pcm_plugin_t *plugin = snd_pcm_plug_last(plug); | 656 | struct snd_pcm_plugin *plugin = snd_pcm_plug_last(plug); |
657 | if (plugin == NULL) { | 657 | if (plugin == NULL) { |
658 | return 0; | 658 | return 0; |
659 | } else { | 659 | } else { |
@@ -678,10 +678,10 @@ static int snd_pcm_plug_playback_channels_mask(snd_pcm_plug_t *plug, | |||
678 | } | 678 | } |
679 | } | 679 | } |
680 | 680 | ||
681 | static int snd_pcm_plug_playback_disable_useless_channels(snd_pcm_plug_t *plug, | 681 | static int snd_pcm_plug_playback_disable_useless_channels(struct snd_pcm_substream *plug, |
682 | snd_pcm_plugin_channel_t *src_channels) | 682 | struct snd_pcm_plugin_channel *src_channels) |
683 | { | 683 | { |
684 | snd_pcm_plugin_t *plugin = snd_pcm_plug_first(plug); | 684 | struct snd_pcm_plugin *plugin = snd_pcm_plug_first(plug); |
685 | unsigned int nchannels = plugin->src_format.channels; | 685 | unsigned int nchannels = plugin->src_format.channels; |
686 | DECLARE_BITMAP(bs, nchannels); | 686 | DECLARE_BITMAP(bs, nchannels); |
687 | unsigned long *srcmask = bs; | 687 | unsigned long *srcmask = bs; |
@@ -703,11 +703,11 @@ static int snd_pcm_plug_playback_disable_useless_channels(snd_pcm_plug_t *plug, | |||
703 | return 0; | 703 | return 0; |
704 | } | 704 | } |
705 | 705 | ||
706 | static int snd_pcm_plug_capture_disable_useless_channels(snd_pcm_plug_t *plug, | 706 | static int snd_pcm_plug_capture_disable_useless_channels(struct snd_pcm_substream *plug, |
707 | snd_pcm_plugin_channel_t *src_channels, | 707 | struct snd_pcm_plugin_channel *src_channels, |
708 | snd_pcm_plugin_channel_t *client_channels) | 708 | struct snd_pcm_plugin_channel *client_channels) |
709 | { | 709 | { |
710 | snd_pcm_plugin_t *plugin = snd_pcm_plug_last(plug); | 710 | struct snd_pcm_plugin *plugin = snd_pcm_plug_last(plug); |
711 | unsigned int nchannels = plugin->dst_format.channels; | 711 | unsigned int nchannels = plugin->dst_format.channels; |
712 | DECLARE_BITMAP(bs, nchannels); | 712 | DECLARE_BITMAP(bs, nchannels); |
713 | unsigned long *dstmask = bs; | 713 | unsigned long *dstmask = bs; |
@@ -736,10 +736,10 @@ static int snd_pcm_plug_capture_disable_useless_channels(snd_pcm_plug_t *plug, | |||
736 | return 0; | 736 | return 0; |
737 | } | 737 | } |
738 | 738 | ||
739 | snd_pcm_sframes_t snd_pcm_plug_write_transfer(snd_pcm_plug_t *plug, snd_pcm_plugin_channel_t *src_channels, snd_pcm_uframes_t size) | 739 | snd_pcm_sframes_t snd_pcm_plug_write_transfer(struct snd_pcm_substream *plug, struct snd_pcm_plugin_channel *src_channels, snd_pcm_uframes_t size) |
740 | { | 740 | { |
741 | snd_pcm_plugin_t *plugin, *next; | 741 | struct snd_pcm_plugin *plugin, *next; |
742 | snd_pcm_plugin_channel_t *dst_channels; | 742 | struct snd_pcm_plugin_channel *dst_channels; |
743 | int err; | 743 | int err; |
744 | snd_pcm_sframes_t frames = size; | 744 | snd_pcm_sframes_t frames = size; |
745 | 745 | ||
@@ -771,10 +771,10 @@ snd_pcm_sframes_t snd_pcm_plug_write_transfer(snd_pcm_plug_t *plug, snd_pcm_plug | |||
771 | return snd_pcm_plug_client_size(plug, frames); | 771 | return snd_pcm_plug_client_size(plug, frames); |
772 | } | 772 | } |
773 | 773 | ||
774 | snd_pcm_sframes_t snd_pcm_plug_read_transfer(snd_pcm_plug_t *plug, snd_pcm_plugin_channel_t *dst_channels_final, snd_pcm_uframes_t size) | 774 | snd_pcm_sframes_t snd_pcm_plug_read_transfer(struct snd_pcm_substream *plug, struct snd_pcm_plugin_channel *dst_channels_final, snd_pcm_uframes_t size) |
775 | { | 775 | { |
776 | snd_pcm_plugin_t *plugin, *next; | 776 | struct snd_pcm_plugin *plugin, *next; |
777 | snd_pcm_plugin_channel_t *src_channels, *dst_channels; | 777 | struct snd_pcm_plugin_channel *src_channels, *dst_channels; |
778 | snd_pcm_sframes_t frames = size; | 778 | snd_pcm_sframes_t frames = size; |
779 | int err; | 779 | int err; |
780 | 780 | ||
@@ -806,7 +806,7 @@ snd_pcm_sframes_t snd_pcm_plug_read_transfer(snd_pcm_plug_t *plug, snd_pcm_plugi | |||
806 | return frames; | 806 | return frames; |
807 | } | 807 | } |
808 | 808 | ||
809 | int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_area, size_t dst_offset, | 809 | int snd_pcm_area_silence(const struct snd_pcm_channel_area *dst_area, size_t dst_offset, |
810 | size_t samples, int format) | 810 | size_t samples, int format) |
811 | { | 811 | { |
812 | /* FIXME: sub byte resolution and odd dst_offset */ | 812 | /* FIXME: sub byte resolution and odd dst_offset */ |
@@ -852,8 +852,8 @@ int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_area, size_t dst_offs | |||
852 | return 0; | 852 | return 0; |
853 | } | 853 | } |
854 | 854 | ||
855 | int snd_pcm_area_copy(const snd_pcm_channel_area_t *src_area, size_t src_offset, | 855 | int snd_pcm_area_copy(const struct snd_pcm_channel_area *src_area, size_t src_offset, |
856 | const snd_pcm_channel_area_t *dst_area, size_t dst_offset, | 856 | const struct snd_pcm_channel_area *dst_area, size_t dst_offset, |
857 | size_t samples, int format) | 857 | size_t samples, int format) |
858 | { | 858 | { |
859 | /* FIXME: sub byte resolution and odd dst_offset */ | 859 | /* FIXME: sub byte resolution and odd dst_offset */ |