Module Name: src Committed By: martin Date: Thu Sep 11 13:58:45 UTC 2014
Modified Files: src/lib/libossaudio [netbsd-7]: ossaudio.c soundcard.h Log Message: Pull up following revision(s) (requested by nat in ticket #92): lib/libossaudio/ossaudio.c: revision 1.30 lib/libossaudio/soundcard.h: revision 1.24 Add missing defines for 16, 24 and 32 bit NE and OE formats. Add the ability to set 24 and 32 bit precision. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.29.2.1 src/lib/libossaudio/ossaudio.c cvs rdiff -u -r1.23 -r1.23.2.1 src/lib/libossaudio/soundcard.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libossaudio/ossaudio.c diff -u src/lib/libossaudio/ossaudio.c:1.29 src/lib/libossaudio/ossaudio.c:1.29.2.1 --- src/lib/libossaudio/ossaudio.c:1.29 Sat May 17 12:38:42 2014 +++ src/lib/libossaudio/ossaudio.c Thu Sep 11 13:58:45 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ossaudio.c,v 1.29 2014/05/17 12:38:42 nat Exp $ */ +/* $NetBSD: ossaudio.c,v 1.29.2.1 2014/09/11 13:58:45 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: ossaudio.c,v 1.29 2014/05/17 12:38:42 nat Exp $"); +__RCSID("$NetBSD: ossaudio.c,v 1.29.2.1 2014/09/11 13:58:45 martin Exp $"); /* * This is an OSS (Linux) sound API emulator. @@ -204,6 +204,30 @@ audio_ioctl(int fd, unsigned long com, v tmpinfo.play.encoding = tmpinfo.record.encoding = AUDIO_ENCODING_ULINEAR_BE; break; + case AFMT_S24_LE: + tmpinfo.play.precision = + tmpinfo.record.precision = 24; + tmpinfo.play.encoding = + tmpinfo.record.encoding = AUDIO_ENCODING_SLINEAR_LE; + break; + case AFMT_S24_BE: + tmpinfo.play.precision = + tmpinfo.record.precision = 24; + tmpinfo.play.encoding = + tmpinfo.record.encoding = AUDIO_ENCODING_SLINEAR_BE; + break; + case AFMT_S32_LE: + tmpinfo.play.precision = + tmpinfo.record.precision = 32; + tmpinfo.play.encoding = + tmpinfo.record.encoding = AUDIO_ENCODING_SLINEAR_LE; + break; + case AFMT_S32_BE: + tmpinfo.play.precision = + tmpinfo.record.precision = 32; + tmpinfo.play.encoding = + tmpinfo.record.encoding = AUDIO_ENCODING_SLINEAR_BE; + break; case AFMT_AC3: tmpinfo.play.precision = tmpinfo.record.precision = 16; @@ -227,13 +251,21 @@ audio_ioctl(int fd, unsigned long com, v idat = AFMT_A_LAW; break; case AUDIO_ENCODING_SLINEAR_LE: - if (tmpinfo.play.precision == 16) + if (tmpinfo.play.precision == 32) + idat = AFMT_S32_LE; + else if (tmpinfo.play.precision == 24) + idat = AFMT_S24_LE; + else if (tmpinfo.play.precision == 16) idat = AFMT_S16_LE; else idat = AFMT_S8; break; case AUDIO_ENCODING_SLINEAR_BE: - if (tmpinfo.play.precision == 16) + if (tmpinfo.play.precision == 32) + idat = AFMT_S32_BE; + else if (tmpinfo.play.precision == 24) + idat = AFMT_S24_BE; + else if (tmpinfo.play.precision == 16) idat = AFMT_S16_BE; else idat = AFMT_S8; Index: src/lib/libossaudio/soundcard.h diff -u src/lib/libossaudio/soundcard.h:1.23 src/lib/libossaudio/soundcard.h:1.23.2.1 --- src/lib/libossaudio/soundcard.h:1.23 Sat May 17 12:38:42 2014 +++ src/lib/libossaudio/soundcard.h Thu Sep 11 13:58:45 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: soundcard.h,v 1.23 2014/05/17 12:38:42 nat Exp $ */ +/* $NetBSD: soundcard.h,v 1.23.2.1 2014/09/11 13:58:45 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -66,7 +66,6 @@ #define AFMT_S24_BE 0x00001000 #define AFMT_S32_LE 0x00002000 #define AFMT_S32_BE 0x00004000 -#define AFMT_S32_NE 0x00008000 #define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT #define SOUND_PCM_READ_BITS _IOR ('P', 5, int) #define SNDCTL_DSP_CHANNELS _IOWR('P', 6, int) @@ -113,8 +112,18 @@ #include <machine/endian_machdep.h> #if _BYTE_ORDER == _LITTLE_ENDIAN #define AFMT_S16_NE AFMT_S16_LE +#define AFMT_S16_OE AFMT_S16_BE +#define AFMT_S24_NE AFMT_S24_LE +#define AFMT_S24_OE AFMT_S24_BE +#define AFMT_S32_NE AFMT_S32_LE +#define AFMT_S32_OE AFMT_S32_BE #else #define AFMT_S16_NE AFMT_S16_BE +#define AFMT_S16_OE AFMT_S16_LE +#define AFMT_S24_NE AFMT_S24_BE +#define AFMT_S24_OE AFMT_S24_LE +#define AFMT_S32_NE AFMT_S32_BE +#define AFMT_S32_OE AFMT_S32_LE #endif /* Aliases */