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