2 * Copyright (C) 2003 Robert Shearman
3 * Copyright (C) 2008 Maarten Lankhorst
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.
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.
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
23 /* All definitions here are packed structures of on-disk formats */
26 typedef struct _riffchunk
30 } RIFFCHUNK
, * LPRIFFCHUNK
;
32 typedef struct _rifflist
37 } RIFFLIST
, * LPRIFFLIST
;
39 #define FCC( ch0, ch1, ch2, ch3 ) \
40 ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
41 ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
43 #define RIFFROUND(cb) ((cb) + ((cb)&1))
44 #define RIFFNEXT(pChunk) (LPRIFFCHUNK)((LPBYTE)(pChunk)+sizeof(RIFFCHUNK)+RIFFROUND(((LPRIFFCHUNK)pChunk)->cb))
46 /* flags for dwFlags member of AVIMAINHEADER */
47 #define AVIF_HASINDEX 0x00000010
48 #define AVIF_MUSTUSEINDEX 0x00000020
49 #define AVIF_ISINTERLEAVED 0x00000100
50 #define AVIF_TRUSTCKTYPE 0x00000800
51 #define AVIF_WASCAPTUREFILE 0x00010000
52 #define AVIF_COPYRIGHTED 0x00020000
54 #define ckidMAINAVIHEADER FCC('a','v','i','h')
55 typedef struct _avimainheader
59 DWORD dwMicroSecPerFrame
;
60 DWORD dwMaxBytesPerSec
;
61 DWORD dwPaddingGranularity
;
64 DWORD dwInitialFrames
;
66 DWORD dwSuggestedBufferSize
;
72 #define ckidODML FCC('o','d','m','l')
73 #define ckidAVIEXTHEADER FCC('d','m','l','h')
74 typedef struct _aviextheader
82 #define ckidSTREAMLIST FCC('s','t','r','l')
84 /* flags for dwFlags member of AVISTREAMHEADER */
85 #define AVISF_DISABLED 0x00000001
86 #define AVISF_VIDEO_PALCHANGES 0x00010000
88 #ifndef ckidSTREAMHEADER
89 #define ckidSTREAMHEADER FCC('s','t','r','h')
92 #ifndef streamtypeVIDEO
93 #define streamtypeVIDEO FCC('v','i','d','s')
94 #define streamtypeAUDIO FCC('a','u','d','s')
95 #define streamtypeMIDI FCC('m','i','d','s')
96 #define streamtypeTEXT FCC('t','x','t','s')
99 typedef struct _avistreamheader
108 DWORD dwInitialFrames
;
113 DWORD dwSuggestedBufferSize
;
125 #ifndef ckidSTREAMFORMAT
126 #define ckidSTREAMFORMAT FCC('s','t','r','f')
128 #define ckidAVIOLDINDEX FCC('i','d','x','1')
130 /* flags for dwFlags member of _avioldindex_entry */
131 #define AVIIF_LIST 0x00000001
132 #define AVIIF_KEYFRAME 0x00000010
133 #define AVIIF_NO_TIME 0x00000100
134 #define AVIIF_COMPRESSOR 0x0FFF0000
136 typedef struct _avioldindex
140 struct _avioldindex_entry
146 } aIndex
[ANYSIZE_ARRAY
];
149 typedef union _timecode
160 #define TIMECODE_RATE_30DROP 0
162 /* flags for dwSMPTEflags member of TIMECODEDATA */
163 #define TIMECODE_SMPTE_BINARY_GROUP 0x07
164 #define TIMECODE_SMPTE_COLOR_FRAME 0x08
166 typedef struct _timecodedata
173 #define AVI_INDEX_OF_INDEXES 0x00
174 #define AVI_INDEX_OF_CHUNKS 0x01
175 #define AVI_INDEX_OF_TIMED_CHUNKS 0x02
176 #define AVI_INDEX_OF_SUB_2FIELD 0x03
177 #define AVI_INDEX_IS_DATA 0x80
179 #define AVI_INDEX_SUB_DEFAULT 0x00
180 #define AVI_INDEX_SUB_2FIELD 0x01
182 typedef struct _avimetaindex
192 DWORD adwIndex
[ANYSIZE_ARRAY
];
195 #define ckidAVISUPERINDEX FCC('i','n','d','x')
196 typedef struct _avisuperindex
{
205 struct _avisuperindex_entry
{
209 } aIndex
[ANYSIZE_ARRAY
];
212 #define AVISTDINDEX_DELTAFRAME (0x80000000)
213 #define AVISTDINDEX_SIZEMASK (~0x80000000)
215 typedef struct _avistdindex_entry
{
220 typedef struct _avistdindex
{
228 DWORDLONG qwBaseOffset
;
230 AVISTDINDEX_ENTRY aIndex
[ANYSIZE_ARRAY
];
233 typedef struct _avitimedindex_entry
{
237 } AVITIMEDINDEX_ENTRY
;
239 typedef struct _avitimedindex
{
247 DWORDLONG qwBaseOffset
;
249 AVITIMEDINDEX_ENTRY aIndex
[ANYSIZE_ARRAY
];
250 /* DWORD adwTrailingFill[ANYSIZE_ARRAY]; */
253 typedef struct _avitimecodeindex
{
262 TIMECODEDATA aIndex
[ANYSIZE_ARRAY
];
265 typedef struct _avitcdlindex_entryA
{
271 } AVITCDLINDEX_ENTRYA
;
273 typedef struct _avitcdlindex_entryW
{
279 } AVITCDLINDEX_ENTRYW
;
281 typedef struct _avitcdlindexA
{
290 AVITCDLINDEX_ENTRYA aIndex
[ANYSIZE_ARRAY
];
291 /* DWORD adwTrailingFill[ANYSIZE_ARRAY]; */
294 typedef struct _avitcdlindexW
{
303 AVITCDLINDEX_ENTRYW aIndex
[ANYSIZE_ARRAY
];
304 /* DWORD adwTrailingFill[ANYSIZE_ARRAY]; */
307 #define AVITCDLINDEX_ENTRY WINELIB_NAME_AW(AVITCDLINDEX_ENTRY)
308 #define AVITCDLINDEX WINELIB_NAME_AW(AVITCDLINDEX)
310 typedef struct _avifieldindex_chunk
{
318 DWORDLONG qwBaseOffset
;
320 struct _avifieldindex_entry
{
323 DWORD dwOffsetField2
;
324 } aIndex
[ANYSIZE_ARRAY
];
325 } AVIFIELDINDEX
, * PAVIFIELDINDEX
;
329 #endif /* AVIRIFF_H */