From: Christophe Massiot Date: Mon, 30 Sep 2002 21:32:33 +0000 (+0000) Subject: * Made audio_sample_format->i_format a FOURCC to allow the creation of X-Git-Tag: 0.5.0~926 X-Git-Url: https://git.sesse.net/?p=vlc;a=commitdiff_plain;h=9a6b90b85548cd6ccec21cc6f2115902799a8b85 * Made audio_sample_format->i_format a FOURCC to allow the creation of new ones. --- diff --git a/include/audio_output.h b/include/audio_output.h index e7909f3088..1f413c4d89 100644 --- a/include/audio_output.h +++ b/include/audio_output.h @@ -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 * @@ -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 */ /* diff --git a/modules/audio_filter/channel_mixer/trivial.c b/modules/audio_filter/channel_mixer/trivial.c index 1a43c48c52..4a023c4b33 100644 --- a/modules/audio_filter/channel_mixer/trivial.c +++ b/modules/audio_filter/channel_mixer/trivial.c @@ -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 * @@ -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; } diff --git a/modules/audio_filter/converter/a52tofloat32.c b/modules/audio_filter/converter/a52tofloat32.c index 96081ac26d..7b096824c2 100644 --- a/modules/audio_filter/converter/a52tofloat32.c +++ b/modules/audio_filter/converter/a52tofloat32.c @@ -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 * Christophe Massiot @@ -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; } diff --git a/modules/audio_filter/converter/a52tospdif.c b/modules/audio_filter/converter/a52tospdif.c index 37c52e7c6d..156e8705c2 100644 --- a/modules/audio_filter/converter/a52tospdif.c +++ b/modules/audio_filter/converter/a52tospdif.c @@ -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 * Stéphane Borel @@ -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; } diff --git a/modules/audio_filter/converter/fixed32tofloat32.c b/modules/audio_filter/converter/fixed32tofloat32.c index ada6df83fb..4958db7487 100644 --- a/modules/audio_filter/converter/fixed32tofloat32.c +++ b/modules/audio_filter/converter/fixed32tofloat32.c @@ -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 * @@ -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; } diff --git a/modules/audio_filter/converter/fixed32tos16.c b/modules/audio_filter/converter/fixed32tos16.c index 110b60bcce..2070f248d3 100644 --- a/modules/audio_filter/converter/fixed32tos16.c +++ b/modules/audio_filter/converter/fixed32tos16.c @@ -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 * @@ -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; diff --git a/modules/audio_filter/converter/float32tos16.c b/modules/audio_filter/converter/float32tos16.c index 902a09fd4d..b4963453c3 100644 --- a/modules/audio_filter/converter/float32tos16.c +++ b/modules/audio_filter/converter/float32tos16.c @@ -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 * @@ -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; diff --git a/modules/audio_filter/converter/float32tos8.c b/modules/audio_filter/converter/float32tos8.c index fad6efe483..ec2943f455 100644 --- a/modules/audio_filter/converter/float32tos8.c +++ b/modules/audio_filter/converter/float32tos8.c @@ -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 * @@ -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; } diff --git a/modules/audio_filter/converter/float32tou16.c b/modules/audio_filter/converter/float32tou16.c index bb0fdaaad4..fab694d3ac 100644 --- a/modules/audio_filter/converter/float32tou16.c +++ b/modules/audio_filter/converter/float32tou16.c @@ -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 * @@ -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; diff --git a/modules/audio_filter/converter/float32tou8.c b/modules/audio_filter/converter/float32tou8.c index 5dfcede1c1..ff5f74c93b 100644 --- a/modules/audio_filter/converter/float32tou8.c +++ b/modules/audio_filter/converter/float32tou8.c @@ -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 * @@ -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; } diff --git a/modules/audio_filter/converter/s16tofloat32.c b/modules/audio_filter/converter/s16tofloat32.c index 707d0a67db..aee7485ae7 100644 --- a/modules/audio_filter/converter/s16tofloat32.c +++ b/modules/audio_filter/converter/s16tofloat32.c @@ -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 * @@ -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; } diff --git a/modules/audio_filter/converter/s16tofloat32swab.c b/modules/audio_filter/converter/s16tofloat32swab.c index cc25b540f8..cbae051c43 100644 --- a/modules/audio_filter/converter/s16tofloat32swab.c +++ b/modules/audio_filter/converter/s16tofloat32swab.c @@ -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 * Henri Fallon @@ -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; diff --git a/modules/audio_filter/resampler/trivial.c b/modules/audio_filter/resampler/trivial.c index f1bf487d9e..d90fc8cc5d 100644 --- a/modules/audio_filter/resampler/trivial.c +++ b/modules/audio_filter/resampler/trivial.c @@ -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 * @@ -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; } diff --git a/modules/audio_filter/resampler/ugly.c b/modules/audio_filter/resampler/ugly.c index 8a66223a97..6457f94ecf 100644 --- a/modules/audio_filter/resampler/ugly.c +++ b/modules/audio_filter/resampler/ugly.c @@ -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 * @@ -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; } diff --git a/modules/audio_mixer/float32.c b/modules/audio_mixer/float32.c index 7b6fbdf1af..154286d5cf 100644 --- a/modules/audio_mixer/float32.c +++ b/modules/audio_mixer/float32.c @@ -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 * @@ -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; } diff --git a/modules/audio_mixer/trivial.c b/modules/audio_mixer/trivial.c index 0e2c176445..0a7f1a9679 100644 --- a/modules/audio_mixer/trivial.c +++ b/modules/audio_mixer/trivial.c @@ -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 * @@ -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; } diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c index b735c88e63..22a73d07ff 100644 --- a/modules/audio_output/alsa.c +++ b/modules/audio_output/alsa.c @@ -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 - Original Author * Jeffrey Baker - 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 ); diff --git a/modules/audio_output/file.c b/modules/audio_output/file.c index 2bc7610bff..500a0cdef0 100644 --- a/modules/audio_output/file.c +++ b/modules/audio_output/file.c @@ -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 * @@ -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; diff --git a/modules/audio_output/oss.c b/modules/audio_output/oss.c index c3c3582a32..d28f88deac 100644 --- a/modules/audio_output/oss.c +++ b/modules/audio_output/oss.c @@ -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 * Samuel Hocevar @@ -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 ); diff --git a/modules/codec/a52.c b/modules/codec/a52.c index d92ec9425e..a0c8aa3038 100644 --- a/modules/codec/a52.c +++ b/modules/codec/a52.c @@ -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 * Christophe Massiot @@ -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, diff --git a/modules/codec/faad/decoder.c b/modules/codec/faad/decoder.c index 7c5966ece2..b4fd779176 100644 --- a/modules/codec/faad/decoder.c +++ b/modules/codec/faad/decoder.c @@ -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 * @@ -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; diff --git a/modules/codec/lpcm.c b/modules/codec/lpcm.c index 4c315d7025..766bde83fb 100644 --- a/modules/codec/lpcm.c +++ b/modules/codec/lpcm.c @@ -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 * Henri Fallon @@ -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; diff --git a/modules/codec/mad/decoder.c b/modules/codec/mad/decoder.c index 07658a5eb1..06ddc4a52a 100644 --- a/modules/codec/mad/decoder.c +++ b/modules/codec/mad/decoder.c @@ -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 diff --git a/modules/codec/mpeg_audio/decoder.c b/modules/codec/mpeg_audio/decoder.c index 413168b85c..b23115e40e 100644 --- a/modules/codec/mpeg_audio/decoder.c +++ b/modules/codec/mpeg_audio/decoder.c @@ -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 * Michel Lespinasse @@ -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 ); diff --git a/modules/gui/macosx/aout.m b/modules/gui/macosx/aout.m index 0ebd41d512..5c4a8d0601 100644 --- a/modules/gui/macosx/aout.m +++ b/modules/gui/macosx/aout.m @@ -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 * Jon Lech Johansen @@ -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; diff --git a/modules/gui/qnx/aout.c b/modules/gui/qnx/aout.c index 17a9d045ca..6198c24806 100644 --- a/modules/gui/qnx/aout.c +++ b/modules/gui/qnx/aout.c @@ -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; diff --git a/modules/misc/dummy/aout.c b/modules/misc/dummy/aout.c index 87b1025e94..bfd0b2f23f 100644 --- a/modules/misc/dummy/aout.c +++ b/modules/misc/dummy/aout.c @@ -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 * @@ -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; diff --git a/src/audio_output/common.c b/src/audio_output/common.c index 1bccddc50d..4043eb21df 100644 --- a/src/audio_output/common.c +++ b/src/audio_output/common.c @@ -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 * @@ -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 ); diff --git a/src/audio_output/filters.c b/src/audio_output/filters.c index 05024856f8..930fd8533e 100644 --- a/src/audio_output/filters.c +++ b/src/audio_output/filters.c @@ -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 * @@ -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 ); diff --git a/src/audio_output/output.c b/src/audio_output/output.c index 0a0a6031af..5ddbcfad1d 100644 --- a/src/audio_output/output.c +++ b/src/audio_output/output.c @@ -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 * @@ -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. */