]> git.sesse.net Git - vlc/commitdiff
* Made audio_sample_format->i_format a FOURCC to allow the creation of
authorChristophe Massiot <massiot@videolan.org>
Mon, 30 Sep 2002 21:32:33 +0000 (21:32 +0000)
committerChristophe Massiot <massiot@videolan.org>
Mon, 30 Sep 2002 21:32:33 +0000 (21:32 +0000)
new ones.

30 files changed:
include/audio_output.h
modules/audio_filter/channel_mixer/trivial.c
modules/audio_filter/converter/a52tofloat32.c
modules/audio_filter/converter/a52tospdif.c
modules/audio_filter/converter/fixed32tofloat32.c
modules/audio_filter/converter/fixed32tos16.c
modules/audio_filter/converter/float32tos16.c
modules/audio_filter/converter/float32tos8.c
modules/audio_filter/converter/float32tou16.c
modules/audio_filter/converter/float32tou8.c
modules/audio_filter/converter/s16tofloat32.c
modules/audio_filter/converter/s16tofloat32swab.c
modules/audio_filter/resampler/trivial.c
modules/audio_filter/resampler/ugly.c
modules/audio_mixer/float32.c
modules/audio_mixer/trivial.c
modules/audio_output/alsa.c
modules/audio_output/file.c
modules/audio_output/oss.c
modules/codec/a52.c
modules/codec/faad/decoder.c
modules/codec/lpcm.c
modules/codec/mad/decoder.c
modules/codec/mpeg_audio/decoder.c
modules/gui/macosx/aout.m
modules/gui/qnx/aout.c
modules/misc/dummy/aout.c
src/audio_output/common.c
src/audio_output/filters.c
src/audio_output/output.c

index e7909f3088ec5bf6571cbbecca9ef3181e9693b7..1f413c4d892926f892938cd99e7899339c371ef8 100644 (file)
@@ -2,7 +2,7 @@
  * audio_output.h : audio output interface
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: audio_output.h,v 1.67 2002/09/26 22:40:18 massiot Exp $
+ * $Id: audio_output.h,v 1.68 2002/09/30 21:32:31 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -40,21 +40,6 @@ struct audio_sample_format_t
      * i_nb_samples * i_bytes_per_frame / i_frame_length */
 };
 
-#define AOUT_FMT_MU_LAW     0x00000001
-#define AOUT_FMT_A_LAW      0x00000002
-#define AOUT_FMT_IMA_ADPCM  0x00000004
-#define AOUT_FMT_U8         0x00000008
-#define AOUT_FMT_S16_LE     0x00000010            /* Little endian signed 16 */
-#define AOUT_FMT_S16_BE     0x00000020               /* Big endian signed 16 */
-#define AOUT_FMT_S8         0x00000040
-#define AOUT_FMT_U16_LE     0x00000080                  /* Little endian U16 */
-#define AOUT_FMT_U16_BE     0x00000100                     /* Big endian U16 */
-#define AOUT_FMT_SPDIF      0x00000400            /* S/PDIF hardware support */
-#define AOUT_FMT_FLOAT32    0x00010000
-#define AOUT_FMT_FIXED32    0x00020000
-#define AOUT_FMT_A52        0x00100000
-#define AOUT_FMT_DTS        0x00200000
-
 #define AOUT_FMTS_IDENTICAL( p_first, p_second ) (                          \
     ((p_first)->i_format == (p_second)->i_format)                           \
       && ((p_first)->i_rate == (p_second)->i_rate)                          \
@@ -68,17 +53,17 @@ struct audio_sample_format_t
            || (p_first)->i_channels == -1 || (p_second)->i_channels == -1) )
 
 #ifdef WORDS_BIGENDIAN
-#   define AOUT_FMT_S16_NE AOUT_FMT_S16_BE
-#   define AOUT_FMT_U16_NE AOUT_FMT_U16_BE
+#   define AOUT_FMT_S16_NE VLC_FOURCC('s','1','6','b')
+#   define AOUT_FMT_U16_NE VLC_FOURCC('u','1','6','b')
 #else
-#   define AOUT_FMT_S16_NE AOUT_FMT_S16_LE
-#   define AOUT_FMT_U16_NE AOUT_FMT_U16_LE
+#   define AOUT_FMT_S16_NE VLC_FOURCC('s','1','6','l')
+#   define AOUT_FMT_U16_NE VLC_FOURCC('u','1','6','l')
 #endif
 
 #define AOUT_FMT_NON_LINEAR( p_format )                                    \
-    ( ((p_format)->i_format == AOUT_FMT_SPDIF)                             \
-       || ((p_format)->i_format == AOUT_FMT_A52)                           \
-       || ((p_format)->i_format == AOUT_FMT_DTS) )
+    ( ((p_format)->i_format == VLC_FOURCC('s','p','d','i'))                \
+       || ((p_format)->i_format == VLC_FOURCC('a','5','2',' '))            \
+       || ((p_format)->i_format == VLC_FOURCC('d','t','s',' ')) )
 
 /* This is heavily borrowed from libmad, by Robert Leslie <rob@mars.org> */
 /*
index 1a43c48c5237cf7ec2bd55ea75a998c1d5e658d9..4a023c4b33843977e965e3aeae1b802ee7703311 100644 (file)
@@ -2,7 +2,7 @@
  * trivial.c : trivial channel mixer plug-in (drops unwanted channels)
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: trivial.c,v 1.3 2002/09/02 23:21:40 massiot Exp $
+ * $Id: trivial.c,v 1.4 2002/09/30 21:32:31 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -59,8 +59,8 @@ static int Create( vlc_object_t *p_this )
     if ( p_filter->input.i_channels == p_filter->output.i_channels
           || p_filter->input.i_format != p_filter->output.i_format
           || p_filter->input.i_rate != p_filter->output.i_rate
-          || (p_filter->input.i_format != AOUT_FMT_FLOAT32
-               && p_filter->input.i_format != AOUT_FMT_FIXED32) )
+          || (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
+               && p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) )
     {
         return -1;
     }
index 96081ac26dea10c67f7f2fb3d0d6660c2dd440af..7b096824c25b582603902e5ea22138b5ab3e8664 100644 (file)
@@ -4,7 +4,7 @@
  *   (http://liba52.sf.net/).
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: a52tofloat32.c,v 1.2 2002/09/16 20:46:37 massiot Exp $
+ * $Id: a52tofloat32.c,v 1.3 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -96,8 +96,8 @@ static int Create( vlc_object_t * _p_filter )
     aout_filter_t * p_filter = (aout_filter_t *)_p_filter;
     struct aout_filter_sys_t * p_sys;
 
-    if ( p_filter->input.i_format != AOUT_FMT_A52
-          || p_filter->output.i_format != AOUT_FMT_FLOAT32 )
+    if ( p_filter->input.i_format != VLC_FOURCC('a','5','2',' ')
+          || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
     {
         return -1;
     }
index 37c52e7c6dc92570a737fbc7c25bb5df02eee827..156e8705c267b8a03b72d045925075faae15f1d6 100644 (file)
@@ -2,7 +2,7 @@
  * a52tospdif.c : encapsulates A/52 frames into S/PDIF packets
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: a52tospdif.c,v 1.12 2002/09/11 23:08:43 stef Exp $
+ * $Id: a52tospdif.c,v 1.13 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -61,8 +61,8 @@ static int Create( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != AOUT_FMT_A52
-          || p_filter->output.i_format != AOUT_FMT_SPDIF )
+    if ( p_filter->input.i_format != VLC_FOURCC('a','5','2',' ')
+          || p_filter->output.i_format != VLC_FOURCC('s','p','d','i') )
     {
         return -1;
     }
index ada6df83fbb3454f7647a9c1a8a46e0603d55c44..4958db74874fbf5e889f0af7c5a7fd3e9446780c 100644 (file)
@@ -2,7 +2,7 @@
  * fixed32float32.c : converter from fixed32 to float32 bits integer
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: fixed32tofloat32.c,v 1.8 2002/08/28 22:44:31 massiot Exp $
+ * $Id: fixed32tofloat32.c,v 1.9 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
  *
@@ -58,8 +58,8 @@ static int Create( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != AOUT_FMT_FIXED32
-          || p_filter->output.i_format != AOUT_FMT_FLOAT32 )
+    if ( p_filter->input.i_format != VLC_FOURCC('f','i','3','2')
+          || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
     {
         return -1;
     }
index 110b60bcce650ce8b9bb58088b7e7fd06417a9bd..2070f248d36dbaf94672a8f4f6a1a050ed7a9da7 100644 (file)
@@ -2,7 +2,7 @@
  * fixed32tos16.c : converter from fixed32 to signed 16 bits integer
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: fixed32tos16.c,v 1.5 2002/08/21 22:41:59 massiot Exp $
+ * $Id: fixed32tos16.c,v 1.6 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
  *
@@ -58,7 +58,7 @@ static int Create( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != AOUT_FMT_FIXED32
+    if ( p_filter->input.i_format != VLC_FOURCC('f','i','3','2')
           || p_filter->output.i_format != AOUT_FMT_S16_NE )
     {
         return -1;
index 902a09fd4dea9e0aaac3255f446d3e6554362df0..b4963453c34e80d96de1266e9dceade7042d023b 100644 (file)
@@ -2,7 +2,7 @@
  * float32tos16.c : converter from float32 to signed 16 bits integer
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: float32tos16.c,v 1.9 2002/08/21 22:41:59 massiot Exp $
+ * $Id: float32tos16.c,v 1.10 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -56,7 +56,7 @@ static int Create( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != AOUT_FMT_FLOAT32
+    if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
           || p_filter->output.i_format != AOUT_FMT_S16_NE )
     {
         return -1;
index fad6efe4831623ae2d5bb4d476face34de12067f..ec2943f455c5e91f15f2fcfd8b7bd1419a5aecb3 100644 (file)
@@ -2,7 +2,7 @@
  * float32tos8.c : converter from float32 to signed 8 bits integer
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: float32tos8.c,v 1.4 2002/08/21 22:41:59 massiot Exp $
+ * $Id: float32tos8.c,v 1.5 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Xavier Maillard <zedek@fxgsproject.org>
  *
@@ -58,8 +58,8 @@ static int Create( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != AOUT_FMT_FLOAT32
-          || p_filter->output.i_format != AOUT_FMT_S8 )
+    if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
+          || p_filter->output.i_format != VLC_FOURCC('s','8',' ',' ') )
     {
         return -1;
     }
index bb0fdaaad4d949050f4a69bf1f9203d57ba8f1ab..fab694d3ac4429687170281d5b48e09e83a445e2 100644 (file)
@@ -2,7 +2,7 @@
  * float32tou16.c : converter from float32 to unsigned 16 bits integer
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: float32tou16.c,v 1.4 2002/08/21 22:41:59 massiot Exp $
+ * $Id: float32tou16.c,v 1.5 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Xavier Maillard <zedek@fxgsproject.org>
  *
@@ -58,7 +58,7 @@ static int Create( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != AOUT_FMT_FLOAT32
+    if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
           || p_filter->output.i_format != AOUT_FMT_U16_NE )
     {
         return -1;
index 5dfcede1c19ac8363708c226dec3c60e9b329313..ff5f74c93b7dca8445d153b74e5c4c16a0b41bbd 100644 (file)
@@ -2,7 +2,7 @@
  * float32tou8.c : converter from float32 to unsigned 8 bits integer
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: float32tou8.c,v 1.4 2002/08/21 22:41:59 massiot Exp $
+ * $Id: float32tou8.c,v 1.5 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Xavier Maillard <zedek@fxgsproject.org>
  *
@@ -58,8 +58,8 @@ static int Create( vlc_object_t *p_this )
 {
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
-    if ( p_filter->input.i_format != AOUT_FMT_FLOAT32
-          || p_filter->output.i_format != AOUT_FMT_U8 )
+    if ( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
+          || p_filter->output.i_format != VLC_FOURCC('u','8',' ',' ') )
     {
         return -1;
     }
index 707d0a67dbb4842e09df244fdfeb1c9b148e2c95..aee7485ae74eff45d7bf0b0f2790c53d2ebf2264 100644 (file)
@@ -2,7 +2,7 @@
  * s16tofloat32.c : converter from signed 16 bits integer to float32
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: s16tofloat32.c,v 1.2 2002/08/21 22:41:59 massiot Exp $
+ * $Id: s16tofloat32.c,v 1.3 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -59,7 +59,7 @@ static int Create( vlc_object_t *p_this )
     aout_filter_t * p_filter = (aout_filter_t *)p_this;
 
     if ( p_filter->input.i_format != AOUT_FMT_S16_NE
-          || p_filter->output.i_format != AOUT_FMT_FLOAT32 )
+          || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
     {
         return -1;
     }
index cc25b540f8ffd48270a0808cef97c46d03b32e3c..cbae051c430d4b76c889edf6bc490ba5c703ee8b 100644 (file)
@@ -3,7 +3,7 @@
  *                      with endianness change
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: s16tofloat32swab.c,v 1.5 2002/09/27 23:38:04 massiot Exp $
+ * $Id: s16tofloat32swab.c,v 1.6 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Henri Fallon <henri@videolan.org>
@@ -75,9 +75,9 @@ static int Create( vlc_object_t *p_this )
         return -1;
     }
 
-    if ( (p_filter->input.i_format == AOUT_FMT_S16_LE ||
-         p_filter->input.i_format == AOUT_FMT_S16_BE)
-         && p_filter->output.i_format == AOUT_FMT_FLOAT32
+    if ( (p_filter->input.i_format == VLC_FOURCC('s','1','6','l') ||
+         p_filter->input.i_format == VLC_FOURCC('s','1','6','b'))
+         && p_filter->output.i_format == VLC_FOURCC('f','l','3','2')
          && p_filter->input.i_format != AOUT_FMT_S16_NE )
     {
         p_filter->pf_do_work = DoWork;
index f1bf487d9e619fde4fbcb9864db37a43bdc246bf..d90fc8cc5daed51fc3ce6d73bbbc4d3328cd00da 100644 (file)
@@ -2,7 +2,7 @@
  * trivial.c : trivial resampler (skips samples or pads with zeroes)
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: trivial.c,v 1.5 2002/08/24 16:07:48 sam Exp $
+ * $Id: trivial.c,v 1.6 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -59,8 +59,8 @@ static int Create( vlc_object_t *p_this )
     if ( p_filter->input.i_rate == p_filter->output.i_rate
           || p_filter->input.i_format != p_filter->output.i_format
           || p_filter->input.i_channels != p_filter->output.i_channels
-          || (p_filter->input.i_format != AOUT_FMT_FLOAT32
-               && p_filter->input.i_format != AOUT_FMT_FIXED32) )
+          || (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
+               && p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) )
     {
         return -1;
     }
index 8a66223a97cf9664aabe2ece8df86fcb4a906713..6457f94ecf36d7a774fa69cc2537e5e0c811a4fc 100644 (file)
@@ -2,7 +2,7 @@
  * ugly.c : ugly resampler (changes pitch)
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: ugly.c,v 1.2 2002/08/28 22:25:38 massiot Exp $
+ * $Id: ugly.c,v 1.3 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -59,8 +59,8 @@ static int Create( vlc_object_t *p_this )
     if ( p_filter->input.i_rate == p_filter->output.i_rate
           || p_filter->input.i_format != p_filter->output.i_format
           || p_filter->input.i_channels != p_filter->output.i_channels
-          || (p_filter->input.i_format != AOUT_FMT_FLOAT32
-               && p_filter->input.i_format != AOUT_FMT_FIXED32) )
+          || (p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
+               && p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) )
     {
         return VLC_EGENERIC;
     }
index 7b6fbdf1af055f2a51f451117c715dd37f792781..154286d5cfe9c4b9f3f0f2c941704eb4a0fdc0c8 100644 (file)
@@ -2,7 +2,7 @@
  * float32.c : precise float32 audio mixer implementation
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: float32.c,v 1.4 2002/09/20 23:27:03 massiot Exp $
+ * $Id: float32.c,v 1.5 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -55,7 +55,7 @@ static int Create( vlc_object_t *p_this )
 {
     aout_instance_t * p_aout = (aout_instance_t *)p_this;
 
-    if ( p_aout->mixer.mixer.i_format != AOUT_FMT_FLOAT32 )
+    if ( p_aout->mixer.mixer.i_format != VLC_FOURCC('f','l','3','2') )
     {
         return -1;
     }
index 0e2c1764454dfa6549463d43fac53bbd09892156..0a7f1a96796dc71ccf20be5e599ae3d52c7f6928 100644 (file)
@@ -2,7 +2,7 @@
  * trivial.c : trivial mixer plug-in (1 input, no downmixing)
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: trivial.c,v 1.8 2002/09/28 13:05:16 massiot Exp $
+ * $Id: trivial.c,v 1.9 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -55,8 +55,8 @@ static int Create( vlc_object_t *p_this )
 {
     aout_instance_t * p_aout = (aout_instance_t *)p_this;
 
-    if ( p_aout->mixer.mixer.i_format != AOUT_FMT_FLOAT32
-          && p_aout->mixer.mixer.i_format != AOUT_FMT_FIXED32 )
+    if ( p_aout->mixer.mixer.i_format != VLC_FOURCC('f','l','3','2')
+          && p_aout->mixer.mixer.i_format != VLC_FOURCC('f','i','3','2') )
     {
         return -1;
     }
index b735c88e63db36eafa2990fadb833deafea55456..22a73d07ff2d979a215d5413d3c9245d36231940 100644 (file)
@@ -2,7 +2,7 @@
  * alsa.c : alsa plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: alsa.c,v 1.11 2002/09/18 21:21:23 massiot Exp $
+ * $Id: alsa.c,v 1.12 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Henri Fallon <henri@videolan.org> - Original Author
  *          Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
@@ -136,7 +136,7 @@ static int Open( vlc_object_t *p_this )
     else
     {
         /* Use the internal logic to decide on the device name */
-        if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
+        if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') )
         {
             /* Will probably need some little modification in the case
                we want to send some data at a different rate
@@ -180,7 +180,7 @@ static int Open( vlc_object_t *p_this )
     /* Default settings */
     p_sys->b_can_sleek = VLC_FALSE;
     i_channels = p_aout->output.output.i_channels;
-    if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
+    if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') )
     {
         p_sys->i_buffer_size = ALSA_SPDIF_BUFFER_SIZE;
         p_aout->output.i_nb_samples = ALSA_SPDIF_PERIOD_SIZE;
@@ -195,17 +195,11 @@ static int Open( vlc_object_t *p_this )
     /* Compute the settings */
     switch (p_aout->output.output.i_format)
     {
-        case AOUT_FMT_MU_LAW:    i_format = SND_PCM_FORMAT_MU_LAW; break;
-        case AOUT_FMT_A_LAW:     i_format = SND_PCM_FORMAT_A_LAW; break;
-        case AOUT_FMT_IMA_ADPCM: i_format = SND_PCM_FORMAT_IMA_ADPCM; break;
-        case AOUT_FMT_U8:        i_format = SND_PCM_FORMAT_U8; break;
-        case AOUT_FMT_S16_LE:    i_format = SND_PCM_FORMAT_S16_LE; break;
-        case AOUT_FMT_S16_BE:    i_format = SND_PCM_FORMAT_S16_BE; break;
-        case AOUT_FMT_S8:        i_format = SND_PCM_FORMAT_S8; break;
-        case AOUT_FMT_U16_LE:    i_format = SND_PCM_FORMAT_U16_LE; break;
-        case AOUT_FMT_U16_BE:    i_format = SND_PCM_FORMAT_U16_BE; break;
-        case AOUT_FMT_FLOAT32:   i_format = SND_PCM_FORMAT_FLOAT; break;
-        case AOUT_FMT_SPDIF:
+        case VLC_FOURCC('f','l','3','2'):
+            i_format = SND_PCM_FORMAT_FLOAT;
+            break;
+
+        case VLC_FOURCC('s','p','d','i'):
             /* Override some settings to make S/PDIF work */
             p_sys->b_can_sleek = VLC_TRUE;
             i_format = SND_PCM_FORMAT_S16_LE;
@@ -213,7 +207,6 @@ static int Open( vlc_object_t *p_this )
             p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
             p_aout->output.output.i_frame_length = ALSA_SPDIF_PERIOD_SIZE;
             break;
-        case AOUT_FMT_FIXED32:
         default:
             msg_Err( p_aout, "audio output format 0x%x not supported",
                      p_aout->output.output.i_format );
index 2bc7610bff3aa3077080e2a519def01993107646..500a0cdef0766d687fa1f8a151e1834db0c24e11 100644 (file)
@@ -2,7 +2,7 @@
  * file.c : audio output which writes the samples to a file
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: file.c,v 1.11 2002/09/18 21:21:23 massiot Exp $
+ * $Id: file.c,v 1.12 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -54,10 +54,16 @@ static void    Play        ( aout_instance_t * );
 static char *format_list[] = { "u8", "s8", "u16", "s16", "u16_le", "s16_le",
                                "u16_be", "s16_be", "fixed32", "float32",
                                "spdif", NULL };
-static int format_int[] = { AOUT_FMT_U8, AOUT_FMT_S8, AOUT_FMT_U16_NE,
-                            AOUT_FMT_S16_NE, AOUT_FMT_U16_LE, AOUT_FMT_S16_LE,
-                            AOUT_FMT_U16_BE, AOUT_FMT_S16_BE, AOUT_FMT_FIXED32,
-                            AOUT_FMT_FLOAT32, AOUT_FMT_SPDIF };
+static int format_int[] = { VLC_FOURCC('u','8',' ',' '),
+                            VLC_FOURCC('s','8',' ',' '),
+                            AOUT_FMT_U16_NE, AOUT_FMT_S16_NE,
+                            VLC_FOURCC('u','1','6','l'),
+                            VLC_FOURCC('s','1','6','l'),
+                            VLC_FOURCC('u','1','6','b'),
+                            VLC_FOURCC('s','1','6','b'),
+                            VLC_FOURCC('f','i','3','2'),
+                            VLC_FOURCC('f','l','3','2'),
+                            VLC_FOURCC('s','p','i','f') };
 
 #define PATH_TEXT N_("path of the output file")
 #define PATH_LONGTEXT N_("By default samples.raw")
@@ -111,7 +117,7 @@ static int Open( vlc_object_t * p_this )
     }
 
     p_aout->output.output.i_format = format_int[i];
-    if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
+    if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') )
     {
         p_aout->output.i_nb_samples = A52_FRAME_NB;
         p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
index c3c3582a32e4ad836b1d2b99dd9917bd659c503f..d28f88deace6b69dc328d67f29680af280ff6c25 100644 (file)
@@ -2,7 +2,7 @@
  * oss.c : OSS /dev/dsp module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2002 VideoLAN
- * $Id: oss.c,v 1.26 2002/09/18 21:21:23 massiot Exp $
+ * $Id: oss.c,v 1.27 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -158,9 +158,9 @@ static int Open( vlc_object_t *p_this )
     }
 
     /* Set the output format */
-    if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
+    if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') )
     {
-        i_format = AOUT_FMT_SPDIF;
+        i_format = VLC_FOURCC('s','p','d','i');
         p_aout->output.i_nb_samples = A52_FRAME_NB;
         p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
         p_aout->output.output.i_frame_length = A52_FRAME_NB;
@@ -178,7 +178,7 @@ static int Open( vlc_object_t *p_this )
     if( ioctl( p_sys->i_fd, SNDCTL_DSP_SETFMT, &i_format ) < 0
          || i_format != p_aout->output.output.i_format )
     {
-        if ( i_format == AOUT_FMT_SPDIF )
+        if ( i_format == VLC_FOURCC('s','p','d','i') )
         {
             /* Retry with S16 */
             msg_Warn( p_aout, "cannot set audio output format (%i)", i_format );
@@ -199,7 +199,7 @@ static int Open( vlc_object_t *p_this )
         }
     }
 
-    if ( p_aout->output.output.i_format != AOUT_FMT_SPDIF )
+    if ( p_aout->output.output.i_format != VLC_FOURCC('s','p','d','i') )
     {
         /* FIXME */
         if ( p_aout->output.output.i_channels > 2 )
@@ -326,7 +326,7 @@ static int OSSThread( aout_instance_t * p_aout )
         int i_tmp, i_size;
         byte_t * p_bytes;
 
-        if ( p_aout->output.output.i_format != AOUT_FMT_SPDIF )
+        if ( p_aout->output.output.i_format != VLC_FOURCC('s','p','d','i') )
         {
             mtime_t buffered = BufferDuration( p_aout );
 
index d92ec9425e5cc659fa309001a25d52c2c15d65f7..a0c8aa3038de2f56f7c5f1ec1c7a235a1a7c2b66 100644 (file)
@@ -2,7 +2,7 @@
  * a52.c: A/52 basic parser
  *****************************************************************************
  * Copyright (C) 2001-2002 VideoLAN
- * $Id: a52.c,v 1.13 2002/09/26 22:40:20 massiot Exp $
+ * $Id: a52.c,v 1.14 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Stéphane Borel <stef@via.ecp.fr>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -125,7 +125,7 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
     p_dec->p_aout = NULL;
     p_dec->p_aout_input = NULL;
     p_dec->p_fifo = p_fifo;
-    p_dec->output_format.i_format = AOUT_FMT_A52;
+    p_dec->output_format.i_format = VLC_FOURCC('a','5','2',' ');
 
     /* Init the bitstream */
     InitBitstream( &p_dec->bit_stream, p_dec->p_fifo,
index 7c5966ece2f3e364363482dad192cca8cccf603c..b4fd779176a6e7e39bbe38fcd0b6804781b7b169 100644 (file)
@@ -2,7 +2,7 @@
  * decoder.c: AAC decoder using libfaad2
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: decoder.c,v 1.4 2002/09/28 13:05:16 massiot Exp $
+ * $Id: decoder.c,v 1.5 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *      
@@ -326,7 +326,7 @@ static int InitThread( adec_thread_t * p_adec )
         
 
     /* Initialize the thread properties */
-    p_adec->output_format.i_format = AOUT_FMT_FLOAT32;
+    p_adec->output_format.i_format = VLC_FOURCC('f','l','3','2');
     p_adec->output_format.i_rate = i_rate;
     p_adec->output_format.i_channels = i_channels;
     p_adec->p_aout = NULL;
index 4c315d7025ce70458caf4be57289780afcdbecd2..766bde83fb8570156478fd636814fc588c331af2 100644 (file)
@@ -2,7 +2,7 @@
  * lpcm.c: lpcm decoder module
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: lpcm.c,v 1.3 2002/09/28 13:05:16 massiot Exp $
+ * $Id: lpcm.c,v 1.4 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Henri Fallon <henri@videolan.org>
@@ -126,7 +126,7 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
    
     /* FIXME : I suppose the number of channel and sampling rate 
      * are somewhere in the headers */
-    p_dec->output_format.i_format = AOUT_FMT_S16_BE;
+    p_dec->output_format.i_format = VLC_FOURCC('s','1','6','b');
     p_dec->output_format.i_channels = 2;
     p_dec->output_format.i_rate = 48000;
     
index 07658a5eb1e464a0273fdfc461c3750fcb35dd76..06ddc4a52ac13997c2deaca89725c08d77673665 100644 (file)
@@ -141,7 +141,7 @@ static int InitThread( mad_adec_thread_t * p_dec )
     /* Initialize the thread properties */
     p_dec->p_aout = NULL;
     p_dec->p_aout_input = NULL;
-    p_dec->output_format.i_format = AOUT_FMT_FIXED32;
+    p_dec->output_format.i_format = VLC_FOURCC('f','i','3','2');
 
     /*
      * Properties of audio for libmad
index 413168b85c4c1137d73c67b12087e602f4399df6..b23115e40e8b0de931799ddf2080e4716b6ab216 100644 (file)
@@ -2,7 +2,7 @@
  * decoder.c: MPEG audio decoder thread
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: decoder.c,v 1.4 2002/09/26 22:40:23 massiot Exp $
+ * $Id: decoder.c,v 1.5 2002/09/30 21:32:32 massiot Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Michel Lespinasse <walken@via.ecp.fr>
@@ -178,7 +178,7 @@ static void DecodeThread( adec_thread_t * p_dec )
             }
 
             /* Set output configuration */
-            p_dec->output_format.i_format   = AOUT_FMT_FLOAT32;
+            p_dec->output_format.i_format   = VLC_FOURCC('f','l','3','2');
             p_dec->output_format.i_channels = ( sync_info.b_stereo ? 2 : 1 );
             p_dec->output_format.i_rate     = sync_info.sample_rate;
             aout_DateInit( &p_dec->end_date, sync_info.sample_rate );
index 0ebd41d5123d1ff20ec40f8b68fb6c644241fafa..5c4a8d060176d92b38c4f32878e7afde94d7e6a6 100644 (file)
@@ -2,7 +2,7 @@
  * aout.m: CoreAudio output plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: aout.m,v 1.10 2002/09/18 21:21:24 massiot Exp $
+ * $Id: aout.m,v 1.11 2002/09/30 21:32:33 massiot Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
@@ -120,7 +120,7 @@ int E_(OpenAudio)( vlc_object_t * p_this )
     }
 
     /* We only deal with floats. FIXME : this is where we should do S/PDIF. */
-    p_aout->output.output.i_format = AOUT_FMT_FLOAT32;
+    p_aout->output.output.i_format = VLC_FOURCC('f','l','3','2');
 
     /* Set sample rate and channels per frame */
     p_aout->output.output.i_rate = p_sys->stream_format.mSampleRate;
index 17a9d045ca4617f23336ce2d30468504c816c8e5..6198c24806a9480399149f3654ca8d61cd48e406 100644 (file)
@@ -266,7 +266,7 @@ static int QNXaoutThread( aout_instance_t * p_aout )
         int i_tmp, i_size;
         byte_t * p_bytes;
 
-        if ( p_aout->output.output.i_format != AOUT_FMT_SPDIF )
+        if ( p_aout->output.output.i_format != VLC_FOURCC('s','p','d','i') )
         {
             mtime_t next_date = 0;
 
index 87b1025e941601f09658c1af2795066308494b82..bfd0b2f23f6cb0b63f0f3ce9458b5a87334e2fbb 100644 (file)
@@ -2,7 +2,7 @@
  * aout_dummy.c : dummy audio output plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: aout.c,v 1.9 2002/09/18 21:21:24 massiot Exp $
+ * $Id: aout.c,v 1.10 2002/09/30 21:32:33 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -50,7 +50,7 @@ int E_(OpenAudio) ( vlc_object_t * p_this )
     p_aout->output.pf_play = Play;
     aout_VolumeSoftInit( p_aout );
 
-    if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
+    if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') )
     {
         p_aout->output.i_nb_samples = A52_FRAME_NB;
         p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
index 1bccddc50d612f5c13c21d8a891e07e9b26ae7b2..4043eb21df8aff78e693a072607dae5b8fa9251e 100644 (file)
@@ -2,7 +2,7 @@
  * common.c : audio output management of common data structures
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: common.c,v 1.1 2002/09/26 22:40:25 massiot Exp $
+ * $Id: common.c,v 1.2 2002/09/30 21:32:33 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -136,32 +136,30 @@ void aout_FormatPrepare( audio_sample_format_t * p_format )
 
     switch ( p_format->i_format )
     {
-    case AOUT_FMT_U8:
-    case AOUT_FMT_S8:
+    case VLC_FOURCC('u','8',' ',' '):
+    case VLC_FOURCC('s','8',' ',' '):
         i_result = 1;
         break;
 
-    case AOUT_FMT_U16_LE:
-    case AOUT_FMT_U16_BE:
-    case AOUT_FMT_S16_LE:
-    case AOUT_FMT_S16_BE:
+    case VLC_FOURCC('u','1','6','l'):
+    case VLC_FOURCC('s','1','6','l'):
+    case VLC_FOURCC('u','1','6','b'):
+    case VLC_FOURCC('s','1','6','b'):
         i_result = 2;
         break;
 
-    case AOUT_FMT_FLOAT32:
-    case AOUT_FMT_FIXED32:
+    case VLC_FOURCC('f','l','3','2'):
+    case VLC_FOURCC('f','i','3','2'):
         i_result = 4;
         break;
 
-    case AOUT_FMT_SPDIF:
-    case AOUT_FMT_A52:
-    case AOUT_FMT_DTS:
+    case VLC_FOURCC('s','p','d','i'):
+    case VLC_FOURCC('a','5','2',' '):
+    case VLC_FOURCC('d','t','s',' '):
+    default:
         /* For these formats the caller has to indicate the parameters
          * by hand. */
         return;
-
-    default:
-        i_result = 0; /* will segfault much sooner... */
     }
 
     p_format->i_bytes_per_frame = i_result * aout_FormatNbChannels( p_format );
index 05024856f81a9eddf729e9f5c4cf9be31958ca3b..930fd8533e9784d252b66830cacb5497c38b7305 100644 (file)
@@ -2,7 +2,7 @@
  * filters.c : audio output filters management
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: filters.c,v 1.10 2002/09/22 14:53:52 massiot Exp $
+ * $Id: filters.c,v 1.11 2002/09/30 21:32:33 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -128,8 +128,9 @@ int aout_FiltersCreatePipeline( aout_instance_t * p_aout,
         return 0;
     }
 
-    msg_Dbg( p_aout, "filter(s) format=%d->%d rate=%d->%d channels=%d->%d",
-             p_input_format->i_format, p_output_format->i_format,
+    msg_Dbg( p_aout, "filter(s) format=%4.4s->%4.4s rate=%d->%d channels=%d->%d",
+             (char *)&p_input_format->i_format,
+             (char *)&p_output_format->i_format,
              p_input_format->i_rate, p_output_format->i_rate,
              p_input_format->i_channels, p_output_format->i_channels );
 
index 0a0a6031af0684cb3c3d4a637b175b9ec7e42421..5ddbcfad1df81f093e9b65f43ab95780bcaa9a97 100644 (file)
@@ -2,7 +2,7 @@
  * output.c : internal management of output streams for the audio output
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: output.c,v 1.15 2002/09/26 22:40:25 massiot Exp $
+ * $Id: output.c,v 1.16 2002/09/30 21:32:33 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -50,14 +50,15 @@ int aout_OutputNew( aout_instance_t * p_aout,
     if ( i_channels != -1 ) p_aout->output.output.i_channels = i_channels;
     if ( AOUT_FMT_NON_LINEAR(&p_aout->output.output) )
     {
-        p_aout->output.output.i_format = AOUT_FMT_SPDIF;
+        p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i');
     }
     else
     {
         /* Non-S/PDIF mixer only deals with float32 or fixed32. */
         p_aout->output.output.i_format
                      = (p_aout->p_vlc->i_cpu & CPU_CAPABILITY_FPU) ?
-                        AOUT_FMT_FLOAT32 : AOUT_FMT_FIXED32;
+                        VLC_FOURCC('f','l','3','2') :
+                        VLC_FOURCC('f','i','3','2');
     }
     aout_FormatPrepare( &p_aout->output.output );
 
@@ -80,8 +81,9 @@ int aout_OutputNew( aout_instance_t * p_aout,
 
     vlc_mutex_unlock( &p_aout->output_fifo_lock );
 
-    msg_Dbg( p_aout, "output format=%d rate=%d channels=%d",
-             p_aout->output.output.i_format, p_aout->output.output.i_rate,
+    msg_Dbg( p_aout, "output format=%4.4s rate=%d channels=%d",
+             (char *)&p_aout->output.output.i_format,
+             p_aout->output.output.i_rate,
              p_aout->output.output.i_channels );
 
     /* Calculate the resulting mixer output format. */
@@ -92,7 +94,8 @@ int aout_OutputNew( aout_instance_t * p_aout,
         /* Non-S/PDIF mixer only deals with float32 or fixed32. */
         p_aout->mixer.mixer.i_format
                      = (p_aout->p_vlc->i_cpu & CPU_CAPABILITY_FPU) ?
-                        AOUT_FMT_FLOAT32 : AOUT_FMT_FIXED32;
+                        VLC_FOURCC('f','l','3','2') :
+                        VLC_FOURCC('f','i','3','2');
         aout_FormatPrepare( &p_aout->mixer.mixer );
     }
     else
@@ -100,8 +103,8 @@ int aout_OutputNew( aout_instance_t * p_aout,
         p_aout->mixer.mixer.i_format = p_format->i_format;
     }
 
-    msg_Dbg( p_aout, "mixer format=%d rate=%d channels=%d",
-             p_aout->mixer.mixer.i_format, p_aout->mixer.mixer.i_rate,
+    msg_Dbg( p_aout, "mixer format=%4.4s rate=%d channels=%d",
+             (char *)&p_aout->mixer.mixer.i_format, p_aout->mixer.mixer.i_rate,
              p_aout->mixer.mixer.i_channels );
 
     /* Create filters. */