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
20 /* All definitions here are packed structures of on-disk formats */
23 typedef struct _riffchunk
27 } RIFFCHUNK
, * LPRIFFCHUNK
;
29 typedef struct _rifflist
34 } RIFFLIST
, * LPRIFFLIST
;
36 #define FCC( ch0, ch1, ch2, ch3 ) \
37 ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
38 ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
40 #define RIFFROUND(cb) ((cb) + ((cb)&1))
41 #define RIFFNEXT(pChunk) (LPRIFFCHUNK)((LPBYTE)(pChunk)+sizeof(RIFFCHUNK)+RIFFROUND(((LPRIFFCHUNK)pChunk)->cb))
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
51 #define ckidMAINAVIHEADER FCC('a','v','i','h')
52 typedef struct _avimainheader
56 DWORD dwMicroSecPerFrame
;
57 DWORD dwMaxBytesPerSec
;
58 DWORD dwPaddingGranularity
;
61 DWORD dwInitialFrames
;
63 DWORD dwSuggestedBufferSize
;
69 #define ckidODML FCC('o','d','m','l')
70 #define ckidAVIEXTHEADER FCC('d','m','l','h')
71 typedef struct _aviextheader
79 #define ckidSTREAMLIST FCC('s','t','r','l')
81 /* flags for dwFlags member of AVISTREAMHEADER */
82 #define AVISF_DISABLED 0x00000001
83 #define AVISF_VIDEO_PALCHANGES 0x00010000
85 #ifndef ckidSTREAMHEADER
86 #define ckidSTREAMHEADER FCC('s','t','r','h')
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')
96 typedef struct _avistreamheader
105 DWORD dwInitialFrames
;
110 DWORD dwSuggestedBufferSize
;
122 #ifndef ckidSTREAMFORMAT
123 #define ckidSTREAMFORMAT FCC('s','t','r','f')
125 #define ckidAVIOLDINDEX FCC('i','d','x','1')
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
133 typedef struct _avioldindex
137 struct _avioldindex_entry
143 } aIndex
[ANYSIZE_ARRAY
];
146 typedef union _timecode
157 #define TIMECODE_RATE_30DROP 0
159 /* flags for dwSMPTEflags member of TIMECODEDATA */
160 #define TIMECODE_SMPTE_BINARY_GROUP 0x07
161 #define TIMECODE_SMPTE_COLOR_FRAME 0x08
163 typedef struct _timecodedata
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
176 #define AVI_INDEX_SUB_DEFAULT 0x00
177 #define AVI_INDEX_SUB_2FIELD 0x01
179 typedef struct _avimetaindex
189 DWORD adwIndex
[ANYSIZE_ARRAY
];
192 #define ckidAVISUPERINDEX FCC('i','n','d','x')
193 typedef struct _avisuperindex
{
202 struct _avisuperindex_entry
{
206 } aIndex
[ANYSIZE_ARRAY
];
209 #define AVISTDINDEX_DELTAFRAME (0x80000000)
210 #define AVISTDINDEX_SIZEMASK (~0x80000000)
212 typedef struct _avistdindex_entry
{
217 typedef struct _avistdindex
{
225 DWORDLONG qwBaseOffset
;
227 AVISTDINDEX_ENTRY aIndex
[ANYSIZE_ARRAY
];
230 typedef struct _avitimedindex_entry
{
234 } AVITIMEDINDEX_ENTRY
;
236 typedef struct _avitimedindex
{
244 DWORDLONG qwBaseOffset
;
246 AVITIMEDINDEX_ENTRY aIndex
[ANYSIZE_ARRAY
];
247 /* DWORD adwTrailingFill[ANYSIZE_ARRAY]; */
250 typedef struct _avitimecodeindex
{
259 TIMECODEDATA aIndex
[ANYSIZE_ARRAY
];
262 typedef struct _avitcdlindex_entryA
{
268 } AVITCDLINDEX_ENTRYA
;
270 typedef struct _avitcdlindex_entryW
{
276 } AVITCDLINDEX_ENTRYW
;
278 typedef struct _avitcdlindexA
{
287 AVITCDLINDEX_ENTRYA aIndex
[ANYSIZE_ARRAY
];
288 /* DWORD adwTrailingFill[ANYSIZE_ARRAY]; */
291 typedef struct _avitcdlindexW
{
300 AVITCDLINDEX_ENTRYW aIndex
[ANYSIZE_ARRAY
];
301 /* DWORD adwTrailingFill[ANYSIZE_ARRAY]; */
304 #define AVITCDLINDEX_ENTRY WINELIB_NAME_AW(AVITCDLINDEX_ENTRY)
305 #define AVITCDLINDEX WINELIB_NAME_AW(AVITCDLINDEX)
307 typedef struct _avifieldindex_chunk
{
315 DWORDLONG qwBaseOffset
;
317 struct _avifieldindex_entry
{
320 DWORD dwOffsetField2
;
321 } aIndex
[ANYSIZE_ARRAY
];
322 } AVIFIELDINDEX
, * PAVIFIELDINDEX
;