23 #include <linux/time.h>
43 unsigned char *
dst,
unsigned char *
src)
46 unsigned char *
p = (
unsigned char *)&tmp;
55 static void convert(
struct snd_pcm_plugin *plugin,
56 const struct snd_pcm_plugin_channel *src_channels,
57 struct snd_pcm_plugin_channel *dst_channels,
62 int nchannels = plugin->src_format.channels;
66 int src_step, dst_step;
71 dst_channels[
channel].enabled = 0;
74 dst_channels[
channel].enabled = 1;
75 src = src_channels[
channel].area.addr + src_channels[
channel].area.first / 8;
76 dst = dst_channels[
channel].area.addr + dst_channels[
channel].area.first / 8;
77 src_step = src_channels[
channel].area.step / 8;
78 dst_step = dst_channels[
channel].area.step / 8;
80 while (frames1-- > 0) {
81 do_convert(data, dst, src);
89 const struct snd_pcm_plugin_channel *src_channels,
90 struct snd_pcm_plugin_channel *dst_channels,
93 if (
snd_BUG_ON(!plugin || !src_channels || !dst_channels))
97 #ifdef CONFIG_SND_DEBUG
100 for (channel = 0; channel < plugin->src_format.channels; channel++) {
101 if (
snd_BUG_ON(src_channels[channel].area.first % 8 ||
102 src_channels[channel].area.step % 8))
104 if (
snd_BUG_ON(dst_channels[channel].area.first % 8 ||
105 dst_channels[channel].area.step % 8))
110 convert(plugin, src_channels, dst_channels, frames);
117 int src_le, dst_le, src_bytes,
dst_bytes;
148 struct snd_pcm_plugin_format *src_format,
149 struct snd_pcm_plugin_format *dst_format,
150 struct snd_pcm_plugin **r_plugin)
154 struct snd_pcm_plugin *plugin;
160 if (
snd_BUG_ON(src_format->rate != dst_format->rate))
162 if (
snd_BUG_ON(src_format->channels != dst_format->channels))
169 src_format, dst_format,
174 init_data(data, src_format->format, dst_format->format);
175 plugin->transfer = linear_transfer;