Commit 67c26fdc authored by Gildas Bazin's avatar Gildas Bazin

* modules/mux/mp4.c: Use SoundDescription instead of SoundDescriptionV1.

* modules/demux/mp4/*: Added support for the "wave" tag used in mov files with aac.
parent 43a0fe32
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libmp4.c : LibMP4 library for mp4 module for vlc * libmp4.c : LibMP4 library for mp4 module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: libmp4.c,v 1.33 2003/09/08 00:35:16 fenrir Exp $ * $Id: libmp4.c,v 1.34 2003/10/07 14:59:10 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -1102,6 +1102,11 @@ static int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1102,6 +1102,11 @@ static int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{ {
i_len = MP4_ReadLengthDescriptor( &p_peek, &i_read ); i_len = MP4_ReadLengthDescriptor( &p_peek, &i_read );
#ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Found esds MPEG4ESDescr (%dBytes)",
i_len );
#endif
MP4_GET2BYTES( es_descriptor.i_ES_ID ); MP4_GET2BYTES( es_descriptor.i_ES_ID );
MP4_GET1BYTE( i_flags ); MP4_GET1BYTE( i_flags );
es_descriptor.b_stream_dependence = ( (i_flags&0x80) != 0); es_descriptor.b_stream_dependence = ( (i_flags&0x80) != 0);
...@@ -1142,6 +1147,12 @@ static int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1142,6 +1147,12 @@ static int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
} }
i_len = MP4_ReadLengthDescriptor( &p_peek, &i_read ); i_len = MP4_ReadLengthDescriptor( &p_peek, &i_read );
#ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Found esds MP4DecConfigDescr (%dBytes)",
i_len );
#endif
es_descriptor.p_decConfigDescr = es_descriptor.p_decConfigDescr =
malloc( sizeof( MP4_descriptor_decoder_config_t )); malloc( sizeof( MP4_descriptor_decoder_config_t ));
...@@ -1161,6 +1172,12 @@ static int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1161,6 +1172,12 @@ static int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
} }
i_len = MP4_ReadLengthDescriptor( &p_peek, &i_read ); i_len = MP4_ReadLengthDescriptor( &p_peek, &i_read );
#ifdef MP4_VERBOSE
msg_Dbg( p_stream->p_input, "Found esds MP4DecSpecificDescr (%dBytes)",
i_len );
#endif
es_descriptor.p_decConfigDescr->i_decoder_specific_info_len = i_len; es_descriptor.p_decConfigDescr->i_decoder_specific_info_len = i_len;
es_descriptor.p_decConfigDescr->p_decoder_specific_info = malloc( i_len ); es_descriptor.p_decConfigDescr->p_decoder_specific_info = malloc( i_len );
memcpy( es_descriptor.p_decConfigDescr->p_decoder_specific_info, memcpy( es_descriptor.p_decConfigDescr->p_decoder_specific_info,
...@@ -2009,6 +2026,7 @@ static struct ...@@ -2009,6 +2026,7 @@ static struct
{ FOURCC_rmda, MP4_ReadBoxContainer, MP4_FreeBox_Common }, { FOURCC_rmda, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ FOURCC_tref, MP4_ReadBoxContainer, MP4_FreeBox_Common }, { FOURCC_tref, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ FOURCC_gmhd, MP4_ReadBoxContainer, MP4_FreeBox_Common }, { FOURCC_gmhd, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ FOURCC_wave, MP4_ReadBoxContainer, MP4_FreeBox_Common },
/* specific box */ /* specific box */
{ FOURCC_ftyp, MP4_ReadBox_ftyp, MP4_FreeBox_ftyp }, { FOURCC_ftyp, MP4_ReadBox_ftyp, MP4_FreeBox_ftyp },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libmp4.h : LibMP4 library for mp4 module for vlc * libmp4.h : LibMP4 library for mp4 module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: libmp4.h,v 1.16 2003/09/08 00:35:16 fenrir Exp $ * $Id: libmp4.h,v 1.17 2003/10/07 14:59:10 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -152,6 +152,7 @@ ...@@ -152,6 +152,7 @@
#define FOURCC_alis VLC_FOURCC( 'a', 'l', 'i', 's' ) #define FOURCC_alis VLC_FOURCC( 'a', 'l', 'i', 's' )
#define FOURCC_gmhd VLC_FOURCC( 'g', 'm', 'h', 'd' ) #define FOURCC_gmhd VLC_FOURCC( 'g', 'm', 'h', 'd' )
#define FOURCC_wave VLC_FOURCC( 'w', 'a', 'v', 'e' )
/* Do you want some debug information on all read boxes ? */ /* Do you want some debug information on all read boxes ? */
#define MP4_VERBOSE 1 #define MP4_VERBOSE 1
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mp4.c : MP4 file input module for vlc * mp4.c : MP4 file input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: mp4.c,v 1.39 2003/09/19 21:53:48 fenrir Exp $ * $Id: mp4.c,v 1.40 2003/10/07 14:59:10 gbazin Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -984,7 +984,8 @@ static int TrackCreateES ( input_thread_t *p_input, ...@@ -984,7 +984,8 @@ static int TrackCreateES ( input_thread_t *p_input,
/* now see if esds is present and if so create a data packet /* now see if esds is present and if so create a data packet
with decoder_specific_info */ with decoder_specific_info */
#define p_decconfig p_esds->data.p_esds->es_descriptor.p_decConfigDescr #define p_decconfig p_esds->data.p_esds->es_descriptor.p_decConfigDescr
if( ( p_esds = MP4_BoxGet( p_sample, "esds" ) )&& if( ( ( p_esds = MP4_BoxGet( p_sample, "esds" ) ) ||
( p_esds = MP4_BoxGet( p_sample, "wave/esds" ) ) )&&
( p_esds->data.p_esds )&& ( p_esds->data.p_esds )&&
( p_decconfig ) ) ( p_decconfig ) )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mp4.c: mp4/mov muxer * mp4.c: mp4/mov muxer
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002, 2003 VideoLAN * Copyright (C) 2001, 2002, 2003 VideoLAN
* $Id: mp4.c,v 1.4 2003/09/02 16:00:24 gbazin Exp $ * $Id: mp4.c,v 1.5 2003/10/07 14:59:10 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -624,8 +624,8 @@ static void Close( vlc_object_t * p_this ) ...@@ -624,8 +624,8 @@ static void Close( vlc_object_t * p_this )
} }
bo_add_16be( soun, 1 ); // data-reference-index bo_add_16be( soun, 1 ); // data-reference-index
/* SoundDescriptionV1 */ /* SoundDescription */
bo_add_16be( soun, 1 ); // version; bo_add_16be( soun, 0 ); // version;
bo_add_16be( soun, 0 ); // revision level (0) bo_add_16be( soun, 0 ); // revision level (0)
bo_add_32be( soun, 0 ); // vendor bo_add_32be( soun, 0 ); // vendor
bo_add_16be( soun, p_stream->p_fmt->i_channels ); // channel-count bo_add_16be( soun, p_stream->p_fmt->i_channels ); // channel-count
......
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