Commit aaddb130 authored by Srikanth Raju's avatar Srikanth Raju Committed by Laurent Aimar

Wav GSM Demuxer Support Fixes Wav demux to work with MS-GSM codec. Uses ffmpeg decoder.

Signed-off-by: default avatarLaurent Aimar <fenrir@videolan.org>
parent 70dd3161
...@@ -305,7 +305,7 @@ wave_format_tag_to_fourcc[] = ...@@ -305,7 +305,7 @@ wave_format_tag_to_fourcc[] =
{ 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" },
{ WAVE_FORMAT_GSM610, VLC_FOURCC( 'g', 's', 'm', ' ' ), "GSM 610" }, { WAVE_FORMAT_GSM610, VLC_FOURCC( 'a', 'g', 's', 'm' ), "Microsoft WAV GSM" },
{ WAVE_FORMAT_G726, VLC_FOURCC( 'g', '7', '2', '6' ), "G.726 ADPCM" }, { WAVE_FORMAT_G726, VLC_FOURCC( 'g', '7', '2', '6' ), "G.726 ADPCM" },
{ WAVE_FORMAT_MPEGLAYER3, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" }, { WAVE_FORMAT_MPEGLAYER3, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
{ WAVE_FORMAT_MPEG, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" }, { WAVE_FORMAT_MPEG, VLC_FOURCC( 'm', 'p', 'g', 'a' ), "Mpeg Audio" },
......
...@@ -1046,7 +1046,7 @@ static const struct ...@@ -1046,7 +1046,7 @@ static const struct
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 34, 0 ) #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 34, 0 )
{ VLC_FOURCC('g','s','m',' '), CODEC_ID_GSM, { VLC_FOURCC('g','s','m',' '), CODEC_ID_GSM,
AUDIO_ES, "GSM Audio" }, AUDIO_ES, "GSM Audio" },
{ VLC_FOURCC('g','s','m','s'), CODEC_ID_GSM_MS, { VLC_FOURCC('a','g','s','m'), CODEC_ID_GSM_MS, /* According to http://wiki.multimedia.cx/index.php?title=GSM */
AUDIO_ES, "Microsoft GSM Audio" }, AUDIO_ES, "Microsoft GSM Audio" },
#endif #endif
......
...@@ -78,6 +78,7 @@ static int ChunkFind( demux_t *, const char *, unsigned int * ); ...@@ -78,6 +78,7 @@ static int ChunkFind( demux_t *, const char *, unsigned int * );
static void FrameInfo_IMA_ADPCM( demux_t *, unsigned int *, int * ); static void FrameInfo_IMA_ADPCM( demux_t *, unsigned int *, int * );
static void FrameInfo_MS_ADPCM ( demux_t *, unsigned int *, int * ); static void FrameInfo_MS_ADPCM ( demux_t *, unsigned int *, int * );
static void FrameInfo_PCM ( demux_t *, unsigned int *, int * ); static void FrameInfo_PCM ( demux_t *, unsigned int *, int * );
static void FrameInfo_MSGSM ( demux_t *, unsigned int *, int * );
static const uint32_t pi_channels_src[] = static const uint32_t pi_channels_src[] =
{ WAVE_SPEAKER_FRONT_LEFT, WAVE_SPEAKER_FRONT_RIGHT, { WAVE_SPEAKER_FRONT_LEFT, WAVE_SPEAKER_FRONT_RIGHT,
...@@ -263,6 +264,10 @@ static int Open( vlc_object_t * p_this ) ...@@ -263,6 +264,10 @@ static int Open( vlc_object_t * p_this )
case VLC_FOURCC( 'a', '5', '2', ' ' ): case VLC_FOURCC( 'a', '5', '2', ' ' ):
/* FIXME set end of area FIXME */ /* FIXME set end of area FIXME */
goto error; goto error;
case VLC_FOURCC( 'a', 'g', 's', 'm' ):
FrameInfo_MSGSM( p_demux, &p_sys->i_frame_size,
&p_sys->i_frame_samples );
break;
default: default:
msg_Err( p_demux, "unsupported codec (%4.4s)", msg_Err( p_demux, "unsupported codec (%4.4s)",
(char*)&p_sys->fmt.i_codec ); (char*)&p_sys->fmt.i_codec );
...@@ -454,3 +459,13 @@ static void FrameInfo_IMA_ADPCM( demux_t *p_demux, unsigned int *pi_size, ...@@ -454,3 +459,13 @@ static void FrameInfo_IMA_ADPCM( demux_t *p_demux, unsigned int *pi_size,
*pi_size = p_sys->fmt.audio.i_blockalign; *pi_size = p_sys->fmt.audio.i_blockalign;
} }
static void FrameInfo_MSGSM( demux_t *p_demux, unsigned int *pi_size,
int *pi_samples )
{
demux_sys_t *p_sys = p_demux->p_sys;
*pi_samples = ( p_sys->fmt.audio.i_blockalign * p_sys->fmt.audio.i_rate * 8)
/ p_sys->fmt.i_bitrate;
*pi_size = p_sys->fmt.audio.i_blockalign;
}
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