[PSDK]
[reactos.git] / include / dxsdk / aviriff.h
1 /*
2 * Copyright (C) 2003 Robert Shearman
3 * Copyright (C) 2008 Maarten Lankhorst
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20 /* All definitions here are packed structures of on-disk formats */
21 #include <pshpack2.h>
22
23 typedef struct _riffchunk
24 {
25 FOURCC fcc;
26 DWORD cb;
27 } RIFFCHUNK, * LPRIFFCHUNK;
28
29 typedef struct _rifflist
30 {
31 FOURCC fcc;
32 DWORD cb;
33 FOURCC fccListType;
34 } RIFFLIST, * LPRIFFLIST;
35
36 #define FCC( ch0, ch1, ch2, ch3 ) \
37 ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
38 ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
39
40 #define RIFFROUND(cb) ((cb) + ((cb)&1))
41 #define RIFFNEXT(pChunk) (LPRIFFCHUNK)((LPBYTE)(pChunk)+sizeof(RIFFCHUNK)+RIFFROUND(((LPRIFFCHUNK)pChunk)->cb))
42
43 /* flags for dwFlags member of AVIMAINHEADER */
44 #define AVIF_HASINDEX 0x00000010
45 #define AVIF_MUSTUSEINDEX 0x00000020
46 #define AVIF_ISINTERLEAVED 0x00000100
47 #define AVIF_TRUSTCKTYPE 0x00000800
48 #define AVIF_WASCAPTUREFILE 0x00010000
49 #define AVIF_COPYRIGHTED 0x00020000
50
51 #define ckidMAINAVIHEADER FCC('a','v','i','h')
52 typedef struct _avimainheader
53 {
54 FOURCC fcc;
55 DWORD cb;
56 DWORD dwMicroSecPerFrame;
57 DWORD dwMaxBytesPerSec;
58 DWORD dwPaddingGranularity;
59 DWORD dwFlags;
60 DWORD dwTotalFrames;
61 DWORD dwInitialFrames;
62 DWORD dwStreams;
63 DWORD dwSuggestedBufferSize;
64 DWORD dwWidth;
65 DWORD dwHeight;
66 DWORD dwReserved[4];
67 } AVIMAINHEADER;
68
69 #define ckidODML FCC('o','d','m','l')
70 #define ckidAVIEXTHEADER FCC('d','m','l','h')
71 typedef struct _aviextheader
72 {
73 FOURCC fcc;
74 DWORD cb;
75 DWORD dwGrandFrames;
76 DWORD dwFuture[61];
77 } AVIEXTHEADER;
78
79 #define ckidSTREAMLIST FCC('s','t','r','l')
80
81 /* flags for dwFlags member of AVISTREAMHEADER */
82 #define AVISF_DISABLED 0x00000001
83 #define AVISF_VIDEO_PALCHANGES 0x00010000
84
85 #ifndef ckidSTREAMHEADER
86 #define ckidSTREAMHEADER FCC('s','t','r','h')
87 #endif
88
89 #ifndef streamtypeVIDEO
90 #define streamtypeVIDEO FCC('v','i','d','s')
91 #define streamtypeAUDIO FCC('a','u','d','s')
92 #define streamtypeMIDI FCC('m','i','d','s')
93 #define streamtypeTEXT FCC('t','x','t','s')
94 #endif
95
96 typedef struct _avistreamheader
97 {
98 FOURCC fcc;
99 DWORD cb;
100 FOURCC fccType;
101 FOURCC fccHandler;
102 DWORD dwFlags;
103 WORD wPriority;
104 WORD wLanguage;
105 DWORD dwInitialFrames;
106 DWORD dwScale;
107 DWORD dwRate;
108 DWORD dwStart;
109 DWORD dwLength;
110 DWORD dwSuggestedBufferSize;
111 DWORD dwQuality;
112 DWORD dwSampleSize;
113 struct
114 {
115 short int left;
116 short int top;
117 short int right;
118 short int bottom;
119 } rcFrame;
120 } AVISTREAMHEADER;
121
122 #ifndef ckidSTREAMFORMAT
123 #define ckidSTREAMFORMAT FCC('s','t','r','f')
124 #endif
125 #define ckidAVIOLDINDEX FCC('i','d','x','1')
126
127 /* flags for dwFlags member of _avioldindex_entry */
128 #define AVIIF_LIST 0x00000001
129 #define AVIIF_KEYFRAME 0x00000010
130 #define AVIIF_NO_TIME 0x00000100
131 #define AVIIF_COMPRESSOR 0x0FFF0000
132
133 typedef struct _avioldindex
134 {
135 FOURCC fcc;
136 DWORD cb;
137 struct _avioldindex_entry
138 {
139 DWORD dwChunkId;
140 DWORD dwFlags;
141 DWORD dwOffset;
142 DWORD dwSize;
143 } aIndex[ANYSIZE_ARRAY];
144 } AVIOLDINDEX;
145
146 typedef union _timecode
147 {
148 struct
149 {
150 WORD wFrameRate;
151 WORD wFrameFract;
152 LONG cFrames;
153 } DUMMYSTRUCTNAME;
154 DWORDLONG qw;
155 } TIMECODE;
156
157 #define TIMECODE_RATE_30DROP 0
158
159 /* flags for dwSMPTEflags member of TIMECODEDATA */
160 #define TIMECODE_SMPTE_BINARY_GROUP 0x07
161 #define TIMECODE_SMPTE_COLOR_FRAME 0x08
162
163 typedef struct _timecodedata
164 {
165 TIMECODE time;
166 DWORD dwSMPTEflags;
167 DWORD dwUser;
168 } TIMECODEDATA;
169
170 #define AVI_INDEX_OF_INDEXES 0x00
171 #define AVI_INDEX_OF_CHUNKS 0x01
172 #define AVI_INDEX_OF_TIMED_CHUNKS 0x02
173 #define AVI_INDEX_OF_SUB_2FIELD 0x03
174 #define AVI_INDEX_IS_DATA 0x80
175
176 #define AVI_INDEX_SUB_DEFAULT 0x00
177 #define AVI_INDEX_SUB_2FIELD 0x01
178
179 typedef struct _avimetaindex
180 {
181 FOURCC fcc;
182 UINT cb;
183 WORD wLongsPerEntry;
184 BYTE bIndexSubType;
185 BYTE bIndexType;
186 DWORD nEntriesInUse;
187 DWORD dwChunkId;
188 DWORD dwReserved[3];
189 DWORD adwIndex[ANYSIZE_ARRAY];
190 } AVIMETAINDEX;
191
192 #define ckidAVISUPERINDEX FCC('i','n','d','x')
193 typedef struct _avisuperindex {
194 FOURCC fcc;
195 UINT cb;
196 WORD wLongsPerEntry;
197 BYTE bIndexSubType;
198 BYTE bIndexType;
199 DWORD nEntriesInUse;
200 DWORD dwChunkId;
201 DWORD dwReserved[3];
202 struct _avisuperindex_entry {
203 DWORDLONG qwOffset;
204 DWORD dwSize;
205 DWORD dwDuration;
206 } aIndex[ANYSIZE_ARRAY];
207 } AVISUPERINDEX;
208
209 #define AVISTDINDEX_DELTAFRAME (0x80000000)
210 #define AVISTDINDEX_SIZEMASK (~0x80000000)
211
212 typedef struct _avistdindex_entry {
213 DWORD dwOffset;
214 DWORD dwSize;
215 } AVISTDINDEX_ENTRY;
216
217 typedef struct _avistdindex {
218 FOURCC fcc;
219 UINT cb;
220 WORD wLongsPerEntry;
221 BYTE bIndexSubType;
222 BYTE bIndexType;
223 DWORD nEntriesInUse;
224 DWORD dwChunkId;
225 DWORDLONG qwBaseOffset;
226 DWORD dwReserved_3;
227 AVISTDINDEX_ENTRY aIndex[ANYSIZE_ARRAY];
228 } AVISTDINDEX;
229
230 typedef struct _avitimedindex_entry {
231 DWORD dwOffset;
232 DWORD dwSize;
233 DWORD dwDuration;
234 } AVITIMEDINDEX_ENTRY;
235
236 typedef struct _avitimedindex {
237 FOURCC fcc;
238 UINT cb;
239 WORD wLongsPerEntry;
240 BYTE bIndexSubType;
241 BYTE bIndexType;
242 DWORD nEntriesInUse;
243 DWORD dwChunkId;
244 DWORDLONG qwBaseOffset;
245 DWORD dwReserved_3;
246 AVITIMEDINDEX_ENTRY aIndex[ANYSIZE_ARRAY];
247 /* DWORD adwTrailingFill[ANYSIZE_ARRAY]; */
248 } AVITIMEDINDEX;
249
250 typedef struct _avitimecodeindex {
251 FOURCC fcc;
252 UINT cb;
253 WORD wLongsPerEntry;
254 BYTE bIndexSubType;
255 BYTE bIndexType;
256 DWORD nEntriesInUse;
257 DWORD dwChunkId;
258 DWORD dwReserved[3];
259 TIMECODEDATA aIndex[ANYSIZE_ARRAY];
260 } AVITIMECODEINDEX;
261
262 typedef struct _avitcdlindex_entryA {
263 DWORD dwTick;
264 TIMECODE time;
265 DWORD dwSMPTEflags;
266 DWORD dwUser;
267 CHAR szReelId[12];
268 } AVITCDLINDEX_ENTRYA;
269
270 typedef struct _avitcdlindex_entryW {
271 DWORD dwTick;
272 TIMECODE time;
273 DWORD dwSMPTEflags;
274 DWORD dwUser;
275 WCHAR szReelId[12];
276 } AVITCDLINDEX_ENTRYW;
277
278 typedef struct _avitcdlindexA {
279 FOURCC fcc;
280 UINT cb;
281 WORD wLongsPerEntry;
282 BYTE bIndexSubType;
283 BYTE bIndexType;
284 DWORD nEntriesInUse;
285 DWORD dwChunkId;
286 DWORD dwReserved[3];
287 AVITCDLINDEX_ENTRYA aIndex[ANYSIZE_ARRAY];
288 /* DWORD adwTrailingFill[ANYSIZE_ARRAY]; */
289 } AVITCDLINDEXA;
290
291 typedef struct _avitcdlindexW {
292 FOURCC fcc;
293 UINT cb;
294 WORD wLongsPerEntry;
295 BYTE bIndexSubType;
296 BYTE bIndexType;
297 DWORD nEntriesInUse;
298 DWORD dwChunkId;
299 DWORD dwReserved[3];
300 AVITCDLINDEX_ENTRYW aIndex[ANYSIZE_ARRAY];
301 /* DWORD adwTrailingFill[ANYSIZE_ARRAY]; */
302 } AVITCDLINDEXW;
303
304 #define AVITCDLINDEX_ENTRY WINELIB_NAME_AW(AVITCDLINDEX_ENTRY)
305 #define AVITCDLINDEX WINELIB_NAME_AW(AVITCDLINDEX)
306
307 typedef struct _avifieldindex_chunk {
308 FOURCC fcc;
309 DWORD cb;
310 WORD wLongsPerEntry;
311 BYTE bIndexSubType;
312 BYTE bIndexType;
313 DWORD nEntriesInUse;
314 DWORD dwChunkId;
315 DWORDLONG qwBaseOffset;
316 DWORD dwReserved3;
317 struct _avifieldindex_entry {
318 DWORD dwOffset;
319 DWORD dwSize;
320 DWORD dwOffsetField2;
321 } aIndex[ANYSIZE_ARRAY];
322 } AVIFIELDINDEX, * PAVIFIELDINDEX;
323
324 #include <poppack.h>