Mercurial > mplayer.hg
annotate loader/vfl.c @ 26793:a30e8bd1d5dd
10l: Fix MAN_LANG creation for real this time.
author | diego |
---|---|
date | Sun, 18 May 2008 17:32:51 +0000 |
parents | b70f5ac9c001 |
children | 0b21ffa03b9c |
rev | line source |
---|---|
1 | 1 /* |
2 * Copyright 1998 Marcus Meissner | |
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
7385
diff
changeset
|
3 * |
18783 | 4 * Modified for use with MPlayer, detailed changelog at |
5 * http://svn.mplayerhq.hu/mplayer/trunk/ | |
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
7385
diff
changeset
|
6 * |
1 | 7 */ |
8 #include <config.h> | |
9 | |
10 #include <stdio.h> | |
1312 | 11 #include <stdlib.h> |
1 | 12 #include <string.h> |
13 | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
1297
diff
changeset
|
14 #include "win32.h" |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
1297
diff
changeset
|
15 #include "loader.h" |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
1297
diff
changeset
|
16 |
1 | 17 #include "wine/winbase.h" |
18 #include "wine/windef.h" | |
19 #include "wine/winuser.h" | |
20 #include "wine/vfw.h" | |
21 #include "wine/winestring.h" | |
22 #include "wine/driver.h" | |
23 #include "wine/avifmt.h" | |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
1297
diff
changeset
|
24 #include "driver.h" |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
1297
diff
changeset
|
25 |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
1297
diff
changeset
|
26 #define OpenDriverA DrvOpen |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
1297
diff
changeset
|
27 #define CloseDriver DrvClose |
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
1297
diff
changeset
|
28 |
1 | 29 /*********************************************************************** |
30 * VideoForWindowsVersion [MSVFW.2][MSVIDEO.2] | |
31 * Returns the version in major.minor form. | |
32 * In Windows95 this returns 0x040003b6 (4.950) | |
33 */ | |
7385
e2fcdd7608b1
- updated to use new stype ICopen (filename passed in the icopen struct)
arpi
parents:
2069
diff
changeset
|
34 long VFWAPI VideoForWindowsVersion(void) { |
1 | 35 return 0x040003B6; /* 4.950 */ |
36 } | |
37 | |
38 /* system.ini: [drivers] */ | |
39 | |
40 /*********************************************************************** | |
41 * ICInfo [MSVFW.33] | |
42 * Get information about an installable compressor. Return TRUE if there | |
43 * is one. | |
44 */ | |
45 int VFWAPI | |
46 ICInfo( | |
47 long fccType, /* [in] type of compressor ('vidc') */ | |
48 long fccHandler, /* [in] <n>th compressor */ | |
49 ICINFO *lpicinfo /* [out] information about compressor */ | |
50 ) { | |
51 /* does OpenDriver/CloseDriver */ | |
52 lpicinfo->dwSize = sizeof(ICINFO); | |
53 lpicinfo->fccType = fccType; | |
54 lpicinfo->dwFlags = 0; | |
55 return TRUE; | |
56 } | |
57 | |
58 /*********************************************************************** | |
59 * ICOpen [MSVFW.37] | |
60 * Opens an installable compressor. Return special handle. | |
61 */ | |
62 HIC VFWAPI | |
7385
e2fcdd7608b1
- updated to use new stype ICopen (filename passed in the icopen struct)
arpi
parents:
2069
diff
changeset
|
63 //ICOpen(long fccType,long fccHandler,unsigned int wMode) { |
e2fcdd7608b1
- updated to use new stype ICopen (filename passed in the icopen struct)
arpi
parents:
2069
diff
changeset
|
64 ICOpen(long filename,long fccHandler,unsigned int wMode) { |
1 | 65 ICOPEN icopen; |
66 HDRVR hdrv; | |
67 WINE_HIC *whic; | |
68 | |
69 /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the | |
70 * same layout as ICOPEN | |
71 */ | |
7385
e2fcdd7608b1
- updated to use new stype ICopen (filename passed in the icopen struct)
arpi
parents:
2069
diff
changeset
|
72 icopen.fccType = 0x63646976; // "vidc" //fccType; |
1 | 73 icopen.fccHandler = fccHandler; |
74 icopen.dwSize = sizeof(ICOPEN); | |
75 icopen.dwFlags = wMode; | |
7385
e2fcdd7608b1
- updated to use new stype ICopen (filename passed in the icopen struct)
arpi
parents:
2069
diff
changeset
|
76 icopen.pV1Reserved = (void*)filename; |
1 | 77 /* FIXME: do we need to fill out the rest too? */ |
78 hdrv=OpenDriverA((long)&icopen); | |
7385
e2fcdd7608b1
- updated to use new stype ICopen (filename passed in the icopen struct)
arpi
parents:
2069
diff
changeset
|
79 if (!hdrv) return 0; |
18878 | 80 whic = malloc(sizeof(WINE_HIC)); |
1 | 81 whic->hdrv = hdrv; |
82 whic->driverproc= ((DRVR*)hdrv)->DriverProc; | |
83 // whic->private = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen); | |
7385
e2fcdd7608b1
- updated to use new stype ICopen (filename passed in the icopen struct)
arpi
parents:
2069
diff
changeset
|
84 whic->driverid = ((DRVR*)hdrv)->dwDriverID; |
1 | 85 return (HIC)whic; |
86 } | |
87 | |
88 /*********************************************************************** | |
89 * ICGetInfo [MSVFW.30] | |
90 */ | |
91 LRESULT VFWAPI | |
92 ICGetInfo(HIC hic,ICINFO *picinfo,long cb) { | |
93 LRESULT ret; | |
94 | |
95 ret = ICSendMessage(hic,ICM_GETINFO,(long)picinfo,cb); | |
96 | |
97 return ret; | |
98 } | |
99 | |
100 /*********************************************************************** | |
101 * ICCompress [MSVFW.23] | |
102 */ | |
103 long VFWAPIV | |
104 ICCompress( | |
105 HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData, | |
106 LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid, | |
107 long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality, | |
108 LPBITMAPINFOHEADER lpbiPrev,void* lpPrev | |
109 ) { | |
110 ICCOMPRESS iccmp; | |
111 | |
112 iccmp.dwFlags = dwFlags; | |
113 | |
114 iccmp.lpbiOutput = lpbiOutput; | |
115 iccmp.lpOutput = lpData; | |
116 iccmp.lpbiInput = lpbiInput; | |
117 iccmp.lpInput = lpBits; | |
118 | |
119 iccmp.lpckid = lpckid; | |
120 iccmp.lpdwFlags = lpdwFlags; | |
121 iccmp.lFrameNum = lFrameNum; | |
122 iccmp.dwFrameSize = dwFrameSize; | |
123 iccmp.dwQuality = dwQuality; | |
124 iccmp.lpbiPrev = lpbiPrev; | |
125 iccmp.lpPrev = lpPrev; | |
126 return ICSendMessage(hic,ICM_COMPRESS,(long)&iccmp,sizeof(iccmp)); | |
127 } | |
128 | |
129 /*********************************************************************** | |
130 * ICDecompress [MSVFW.26] | |
131 */ | |
132 long VFWAPIV | |
133 ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) { | |
134 ICDECOMPRESS icd; | |
135 int result; | |
136 icd.dwFlags = dwFlags; | |
137 icd.lpbiInput = lpbiFormat; | |
138 icd.lpInput = lpData; | |
139 | |
140 icd.lpbiOutput = lpbi; | |
141 icd.lpOutput = lpBits; | |
142 icd.ckid = 0; | |
143 result=ICSendMessage(hic,ICM_DECOMPRESS,(long)&icd,sizeof(icd)); | |
144 return result; | |
145 } | |
146 | |
147 /*********************************************************************** | |
1297 | 148 * ICDecompressEx [MSVFW.26] |
149 */ | |
150 long VFWAPIV | |
151 ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) { | |
152 ICDECOMPRESSEX icd; | |
153 int result; | |
154 | |
155 icd.dwFlags = dwFlags; | |
156 | |
157 icd.lpbiSrc = lpbiFormat; | |
158 icd.lpSrc = lpData; | |
159 | |
160 icd.lpbiDst = lpbi; | |
161 icd.lpDst = lpBits; | |
162 | |
163 icd.xSrc=icd.ySrc=0; | |
164 icd.dxSrc=lpbiFormat->biWidth; | |
165 icd.dySrc=abs(lpbiFormat->biHeight); | |
166 | |
167 icd.xDst=icd.yDst=0; | |
168 icd.dxDst=lpbi->biWidth; | |
169 icd.dyDst=abs(lpbi->biHeight); | |
170 | |
171 //icd.ckid = 0; | |
172 result=ICSendMessage(hic,ICM_DECOMPRESSEX,(long)&icd,sizeof(icd)); | |
173 return result; | |
174 } | |
175 | |
176 long VFWAPIV | |
177 ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi) { | |
178 ICDECOMPRESSEX icd; | |
179 int result; | |
180 | |
181 icd.dwFlags = 0; | |
182 | |
183 icd.lpbiSrc = lpbiFormat; | |
184 icd.lpSrc = 0; | |
185 | |
186 icd.lpbiDst = lpbi; | |
187 icd.lpDst = 0; | |
188 | |
189 icd.xSrc=icd.ySrc=0; | |
190 icd.dxSrc=lpbiFormat->biWidth; | |
191 icd.dySrc=abs(lpbiFormat->biHeight); | |
192 | |
193 icd.xDst=icd.yDst=0; | |
194 icd.dxDst=lpbi->biWidth; | |
195 icd.dyDst=abs(lpbi->biHeight); | |
196 | |
197 //icd.ckid = 0; | |
198 result=ICSendMessage(hic,command,(long)&icd,sizeof(icd)); | |
199 return result; | |
200 } | |
201 | |
202 | |
203 /*********************************************************************** | |
1 | 204 * ICSendMessage [MSVFW.40] |
205 */ | |
206 LRESULT VFWAPI | |
207 ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) { | |
7385
e2fcdd7608b1
- updated to use new stype ICopen (filename passed in the icopen struct)
arpi
parents:
2069
diff
changeset
|
208 WINE_HIC *whic = (WINE_HIC*)hic; |
e2fcdd7608b1
- updated to use new stype ICopen (filename passed in the icopen struct)
arpi
parents:
2069
diff
changeset
|
209 return SendDriverMessage(whic->hdrv, msg, lParam1,lParam2); |
1 | 210 } |
211 | |
212 | |
213 /*********************************************************************** | |
214 * ICClose [MSVFW.22] | |
215 */ | |
216 LRESULT VFWAPI ICClose(HIC hic) { | |
217 WINE_HIC *whic = (WINE_HIC*)hic; | |
218 /* FIXME: correct? */ | |
219 // CloseDriver(whic->hdrv,0,0); | |
220 DrvClose(whic->hdrv); | |
221 //#warning FIXME: DrvClose | |
7385
e2fcdd7608b1
- updated to use new stype ICopen (filename passed in the icopen struct)
arpi
parents:
2069
diff
changeset
|
222 free(whic); |
1 | 223 return 0; |
224 } | |
7385
e2fcdd7608b1
- updated to use new stype ICopen (filename passed in the icopen struct)
arpi
parents:
2069
diff
changeset
|
225 |
1 | 226 int VFWAPI ICDoSomething() |
227 { | |
228 return 0; | |
229 } | |
230 |