mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
audio: use qapi AudioFormat instead of audfmt_e
I had to include an enum for audio sampling formats into qapi, but that meant duplicating the audfmt_e enum. This patch replaces audfmt_e and associated values with the qapi generated AudioFormat enum. This patch is mostly a search-and-replace, except for switches where the qapi generated AUDIO_FORMAT_MAX caused problems. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 01251b2758a1679c66842120b77c0fb46d7d0eaf.1552083282.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
8c3a7d0087
commit
85bc58520c
26 changed files with 196 additions and 189 deletions
|
@ -70,7 +70,7 @@ typedef struct OSSVoiceIn {
|
|||
|
||||
struct oss_params {
|
||||
int freq;
|
||||
audfmt_e fmt;
|
||||
AudioFormat fmt;
|
||||
int nchannels;
|
||||
int nfrags;
|
||||
int fragsize;
|
||||
|
@ -148,16 +148,16 @@ static int oss_write (SWVoiceOut *sw, void *buf, int len)
|
|||
return audio_pcm_sw_write (sw, buf, len);
|
||||
}
|
||||
|
||||
static int aud_to_ossfmt (audfmt_e fmt, int endianness)
|
||||
static int aud_to_ossfmt (AudioFormat fmt, int endianness)
|
||||
{
|
||||
switch (fmt) {
|
||||
case AUD_FMT_S8:
|
||||
case AUDIO_FORMAT_S8:
|
||||
return AFMT_S8;
|
||||
|
||||
case AUD_FMT_U8:
|
||||
case AUDIO_FORMAT_U8:
|
||||
return AFMT_U8;
|
||||
|
||||
case AUD_FMT_S16:
|
||||
case AUDIO_FORMAT_S16:
|
||||
if (endianness) {
|
||||
return AFMT_S16_BE;
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ static int aud_to_ossfmt (audfmt_e fmt, int endianness)
|
|||
return AFMT_S16_LE;
|
||||
}
|
||||
|
||||
case AUD_FMT_U16:
|
||||
case AUDIO_FORMAT_U16:
|
||||
if (endianness) {
|
||||
return AFMT_U16_BE;
|
||||
}
|
||||
|
@ -182,37 +182,37 @@ static int aud_to_ossfmt (audfmt_e fmt, int endianness)
|
|||
}
|
||||
}
|
||||
|
||||
static int oss_to_audfmt (int ossfmt, audfmt_e *fmt, int *endianness)
|
||||
static int oss_to_audfmt (int ossfmt, AudioFormat *fmt, int *endianness)
|
||||
{
|
||||
switch (ossfmt) {
|
||||
case AFMT_S8:
|
||||
*endianness = 0;
|
||||
*fmt = AUD_FMT_S8;
|
||||
*fmt = AUDIO_FORMAT_S8;
|
||||
break;
|
||||
|
||||
case AFMT_U8:
|
||||
*endianness = 0;
|
||||
*fmt = AUD_FMT_U8;
|
||||
*fmt = AUDIO_FORMAT_U8;
|
||||
break;
|
||||
|
||||
case AFMT_S16_LE:
|
||||
*endianness = 0;
|
||||
*fmt = AUD_FMT_S16;
|
||||
*fmt = AUDIO_FORMAT_S16;
|
||||
break;
|
||||
|
||||
case AFMT_U16_LE:
|
||||
*endianness = 0;
|
||||
*fmt = AUD_FMT_U16;
|
||||
*fmt = AUDIO_FORMAT_U16;
|
||||
break;
|
||||
|
||||
case AFMT_S16_BE:
|
||||
*endianness = 1;
|
||||
*fmt = AUD_FMT_S16;
|
||||
*fmt = AUDIO_FORMAT_S16;
|
||||
break;
|
||||
|
||||
case AFMT_U16_BE:
|
||||
*endianness = 1;
|
||||
*fmt = AUD_FMT_U16;
|
||||
*fmt = AUDIO_FORMAT_U16;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -500,7 +500,7 @@ static int oss_init_out(HWVoiceOut *hw, struct audsettings *as,
|
|||
int endianness;
|
||||
int err;
|
||||
int fd;
|
||||
audfmt_e effective_fmt;
|
||||
AudioFormat effective_fmt;
|
||||
struct audsettings obt_as;
|
||||
OSSConf *conf = drv_opaque;
|
||||
|
||||
|
@ -667,7 +667,7 @@ static int oss_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque)
|
|||
int endianness;
|
||||
int err;
|
||||
int fd;
|
||||
audfmt_e effective_fmt;
|
||||
AudioFormat effective_fmt;
|
||||
struct audsettings obt_as;
|
||||
OSSConf *conf = drv_opaque;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue