annotate libmpdemux/parse_mp4.h @ 5333:c4f6ab72300a

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