Commit 4befbe94 authored by Laurent Aimar's avatar Laurent Aimar

* mp4: I have reworked a lot the demuxer. Now it should handle gracefully

the audio part of mov file. I'm really interested by any regression you
could find, please _test_ all .mp4/.mov file you have.
parent bb26c6a5
......@@ -2,7 +2,7 @@
* libmp4.c : LibMP4 library for mp4 module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libmp4.c,v 1.16 2003/03/09 16:22:35 fenrir Exp $
* $Id: libmp4.c,v 1.17 2003/03/11 18:57:50 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -1152,6 +1152,7 @@ int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
if( i_type != 0x04)/* MP4DecConfigDescrTag */
{
es_descriptor.p_decConfigDescr = NULL;
MP4_READBOX_EXIT( 1 ); /* rest isn't interesting up to now */
}
......@@ -1169,6 +1170,8 @@ int MP4_ReadBox_esds( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET1BYTE( i_type );
if( i_type != 0x05 )/* MP4DecSpecificDescrTag */
{
es_descriptor.p_decConfigDescr->i_decoder_specific_info_len = 0;
es_descriptor.p_decConfigDescr->p_decoder_specific_info = NULL;
MP4_READBOX_EXIT( 1 );
}
......@@ -2083,16 +2086,28 @@ static struct
/* for codecs */
{ FOURCC_soun, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC__mp3, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_ms02, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_ms11, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_ms55, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC__mp3, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_mp4a, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_twos, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_sowt, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_QDMC, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_QDM2, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_ima4, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_IMA4, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_dvi, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_alaw, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_ulaw, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_raw, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_MAC3, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_MAC6, MP4_ReadBox_sample_soun, MP4_FreeBox_Common },
{ FOURCC_vide, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
{ FOURCC_mp4v, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
{ FOURCC_SVQ1, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
{ FOURCC_SVQ3, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
{ FOURCC_DIVX, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
{ FOURCC_h263, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
{ FOURCC_cvid, MP4_ReadBox_sample_vide, MP4_FreeBox_Common },
......
......@@ -2,7 +2,7 @@
* libmp4.h : LibMP4 library for mp4 module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libmp4.h,v 1.7 2003/03/09 16:22:35 fenrir Exp $
* $Id: libmp4.h,v 1.8 2003/03/11 18:57:50 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -92,10 +92,25 @@
#define FOURCC_isom VLC_FOURCC( 'i', 's', 'o', 'm' )
#define FOURCC_esds VLC_FOURCC( 'e', 's', 'd', 's' )
#define FOURCC_zlib VLC_FOURCC( 'z', 'l', 'i', 'b' )
#define FOURCC_SVQ1 VLC_FOURCC( 'S', 'V', 'Q', '1' )
#define FOURCC__mp3 VLC_FOURCC( '.', 'm', 'p', '3' )
#define FOURCC_ms02 VLC_FOURCC( 'm', 's', 0x0, 0x02 )
#define FOURCC_ms11 VLC_FOURCC( 'm', 's', 0x0, 0x11 )
#define FOURCC_ms55 VLC_FOURCC( 'm', 's', 0x0, 0x55 )
#define FOURCC_twos VLC_FOURCC( 't', 'w', 'o', 's' )
#define FOURCC_sowt VLC_FOURCC( 's', 'o', 'w', 't' )
#define FOURCC_QDMC VLC_FOURCC( 'Q', 'D', 'M', 'C' )
#define FOURCC_QDM2 VLC_FOURCC( 'Q', 'D', 'M', '2' )
#define FOURCC_ima4 VLC_FOURCC( 'i', 'm', 'a', '4' )
#define FOURCC_IMA4 VLC_FOURCC( 'I', 'M', 'A', '4' )
#define FOURCC_dvi VLC_FOURCC( 'd', 'v', 'i', ' ' )
#define FOURCC_MAC3 VLC_FOURCC( 'M', 'A', 'C', '3' )
#define FOURCC_MAC6 VLC_FOURCC( 'M', 'A', 'C', '6' )
#define FOURCC_alaw VLC_FOURCC( 'a', 'l', 'a', 'w' )
#define FOURCC_ulaw VLC_FOURCC( 'u', 'l', 'a', 'w' )
#define FOURCC_zlib VLC_FOURCC( 'z', 'l', 'i', 'b' )
#define FOURCC_SVQ1 VLC_FOURCC( 'S', 'V', 'Q', '1' )
#define FOURCC_SVQ3 VLC_FOURCC( 'S', 'V', 'Q', '3' )
#define FOURCC_3IV1 VLC_FOURCC( '3', 'I', 'V', '1' )
#define FOURCC_3IV2 VLC_FOURCC( '3', 'I', 'V', '2' )
#define FOURCC_h263 VLC_FOURCC( 'h', '2', '6', '3' )
......@@ -105,10 +120,9 @@
#define FOURCC_mjpb VLC_FOURCC( 'm', 'j', 'q', 't' )
#define FOURCC_mjqt VLC_FOURCC( 'm', 'j', 'h', 't' )
#define FOURCC_mjht VLC_FOURCC( 'm', 'j', 'p', 'b' )
#define FOURCC_dvc VLC_FOURCC( 'd', 'v', 'c', ' ' )
#define FOURCC_dvp VLC_FOURCC( 'd', 'v', 'p', ' ' )
#define FOURCC_twos VLC_FOURCC( 't', 'w', 'o', 's' )
#define FOURCC_QDMC VLC_FOURCC( 'Q', 'D', 'M', 'C' )
#define FOURCC_raw VLC_FOURCC( 'r', 'a', 'w', ' ' )
#define FOURCC_jpeg VLC_FOURCC( 'j', 'p', 'e', 'g' )
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* mp4.h : MP4 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mp4.h,v 1.5 2002/12/06 16:34:06 sam Exp $
* $Id: mp4.h,v 1.6 2003/03/11 18:57:51 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -81,8 +81,9 @@ typedef struct chunk_data_mp4_s
*****************************************************************************/
typedef struct track_data_mp4_s
{
int b_ok; /* The track is usable */
int i_track_ID; /* this should be unique */
int b_ok; /* The track is usable */
int b_enable; /* is the trak enable by default */
int b_selected; /* is the trak being played */
int i_cat; /* Type of the track, VIDEO_ES, AUDIO_ES, UNKNOWN_ES ... */
......@@ -111,12 +112,13 @@ typedef struct track_data_mp4_s
uint32_t *p_sample_size; /* XXX perhaps add file offset if take
too much time to do sumations each time*/
es_descriptor_t *p_es; /* vlc es for this track */
MP4_Box_t *p_stbl; /* will contain all timing information */
MP4_Box_t *p_stsd; /* will contain all data to initialize decoder */
MP4_Box_t *p_sample;/* point on actual sdsd */
es_descriptor_t *p_es; /* vlc es for this track */
pes_packet_t *p_pes_init; /* to be send when p_es is selected */
MP4_Box_t *p_sample; /* actual SampleEntry to make life simpler */
} track_data_mp4_t;
......@@ -137,6 +139,7 @@ struct demux_sys_t
track_data_mp4_t *track; /* array of track */
};
#if 0
static inline uint64_t MP4_GetTrackPos( track_data_mp4_t *p_track )
{
unsigned int i_sample;
......@@ -162,6 +165,7 @@ static inline uint64_t MP4_GetTrackPos( track_data_mp4_t *p_track )
}
return( i_pos );
}
#endif
/* Return time in s of a track */
static inline mtime_t MP4_GetTrackPTS( track_data_mp4_t *p_track )
......
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