Add a comment that explains why this header has no multiple inclusion guards.
[mplayer/greg.git] / libmpdemux / ebml.h
blob967bffa118a8fda9ba9c1cece04459ae7c3a6bfe
1 #ifndef EBML_H
2 #define EBML_H
4 #include <inttypes.h>
7 /* EBML version supported */
8 #define EBML_VERSION 1
11 * EBML element IDs. max. 32-bit.
14 /* top-level master-IDs */
15 #define EBML_ID_HEADER 0x1A45DFA3
17 /* IDs in the HEADER master */
18 #define EBML_ID_EBMLVERSION 0x4286
19 #define EBML_ID_EBMLREADVERSION 0x42F7
20 #define EBML_ID_EBMLMAXIDLENGTH 0x42F2
21 #define EBML_ID_EBMLMAXSIZELENGTH 0x42F3
22 #define EBML_ID_DOCTYPE 0x4282
23 #define EBML_ID_DOCTYPEVERSION 0x4287
24 #define EBML_ID_DOCTYPEREADVERSION 0x4285
26 /* general EBML types */
27 #define EBML_ID_VOID 0xEC
29 /* ID returned in error cases */
30 #define EBML_ID_INVALID 0xFFFFFFFF
34 * Matroska element IDs. max. 32-bit.
37 /* toplevel segment */
38 #define MATROSKA_ID_SEGMENT 0x18538067
40 /* matroska top-level master IDs */
41 #define MATROSKA_ID_INFO 0x1549A966
42 #define MATROSKA_ID_TRACKS 0x1654AE6B
43 #define MATROSKA_ID_CUES 0x1C53BB6B
44 #define MATROSKA_ID_TAGS 0x1254C367
45 #define MATROSKA_ID_SEEKHEAD 0x114D9B74
46 #define MATROSKA_ID_ATTACHMENTS 0x1941A469
47 #define MATROSKA_ID_CHAPTERS 0x1043A770
48 #define MATROSKA_ID_CLUSTER 0x1F43B675
50 /* IDs in the info master */
51 #define MATROSKA_ID_TIMECODESCALE 0x2AD7B1
52 #define MATROSKA_ID_DURATION 0x4489
53 #define MATROSKA_ID_WRITINGAPP 0x5741
54 #define MATROSKA_ID_MUXINGAPP 0x4D80
55 #define MATROSKA_ID_DATEUTC 0x4461
57 /* ID in the tracks master */
58 #define MATROSKA_ID_TRACKENTRY 0xAE
60 /* IDs in the trackentry master */
61 #define MATROSKA_ID_TRACKNUMBER 0xD7
62 #define MATROSKA_ID_TRACKUID 0x73C5
63 #define MATROSKA_ID_TRACKTYPE 0x83
64 #define MATROSKA_ID_TRACKAUDIO 0xE1
65 #define MATROSKA_ID_TRACKVIDEO 0xE0
66 #define MATROSKA_ID_CODECID 0x86
67 #define MATROSKA_ID_CODECPRIVATE 0x63A2
68 #define MATROSKA_ID_CODECNAME 0x258688
69 #define MATROSKA_ID_CODECINFOURL 0x3B4040
70 #define MATROSKA_ID_CODECDOWNLOADURL 0x26B240
71 #define MATROSKA_ID_TRACKNAME 0x536E
72 #define MATROSKA_ID_TRACKLANGUAGE 0x22B59C
73 #define MATROSKA_ID_TRACKFLAGENABLED 0xB9
74 #define MATROSKA_ID_TRACKFLAGDEFAULT 0x88
75 #define MATROSKA_ID_TRACKFLAGLACING 0x9C
76 #define MATROSKA_ID_TRACKMINCACHE 0x6DE7
77 #define MATROSKA_ID_TRACKMAXCACHE 0x6DF8
78 #define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383
79 #define MATROSKA_ID_TRACKENCODINGS 0x6D80
81 /* IDs in the trackaudio master */
82 #define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5
83 #define MATROSKA_ID_AUDIOBITDEPTH 0x6264
84 #define MATROSKA_ID_AUDIOCHANNELS 0x9F
86 /* IDs in the trackvideo master */
87 #define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3
88 #define MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0
89 #define MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA
90 #define MATROSKA_ID_VIDEOPIXELWIDTH 0xB0
91 #define MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA
92 #define MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A
93 #define MATROSKA_ID_VIDEOSTEREOMODE 0x53B9
94 #define MATROSKA_ID_VIDEODISPLAYUNIT 0x54B2
95 #define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3
96 #define MATROSKA_ID_VIDEOCOLOURSPACE 0x2EB524
97 #define MATROSKA_ID_VIDEOGAMMA 0x2FB523
99 /* IDs in the trackencodings master */
100 #define MATROSKA_ID_CONTENTENCODING 0x6240
101 #define MATROSKA_ID_CONTENTENCODINGORDER 0x5031
102 #define MATROSKA_ID_CONTENTENCODINGSCOPE 0x5032
103 #define MATROSKA_ID_CONTENTENCODINGTYPE 0x5033
104 #define MATROSKA_ID_CONTENTCOMPRESSION 0x5034
105 #define MATROSKA_ID_CONTENTCOMPALGO 0x4254
106 #define MATROSKA_ID_CONTENTCOMPSETTINGS 0x4255
108 /* ID in the cues master */
109 #define MATROSKA_ID_POINTENTRY 0xBB
111 /* IDs in the pointentry master */
112 #define MATROSKA_ID_CUETIME 0xB3
113 #define MATROSKA_ID_CUETRACKPOSITION 0xB7
115 /* IDs in the cuetrackposition master */
116 #define MATROSKA_ID_CUETRACK 0xF7
117 #define MATROSKA_ID_CUECLUSTERPOSITION 0xF1
119 /* IDs in the seekhead master */
120 #define MATROSKA_ID_SEEKENTRY 0x4DBB
122 /* IDs in the seekpoint master */
123 #define MATROSKA_ID_SEEKID 0x53AB
124 #define MATROSKA_ID_SEEKPOSITION 0x53AC
126 /* IDs in the chapters master */
127 #define MATROSKA_ID_EDITIONENTRY 0x45B9
128 #define MATROSKA_ID_CHAPTERATOM 0xB6
129 #define MATROSKA_ID_CHAPTERTIMESTART 0x91
130 #define MATROSKA_ID_CHAPTERTIMEEND 0x92
131 #define MATROSKA_ID_CHAPTERDISPLAY 0x80
132 #define MATROSKA_ID_CHAPSTRING 0x85
134 /* IDs in the cluster master */
135 #define MATROSKA_ID_CLUSTERTIMECODE 0xE7
136 #define MATROSKA_ID_BLOCKGROUP 0xA0
138 /* IDs in the blockgroup master */
139 #define MATROSKA_ID_BLOCKDURATION 0x9B
140 #define MATROSKA_ID_BLOCK 0xA1
141 #define MATROSKA_ID_SIMPLEBLOCK 0xA3
142 #define MATROSKA_ID_REFERENCEBLOCK 0xFB
144 /* IDs in the attachments master */
145 #define MATROSKA_ID_ATTACHEDFILE 0x61A7
146 #define MATROSKA_ID_FILENAME 0x466E
147 #define MATROSKA_ID_FILEMIMETYPE 0x4660
148 #define MATROSKA_ID_FILEDATA 0x465C
149 #define MATROSKA_ID_FILEUID 0x46AE
151 /* matroska track types */
152 #define MATROSKA_TRACK_VIDEO 0x01 /* rectangle-shaped pictures aka video */
153 #define MATROSKA_TRACK_AUDIO 0x02 /* anything you can hear */
154 #define MATROSKA_TRACK_COMPLEX 0x03 /* audio+video in same track used by DV */
155 #define MATROSKA_TRACK_LOGO 0x10 /* overlay-pictures displayed over video*/
156 #define MATROSKA_TRACK_SUBTITLE 0x11 /* text-subtitles */
157 #define MATROSKA_TRACK_CONTROL 0x20 /* control-codes for menu or other stuff*/
159 /* matroska subtitle types */
160 #define MATROSKA_SUBTYPE_UNKNOWN 0
161 #define MATROSKA_SUBTYPE_TEXT 1
162 #define MATROSKA_SUBTYPE_SSA 2
163 #define MATROSKA_SUBTYPE_VOBSUB 3
165 #ifndef UINT64_MAX
166 #define UINT64_MAX 18446744073709551615ULL
167 #endif
169 #ifndef INT64_MAX
170 #define INT64_MAX 9223372036854775807LL
171 #endif
173 #define EBML_UINT_INVALID UINT64_MAX
174 #define EBML_INT_INVALID INT64_MAX
175 #define EBML_FLOAT_INVALID -1000000000.0
178 uint32_t ebml_read_id (stream_t *s, int *length);
179 uint64_t ebml_read_vlen_uint (uint8_t *buffer, int *length);
180 int64_t ebml_read_vlen_int (uint8_t *buffer, int *length);
181 uint64_t ebml_read_length (stream_t *s, int *length);
182 uint64_t ebml_read_uint (stream_t *s, uint64_t *length);
183 int64_t ebml_read_int (stream_t *s, uint64_t *length);
184 long double ebml_read_float (stream_t *s, uint64_t *length);
185 char *ebml_read_ascii (stream_t *s, uint64_t *length);
186 char *ebml_read_utf8 (stream_t *s, uint64_t *length);
187 int ebml_read_skip (stream_t *s, uint64_t *length);
188 uint32_t ebml_read_master (stream_t *s, uint64_t *length);
189 char *ebml_read_header (stream_t *s, int *version);
191 #endif /* EBML_H */