Lines Matching +full:convert +full:- +full:channels

2  *  Linear conversion Plug-In
4 * Abramo Bagnara <abramo@alsa-project.org>
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
48 memcpy(p + data->copy_ofs, src + data->src_ofs, data->copy_bytes); in do_convert()
49 if (data->cvt_endian) in do_convert()
51 tmp ^= data->flip; in do_convert()
52 memcpy(dst, p + data->dst_ofs, data->dst_bytes); in do_convert()
55 static void convert(struct snd_pcm_plugin *plugin, in convert() function
60 struct linear_priv *data = (struct linear_priv *)plugin->extra_data; in convert()
62 int nchannels = plugin->src_format.channels; in convert()
70 snd_pcm_area_silence(&dst_channels[channel].area, 0, frames, plugin->dst_format.format); in convert()
80 while (frames1-- > 0) { in convert()
94 return -ENXIO; in linear_transfer()
100 for (channel = 0; channel < plugin->src_format.channels; channel++) { in linear_transfer()
103 return -ENXIO; in linear_transfer()
106 return -ENXIO; in linear_transfer()
112 convert(plugin, src_channels, dst_channels, frames); in linear_transfer()
126 data->dst_bytes = dst_bytes; in init_data()
127 data->cvt_endian = src_le != dst_le; in init_data()
128 data->copy_bytes = src_bytes < dst_bytes ? src_bytes : dst_bytes; in init_data()
130 data->copy_ofs = 4 - data->copy_bytes; in init_data()
131 data->src_ofs = src_bytes - data->copy_bytes; in init_data()
133 data->src_ofs = snd_pcm_format_physical_width(src_format) / 8 - in init_data()
136 data->dst_ofs = 4 - data->dst_bytes; in init_data()
138 data->dst_ofs = snd_pcm_format_physical_width(dst_format) / 8 - in init_data()
143 data->flip = (__force u32)cpu_to_le32(0x80000000); in init_data()
145 data->flip = (__force u32)cpu_to_be32(0x80000000); in init_data()
159 return -ENXIO; in snd_pcm_plugin_build_linear()
162 if (snd_BUG_ON(src_format->rate != dst_format->rate)) in snd_pcm_plugin_build_linear()
163 return -ENXIO; in snd_pcm_plugin_build_linear()
164 if (snd_BUG_ON(src_format->channels != dst_format->channels)) in snd_pcm_plugin_build_linear()
165 return -ENXIO; in snd_pcm_plugin_build_linear()
166 if (snd_BUG_ON(!snd_pcm_format_linear(src_format->format) || in snd_pcm_plugin_build_linear()
167 !snd_pcm_format_linear(dst_format->format))) in snd_pcm_plugin_build_linear()
168 return -ENXIO; in snd_pcm_plugin_build_linear()
175 data = (struct linear_priv *)plugin->extra_data; in snd_pcm_plugin_build_linear()
176 init_data(data, src_format->format, dst_format->format); in snd_pcm_plugin_build_linear()
177 plugin->transfer = linear_transfer; in snd_pcm_plugin_build_linear()