Lines Matching refs:plugin
40 typedef void (*rate_f)(struct snd_pcm_plugin *plugin,
53 static void rate_init(struct snd_pcm_plugin *plugin) in rate_init() argument
56 struct rate_priv *data = (struct rate_priv *)plugin->extra_data; in rate_init()
58 for (channel = 0; channel < plugin->src_format.channels; channel++) { in rate_init()
64 static void resample_expand(struct snd_pcm_plugin *plugin, in resample_expand() argument
76 struct rate_priv *data = (struct rate_priv *)plugin->extra_data; in resample_expand()
79 for (channel = 0; channel < plugin->src_format.channels; channel++) { in resample_expand()
85 snd_pcm_area_silence(&dst_channels[channel].area, 0, dst_frames, plugin->dst_format.format); in resample_expand()
123 static void resample_shrink(struct snd_pcm_plugin *plugin, in resample_shrink() argument
135 struct rate_priv *data = (struct rate_priv *)plugin->extra_data; in resample_shrink()
138 for (channel = 0; channel < plugin->src_format.channels; ++channel) { in resample_shrink()
144 snd_pcm_area_silence(&dst_channels[channel].area, 0, dst_frames, plugin->dst_format.format); in resample_shrink()
183 static snd_pcm_sframes_t rate_src_frames(struct snd_pcm_plugin *plugin, snd_pcm_uframes_t frames) in rate_src_frames() argument
188 if (snd_BUG_ON(!plugin)) in rate_src_frames()
192 data = (struct rate_priv *)plugin->extra_data; in rate_src_frames()
193 if (plugin->src_format.rate < plugin->dst_format.rate) { in rate_src_frames()
216 static snd_pcm_sframes_t rate_dst_frames(struct snd_pcm_plugin *plugin, snd_pcm_uframes_t frames) in rate_dst_frames() argument
221 if (snd_BUG_ON(!plugin)) in rate_dst_frames()
225 data = (struct rate_priv *)plugin->extra_data; in rate_dst_frames()
226 if (plugin->src_format.rate < plugin->dst_format.rate) { in rate_dst_frames()
249 static snd_pcm_sframes_t rate_transfer(struct snd_pcm_plugin *plugin, in rate_transfer() argument
257 if (snd_BUG_ON(!plugin || !src_channels || !dst_channels)) in rate_transfer()
264 for (channel = 0; channel < plugin->src_format.channels; channel++) { in rate_transfer()
275 dst_frames = rate_dst_frames(plugin, frames); in rate_transfer()
278 data = (struct rate_priv *)plugin->extra_data; in rate_transfer()
279 data->func(plugin, src_channels, dst_channels, frames, dst_frames); in rate_transfer()
283 static int rate_action(struct snd_pcm_plugin *plugin, in rate_action() argument
287 if (snd_BUG_ON(!plugin)) in rate_action()
292 rate_init(plugin); in rate_action()
307 struct snd_pcm_plugin *plugin; in snd_pcm_plugin_build_rate() local
328 &plugin); in snd_pcm_plugin_build_rate()
331 data = (struct rate_priv *)plugin->extra_data; in snd_pcm_plugin_build_rate()
340 rate_init(plugin); in snd_pcm_plugin_build_rate()
342 plugin->transfer = rate_transfer; in snd_pcm_plugin_build_rate()
343 plugin->src_frames = rate_src_frames; in snd_pcm_plugin_build_rate()
344 plugin->dst_frames = rate_dst_frames; in snd_pcm_plugin_build_rate()
345 plugin->action = rate_action; in snd_pcm_plugin_build_rate()
346 *r_plugin = plugin; in snd_pcm_plugin_build_rate()