vo_tga: Use the proper imgfmt names
[mplayer/glamo.git] / loader / vfl.c
blobe5d0445b9255f0af83b602163fa57d7867c7c5d3
1 /*
2 * Copyright 1998 Marcus Meissner
4 * Modified for use with MPlayer, detailed changelog at
5 * http://svn.mplayerhq.hu/mplayer/trunk/
7 */
8 #include <config.h>
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <string.h>
14 #include "win32.h"
15 #include "loader.h"
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"
24 #include "drv.h"
26 #define OpenDriverA DrvOpen
27 #define CloseDriver DrvClose
29 /***********************************************************************
30 * VideoForWindowsVersion [MSVFW.2][MSVIDEO.2]
31 * Returns the version in major.minor form.
32 * In Windows95 this returns 0x040003b6 (4.950)
34 long VFWAPI VideoForWindowsVersion(void) {
35 return 0x040003B6; /* 4.950 */
38 /* system.ini: [drivers] */
40 /***********************************************************************
41 * ICInfo [MSVFW.33]
42 * Get information about an installable compressor. Return TRUE if there
43 * is one.
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;
58 /***********************************************************************
59 * ICOpen [MSVFW.37]
60 * Opens an installable compressor. Return special handle.
62 HIC VFWAPI
63 //ICOpen(long fccType,long fccHandler,unsigned int wMode) {
64 ICOpen(long filename,long fccHandler,unsigned int wMode) {
65 ICOPEN icopen;
66 HDRVR hdrv;
67 WINE_HIC *whic;
69 /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
70 * same layout as ICOPEN
72 icopen.fccType = 0x63646976; // "vidc" //fccType;
73 icopen.fccHandler = fccHandler;
74 icopen.dwSize = sizeof(ICOPEN);
75 icopen.dwFlags = wMode;
76 icopen.pV1Reserved = (void*)filename;
77 /* FIXME: do we need to fill out the rest too? */
78 hdrv=OpenDriverA((long)&icopen);
79 if (!hdrv) return 0;
80 whic = malloc(sizeof(WINE_HIC));
81 whic->hdrv = hdrv;
82 whic->driverproc= ((DRVR*)hdrv)->DriverProc;
83 // whic->private = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
84 whic->driverid = ((DRVR*)hdrv)->dwDriverID;
85 return (HIC)whic;
88 /***********************************************************************
89 * ICGetInfo [MSVFW.30]
91 LRESULT VFWAPI
92 ICGetInfo(HIC hic,ICINFO *picinfo,long cb) {
93 LRESULT ret;
95 ret = ICSendMessage(hic,ICM_GETINFO,(long)picinfo,cb);
97 return ret;
100 /***********************************************************************
101 * ICCompress [MSVFW.23]
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
110 ICCOMPRESS iccmp;
112 iccmp.dwFlags = dwFlags;
114 iccmp.lpbiOutput = lpbiOutput;
115 iccmp.lpOutput = lpData;
116 iccmp.lpbiInput = lpbiInput;
117 iccmp.lpInput = lpBits;
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));
129 /***********************************************************************
130 * ICDecompress [MSVFW.26]
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;
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;
147 /***********************************************************************
148 * ICDecompressEx [MSVFW.26]
150 long VFWAPIV
151 ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) {
152 ICDECOMPRESSEX icd;
153 int result;
155 icd.dwFlags = dwFlags;
157 icd.lpbiSrc = lpbiFormat;
158 icd.lpSrc = lpData;
160 icd.lpbiDst = lpbi;
161 icd.lpDst = lpBits;
163 icd.xSrc=icd.ySrc=0;
164 icd.dxSrc=lpbiFormat->biWidth;
165 icd.dySrc=abs(lpbiFormat->biHeight);
167 icd.xDst=icd.yDst=0;
168 icd.dxDst=lpbi->biWidth;
169 icd.dyDst=abs(lpbi->biHeight);
171 //icd.ckid = 0;
172 result=ICSendMessage(hic,ICM_DECOMPRESSEX,(long)&icd,sizeof(icd));
173 return result;
176 long VFWAPIV
177 ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi) {
178 ICDECOMPRESSEX icd;
179 int result;
181 icd.dwFlags = 0;
183 icd.lpbiSrc = lpbiFormat;
184 icd.lpSrc = 0;
186 icd.lpbiDst = lpbi;
187 icd.lpDst = 0;
189 icd.xSrc=icd.ySrc=0;
190 icd.dxSrc=lpbiFormat->biWidth;
191 icd.dySrc=abs(lpbiFormat->biHeight);
193 icd.xDst=icd.yDst=0;
194 icd.dxDst=lpbi->biWidth;
195 icd.dyDst=abs(lpbi->biHeight);
197 //icd.ckid = 0;
198 result=ICSendMessage(hic,command,(long)&icd,sizeof(icd));
199 return result;
203 /***********************************************************************
204 * ICSendMessage [MSVFW.40]
206 LRESULT VFWAPI
207 ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) {
208 WINE_HIC *whic = (WINE_HIC*)hic;
209 return SendDriverMessage(whic->hdrv, msg, lParam1,lParam2);
213 /***********************************************************************
214 * ICClose [MSVFW.22]
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
222 free(whic);
223 return 0;
226 int VFWAPI ICDoSomething(void)
228 return 0;