PCM plugin patches made by Abramo Bagnara.

Added new plugin - voice & balance.
This commit is contained in:
Jaroslav Kysela 1999-12-02 14:31:26 +00:00
parent 7167132eed
commit 78dc424b72
11 changed files with 580 additions and 260 deletions

View file

@ -880,17 +880,25 @@ static ssize_t adpcm_dst_size(snd_pcm_plugin_t *plugin, size_t size)
}
}
int snd_pcm_plugin_build_adpcm(int src_format, int dst_format, snd_pcm_plugin_t **r_plugin)
int snd_pcm_plugin_build_adpcm(snd_pcm_format_t *src_format,
snd_pcm_format_t *dst_format,
snd_pcm_plugin_t **r_plugin)
{
struct adpcm_private_data *data;
snd_pcm_plugin_t *plugin;
combination_t cmd;
if (!r_plugin)
if (!r_plugin || !src_format || !dst_format)
return -EINVAL;
*r_plugin = NULL;
if (dst_format == SND_PCM_SFMT_IMA_ADPCM) {
switch (src_format) {
if (src_format->interleave != dst_format->interleave ||
src_format->voices != dst_format->voices ||
src_format->rate != dst_format->rate)
return -EINVAL;
if (dst_format->format == SND_PCM_SFMT_IMA_ADPCM) {
switch (src_format->format) {
case SND_PCM_SFMT_U8: cmd = _U8_ADPCM; break;
case SND_PCM_SFMT_S8: cmd = _S8_ADPCM; break;
case SND_PCM_SFMT_U16_LE: cmd = _U16LE_ADPCM; break;
@ -900,8 +908,8 @@ int snd_pcm_plugin_build_adpcm(int src_format, int dst_format, snd_pcm_plugin_t
default:
return -EINVAL;
}
} else if (src_format == SND_PCM_SFMT_IMA_ADPCM) {
switch (dst_format) {
} else if (src_format->format == SND_PCM_SFMT_IMA_ADPCM) {
switch (dst_format->format) {
case SND_PCM_SFMT_U8: cmd = _ADPCM_U8; break;
case SND_PCM_SFMT_S8: cmd = _ADPCM_S8; break;
case SND_PCM_SFMT_U16_LE: cmd = _ADPCM_U16LE; break;