Commit 7923fdfe authored by Francois Cartegnie's avatar Francois Cartegnie

demux: mp4: rescrict atoms auto matching

Allow restricting auto matching to some parent nodes.
There was some size checks on stsd/wave vs wave to prevent
bad matchs, but this could happen with any other codec name.
parent 65858783
......@@ -3272,249 +3272,253 @@ static const struct
uint32_t i_type;
int (*MP4_ReadBox_function )( stream_t *p_stream, MP4_Box_t *p_box );
void (*MP4_FreeBox_function )( MP4_Box_t *p_box );
uint32_t i_parent; /* set parent to restrict, duplicating if needed; 0 for any */
} MP4_Box_Function [] =
{
/* Containers */
{ ATOM_moov, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_trak, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_mdia, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_moof, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_minf, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_stbl, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_dinf, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_edts, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_udta, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_nmhd, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_hnti, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_rmra, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_rmda, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_tref, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_gmhd, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_wave, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_ilst, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_mvex, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_moov, MP4_ReadBoxContainer, MP4_FreeBox_Common, 0 },
{ ATOM_trak, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_moov },
{ ATOM_mdia, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_trak },
{ ATOM_moof, MP4_ReadBoxContainer, MP4_FreeBox_Common, 0 },
{ ATOM_minf, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_mdia },
{ ATOM_stbl, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_minf },
{ ATOM_dinf, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_minf },
{ ATOM_dinf, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_meta },
{ ATOM_edts, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_trak },
{ ATOM_udta, MP4_ReadBoxContainer, MP4_FreeBox_Common, 0 },
{ ATOM_nmhd, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_minf },
{ ATOM_hnti, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_udta },
{ ATOM_rmra, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_moov },
{ ATOM_rmda, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_rmra },
{ ATOM_tref, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_trak },
{ ATOM_gmhd, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_minf },
{ ATOM_wave, MP4_ReadBoxContainer, MP4_FreeBox_Common, 0 },
{ ATOM_ilst, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_meta },
{ ATOM_mvex, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_moov },
{ ATOM_mvex, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_ftyp },
/* specific box */
{ ATOM_ftyp, MP4_ReadBox_ftyp, MP4_FreeBox_ftyp },
{ ATOM_cmov, MP4_ReadBox_cmov, MP4_FreeBox_Common },
{ ATOM_mvhd, MP4_ReadBox_mvhd, MP4_FreeBox_Common },
{ ATOM_tkhd, MP4_ReadBox_tkhd, MP4_FreeBox_Common },
{ ATOM_mdhd, MP4_ReadBox_mdhd, MP4_FreeBox_Common },
{ ATOM_hdlr, MP4_ReadBox_hdlr, MP4_FreeBox_hdlr },
{ ATOM_vmhd, MP4_ReadBox_vmhd, MP4_FreeBox_Common },
{ ATOM_smhd, MP4_ReadBox_smhd, MP4_FreeBox_Common },
{ ATOM_hmhd, MP4_ReadBox_hmhd, MP4_FreeBox_Common },
{ ATOM_url, MP4_ReadBox_url, MP4_FreeBox_url },
{ ATOM_urn, MP4_ReadBox_urn, MP4_FreeBox_urn },
{ ATOM_dref, MP4_ReadBox_dref, MP4_FreeBox_Common },
{ ATOM_stts, MP4_ReadBox_stts, MP4_FreeBox_stts },
{ ATOM_ctts, MP4_ReadBox_ctts, MP4_FreeBox_ctts },
{ ATOM_stsd, MP4_ReadBox_stsd, MP4_FreeBox_Common },
{ ATOM_stsz, MP4_ReadBox_stsz, MP4_FreeBox_stsz },
{ ATOM_stsc, MP4_ReadBox_stsc, MP4_FreeBox_stsc },
{ ATOM_stco, MP4_ReadBox_stco_co64, MP4_FreeBox_stco_co64 },
{ ATOM_co64, MP4_ReadBox_stco_co64, MP4_FreeBox_stco_co64 },
{ ATOM_stss, MP4_ReadBox_stss, MP4_FreeBox_stss },
{ ATOM_stsh, MP4_ReadBox_stsh, MP4_FreeBox_stsh },
{ ATOM_stdp, MP4_ReadBox_stdp, MP4_FreeBox_stdp },
{ ATOM_padb, MP4_ReadBox_padb, MP4_FreeBox_padb },
{ ATOM_elst, MP4_ReadBox_elst, MP4_FreeBox_elst },
{ ATOM_cprt, MP4_ReadBox_cprt, MP4_FreeBox_cprt },
{ ATOM_esds, MP4_ReadBox_esds, MP4_FreeBox_esds },
{ ATOM_dcom, MP4_ReadBox_dcom, MP4_FreeBox_Common },
{ ATOM_cmvd, MP4_ReadBox_cmvd, MP4_FreeBox_cmvd },
{ ATOM_avcC, MP4_ReadBox_avcC, MP4_FreeBox_avcC },
{ ATOM_hvcC, MP4_ReadBox_hvcC, MP4_FreeBox_hvcC },
{ ATOM_dac3, MP4_ReadBox_dac3, MP4_FreeBox_Common },
{ ATOM_dvc1, MP4_ReadBox_dvc1, MP4_FreeBox_Common },
{ ATOM_enda, MP4_ReadBox_enda, MP4_FreeBox_Common },
{ ATOM_gnre, MP4_ReadBox_gnre, MP4_FreeBox_Common },
{ ATOM_trkn, MP4_ReadBox_trkn, MP4_FreeBox_Common },
{ ATOM_iods, MP4_ReadBox_iods, MP4_FreeBox_Common },
{ ATOM_pasp, MP4_ReadBox_pasp, MP4_FreeBox_Common },
{ ATOM_ftyp, MP4_ReadBox_ftyp, MP4_FreeBox_ftyp, 0 },
{ ATOM_cmov, MP4_ReadBox_cmov, MP4_FreeBox_Common, 0 },
{ ATOM_mvhd, MP4_ReadBox_mvhd, MP4_FreeBox_Common, ATOM_moov },
{ ATOM_tkhd, MP4_ReadBox_tkhd, MP4_FreeBox_Common, ATOM_trak },
{ ATOM_mdhd, MP4_ReadBox_mdhd, MP4_FreeBox_Common, ATOM_mdia },
{ ATOM_hdlr, MP4_ReadBox_hdlr, MP4_FreeBox_hdlr, ATOM_mdia },
{ ATOM_hdlr, MP4_ReadBox_hdlr, MP4_FreeBox_hdlr, ATOM_meta },
{ ATOM_vmhd, MP4_ReadBox_vmhd, MP4_FreeBox_Common, ATOM_minf },
{ ATOM_smhd, MP4_ReadBox_smhd, MP4_FreeBox_Common, ATOM_minf },
{ ATOM_hmhd, MP4_ReadBox_hmhd, MP4_FreeBox_Common, ATOM_minf },
{ ATOM_url, MP4_ReadBox_url, MP4_FreeBox_url, 0 },
{ ATOM_urn, MP4_ReadBox_urn, MP4_FreeBox_urn, 0 },
{ ATOM_dref, MP4_ReadBox_dref, MP4_FreeBox_Common, 0 },
{ ATOM_stts, MP4_ReadBox_stts, MP4_FreeBox_stts, ATOM_stbl },
{ ATOM_ctts, MP4_ReadBox_ctts, MP4_FreeBox_ctts, ATOM_stbl },
{ ATOM_stsd, MP4_ReadBox_stsd, MP4_FreeBox_Common, ATOM_stbl },
{ ATOM_stsz, MP4_ReadBox_stsz, MP4_FreeBox_stsz, ATOM_stbl },
{ ATOM_stsc, MP4_ReadBox_stsc, MP4_FreeBox_stsc, ATOM_stbl },
{ ATOM_stco, MP4_ReadBox_stco_co64, MP4_FreeBox_stco_co64, ATOM_stbl },
{ ATOM_co64, MP4_ReadBox_stco_co64, MP4_FreeBox_stco_co64, ATOM_stbl },
{ ATOM_stss, MP4_ReadBox_stss, MP4_FreeBox_stss, ATOM_stbl },
{ ATOM_stsh, MP4_ReadBox_stsh, MP4_FreeBox_stsh, ATOM_stbl },
{ ATOM_stdp, MP4_ReadBox_stdp, MP4_FreeBox_stdp, 0 },
{ ATOM_padb, MP4_ReadBox_padb, MP4_FreeBox_padb, 0 },
{ ATOM_elst, MP4_ReadBox_elst, MP4_FreeBox_elst, ATOM_edts },
{ ATOM_cprt, MP4_ReadBox_cprt, MP4_FreeBox_cprt, 0 },
{ ATOM_esds, MP4_ReadBox_esds, MP4_FreeBox_esds, 0 },
{ ATOM_dcom, MP4_ReadBox_dcom, MP4_FreeBox_Common, 0 },
{ ATOM_cmvd, MP4_ReadBox_cmvd, MP4_FreeBox_cmvd, 0 },
{ ATOM_avcC, MP4_ReadBox_avcC, MP4_FreeBox_avcC, 0 },
{ ATOM_hvcC, MP4_ReadBox_hvcC, MP4_FreeBox_hvcC, 0 },
{ ATOM_dac3, MP4_ReadBox_dac3, MP4_FreeBox_Common, 0 },
{ ATOM_dvc1, MP4_ReadBox_dvc1, MP4_FreeBox_Common, 0 },
{ ATOM_enda, MP4_ReadBox_enda, MP4_FreeBox_Common, 0 },
{ ATOM_iods, MP4_ReadBox_iods, MP4_FreeBox_Common, 0 },
{ ATOM_pasp, MP4_ReadBox_pasp, MP4_FreeBox_Common, 0 },
/* Nothing to do with this box */
{ ATOM_mdat, MP4_ReadBoxSkip, MP4_FreeBox_Common },
{ ATOM_skip, MP4_ReadBoxSkip, MP4_FreeBox_Common },
{ ATOM_free, MP4_ReadBoxSkip, MP4_FreeBox_Common },
{ ATOM_wide, MP4_ReadBoxSkip, MP4_FreeBox_Common },
{ ATOM_binm, MP4_ReadBoxSkip, MP4_FreeBox_Common },
{ ATOM_mdat, MP4_ReadBoxSkip, MP4_FreeBox_Common, 0 },
{ ATOM_skip, MP4_ReadBoxSkip, MP4_FreeBox_Common, 0 },
{ ATOM_free, MP4_ReadBoxSkip, MP4_FreeBox_Common, 0 },
{ ATOM_wide, MP4_ReadBoxSkip, MP4_FreeBox_Common, 0 },
{ ATOM_binm, MP4_ReadBoxSkip, MP4_FreeBox_Common, 0 },
/* Subtitles */
{ ATOM_tx3g, MP4_ReadBox_sample_tx3g, MP4_FreeBox_Common },
//{ ATOM_text, MP4_ReadBox_sample_text, MP4_FreeBox_Common },
{ ATOM_tx3g, MP4_ReadBox_sample_tx3g, MP4_FreeBox_Common, 0 },
//{ ATOM_text, MP4_ReadBox_sample_text, MP4_FreeBox_Common, 0 },
/* for codecs */
{ ATOM_soun, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_lpcm, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_ms02, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_ms11, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_ms55, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM__mp3, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_mp4a, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_twos, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_sowt, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_QDMC, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_QDM2, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_ima4, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_IMA4, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_dvi, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_alaw, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_ulaw, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_raw, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_MAC3, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_MAC6, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_Qclp, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_samr, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_sawb, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_OggS, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_alac, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_drmi, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_vide, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_mp4v, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_SVQ1, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_SVQ3, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_ZyGo, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_DIVX, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_XVID, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_h263, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_s263, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_cvid, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_3IV1, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_3iv1, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_3IV2, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_3iv2, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_3IVD, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_3ivd, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_3VID, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_3vid, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_mjpa, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_mjpb, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_qdrw, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_mp2v, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_hdv2, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_mjqt, MP4_ReadBox_default, NULL }, /* found in mjpa/b */
{ ATOM_mjht, MP4_ReadBox_default, NULL },
{ ATOM_dvc, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_dvp, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_dv5n, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_dv5p, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_VP31, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_vp31, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_h264, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_jpeg, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_avc1, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_yv12, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_yuv2, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ ATOM_mp4s, MP4_ReadBox_sample_mp4s, MP4_FreeBox_Common },
{ ATOM_soun, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_lpcm, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_ms02, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_ms11, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_ms55, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM__mp3, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_mp4a, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_twos, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_sowt, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_QDMC, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_QDM2, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_ima4, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_IMA4, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_dvi, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_alaw, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_ulaw, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_raw, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_MAC3, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_MAC6, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_Qclp, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_samr, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_sawb, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_OggS, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_alac, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, ATOM_stsd },
{ ATOM_drmi, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_vide, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_mp4v, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_SVQ1, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_SVQ3, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_ZyGo, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_DIVX, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_XVID, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_h263, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_s263, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_cvid, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_3IV1, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_3iv1, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_3IV2, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_3iv2, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_3IVD, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_3ivd, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_3VID, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_3vid, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_mjpa, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_mjpb, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_qdrw, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_mp2v, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_hdv2, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_mjqt, MP4_ReadBox_default, NULL, 0 }, /* found in mjpa/b */
{ ATOM_mjht, MP4_ReadBox_default, NULL, 0 },
{ ATOM_dvc, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_dvp, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_dv5n, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_dv5p, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_VP31, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_vp31, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_h264, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_jpeg, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_avc1, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, ATOM_stsd },
{ ATOM_yv12, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, 0 },
{ ATOM_yuv2, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide, 0 },
{ ATOM_mp4s, MP4_ReadBox_sample_mp4s, MP4_FreeBox_Common, 0 },
/* XXX there is 2 box where we could find this entry stbl and tref*/
{ ATOM_hint, MP4_ReadBox_default, MP4_FreeBox_Common },
{ ATOM_hint, MP4_ReadBox_default, MP4_FreeBox_Common, 0 },
/* found in tref box */
{ ATOM_dpnd, MP4_ReadBox_default, NULL },
{ ATOM_ipir, MP4_ReadBox_default, NULL },
{ ATOM_mpod, MP4_ReadBox_default, NULL },
{ ATOM_chap, MP4_ReadBox_tref_generic, MP4_FreeBox_tref_generic },
{ ATOM_dpnd, MP4_ReadBox_default, NULL, 0 },
{ ATOM_ipir, MP4_ReadBox_default, NULL, 0 },
{ ATOM_mpod, MP4_ReadBox_default, NULL, 0 },
{ ATOM_chap, MP4_ReadBox_tref_generic, MP4_FreeBox_tref_generic, 0 },
/* found in hnti */
{ ATOM_rtp, MP4_ReadBox_default, NULL },
{ ATOM_rtp, MP4_ReadBox_default, NULL, 0 },
/* found in rmra */
{ ATOM_rdrf, MP4_ReadBox_rdrf, MP4_FreeBox_rdrf },
{ ATOM_rmdr, MP4_ReadBox_rmdr, MP4_FreeBox_Common },
{ ATOM_rmqu, MP4_ReadBox_rmqu, MP4_FreeBox_Common },
{ ATOM_rmvc, MP4_ReadBox_rmvc, MP4_FreeBox_Common },
{ ATOM_drms, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun },
{ ATOM_sinf, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_schi, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_user, MP4_ReadBox_drms, MP4_FreeBox_Common },
{ ATOM_key, MP4_ReadBox_drms, MP4_FreeBox_Common },
{ ATOM_iviv, MP4_ReadBox_drms, MP4_FreeBox_Common },
{ ATOM_priv, MP4_ReadBox_drms, MP4_FreeBox_Common },
{ ATOM_frma, MP4_ReadBox_frma, MP4_FreeBox_Common },
{ ATOM_skcr, MP4_ReadBox_skcr, MP4_FreeBox_Common },
{ ATOM_rdrf, MP4_ReadBox_rdrf, MP4_FreeBox_rdrf , ATOM_rmra },
{ ATOM_rmdr, MP4_ReadBox_rmdr, MP4_FreeBox_Common, ATOM_rmra },
{ ATOM_rmqu, MP4_ReadBox_rmqu, MP4_FreeBox_Common, ATOM_rmra },
{ ATOM_rmvc, MP4_ReadBox_rmvc, MP4_FreeBox_Common, ATOM_rmra },
{ ATOM_drms, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun, 0 },
{ ATOM_sinf, MP4_ReadBoxContainer, MP4_FreeBox_Common, 0 },
{ ATOM_schi, MP4_ReadBoxContainer, MP4_FreeBox_Common, 0 },
{ ATOM_user, MP4_ReadBox_drms, MP4_FreeBox_Common, 0 },
{ ATOM_key, MP4_ReadBox_drms, MP4_FreeBox_Common, 0 },
{ ATOM_iviv, MP4_ReadBox_drms, MP4_FreeBox_Common, 0 },
{ ATOM_priv, MP4_ReadBox_drms, MP4_FreeBox_Common, 0 },
{ ATOM_frma, MP4_ReadBox_frma, MP4_FreeBox_Common, 0 },
{ ATOM_skcr, MP4_ReadBox_skcr, MP4_FreeBox_Common, 0 },
/* found in udta */
{ ATOM_0xa9nam, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9aut, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9cpy, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9swr, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9inf, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9ART, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9dir, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9cmt, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9req, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9day, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9des, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9fmt, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9prd, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9prf, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9src, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9alb, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9dis, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9enc, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9gen, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9trk, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9dsa, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9hst, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9url, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9ope, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9com, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9wrt, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9too, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9wrn, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9mak, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9mod, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9PRD, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9grp, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9lyr, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9gen, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9st3, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9ard, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9arg, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9cak, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9con, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9des, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9lnt, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9phg, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9pub, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9sne, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9sol, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9thx, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_0xa9xpd, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx },
{ ATOM_chpl, MP4_ReadBox_chpl, MP4_FreeBox_chpl },
{ ATOM_0xa9nam, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9aut, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9cpy, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9swr, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9inf, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9ART, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9dir, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9cmt, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9req, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9day, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9des, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9fmt, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9prd, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9prf, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9src, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9alb, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9dis, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9enc, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9gen, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9trk, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9dsa, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9hst, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9url, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9ope, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9com, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9wrt, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9too, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9wrn, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9mak, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9mod, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9PRD, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9grp, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9lyr, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9gen, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9st3, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9ard, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9arg, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9cak, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9con, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9des, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9lnt, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9phg, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9pub, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9sne, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9sol, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9thx, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_0xa9xpd, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_chpl, MP4_ReadBox_chpl, MP4_FreeBox_chpl, ATOM_udta },
{ ATOM_gnre, MP4_ReadBox_gnre, MP4_FreeBox_Common, ATOM_ilst },
{ ATOM_trkn, MP4_ReadBox_trkn, MP4_FreeBox_Common, ATOM_ilst },
/* iTunes/Quicktime meta info */
{ ATOM_meta, MP4_ReadBox_meta, MP4_FreeBox_Common },
{ ATOM_name, MP4_ReadBox_name, MP4_FreeBox_name },
{ ATOM_covr, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_data, MP4_ReadBox_data, MP4_FreeBox_data },
{ ATOM_meta, MP4_ReadBox_meta, MP4_FreeBox_Common, 0 },
{ ATOM_name, MP4_ReadBox_name, MP4_FreeBox_name, 0 },
{ ATOM_covr, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_ilst },
{ ATOM_data, MP4_ReadBox_data, MP4_FreeBox_data, 0 },
/* found in smoothstreaming */
{ ATOM_traf, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_mfra, MP4_ReadBoxContainer, MP4_FreeBox_Common },
{ ATOM_mfhd, MP4_ReadBox_mfhd, MP4_FreeBox_Common },
{ ATOM_sidx, MP4_ReadBox_sidx, MP4_FreeBox_sidx },
{ ATOM_tfhd, MP4_ReadBox_tfhd, MP4_FreeBox_Common },
{ ATOM_trun, MP4_ReadBox_trun, MP4_FreeBox_trun },
{ ATOM_trex, MP4_ReadBox_trex, MP4_FreeBox_Common },
{ ATOM_mehd, MP4_ReadBox_mehd, MP4_FreeBox_Common },
{ ATOM_sdtp, MP4_ReadBox_sdtp, MP4_FreeBox_sdtp },
{ ATOM_tfra, MP4_ReadBox_tfra, MP4_FreeBox_tfra },
{ ATOM_mfro, MP4_ReadBox_mfro, MP4_FreeBox_Common },
{ ATOM_uuid, MP4_ReadBox_uuid, MP4_FreeBox_uuid },
{ ATOM_traf, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_moof },
{ ATOM_mfra, MP4_ReadBoxContainer, MP4_FreeBox_Common, 0 },
{ ATOM_mfhd, MP4_ReadBox_mfhd, MP4_FreeBox_Common, ATOM_moof },
{ ATOM_sidx, MP4_ReadBox_sidx, MP4_FreeBox_sidx, 0 },
{ ATOM_tfhd, MP4_ReadBox_tfhd, MP4_FreeBox_Common, ATOM_traf },
{ ATOM_trun, MP4_ReadBox_trun, MP4_FreeBox_trun, ATOM_traf },
{ ATOM_trex, MP4_ReadBox_trex, MP4_FreeBox_Common, ATOM_mvex },
{ ATOM_mehd, MP4_ReadBox_mehd, MP4_FreeBox_Common, ATOM_mvex },
{ ATOM_sdtp, MP4_ReadBox_sdtp, MP4_FreeBox_sdtp, 0 },
{ ATOM_tfra, MP4_ReadBox_tfra, MP4_FreeBox_tfra, ATOM_mfra },
{ ATOM_mfro, MP4_ReadBox_mfro, MP4_FreeBox_Common, ATOM_mfra },
{ ATOM_uuid, MP4_ReadBox_uuid, MP4_FreeBox_uuid, 0 },
/* Last entry */
{ 0, MP4_ReadBox_default, NULL }
{ 0, MP4_ReadBox_default, NULL, 0 }
};
......@@ -3547,6 +3551,11 @@ static MP4_Box_t *MP4_ReadBox( stream_t *p_stream, MP4_Box_t *p_father )
/* Now search function to call */
for( i_index = 0; ; i_index++ )
{
if ( MP4_Box_Function[i_index].i_parent &&
p_box->p_father &&
p_box->p_father->i_type != MP4_Box_Function[i_index].i_parent )
continue;
if( ( MP4_Box_Function[i_index].i_type == p_box->i_type )||
( MP4_Box_Function[i_index].i_type == 0 ) )
{
......
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