Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/lib/libossaudio Pull up following revision(s) (requested ...



details:   https://anonhg.NetBSD.org/src/rev/c5c5e20ca781
branches:  netbsd-7
changeset: 798342:c5c5e20ca781
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Sep 11 13:58:45 2014 +0000

description:
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.

diffstat:

 lib/libossaudio/ossaudio.c  |  40 ++++++++++++++++++++++++++++++++++++----
 lib/libossaudio/soundcard.h |  13 +++++++++++--
 2 files changed, 47 insertions(+), 6 deletions(-)

diffs (109 lines):

diff -r bf15d409fccf -r c5c5e20ca781 lib/libossaudio/ossaudio.c
--- a/lib/libossaudio/ossaudio.c        Thu Sep 11 13:54:54 2014 +0000
+++ b/lib/libossaudio/ossaudio.c        Thu Sep 11 13:58:45 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.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 @@
                        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 bf15d409fccf -r c5c5e20ca781 lib/libossaudio/soundcard.h
--- a/lib/libossaudio/soundcard.h       Thu Sep 11 13:54:54 2014 +0000
+++ b/lib/libossaudio/soundcard.h       Thu Sep 11 13:58:45 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.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 */



Home | Main Index | Thread Index | Old Index