mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
Uros Bizjak <uros@kss-loka.si>
Sun, 28 Nov 1999 18:42:50 +0100 (CET) mu-Law conversion plugin contains the Sun code now. Added A-Law conversion plugin.
This commit is contained in:
parent
091ee0f71b
commit
3239ca9940
6 changed files with 610 additions and 8250 deletions
|
|
@ -248,7 +248,7 @@ double snd_pcm_plugin_hardware_ratio(snd_pcm_t *pcm, int channel)
|
|||
|
||||
static unsigned int snd_pcm_plugin_formats(snd_pcm_t *pcm, unsigned int formats)
|
||||
{
|
||||
formats |= SND_PCM_FMT_MU_LAW;
|
||||
formats |= SND_PCM_FMT_MU_LAW | SND_PCM_FMT_A_LAW;
|
||||
if (formats & (SND_PCM_FMT_U8|SND_PCM_FMT_S8|
|
||||
SND_PCM_FMT_U16_LE|SND_PCM_FMT_S16_LE))
|
||||
formats |= SND_PCM_FMT_U8|SND_PCM_FMT_S8|
|
||||
|
|
@ -381,6 +381,19 @@ int snd_pcm_plugin_params(snd_pcm_t *pcm, snd_pcm_channel_params_t *params)
|
|||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
case SND_PCM_SFMT_A_LAW:
|
||||
if (sinfo.formats & SND_PCM_FMT_S16_LE) {
|
||||
sparams.format.format = SND_PCM_SFMT_S16_LE;
|
||||
} else if (sinfo.formats & SND_PCM_FMT_U16_LE) {
|
||||
sparams.format.format = SND_PCM_SFMT_U16_LE;
|
||||
} else if (sinfo.formats & SND_PCM_FMT_S8) {
|
||||
sparams.format.format = SND_PCM_SFMT_S8;
|
||||
} else if (sinfo.formats & SND_PCM_FMT_U8) {
|
||||
sparams.format.format = SND_PCM_SFMT_U8;
|
||||
} else {
|
||||
return -EINVAL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -430,6 +443,12 @@ int snd_pcm_plugin_params(snd_pcm_t *pcm, snd_pcm_channel_params_t *params)
|
|||
swap_formats(params->channel, &srcfmt, &dstfmt);
|
||||
err = snd_pcm_plugin_build_mulaw(srcfmt, dstfmt, &plugin);
|
||||
break;
|
||||
case SND_PCM_SFMT_A_LAW:
|
||||
srcfmt = SND_PCM_SFMT_A_LAW;
|
||||
dstfmt = sparams.format.format;
|
||||
swap_formats(params->channel, &srcfmt, &dstfmt);
|
||||
err = snd_pcm_plugin_build_alaw(srcfmt, dstfmt, &plugin);
|
||||
break;
|
||||
default:
|
||||
srcfmt = params->format.format;
|
||||
dstfmt = sparams.format.format;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue