1 /*
2  * Modified for use with MPlayer, detailed changelog at
3  * http://svn.mplayerhq.hu/mplayer/trunk/
4  */
5 
6 #ifndef MPLAYER_VFW_H
7 #define MPLAYER_VFW_H
8 //#include "pshpack1.h"
9 #include "windef.h"
10 
11 typedef struct __attribute__((__packed__))
12 {
13     short    bfType;
14     long   bfSize;
15     short    bfReserved1;
16     short    bfReserved2;
17     long   bfOffBits;
18 } BITMAPFILEHEADER;
19 
20 #ifndef _BITMAPINFOHEADER_
21 #define _BITMAPINFOHEADER_
22 typedef struct __attribute__((__packed__))
23 {
24     long 	biSize;
25     long  	biWidth;
26     long  	biHeight;
27     short 	biPlanes;
28     short 	biBitCount;
29     long 	biCompression;
30     long 	biSizeImage;
31     long  	biXPelsPerMeter;
32     long  	biYPelsPerMeter;
33     long 	biClrUsed;
34     long 	biClrImportant;
35 } BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER;
36 typedef struct {
37 	BITMAPINFOHEADER bmiHeader;
38 	int	bmiColors[1];
39 } BITMAPINFO, *LPBITMAPINFO;
40 #endif
41 
42 #define VFWAPI
43 #define VFWAPIV
44 #ifndef MPLAYER_WINDEF_H
45 typedef long (__stdcall__ *DRIVERPROC)(long,HDRVR,unsigned int,long,long);
46 #endif
47 
48 
49 
50 #ifndef mmioFOURCC
51 #define mmioFOURCC( ch0, ch1, ch2, ch3 )				\
52 	( (long)(unsigned char)(ch0) | ( (long)(unsigned char)(ch1) << 8 ) |		\
53 	( (long)(unsigned char)(ch2) << 16 ) | ( (long)(unsigned char)(ch3) << 24 ) )
54 #endif
55 
56 #ifndef aviTWOCC
57 #define aviTWOCC(ch0, ch1) ((short)(unsigned char)(ch0) | ((short)(unsigned char)(ch1) << 8))
58 #endif
59 
60 #define ICTYPE_VIDEO	mmioFOURCC('v', 'i', 'd', 'c')
61 #define ICTYPE_AUDIO	mmioFOURCC('a', 'u', 'd', 'c')
62 
63 
64 /* Installable Compressor M? */
65 
66 /* HIC struct (same layout as Win95 one) */
67 typedef struct tagWINE_HIC {
68 	long		magic;		/* 00: 'Smag' */
69 	HANDLE	curthread;	/* 04: */
70 	long		type;		/* 08: */
71 	long		handler;	/* 0C: */
72 	HDRVR		hdrv;		/* 10: */
73 	long		driverid;	/* 14:(handled by SendDriverMessage)*/
74 	DRIVERPROC	driverproc;	/* 18:(handled by SendDriverMessage)*/
75 	long		x1;		/* 1c: name? */
76 	short		x2;		/* 20: */
77 	long		x3;		/* 22: */
78 					/* 26: */
79 } WINE_HIC;
80 
81 /* error return codes */
82 #define	ICERR_OK		0
83 #define	ICERR_DONTDRAW		1
84 #define	ICERR_NEWPALETTE	2
85 #define	ICERR_GOTOKEYFRAME	3
86 #define	ICERR_STOPDRAWING	4
87 
88 #define	ICERR_UNSUPPORTED	-1
89 #define	ICERR_BADFORMAT		-2
90 #define	ICERR_MEMORY		-3
91 #define	ICERR_INTERNAL		-4
92 #define	ICERR_BADFLAGS		-5
93 #define	ICERR_BADPARAM		-6
94 #define	ICERR_BADSIZE		-7
95 #define	ICERR_BADHANDLE		-8
96 #define	ICERR_CANTUPDATE	-9
97 #define	ICERR_ABORT		-10
98 #define	ICERR_ERROR		-100
99 #define	ICERR_BADBITDEPTH	-200
100 #define	ICERR_BADIMAGESIZE	-201
101 
102 #define	ICERR_CUSTOM		-400
103 
104 /* ICM Messages */
105 #define	ICM_USER		(DRV_USER+0x0000)
106 
107 /* ICM driver message range */
108 #define	ICM_RESERVED_LOW	(DRV_USER+0x1000)
109 #define	ICM_RESERVED_HIGH	(DRV_USER+0x2000)
110 #define	ICM_RESERVED		ICM_RESERVED_LOW
111 
112 #define	ICM_GETSTATE		(ICM_RESERVED+0)
113 #define	ICM_SETSTATE		(ICM_RESERVED+1)
114 #define	ICM_GETINFO		(ICM_RESERVED+2)
115 
116 #define	ICM_CONFIGURE		(ICM_RESERVED+10)
117 #define	ICM_ABOUT		(ICM_RESERVED+11)
118 /* */
119 
120 #define	ICM_GETDEFAULTQUALITY	(ICM_RESERVED+30)
121 #define	ICM_GETQUALITY		(ICM_RESERVED+31)
122 #define	ICM_SETQUALITY		(ICM_RESERVED+32)
123 
124 #define	ICM_SET			(ICM_RESERVED+40)
125 #define	ICM_GET			(ICM_RESERVED+41)
126 
127 /* 2 constant FOURCC codes */
128 #define ICM_FRAMERATE		mmioFOURCC('F','r','m','R')
129 #define ICM_KEYFRAMERATE	mmioFOURCC('K','e','y','R')
130 
131 #define	ICM_COMPRESS_GET_FORMAT		(ICM_USER+4)
132 #define	ICM_COMPRESS_GET_SIZE		(ICM_USER+5)
133 #define	ICM_COMPRESS_QUERY		(ICM_USER+6)
134 #define	ICM_COMPRESS_BEGIN		(ICM_USER+7)
135 #define	ICM_COMPRESS			(ICM_USER+8)
136 #define	ICM_COMPRESS_END		(ICM_USER+9)
137 
138 #define	ICM_DECOMPRESS_GET_FORMAT	(ICM_USER+10)
139 #define	ICM_DECOMPRESS_QUERY		(ICM_USER+11)
140 #define	ICM_DECOMPRESS_BEGIN		(ICM_USER+12)
141 #define	ICM_DECOMPRESS			(ICM_USER+13)
142 #define	ICM_DECOMPRESS_END		(ICM_USER+14)
143 #define	ICM_DECOMPRESS_SET_PALETTE	(ICM_USER+29)
144 #define	ICM_DECOMPRESS_GET_PALETTE	(ICM_USER+30)
145 
146 #define	ICM_DRAW_QUERY			(ICM_USER+31)
147 #define	ICM_DRAW_BEGIN			(ICM_USER+15)
148 #define	ICM_DRAW_GET_PALETTE		(ICM_USER+16)
149 #define	ICM_DRAW_START			(ICM_USER+18)
150 #define	ICM_DRAW_STOP			(ICM_USER+19)
151 #define	ICM_DRAW_END			(ICM_USER+21)
152 #define	ICM_DRAW_GETTIME		(ICM_USER+32)
153 #define	ICM_DRAW			(ICM_USER+33)
154 #define	ICM_DRAW_WINDOW			(ICM_USER+34)
155 #define	ICM_DRAW_SETTIME		(ICM_USER+35)
156 #define	ICM_DRAW_REALIZE		(ICM_USER+36)
157 #define	ICM_DRAW_FLUSH			(ICM_USER+37)
158 #define	ICM_DRAW_RENDERBUFFER		(ICM_USER+38)
159 
160 #define	ICM_DRAW_START_PLAY		(ICM_USER+39)
161 #define	ICM_DRAW_STOP_PLAY		(ICM_USER+40)
162 
163 #define	ICM_DRAW_SUGGESTFORMAT		(ICM_USER+50)
164 #define	ICM_DRAW_CHANGEPALETTE		(ICM_USER+51)
165 
166 #define	ICM_GETBUFFERSWANTED		(ICM_USER+41)
167 
168 #define	ICM_GETDEFAULTKEYFRAMERATE	(ICM_USER+42)
169 
170 #define	ICM_DECOMPRESSEX_BEGIN		(ICM_USER+60)
171 #define	ICM_DECOMPRESSEX_QUERY		(ICM_USER+61)
172 #define	ICM_DECOMPRESSEX		(ICM_USER+62)
173 #define	ICM_DECOMPRESSEX_END		(ICM_USER+63)
174 
175 #define	ICM_COMPRESS_FRAMES_INFO	(ICM_USER+70)
176 #define	ICM_SET_STATUS_PROC		(ICM_USER+72)
177 
178 /* structs */
179 
180 typedef struct {
181 	long	dwSize;		/* 00: size */
182 	long	fccType;	/* 04: type 'vidc' usually */
183 	long	fccHandler;	/* 08: */
184 	long	dwVersion;	/* 0c: version of compman opening you */
185 	long	dwFlags;	/* 10: LOshort is type specific */
186 	LRESULT	dwError;	/* 14: */
187 	void*	pV1Reserved;	/* 18: */
188 	void*	pV2Reserved;	/* 1c: */
189 	long	dnDevNode;	/* 20: */
190 				/* 24: */
191 } ICOPEN,*LPICOPEN;
192 
193 #define ICCOMPRESS_KEYFRAME     0x00000001L
194 
195 typedef struct {
196     long		dwFlags;
197     LPBITMAPINFOHEADER	lpbiOutput;
198     void*		lpOutput;
199     LPBITMAPINFOHEADER	lpbiInput;
200     const void*		lpInput;
201     long*		lpckid;
202     long*		lpdwFlags;
203     long		lFrameNum;
204     long		dwFrameSize;
205     long		dwQuality;
206     LPBITMAPINFOHEADER	lpbiPrev;
207     void*		lpPrev;
208 } ICCOMPRESS;
209 
210 
211 long VFWAPI VideoForWindowsVersion(void);
212 
213 long VFWAPIV ICCompress(
214 	HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData,
215 	LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid,
216 	long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality,
217 	LPBITMAPINFOHEADER lpbiPrev,void* lpPrev
218 );
219 
220 
221 #define ICCompressGetFormat(hic, lpbiInput, lpbiOutput) 		\
222 	ICSendMessage(							\
223 	    hic,ICM_COMPRESS_GET_FORMAT,(long)(void*)(lpbiInput),	\
224 	    (long)(void*)(lpbiOutput)					\
225 	)
226 
227 #define ICCompressGetFormatSize(hic,lpbi) ICCompressGetFormat(hic,lpbi,NULL)
228 
229 #define ICGetDefaultKeyFrameRate(hic,lpint) 		\
230 	ICSendMessage(					\
231 	    hic, ICM_GETDEFAULTKEYFRAMERATE,		\
232 	    (long)(void*)(lpint), 			\
233 	    0	)
234 
235 #define ICGetDefaultQuality(hic,lpint) 			\
236 	ICSendMessage(					\
237 	    hic, ICM_GETDEFAULTQUALITY,			\
238 	    (long)(void*)(lpint), 			\
239 	    0	)
240 
241 
242 #define ICCompressBegin(hic, lpbiInput, lpbiOutput) 			\
243     ICSendMessage(							\
244     	hic, ICM_COMPRESS_BEGIN, (long)(void*)(lpbiInput),		\
245 	(long)(void*)(lpbiOutput)					\
246     )
247 
248 #define ICCompressGetSize(hic, lpbiInput, lpbiOutput) 		\
249     ICSendMessage(							\
250     	hic, ICM_COMPRESS_GET_SIZE, (long)(void*)(lpbiInput), 	\
251 	(long)(void*)(lpbiOutput)					\
252     )
253 
254 #define ICCompressQuery(hic, lpbiInput, lpbiOutput)		\
255     ICSendMessage(						\
256     	hic, ICM_COMPRESS_QUERY, (long)(void*)(lpbiInput),	\
257 	(long)(void*)(lpbiOutput)				\
258     )
259 
260 
261 #define ICCompressEnd(hic) ICSendMessage(hic, ICM_COMPRESS_END, 0, 0)
262 
263 /* ICCOMPRESSFRAMES.dwFlags */
264 #define ICCOMPRESSFRAMES_PADDING        0x00000001
265 typedef struct {
266     long               dwFlags;
267     LPBITMAPINFOHEADER  lpbiOutput;
268     LPARAM              lOutput;
269     LPBITMAPINFOHEADER  lpbiInput;
270     LPARAM              lInput;
271     long                lStartFrame;
272     long                lFrameCount;
273     long                lQuality;
274     long                lDataRate;
275     long                lKeyRate;
276     long               dwRate;
277     long               dwScale;
278     long               dwOverheadPerFrame;
279     long               dwReserved2;
280     long CALLBACK (*GetData)(LPARAM lInput,long lFrame,void* lpBits,long len);
281     long CALLBACK (*PutData)(LPARAM lOutput,long lFrame,void* lpBits,long len);
282 } ICCOMPRESSFRAMES;
283 
284 /* Values for wMode of ICOpen() */
285 #define	ICMODE_COMPRESS		1
286 #define	ICMODE_DECOMPRESS	2
287 #define	ICMODE_FASTDECOMPRESS	3
288 #define	ICMODE_QUERY		4
289 #define	ICMODE_FASTCOMPRESS	5
290 #define	ICMODE_DRAW		8
291 
292 /* quality flags */
293 #define ICQUALITY_LOW       0
294 #define ICQUALITY_HIGH      10000
295 #define ICQUALITY_DEFAULT   -1
296 
297 typedef struct {
298 	long	dwSize;		/* 00: */
299 	long	fccType;	/* 04:compressor type     'vidc' 'audc' */
300 	long	fccHandler;	/* 08:compressor sub-type 'rle ' 'jpeg' 'pcm '*/
301 	long	dwFlags;	/* 0c:flags LOshort is type specific */
302 	long	dwVersion;	/* 10:version of the driver */
303 	long	dwVersionICM;	/* 14:version of the ICM used */
304 	/*
305 	 * under Win32, the driver always returns UNICODE strings.
306 	 */
307 	WCHAR	szName[16];		/* 18:short name */
308 	WCHAR	szDescription[128];	/* 38:long name */
309 	WCHAR	szDriver[128];		/* 138:driver that contains compressor*/
310 					/* 238: */
311 } ICINFO;
312 
313 /* ICINFO.dwFlags */
314 #define	VIDCF_QUALITY		0x0001  /* supports quality */
315 #define	VIDCF_CRUNCH		0x0002  /* supports crunching to a frame size */
316 #define	VIDCF_TEMPORAL		0x0004  /* supports inter-frame compress */
317 #define	VIDCF_COMPRESSFRAMES	0x0008  /* wants the compress all frames message */
318 #define	VIDCF_DRAW		0x0010  /* supports drawing */
319 #define	VIDCF_FASTTEMPORALC	0x0020  /* does not need prev frame on compress */
320 #define	VIDCF_FASTTEMPORALD	0x0080  /* does not need prev frame on decompress */
321 #define	VIDCF_QUALITYTIME	0x0040  /* supports temporal quality */
322 
323 #define	VIDCF_FASTTEMPORAL	(VIDCF_FASTTEMPORALC|VIDCF_FASTTEMPORALD)
324 
325 
326 /* function shortcuts */
327 /* ICM_ABOUT */
328 #define ICMF_ABOUT_QUERY         0x00000001
329 
330 #define ICQueryAbout(hic) \
331 	(ICSendMessage(hic,ICM_ABOUT,(long)-1,ICMF_ABOUT_QUERY)==ICERR_OK)
332 
333 #define ICAbout(hic, hwnd) ICSendMessage(hic,ICM_ABOUT,(long)(unsigned int)(hwnd),0)
334 
335 /* ICM_CONFIGURE */
336 #define ICMF_CONFIGURE_QUERY	0x00000001
337 #define ICQueryConfigure(hic) \
338 	(ICSendMessage(hic,ICM_CONFIGURE,(long)-1,ICMF_CONFIGURE_QUERY)==ICERR_OK)
339 
340 #define ICConfigure(hic,hwnd) \
341 	ICSendMessage(hic,ICM_CONFIGURE,(long)(unsigned int)(hwnd),0)
342 
343 /* Decompression stuff */
344 #define ICDECOMPRESS_HURRYUP		0x80000000	/* don't draw just buffer (hurry up!) */
345 #define ICDECOMPRESS_UPDATE		0x40000000	/* don't draw just update screen */
346 #define ICDECOMPRESS_PREROL		0x20000000	/* this frame is before real start */
347 #define ICDECOMPRESS_NULLFRAME		0x10000000	/* repeat last frame */
348 #define ICDECOMPRESS_NOTKEYFRAME	0x08000000	/* this frame is not a key frame */
349 
350 typedef struct {
351     long		dwFlags;	/* flags (from AVI index...) */
352     LPBITMAPINFOHEADER	lpbiInput;	/* BITMAPINFO of compressed data */
353     const void*		lpInput;	/* compressed data */
354     LPBITMAPINFOHEADER	lpbiOutput;	/* DIB to decompress to */
355     void*		lpOutput;
356     long		ckid;		/* ckid from AVI file */
357 } ICDECOMPRESS;
358 
359 typedef struct {
360     long		dwFlags;
361     LPBITMAPINFOHEADER lpbiSrc;
362     const void*		lpSrc;
363     LPBITMAPINFOHEADER	lpbiDst;
364     void*		lpDst;
365 
366     /* changed for ICM_DECOMPRESSEX */
367     INT		xDst;       /* destination rectangle */
368     INT		yDst;
369     INT		dxDst;
370     INT		dyDst;
371 
372     INT		xSrc;       /* source rectangle */
373     INT		ySrc;
374     INT		dxSrc;
375     INT		dySrc;
376 } ICDECOMPRESSEX;
377 
378 
379 long VFWAPIV ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits);
380 long VFWAPIV ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits);
381 long VFWAPIV ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi);
382 
383 
384 #define ICDecompressBegin(hic, lpbiInput, lpbiOutput) 	\
385     ICSendMessage(						\
386     	hic, ICM_DECOMPRESS_BEGIN, (long)(void*)(lpbiInput),	\
387 	(long)(void*)(lpbiOutput)				\
388     )
389 
390 #define ICDecompressBeginEx(hic, lpbiInput, lpbiOutput) 	\
391     ICUniversalEx(						\
392     	hic, ICM_DECOMPRESSEX_BEGIN, (lpbiInput),		\
393 	(lpbiOutput)						\
394     )
395 
396 #define ICDecompressQuery(hic, lpbiInput, lpbiOutput)	 	\
397     ICSendMessage(						\
398     	hic,ICM_DECOMPRESS_QUERY, (long)(void*)(lpbiInput),	\
399 	(long) (void*)(lpbiOutput)				\
400     )
401 
402 #define ICDecompressQueryEx(hic, lpbiInput, lpbiOutput) 	\
403     ICUniversalEx(						\
404     	hic,ICM_DECOMPRESSEX_QUERY, (lpbiInput),		\
405 	(lpbiOutput)						\
406     )
407 
408 #define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput)		\
409     ((long)ICSendMessage(						\
410     	hic,ICM_DECOMPRESS_GET_FORMAT, (long)(void*)(lpbiInput),	\
411 	(long)(void*)(lpbiOutput)					\
412     ))
413 
414 #define ICDecompressGetFormatSize(hic, lpbi) 				\
415 	ICDecompressGetFormat(hic, lpbi, NULL)
416 
417 #define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput)		\
418     ICSendMessage(							\
419     	hic, ICM_DECOMPRESS_GET_PALETTE, (long)(void*)(lpbiInput), 	\
420 	(long)(void*)(lpbiOutput)					\
421     )
422 
423 #define ICDecompressSetPalette(hic,lpbiPalette)	\
424         ICSendMessage(				\
425 		hic,ICM_DECOMPRESS_SET_PALETTE,		\
426 		(long)(void*)(lpbiPalette),0		\
427 	)
428 
429 #define ICDecompressEnd(hic) ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0)
430 #define ICDecompressEndEx(hic) ICSendMessage(hic,ICM_DECOMPRESSEX_END, 0, 0)
431 
432 #define ICDRAW_QUERY        0x00000001L   /* test for support */
433 #define ICDRAW_FULLSCREEN   0x00000002L   /* draw to full screen */
434 #define ICDRAW_HDC          0x00000004L   /* draw to a HDC/HWND */
435 
436 
437 WIN_BOOL	VFWAPI	ICInfo(long fccType, long fccHandler, ICINFO * lpicinfo);
438 LRESULT	VFWAPI	ICGetInfo(HIC hic,ICINFO *picinfo, long cb);
439 HIC	VFWAPI	ICOpen(long fccType, long fccHandler, UINT wMode);
440 //HIC	VFWAPI	ICOpenFunction(long fccType, long fccHandler, unsigned int wMode, void* lpfnHandler);
441 
442 LRESULT VFWAPI ICClose(HIC hic);
443 LRESULT	VFWAPI ICSendMessage(HIC hic, unsigned int msg, long dw1, long dw2);
444 //HIC	VFWAPI ICLocate(long fccType, long fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, short wFlags);
445 
446 int VFWAPI ICDoSomething(void);
447 
448 long	VFWAPIV	ICDrawBegin(
449         HIC			hic,
450         long			dwFlags,/* flags */
451         HPALETTE		hpal,	/* palette to draw with */
452         HWND			hwnd,	/* window to draw to */
453         HDC			hdc,	/* HDC to draw to */
454         INT			xDst,	/* destination rectangle */
455         INT			yDst,
456         INT			dxDst,
457         INT			dyDst,
458         LPBITMAPINFOHEADER	lpbi,	/* format of frame to draw */
459         INT			xSrc,	/* source rectangle */
460         INT			ySrc,
461         INT			dxSrc,
462         INT			dySrc,
463         long			dwRate,	/* frames/second = (dwRate/dwScale) */
464         long			dwScale
465 );
466 
467 /* as passed to ICM_DRAW_BEGIN (FIXME: correct only for Win32?)  */
468 typedef struct {
469 	long		dwFlags;
470 	HPALETTE	hpal;
471 	HWND		hwnd;
472 	HDC		hdc;
473 	INT		xDst;
474 	INT		yDst;
475 	INT		dxDst;
476 	INT		dyDst;
477 	LPBITMAPINFOHEADER	lpbi;
478 	INT		xSrc;
479 	INT		ySrc;
480 	INT		dxSrc;
481 	INT		dySrc;
482 	long		dwRate;
483 	long		dwScale;
484 } ICDRAWBEGIN;
485 
486 #define ICDRAW_HURRYUP      0x80000000L   /* don't draw just buffer (hurry up!) */
487 #define ICDRAW_UPDATE       0x40000000L   /* don't draw just update screen */
488 #define ICDRAW_PREROLL      0x20000000L   /* this frame is before real start */
489 #define ICDRAW_NULLFRAME    0x10000000L   /* repeat last frame */
490 #define ICDRAW_NOTKEYFRAME  0x08000000L   /* this frame is not a key frame */
491 
492 typedef struct {
493 	long	dwFlags;
494 	void*	lpFormat;
495 	void*	lpData;
496 	long	cbData;
497 	long	lTime;
498 } ICDRAW;
499 
500 long VFWAPIV ICDraw(HIC hic,long dwFlags,void* lpFormat,void* lpData,long cbData,long lTime);
501 
502 
503 #define	AVIGETFRAMEF_BESTDISPLAYFMT	1
504 
505 typedef struct AVISTREAMINFOA {
506     long	fccType;
507     long	fccHandler;
508     long	dwFlags;        /* AVIIF_* */
509     long	dwCaps;
510     short	wPriority;
511     short	wLanguage;
512     long	dwScale;
513     long	dwRate;		/* dwRate / dwScale == samples/second */
514     long	dwStart;
515     long	dwLength;	/* In units above... */
516     long	dwInitialFrames;
517     long	dwSuggestedBufferSize;
518     long	dwQuality;
519     long	dwSampleSize;
520     RECT	rcFrame;
521     long	dwEditCount;
522     long	dwFormatChangeCount;
523     char	szName[64];
524 } AVISTREAMINFOA, * LPAVISTREAMINFOA, *PAVISTREAMINFOA;
525 
526 typedef struct AVISTREAMINFOW {
527     long	fccType;
528     long	fccHandler;
529     long	dwFlags;
530     long	dwCaps;
531     short	wPriority;
532     short	wLanguage;
533     long	dwScale;
534     long	dwRate;		/* dwRate / dwScale == samples/second */
535     long	dwStart;
536     long	dwLength;	/* In units above... */
537     long	dwInitialFrames;
538     long	dwSuggestedBufferSize;
539     long	dwQuality;
540     long	dwSampleSize;
541     RECT	rcFrame;
542     long	dwEditCount;
543     long	dwFormatChangeCount;
544     short	szName[64];
545 } AVISTREAMINFOW, * LPAVISTREAMINFOW, *PAVISTREAMINFOW;
546 DECL_WINELIB_TYPE_AW(AVISTREAMINFO)
547 DECL_WINELIB_TYPE_AW(LPAVISTREAMINFO)
548 DECL_WINELIB_TYPE_AW(PAVISTREAMINFO)
549 
550 #define AVISTREAMINFO_DISABLED		0x00000001
551 #define AVISTREAMINFO_FORMATCHANGES	0x00010000
552 
553 /* AVIFILEINFO.dwFlags */
554 #define AVIFILEINFO_HASINDEX		0x00000010
555 #define AVIFILEINFO_MUSTUSEINDEX	0x00000020
556 #define AVIFILEINFO_ISINTERLEAVED	0x00000100
557 #define AVIFILEINFO_WASCAPTUREFILE	0x00010000
558 #define AVIFILEINFO_COPYRIGHTED		0x00020000
559 
560 /* AVIFILEINFO.dwCaps */
561 #define AVIFILECAPS_CANREAD		0x00000001
562 #define AVIFILECAPS_CANWRITE		0x00000002
563 #define AVIFILECAPS_ALLKEYFRAMES	0x00000010
564 #define AVIFILECAPS_NOCOMPRESSION	0x00000020
565 
566 typedef struct AVIFILEINFOW {
567     long               dwMaxBytesPerSec;
568     long               dwFlags;
569     long               dwCaps;
570     long               dwStreams;
571     long               dwSuggestedBufferSize;
572     long               dwWidth;
573     long               dwHeight;
574     long               dwScale;
575     long               dwRate;
576     long               dwLength;
577     long               dwEditCount;
578     short               szFileType[64];
579 } AVIFILEINFOW, * LPAVIFILEINFOW, *PAVIFILEINFOW;
580 
581 typedef struct AVIFILEINFOA {
582     long               dwMaxBytesPerSec;
583     long               dwFlags;
584     long               dwCaps;
585     long               dwStreams;
586     long               dwSuggestedBufferSize;
587     long               dwWidth;
588     long               dwHeight;
589     long               dwScale;
590     long               dwRate;
591     long               dwLength;
592     long               dwEditCount;
593     char		szFileType[64];
594 } AVIFILEINFOA, * LPAVIFILEINFOA, *PAVIFILEINFOA;
595 
596 DECL_WINELIB_TYPE_AW(AVIFILEINFO)
597 DECL_WINELIB_TYPE_AW(PAVIFILEINFO)
598 DECL_WINELIB_TYPE_AW(LPAVIFILEINFO)
599 
600 /* AVICOMPRESSOPTIONS.dwFlags. determines presence of fields in below struct */
601 #define AVICOMPRESSF_INTERLEAVE	0x00000001
602 #define AVICOMPRESSF_DATARATE	0x00000002
603 #define AVICOMPRESSF_KEYFRAMES	0x00000004
604 #define AVICOMPRESSF_VALID	0x00000008
605 
606 typedef struct {
607     long	fccType;		/* stream type, for consistency */
608     long	fccHandler;		/* compressor */
609     long	dwKeyFrameEvery;	/* keyframe rate */
610     long	dwQuality;		/* compress quality 0-10,000 */
611     long	dwBytesPerSecond;	/* unsigned chars per second */
612     long	dwFlags;		/* flags... see below */
613     void*	lpFormat;		/* save format */
614     long	cbFormat;
615     void*	lpParms;		/* compressor options */
616     long	cbParms;
617     long	dwInterleaveEvery;	/* for non-video streams only */
618 } AVICOMPRESSOPTIONS, *LPAVICOMPRESSOPTIONS,*PAVICOMPRESSOPTIONS;
619 
620 
621 
622 typedef struct {
623     long		cbSize;		// set to sizeof(COMPVARS) before
624 					// calling ICCompressorChoose
625     long		dwFlags;	// see below...
626     HIC			hic;		// HIC of chosen compressor
627     long               fccType;	// basically ICTYPE_VIDEO
628     long               fccHandler;	// handler of chosen compressor or
629 					// "" or "DIB "
630     LPBITMAPINFO	lpbiIn;		// input format
631     LPBITMAPINFO	lpbiOut;	// output format - will compress to this
632     void*		lpBitsOut;
633     void*		lpBitsPrev;
634     long		lFrame;
635     long		lKey;		// key frames how often?
636     long		lDataRate;	// desired data rate KB/Sec
637     long		lQ;		// desired quality
638     long		lKeyCount;
639     void*		lpState;	// state of compressor
640     long		cbState;	// size of the state
641 } COMPVARS, *PCOMPVARS;
642 
643 // FLAGS for dwFlags element of COMPVARS structure:
644 
645 
646 #define AVIERR_OK		0
647 #define MAKE_AVIERR(error)	MAKE_SCODE(SEVERITY_ERROR,FACILITY_ITF,0x4000+error)
648 
649 #define AVIERR_UNSUPPORTED	MAKE_AVIERR(101)
650 #define AVIERR_BADFORMAT	MAKE_AVIERR(102)
651 #define AVIERR_MEMORY		MAKE_AVIERR(103)
652 #define AVIERR_INTERNAL		MAKE_AVIERR(104)
653 #define AVIERR_BADFLAGS		MAKE_AVIERR(105)
654 #define AVIERR_BADPARAM		MAKE_AVIERR(106)
655 #define AVIERR_BADSIZE		MAKE_AVIERR(107)
656 #define AVIERR_BADHANDLE	MAKE_AVIERR(108)
657 #define AVIERR_FILEREAD		MAKE_AVIERR(109)
658 #define AVIERR_FILEWRITE	MAKE_AVIERR(110)
659 #define AVIERR_FILEOPEN		MAKE_AVIERR(111)
660 #define AVIERR_COMPRESSOR	MAKE_AVIERR(112)
661 #define AVIERR_NOCOMPRESSOR	MAKE_AVIERR(113)
662 #define AVIERR_READONLY		MAKE_AVIERR(114)
663 #define AVIERR_NODATA		MAKE_AVIERR(115)
664 #define AVIERR_BUFFERTOOSMALL	MAKE_AVIERR(116)
665 #define AVIERR_CANTCOMPRESS	MAKE_AVIERR(117)
666 #define AVIERR_USERABORT	MAKE_AVIERR(198)
667 #define AVIERR_ERROR		MAKE_AVIERR(199)
668 
669 #endif /* MPLAYER_VFW_H */
670