Add missing #include, fixes the warning:
[mplayer/greg.git] / libmpdemux / parse_mp4.h
blob6bd404c51b16452a32eed3cad1cc26a11725fa83
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 */
7 #ifndef PARSE_MP4_H
8 #define PARSE_MP4_H
10 #include <inttypes.h>
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
33 /* object type identifiers in the ESDS */
34 /* See http://gpac.sourceforge.net/tutorial/mediatypes.htm */
35 /* BIFS stream version 1 */
36 #define MP4OTI_MPEG4Systems1 0x01
37 /* BIFS stream version 2 */
38 #define MP4OTI_MPEG4Systems2 0x02
39 /* MPEG-4 visual stream */
40 #define MP4OTI_MPEG4Visual 0x20
41 /* MPEG-4 audio stream */
42 #define MP4OTI_MPEG4Audio 0x40
43 /* MPEG-2 visual streams with various profiles */
44 #define MP4OTI_MPEG2VisualSimple 0x60
45 #define MP4OTI_MPEG2VisualMain 0x61
46 #define MP4OTI_MPEG2VisualSNR 0x62
47 #define MP4OTI_MPEG2VisualSpatial 0x63
48 #define MP4OTI_MPEG2VisualHigh 0x64
49 #define MP4OTI_MPEG2Visual422 0x65
50 /* MPEG-2 audio stream part 7 ("AAC") with various profiles */
51 #define MP4OTI_MPEG2AudioMain 0x66
52 #define MP4OTI_MPEG2AudioLowComplexity 0x67
53 #define MP4OTI_MPEG2AudioScaleableSamplingRate 0x68
54 /* MPEG-2 audio part 3 ("MP3") */
55 #define MP4OTI_MPEG2AudioPart3 0x69
56 /* MPEG-1 visual visual stream */
57 #define MP4OTI_MPEG1Visual 0x6A
58 /* MPEG-1 audio stream part 3 ("MP3") */
59 #define MP4OTI_MPEG1Audio 0x6B
60 /* JPEG visual stream */
61 #define MP4OTI_JPEG 0x6C
62 /* 3GPP2 */
63 #define MP4OTI_13kVoice 0xE1
65 /* I define uint24 here for better understanding */
66 #ifndef uint24_t
67 #define uint24_t uint32_t
68 #endif
70 /* esds_t */
71 typedef struct {
72 uint8_t version;
73 uint24_t flags;
75 /* 0x03 ESDescrTag */
76 uint16_t ESId;
77 uint8_t streamPriority;
79 /* 0x04 DecConfigDescrTag */
80 uint8_t objectTypeId;
81 uint8_t streamType;
82 /* XXX: really streamType is
83 * only 6bit, followed by:
84 * 1bit upStream
85 * 1bit reserved
86 */
87 uint24_t bufferSizeDB;
88 uint32_t maxBitrate;
89 uint32_t avgBitrate;
91 /* 0x05 DecSpecificDescrTag */
92 uint16_t decoderConfigLen;
93 uint8_t *decoderConfig;
95 /* 0x06 SLConfigDescrTag */
96 uint8_t SLConfigLen;
97 uint8_t *SLConfig;
99 /* TODO: add the missing tags,
100 * I currently have no specs
101 * for them and doubt they
102 * are currently needed ::atmos
105 } esds_t;
107 int mp4_parse_esds(unsigned char *data, int datalen, esds_t *esds);
108 void mp4_free_esds(esds_t *esds);
110 #endif /* !PARSE_MP4_H */