Mercurial > mplayer.hg
comparison libmpdemux/parse_mp4.h @ 5301:d72c3169a343
Improved MP4 parsing (finally)
author | atmos4 |
---|---|
date | Sun, 24 Mar 2002 02:25:41 +0000 |
parents | |
children | 77ac28af44ec |
comparison
equal
deleted
inserted
replaced
5300:5d7bd47b46ef | 5301:d72c3169a343 |
---|---|
1 /* parse_mp4.h - Headerfile for MP4 file format parser code | |
2 * This file is part of MPlayer, see http://mplayerhq.hu/ for info. | |
3 * (c)2002 by Felix Buenemann <atmosfear at users.sourceforge.net> | |
4 * File licensed under the GPL, see http://www.fsf.org/ for more info. | |
5 */ | |
6 | |
7 #ifndef __PARSE_MP4_H | |
8 #define __PARSE_MP4_H 1 | |
9 | |
10 #include <inttypes.h> | |
11 | |
12 /* one byte tag identifiers */ | |
13 #define MP4ODescrTag 0x01 | |
14 #define MP4IODescrTag 0x02 | |
15 #define MP4ESDescrTag 0x03 | |
16 #define MP4DecConfigDescrTag 0x04 | |
17 #define MP4DecSpecificDescrTag 0x05 | |
18 #define MP4SLConfigDescrTag 0x06 | |
19 #define MP4ContentIdDescrTag 0x07 | |
20 #define MP4SupplContentIdDescrTag 0x08 | |
21 #define MP4IPIPtrDescrTag 0x09 | |
22 #define MP4IPMPPtrDescrTag 0x0A | |
23 #define MP4IPMPDescrTag 0x0B | |
24 #define MP4RegistrationDescrTag 0x0D | |
25 #define MP4ESIDIncDescrTag 0x0E | |
26 #define MP4ESIDRefDescrTag 0x0F | |
27 #define MP4FileIODescrTag 0x10 | |
28 #define MP4FileODescrTag 0x11 | |
29 #define MP4ExtProfileLevelDescrTag 0x13 | |
30 #define MP4ExtDescrTagsStart 0x80 | |
31 #define MP4ExtDescrTagsEnd 0xFE | |
32 | |
33 /* I define uint24 here for better understanding */ | |
34 #ifndef uint24_t | |
35 #define uint24_t uint32_t | |
36 #endif | |
37 | |
38 /* esds_t */ | |
39 typedef struct { | |
40 uint8_t version; | |
41 uint24_t flags; | |
42 | |
43 /* 0x03 ESDescrTag */ | |
44 uint16_t ESId; | |
45 uint8_t streamPriority; | |
46 | |
47 /* 0x04 DecConfigDescrTag */ | |
48 uint8_t objectTypeId; | |
49 uint8_t streamType; | |
50 /* XXX: really streamType is | |
51 * only 6bit, followed by: | |
52 * 1bit upStream | |
53 * 1bit reserved | |
54 */ | |
55 uint24_t bufferSizeDB; | |
56 uint32_t maxBitrate; | |
57 uint32_t avgBitrate; | |
58 | |
59 /* 0x05 DecSpecificDescrTag */ | |
60 uint8_t decoderConfigLen; | |
61 uint8_t *decoderConfig; | |
62 | |
63 /* 0x06 SLConfigDescrTag */ | |
64 uint8_t SLConfigLen; | |
65 uint8_t *SLConfig; | |
66 | |
67 /* TODO: add the missing tags, | |
68 * I currently have no specs | |
69 * for them and doubt they | |
70 * are currently needed ::atmos | |
71 */ | |
72 | |
73 } esds_t; | |
74 | |
75 int mp4_parse_esds(unsigned char *data, int datalen, esds_t *esds); | |
76 | |
77 #endif /* !__PARSE_MP4_H */ | |
78 |