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