Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libossaudio Add missing defines for 16, 24 and 32 bit NE...
details: https://anonhg.NetBSD.org/src/rev/21c3c6f48e21
branches: trunk
changeset: 802304:21c3c6f48e21
user: nat <nat%NetBSD.org@localhost>
date: Tue Sep 09 10:45:18 2014 +0000
description:
Add missing defines for 16, 24 and 32 bit NE and OE formats.
Add the ability to set 24 and 32 bit precision.
This commit was approved by wiz@
diffstat:
lib/libossaudio/ossaudio.c | 40 ++++++++++++++++++++++++++++++++++++----
lib/libossaudio/soundcard.h | 13 +++++++++++--
2 files changed, 47 insertions(+), 6 deletions(-)
diffs (109 lines):
diff -r 499949f3b113 -r 21c3c6f48e21 lib/libossaudio/ossaudio.c
--- a/lib/libossaudio/ossaudio.c Tue Sep 09 10:34:36 2014 +0000
+++ b/lib/libossaudio/ossaudio.c Tue Sep 09 10:45:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ossaudio.c,v 1.29 2014/05/17 12:38:42 nat Exp $ */
+/* $NetBSD: ossaudio.c,v 1.30 2014/09/09 10:45:18 nat 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.30 2014/09/09 10:45:18 nat Exp $");
/*
* This is an OSS (Linux) sound API emulator.
@@ -204,6 +204,30 @@
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 @@
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;
diff -r 499949f3b113 -r 21c3c6f48e21 lib/libossaudio/soundcard.h
--- a/lib/libossaudio/soundcard.h Tue Sep 09 10:34:36 2014 +0000
+++ b/lib/libossaudio/soundcard.h Tue Sep 09 10:45:18 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: soundcard.h,v 1.23 2014/05/17 12:38:42 nat Exp $ */
+/* $NetBSD: soundcard.h,v 1.24 2014/09/09 10:45:18 nat 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 */
Home |
Main Index |
Thread Index |
Old Index