annotate loader/vfl.c @ 714:eb58bada8bce

removed debug printf
author arpi_esp
date Sun, 06 May 2001 21:58:44 +0000
parents d751f549f29f
children bf973bffe240
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 * Copyright 1998 Marcus Meissner
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 #include <config.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 #include <stdio.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 #include <string.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 #include "wine/winbase.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 #include "wine/windef.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 #include "wine/winuser.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12 #include "wine/vfw.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13 #include "wine/winestring.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 #include "wine/driver.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 #include "wine/avifmt.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 #define FIXME_(X) printf
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 #define FIXME printf
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20 long VFWAPI VideoForWindowsVersion(void);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
21
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22 extern void* my_mreq(int size, int to_zero);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 extern void DrvClose(HDRVR hdrvr);
597
d751f549f29f no more warnings...
szabii
parents: 1
diff changeset
24 extern int my_release(void* memory);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26 long VFWAPIV ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
27
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
28 WIN_BOOL VFWAPI ICInfo(long fccType, long fccHandler, ICINFO * lpicinfo);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 LRESULT VFWAPI ICGetInfo(HIC hic,ICINFO *picinfo, long cb);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30 HIC VFWAPI ICOpen(long fccType, long fccHandler, UINT wMode);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31 HIC VFWAPI ICOpenFunction(long fccType, long fccHandler, unsigned int wMode, void* lpfnHandler);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
32
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
33 LRESULT VFWAPI ICClose(HIC hic);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 LRESULT VFWAPI ICSendMessage(HIC hic, unsigned int msg, long dw1, long dw2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
35 HIC VFWAPI ICLocate(long fccType, long fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, short wFlags);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 #define OpenDriverA DrvOpen
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 extern HDRVR VFWAPI DrvOpen(long);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 #define STORE_ALL \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 __asm__ ( \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41 "push %%ebx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 "push %%ecx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
43 "push %%edx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 "push %%esi\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 "push %%edi\n\t"::)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 #define REST_ALL \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 __asm__ ( \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 "pop %%edi\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 "pop %%esi\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51 "pop %%edx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52 "pop %%ecx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 "pop %%ebx\n\t"::)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 typedef struct {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 unsigned int uDriverSignature;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 void* hDriverModule;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 DRIVERPROC DriverProc;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 long dwDriverID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 } DRVR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 * VideoForWindowsVersion [MSVFW.2][MSVIDEO.2]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 * Returns the version in major.minor form.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 * In Windows95 this returns 0x040003b6 (4.950)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 long VideoForWindowsVersion(void) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 return 0x040003B6; /* 4.950 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 /* system.ini: [drivers] */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 * ICInfo [MSVFW.33]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76 * Get information about an installable compressor. Return TRUE if there
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 * is one.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 int VFWAPI
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 ICInfo(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 long fccType, /* [in] type of compressor ('vidc') */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 long fccHandler, /* [in] <n>th compressor */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 ICINFO *lpicinfo /* [out] information about compressor */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 char type[5];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87 memcpy(type,&fccType,4);type[4]=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 /* does OpenDriver/CloseDriver */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 lpicinfo->dwSize = sizeof(ICINFO);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91 lpicinfo->fccType = fccType;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 lpicinfo->dwFlags = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 if (GetPrivateProfileStringA("drivers32",NULL,NULL,buf,2000,"system.ini")) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 char *s = buf;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96 while (*s) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 if (!lstrncmpiA(type,s,4)) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98 if(!fccHandler--) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99 lpicinfo->fccHandler = mmioStringToFOURCCA(s+5,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100 return TRUE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 s=s+lstrlenA(s)+1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
106 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107 return TRUE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 * ICOpen [MSVFW.37]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 * Opens an installable compressor. Return special handle.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114 HIC VFWAPI
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115 ICOpen(long fccType,long fccHandler,unsigned int wMode) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 char type[5],handler[5],codecname[20];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117 ICOPEN icopen;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118 HDRVR hdrv;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119 WINE_HIC *whic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121 memcpy(type,&fccType,4);type[4]=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122 memcpy(handler,&fccHandler,4);handler[4]=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
124 sprintf(codecname,"%s.%s",type,handler);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
126 /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
127 * same layout as ICOPEN
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
128 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
129 icopen.fccType = fccType;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
130 icopen.fccHandler = fccHandler;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131 icopen.dwSize = sizeof(ICOPEN);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
132 icopen.dwFlags = wMode;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
133 /* FIXME: do we need to fill out the rest too? */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
134 // hdrv=OpenDriverA(codecname,"drivers32",(long)&icopen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
135 hdrv=OpenDriverA((long)&icopen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
136 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137 if (!hdrv) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138 if (!strcasecmp(type,"vids")) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
139 sprintf(codecname,"vidc.%s",handler);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140 fccType = mmioFOURCC('v','i','d','c');
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
141 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142 // hdrv=OpenDriverA(codecname,"drivers32",(long)&icopen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
143 hdrv=OpenDriverA((long)&icopen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
144 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
145 if (!hdrv)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
146 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
147 // }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148 whic = (WINE_HIC*)my_mreq(sizeof(WINE_HIC), 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
149 whic->hdrv = hdrv;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
150 whic->driverproc= ((DRVR*)hdrv)->DriverProc;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
151 // whic->private = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
152 whic->private = ((DRVR*)hdrv)->dwDriverID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
153 return (HIC)whic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
154 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
155
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
156 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
157 * ICOpenFunction [MSVFW.38]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
158 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159 HIC VFWAPI ICOpenFunction(long fccType, long fccHandler, unsigned int wMode,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
160 void* lpfnHandler) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
161 char type[5],handler[5];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
162 HIC hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
163 WINE_HIC *whic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165 memcpy(type,&fccType,4);type[4]=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166 memcpy(handler,&fccHandler,4);handler[4]=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167 FIXME("(%s,%s,%d,%p), stub!\n",type,handler,wMode,lpfnHandler);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
168 hic = ICOpen(fccType,fccHandler,wMode);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169 if (!hic)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
170 return hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
171 whic = (WINE_HIC*)hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
172 whic->driverproc = (DRIVERPROC)lpfnHandler;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173 return hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
175
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
176
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
177 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
178 * ICGetInfo [MSVFW.30]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
179 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
180 LRESULT VFWAPI
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
181 ICGetInfo(HIC hic,ICINFO *picinfo,long cb) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
182 LRESULT ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
183
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
184 ret = ICSendMessage(hic,ICM_GETINFO,(long)picinfo,cb);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
185
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
186 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
187 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
188
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190 * ICLocate [MSVFW.35]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
191 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
192 HIC VFWAPI
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
193 ICLocate(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194 long fccType, long fccHandler, LPBITMAPINFOHEADER lpbiIn,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
195 LPBITMAPINFOHEADER lpbiOut, short wMode
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
196 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
197 char type[5],handler[5];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
198 HIC hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
199 long querymsg;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
200
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
201 switch (wMode) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
202 case ICMODE_FASTCOMPRESS:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
203 case ICMODE_COMPRESS:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
204 querymsg = ICM_COMPRESS_QUERY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
205 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
206 case ICMODE_DECOMPRESS:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
207 case ICMODE_FASTDECOMPRESS:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
208 querymsg = ICM_DECOMPRESS_QUERY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
209 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
210 case ICMODE_DRAW:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
211 querymsg = ICM_DRAW_QUERY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
212 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
213 default:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
214 FIXME("Unknown mode (%d)\n",wMode);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
215 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
216 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
218 /* Easy case: handler/type match, we just fire a query and return */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
219 hic = ICOpen(fccType,fccHandler,wMode);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
220 if (hic) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
221 if (!ICSendMessage(hic,querymsg,(long)lpbiIn,(long)lpbiOut))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
222 return hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
223 ICClose(hic);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
224 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
225 type[4]='\0';memcpy(type,&fccType,4);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
226 handler[4]='\0';memcpy(handler,&fccHandler,4);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
227 if (fccType==streamtypeVIDEO) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
228 hic = ICLocate(ICTYPE_VIDEO,fccHandler,lpbiIn,lpbiOut,wMode);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
229 if (hic)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
230 return hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
231 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
232 FIXME("(%s,%s,%p,%p,0x%04x),unhandled!\n",type,handler,lpbiIn,lpbiOut,wMode);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
233 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
234 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
235
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
236 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
237 * ICCompress [MSVFW.23]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
238 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
239 long VFWAPIV
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
240 ICCompress(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
241 HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
242 LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
243 long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
244 LPBITMAPINFOHEADER lpbiPrev,void* lpPrev
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
245 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
246 ICCOMPRESS iccmp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
247
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
248 iccmp.dwFlags = dwFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
249
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
250 iccmp.lpbiOutput = lpbiOutput;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
251 iccmp.lpOutput = lpData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
252 iccmp.lpbiInput = lpbiInput;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
253 iccmp.lpInput = lpBits;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
254
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
255 iccmp.lpckid = lpckid;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
256 iccmp.lpdwFlags = lpdwFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
257 iccmp.lFrameNum = lFrameNum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
258 iccmp.dwFrameSize = dwFrameSize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
259 iccmp.dwQuality = dwQuality;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
260 iccmp.lpbiPrev = lpbiPrev;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
261 iccmp.lpPrev = lpPrev;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
262 return ICSendMessage(hic,ICM_COMPRESS,(long)&iccmp,sizeof(iccmp));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
263 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
264
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
265 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
266 * ICDecompress [MSVFW.26]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
267 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
268 long VFWAPIV
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
269 ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
270 ICDECOMPRESS icd;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
271 int result;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
272 icd.dwFlags = dwFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
273 icd.lpbiInput = lpbiFormat;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
274 icd.lpInput = lpData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
275
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
276 icd.lpbiOutput = lpbi;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
277 icd.lpOutput = lpBits;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
278 icd.ckid = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
279 STORE_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
280 result=ICSendMessage(hic,ICM_DECOMPRESS,(long)&icd,sizeof(icd));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
281 REST_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
282 return result;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
283 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
284
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
285 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
286 * ICSendMessage [MSVFW.40]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
287 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
288 LRESULT VFWAPI
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
289 ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
290 LRESULT ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
291 WINE_HIC *whic = (WINE_HIC*)hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
292 char qw[200];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
293
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
294 __asm__ __volatile__ ("fsave (%0)\n\t": :"r"(&qw));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
295 STORE_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
296 /*__asm__
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
297 (
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
298 "pushl %eax\n\t"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
299 "movl $0xf,%eax\n\t"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
300 "movw %ax, %fs\n\t"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
301 "popl %eax\n\t"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
302 );*/
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
303 ret = whic->driverproc(whic->private,1,msg,lParam1,lParam2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
304 REST_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
305 __asm__ __volatile__ ("frstor (%0)\n\t": :"r"(&qw));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
306 // } else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
307
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
308 // ret = SendDriverMessage(whic->hdrv,msg,lParam1,lParam2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
309 // TRACE(" -> 0x%08lx\n",ret);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
310 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
311 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
312
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
313
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
314 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
315 * ICClose [MSVFW.22]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
316 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
317 LRESULT VFWAPI ICClose(HIC hic) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
318 WINE_HIC *whic = (WINE_HIC*)hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
319 /* FIXME: correct? */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
320 // CloseDriver(whic->hdrv,0,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
321 DrvClose(whic->hdrv);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
322 //#warning FIXME: DrvClose
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
323 my_release(whic);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
324 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
325 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
326 int VFWAPI ICDoSomething()
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
327 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
328 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
329 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
330