00001
00002
00003
00004
00005
00006
00007
00008
00009 #include <config.h>
00010
00011 #include <stdio.h>
00012 #include <stdlib.h>
00013 #include <string.h>
00014
00015 #include "win32.h"
00016 #include "loader.h"
00017
00018 #include "wine/winbase.h"
00019 #include "wine/windef.h"
00020 #include "wine/winuser.h"
00021 #include "wine/vfw.h"
00022 #include "wine/winestring.h"
00023 #include "wine/driver.h"
00024 #include "wine/avifmt.h"
00025 #include "driver.h"
00026
00027 #define OpenDriverA DrvOpen
00028 #define CloseDriver DrvClose
00029
00030
00031
00032
00033
00034
00035 long VFWAPI VideoForWindowsVersion(void) {
00036 return 0x040003B6;
00037 }
00038
00039
00040
00041
00042
00043
00044
00045
00046 int VFWAPI
00047 ICInfo(
00048 long fccType,
00049 long fccHandler,
00050 ICINFO *lpicinfo
00051 ) {
00052
00053 lpicinfo->dwSize = sizeof(ICINFO);
00054 lpicinfo->fccType = fccType;
00055 lpicinfo->dwFlags = 0;
00056 return TRUE;
00057 }
00058
00059
00060
00061
00062
00063 HIC VFWAPI
00064
00065 ICOpen(long filename,long fccHandler,unsigned int wMode) {
00066 ICOPEN icopen;
00067 HDRVR hdrv;
00068 WINE_HIC *whic;
00069
00070
00071
00072
00073 icopen.fccType = 0x63646976;
00074 icopen.fccHandler = fccHandler;
00075 icopen.dwSize = sizeof(ICOPEN);
00076 icopen.dwFlags = wMode;
00077 icopen.pV1Reserved = (void*)filename;
00078
00079 hdrv=OpenDriverA((long)&icopen);
00080 if (!hdrv) return 0;
00081 whic = (WINE_HIC*)malloc(sizeof(WINE_HIC));
00082 whic->hdrv = hdrv;
00083 whic->driverproc= ((DRVR*)hdrv)->DriverProc;
00084
00085 whic->driverid = ((DRVR*)hdrv)->dwDriverID;
00086 return (HIC)whic;
00087 }
00088
00089
00090
00091
00092 LRESULT VFWAPI
00093 ICGetInfo(HIC hic,ICINFO *picinfo,long cb) {
00094 LRESULT ret;
00095
00096 ret = ICSendMessage(hic,ICM_GETINFO,(long)picinfo,cb);
00097
00098 return ret;
00099 }
00100
00101
00102
00103
00104 long VFWAPIV
00105 ICCompress(
00106 HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData,
00107 LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid,
00108 long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality,
00109 LPBITMAPINFOHEADER lpbiPrev,void* lpPrev
00110 ) {
00111 ICCOMPRESS iccmp;
00112
00113 iccmp.dwFlags = dwFlags;
00114
00115 iccmp.lpbiOutput = lpbiOutput;
00116 iccmp.lpOutput = lpData;
00117 iccmp.lpbiInput = lpbiInput;
00118 iccmp.lpInput = lpBits;
00119
00120 iccmp.lpckid = lpckid;
00121 iccmp.lpdwFlags = lpdwFlags;
00122 iccmp.lFrameNum = lFrameNum;
00123 iccmp.dwFrameSize = dwFrameSize;
00124 iccmp.dwQuality = dwQuality;
00125 iccmp.lpbiPrev = lpbiPrev;
00126 iccmp.lpPrev = lpPrev;
00127 return ICSendMessage(hic,ICM_COMPRESS,(long)&iccmp,sizeof(iccmp));
00128 }
00129
00130
00131
00132
00133 long VFWAPIV
00134 ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) {
00135 ICDECOMPRESS icd;
00136 int result;
00137 icd.dwFlags = dwFlags;
00138 icd.lpbiInput = lpbiFormat;
00139 icd.lpInput = lpData;
00140
00141 icd.lpbiOutput = lpbi;
00142 icd.lpOutput = lpBits;
00143 icd.ckid = 0;
00144 result=ICSendMessage(hic,ICM_DECOMPRESS,(long)&icd,sizeof(icd));
00145 return result;
00146 }
00147
00148
00149
00150
00151 long VFWAPIV
00152 ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) {
00153 ICDECOMPRESSEX icd;
00154 int result;
00155
00156 icd.dwFlags = dwFlags;
00157
00158 icd.lpbiSrc = lpbiFormat;
00159 icd.lpSrc = lpData;
00160
00161 icd.lpbiDst = lpbi;
00162 icd.lpDst = lpBits;
00163
00164 icd.xSrc=icd.ySrc=0;
00165 icd.dxSrc=lpbiFormat->biWidth;
00166 icd.dySrc=abs(lpbiFormat->biHeight);
00167
00168 icd.xDst=icd.yDst=0;
00169 icd.dxDst=lpbi->biWidth;
00170 icd.dyDst=abs(lpbi->biHeight);
00171
00172
00173 result=ICSendMessage(hic,ICM_DECOMPRESSEX,(long)&icd,sizeof(icd));
00174 return result;
00175 }
00176
00177 long VFWAPIV
00178 ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi) {
00179 ICDECOMPRESSEX icd;
00180 int result;
00181
00182 icd.dwFlags = 0;
00183
00184 icd.lpbiSrc = lpbiFormat;
00185 icd.lpSrc = 0;
00186
00187 icd.lpbiDst = lpbi;
00188 icd.lpDst = 0;
00189
00190 icd.xSrc=icd.ySrc=0;
00191 icd.dxSrc=lpbiFormat->biWidth;
00192 icd.dySrc=abs(lpbiFormat->biHeight);
00193
00194 icd.xDst=icd.yDst=0;
00195 icd.dxDst=lpbi->biWidth;
00196 icd.dyDst=abs(lpbi->biHeight);
00197
00198
00199 result=ICSendMessage(hic,command,(long)&icd,sizeof(icd));
00200 return result;
00201 }
00202
00203
00204
00205
00206
00207 LRESULT VFWAPI
00208 ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) {
00209 WINE_HIC *whic = (WINE_HIC*)hic;
00210 return SendDriverMessage(whic->hdrv, msg, lParam1,lParam2);
00211 }
00212
00213
00214
00215
00216
00217 LRESULT VFWAPI ICClose(HIC hic) {
00218 WINE_HIC *whic = (WINE_HIC*)hic;
00219
00220
00221 DrvClose(whic->hdrv);
00222
00223 free(whic);
00224 return 0;
00225 }
00226
00227 int VFWAPI ICDoSomething()
00228 {
00229 return 0;
00230 }
00231