mirror of
https://github.com/mpv-player/mpv
synced 2025-03-23 11:47:45 +00:00
Extended support for other object type IDs in the ESDS. This enables e.g. MPEG2 video in the MP4 container.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13955 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
b3dcfc7ec6
commit
6fcdde79ef
@ -946,7 +946,7 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak
|
||||
sh->i_bps = esds.avgBitrate/8;
|
||||
|
||||
// printf("######## audio format = %d ########\n",esds.objectTypeId);
|
||||
if(esds.objectTypeId==107)
|
||||
if(esds.objectTypeId==MP4OTI_MPEG1Audio || esds.objectTypeId==MP4OTI_MPEG2AudioPart3)
|
||||
sh->format=0x55; // .mp3
|
||||
|
||||
// dump away the codec specific configuration for the AAC decoder
|
||||
@ -1103,6 +1103,13 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak
|
||||
esds_t esds;
|
||||
if(!mp4_parse_esds(trak->stdata+pos+8, atom_len-8, &esds)) {
|
||||
|
||||
if(esds.objectTypeId==MP4OTI_MPEG2VisualSimple || esds.objectTypeId==MP4OTI_MPEG2VisualMain ||
|
||||
esds.objectTypeId==MP4OTI_MPEG2VisualSNR || esds.objectTypeId==MP4OTI_MPEG2VisualSpatial ||
|
||||
esds.objectTypeId==MP4OTI_MPEG2VisualHigh || esds.objectTypeId==MP4OTI_MPEG2Visual422)
|
||||
sh->format=mmioFOURCC('m', 'p', 'g', '2');
|
||||
else if(esds.objectTypeId==MP4OTI_MPEG1Visual)
|
||||
sh->format=mmioFOURCC('m', 'p', 'g', '1');
|
||||
|
||||
// dump away the codec specific configuration for the AAC decoder
|
||||
trak->stream_header_len = esds.decoderConfigLen;
|
||||
trak->stream_header = (unsigned char *)malloc(trak->stream_header_len);
|
||||
|
@ -30,6 +30,36 @@
|
||||
#define MP4ExtDescrTagsStart 0x80
|
||||
#define MP4ExtDescrTagsEnd 0xFE
|
||||
|
||||
/* object type identifiers in the ESDS */
|
||||
/* See http://gpac.sourceforge.net/tutorial/mediatypes.htm */
|
||||
/* BIFS stream version 1 */
|
||||
#define MP4OTI_MPEG4Systems1 0x01
|
||||
/* BIFS stream version 2 */
|
||||
#define MP4OTI_MPEG4Systems2 0x02
|
||||
/* MPEG-4 visual stream */
|
||||
#define MP4OTI_MPEG4Visual 0x20
|
||||
/* MPEG-4 audio stream */
|
||||
#define MP4OTI_MPEG4Audio 0x40
|
||||
/* MPEG-2 visual streams with various profiles */
|
||||
#define MP4OTI_MPEG2VisualSimple 0x60
|
||||
#define MP4OTI_MPEG2VisualMain 0x61
|
||||
#define MP4OTI_MPEG2VisualSNR 0x62
|
||||
#define MP4OTI_MPEG2VisualSpatial 0x63
|
||||
#define MP4OTI_MPEG2VisualHigh 0x64
|
||||
#define MP4OTI_MPEG2Visual422 0x65
|
||||
/* MPEG-2 audio stream part 7 ("AAC") with various profiles */
|
||||
#define MP4OTI_MPEG2AudioMain 0x66
|
||||
#define MP4OTI_MPEG2AudioLowComplexity 0x67
|
||||
#define MP4OTI_MPEG2AudioScaleableSamplingRate 0x68
|
||||
/* MPEG-2 audio part 3 ("MP3") */
|
||||
#define MP4OTI_MPEG2AudioPart3 0x69
|
||||
/* MPEG-1 visual visual stream */
|
||||
#define MP4OTI_MPEG1Visual 0x6A
|
||||
/* MPEG-1 audio stream part 3 ("MP3") */
|
||||
#define MP4OTI_MPEG1Audio 0x6B
|
||||
/* JPEG visual stream */
|
||||
#define MP4OTI_JPEG 0x6C
|
||||
|
||||
/* I define uint24 here for better understanding */
|
||||
#ifndef uint24_t
|
||||
#define uint24_t uint32_t
|
||||
|
Loading…
Reference in New Issue
Block a user