Commit 5fc35373 authored by Gildas Bazin's avatar Gildas Bazin

* modules/demux/wav.c: more fixes for multichannel wav files support.
* include/codecs.h: ms speakers definitions.
* modules/codec/araw.c: added support for fl64 fourcc.
parent 914b337e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* codecs.h: codec related structures needed by the demuxers and decoders * codecs.h: codec related structures needed by the demuxers and decoders
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: codecs.h,v 1.11 2004/02/14 17:03:33 gbazin Exp $ * $Id: codecs.h,v 1.12 2004/02/23 23:01:05 gbazin Exp $
* *
* Author: Gildas Bazin <gbazin@netcourrier.com> * Author: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -126,8 +126,7 @@ typedef struct ...@@ -126,8 +126,7 @@ typedef struct
unsigned int i_id; unsigned int i_id;
} dvb_spuinfo_t; } dvb_spuinfo_t;
/* WAVE form wFormatTag IDs */ /* WAVE format wFormatTag IDs */
#define WAVE_FORMAT_UNKNOWN 0x0000 /* Microsoft Corporation */ #define WAVE_FORMAT_UNKNOWN 0x0000 /* Microsoft Corporation */
#define WAVE_FORMAT_PCM 0x0001 /* Microsoft Corporation */ #define WAVE_FORMAT_PCM 0x0001 /* Microsoft Corporation */
#define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */ #define WAVE_FORMAT_ADPCM 0x0002 /* Microsoft Corporation */
...@@ -155,6 +154,27 @@ typedef struct ...@@ -155,6 +154,27 @@ typedef struct
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */ #define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */
#endif #endif
/* Microsoft speaker definitions */
#define WAVE_SPEAKER_FRONT_LEFT 0x1
#define WAVE_SPEAKER_FRONT_RIGHT 0x2
#define WAVE_SPEAKER_FRONT_CENTER 0x4
#define WAVE_SPEAKER_LOW_FREQUENCY 0x8
#define WAVE_SPEAKER_BACK_LEFT 0x10
#define WAVE_SPEAKER_BACK_RIGHT 0x20
#define WAVE_SPEAKER_FRONT_LEFT_OF_CENTER 0x40
#define WAVE_SPEAKER_FRONT_RIGHT_OF_CENTER 0x80
#define WAVE_SPEAKER_BACK_CENTER 0x100
#define WAVE_SPEAKER_SIDE_LEFT 0x200
#define WAVE_SPEAKER_SIDE_RIGHT 0x400
#define WAVE_SPEAKER_TOP_CENTER 0x800
#define WAVE_SPEAKER_TOP_FRONT_LEFT 0x1000
#define WAVE_SPEAKER_TOP_FRONT_CENTER 0x2000
#define WAVE_SPEAKER_TOP_FRONT_RIGHT 0x4000
#define WAVE_SPEAKER_TOP_BACK_LEFT 0x8000
#define WAVE_SPEAKER_TOP_BACK_CENTER 0x10000
#define WAVE_SPEAKER_TOP_BACK_RIGHT 0x20000
#define WAVE_SPEAKER_RESERVED 0x80000000
static struct static struct
{ {
uint16_t i_tag; uint16_t i_tag;
...@@ -165,7 +185,7 @@ wave_format_tag_to_fourcc[] = ...@@ -165,7 +185,7 @@ wave_format_tag_to_fourcc[] =
{ {
{ WAVE_FORMAT_PCM, VLC_FOURCC( 'a', 'r', 'a', 'w' ), "Raw audio" }, { WAVE_FORMAT_PCM, VLC_FOURCC( 'a', 'r', 'a', 'w' ), "Raw audio" },
{ WAVE_FORMAT_ADPCM, VLC_FOURCC( 'm', 's', 0x00,0x02), "Adpcm" }, { WAVE_FORMAT_ADPCM, VLC_FOURCC( 'm', 's', 0x00,0x02), "Adpcm" },
{ WAVE_FORMAT_IEEE_FLOAT, VLC_FOURCC( 'f', 'l', '3', '2' ), "IEEE Float audio" }, { WAVE_FORMAT_IEEE_FLOAT, VLC_FOURCC( 'a', 'f', 'l', 't' ), "IEEE Float audio" },
{ WAVE_FORMAT_ALAW, VLC_FOURCC( 'a', 'l', 'a', 'w' ), "A-Law" }, { WAVE_FORMAT_ALAW, VLC_FOURCC( 'a', 'l', 'a', 'w' ), "A-Law" },
{ WAVE_FORMAT_MULAW, VLC_FOURCC( 'm', 'l', 'a', 'w' ), "Mu-Law" }, { WAVE_FORMAT_MULAW, VLC_FOURCC( 'm', 'l', 'a', 'w' ), "Mu-Law" },
{ WAVE_FORMAT_IMA_ADPCM,VLC_FOURCC( 'm', 's', 0x00,0x11), "Ima-Adpcm" }, { WAVE_FORMAT_IMA_ADPCM,VLC_FOURCC( 'm', 's', 0x00,0x11), "Ima-Adpcm" },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* araw.c: Pseudo audio decoder; for raw pcm data * araw.c: Pseudo audio decoder; for raw pcm data
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2003 VideoLAN * Copyright (C) 2001, 2003 VideoLAN
* $Id: araw.c,v 1.29 2004/02/14 17:03:32 gbazin Exp $ * $Id: araw.c,v 1.30 2004/02/23 23:01:05 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -160,7 +160,7 @@ static int DecoderOpen( vlc_object_t *p_this ) ...@@ -160,7 +160,7 @@ static int DecoderOpen( vlc_object_t *p_this )
{ {
/* from wav/avi/asf file */ /* from wav/avi/asf file */
case VLC_FOURCC('a','r','a','w'): case VLC_FOURCC('a','r','a','w'):
case VLC_FOURCC('f','l','3','2'): case VLC_FOURCC('a','f','l','t'):
/* _signed_ big endian samples (mov)*/ /* _signed_ big endian samples (mov)*/
case VLC_FOURCC('t','w','o','s'): case VLC_FOURCC('t','w','o','s'):
/* _signed_ little endian samples (mov)*/ /* _signed_ little endian samples (mov)*/
...@@ -202,13 +202,16 @@ static int DecoderOpen( vlc_object_t *p_this ) ...@@ -202,13 +202,16 @@ static int DecoderOpen( vlc_object_t *p_this )
p_dec->fmt_in.audio.i_rate, p_dec->fmt_in.audio.i_channels, p_dec->fmt_in.audio.i_rate, p_dec->fmt_in.audio.i_channels,
p_dec->fmt_in.audio.i_bitspersample ); p_dec->fmt_in.audio.i_bitspersample );
if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'f', 'l', '3', '2' ) ) if( p_dec->fmt_in.i_codec == VLC_FOURCC( 'a', 'f', 'l', 't' ) )
{ {
switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 ) switch( ( p_dec->fmt_in.audio.i_bitspersample + 7 ) / 8 )
{ {
case 4: case 4:
p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2'); p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
break; break;
case 8:
p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','6','4');
break;
default: default:
msg_Err( p_dec, "bad parameters(bits/sample)" ); msg_Err( p_dec, "bad parameters(bits/sample)" );
return VLC_EGENERIC; return VLC_EGENERIC;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wav.c : wav file input module for vlc * wav.c : wav file input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: wav.c,v 1.13 2004/02/14 17:03:32 gbazin Exp $ * $Id: wav.c,v 1.14 2004/02/23 23:01:05 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -118,7 +118,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -118,7 +118,7 @@ static int Open( vlc_object_t * p_this )
msg_Err( p_input, "invalid 'fmt ' chunk" ); msg_Err( p_input, "invalid 'fmt ' chunk" );
goto error; goto error;
} }
stream_Read( p_input->s, NULL, 8 ); /* cannot fail */ stream_Read( p_input->s, NULL, 8 ); /* Cannot fail */
/* load waveformatex */ /* load waveformatex */
p_wf = (WAVEFORMATEX *)p_wf_ext = malloc( __EVEN( i_size ) + 2 ); p_wf = (WAVEFORMATEX *)p_wf_ext = malloc( __EVEN( i_size ) + 2 );
...@@ -143,7 +143,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -143,7 +143,7 @@ static int Open( vlc_object_t * p_this )
/* Handle new WAVE_FORMAT_EXTENSIBLE wav files */ /* Handle new WAVE_FORMAT_EXTENSIBLE wav files */
if( GetWLE( &p_wf->wFormatTag ) == WAVE_FORMAT_EXTENSIBLE && if( GetWLE( &p_wf->wFormatTag ) == WAVE_FORMAT_EXTENSIBLE &&
i_size >= sizeof( WAVEFORMATEXTENSIBLE ) - 2 ) i_size >= sizeof( WAVEFORMATEXTENSIBLE ) )
{ {
wf_tag_to_fourcc( GetWLE( &p_wf_ext->SubFormat ), wf_tag_to_fourcc( GetWLE( &p_wf_ext->SubFormat ),
&p_sys->fmt.i_codec, &psz_name ); &p_sys->fmt.i_codec, &psz_name );
...@@ -158,8 +158,8 @@ static int Open( vlc_object_t * p_this ) ...@@ -158,8 +158,8 @@ static int Open( vlc_object_t * p_this )
p_sys->fmt.i_extra ); p_sys->fmt.i_extra );
} }
msg_Dbg( p_input, "format: 0x%4.4x fourcc: %4.4s channels: %d " msg_Dbg( p_input, "format: 0x%4.4x, fourcc: %4.4s, channels: %d, "
"freq: %d Hz bitrate: %dKo/s blockalign: %d bits/samples: %d " "freq: %d Hz, bitrate: %dKo/s, blockalign: %d, bits/samples: %d, "
"extra size: %d", "extra size: %d",
GetWLE( &p_wf->wFormatTag ), (char *)&p_sys->fmt.i_codec, GetWLE( &p_wf->wFormatTag ), (char *)&p_sys->fmt.i_codec,
p_sys->fmt.audio.i_channels, p_sys->fmt.audio.i_rate, p_sys->fmt.audio.i_channels, p_sys->fmt.audio.i_rate,
...@@ -171,7 +171,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -171,7 +171,7 @@ static int Open( vlc_object_t * p_this )
switch( p_sys->fmt.i_codec ) switch( p_sys->fmt.i_codec )
{ {
case VLC_FOURCC( 'a', 'r', 'a', 'w' ): case VLC_FOURCC( 'a', 'r', 'a', 'w' ):
case VLC_FOURCC( 'f', 'l', '3', '2' ): case VLC_FOURCC( 'a', 'f', 'l', 't' ):
case VLC_FOURCC( 'u', 'l', 'a', 'w' ): case VLC_FOURCC( 'u', 'l', 'a', 'w' ):
case VLC_FOURCC( 'a', 'l', 'a', 'w' ): case VLC_FOURCC( 'a', 'l', 'a', 'w' ):
FrameInfo_PCM( p_input, &p_sys->i_frame_size, &p_sys->i_frame_length ); FrameInfo_PCM( p_input, &p_sys->i_frame_size, &p_sys->i_frame_length );
...@@ -207,11 +207,9 @@ static int Open( vlc_object_t * p_this ) ...@@ -207,11 +207,9 @@ static int Open( vlc_object_t * p_this )
msg_Err( p_input, "cannot find 'data' chunk" ); msg_Err( p_input, "cannot find 'data' chunk" );
goto error; goto error;
} }
stream_Read( p_input->s, NULL, 8 ); /* Cannot fail */
p_sys->i_data_pos = stream_Tell( p_input->s ); p_sys->i_data_pos = stream_Tell( p_input->s );
stream_Read( p_input->s, NULL, 8 ); /* cannot fail */
/* Create one program */ /* Create one program */
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
if( input_InitStream( p_input, 0 ) == -1) if( input_InitStream( p_input, 0 ) == -1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment