| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
#include <config.h> |
|---|
| 26 |
|
|---|
| 27 |
#include <stdio.h> |
|---|
| 28 |
#include <stdlib.h> |
|---|
| 29 |
#include <string.h> |
|---|
| 30 |
|
|---|
| 31 |
#include "win32.h" |
|---|
| 32 |
#include "loader.h" |
|---|
| 33 |
|
|---|
| 34 |
#include "wine/winbase.h" |
|---|
| 35 |
#include "wine/windef.h" |
|---|
| 36 |
#include "wine/winuser.h" |
|---|
| 37 |
#include "wine/vfw.h" |
|---|
| 38 |
#include "wine/winestring.h" |
|---|
| 39 |
#include "wine/driver.h" |
|---|
| 40 |
#include "wine/avifmt.h" |
|---|
| 41 |
#include "driver.h" |
|---|
| 42 |
|
|---|
| 43 |
#define OpenDriverA DrvOpen |
|---|
| 44 |
#define CloseDriver DrvClose |
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
long VFWAPI VideoForWindowsVersion(void) { |
|---|
| 52 |
return 0x040003B6; |
|---|
| 53 |
} |
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
int VFWAPI |
|---|
| 63 |
ICInfo( |
|---|
| 64 |
long fccType, |
|---|
| 65 |
long fccHandler, |
|---|
| 66 |
ICINFO *lpicinfo |
|---|
| 67 |
) { |
|---|
| 68 |
|
|---|
| 69 |
lpicinfo->dwSize = sizeof(ICINFO); |
|---|
| 70 |
lpicinfo->fccType = fccType; |
|---|
| 71 |
lpicinfo->dwFlags = 0; |
|---|
| 72 |
return TRUE; |
|---|
| 73 |
} |
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
HIC VFWAPI |
|---|
| 80 |
|
|---|
| 81 |
ICOpen(long filename,long fccHandler,unsigned int wMode) { |
|---|
| 82 |
ICOPEN icopen; |
|---|
| 83 |
HDRVR hdrv; |
|---|
| 84 |
WINE_HIC *whic; |
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
icopen.fccType = 0x63646976; |
|---|
| 90 |
icopen.fccHandler = fccHandler; |
|---|
| 91 |
icopen.dwSize = sizeof(ICOPEN); |
|---|
| 92 |
icopen.dwFlags = wMode; |
|---|
| 93 |
icopen.pV1Reserved = (void*)filename; |
|---|
| 94 |
|
|---|
| 95 |
hdrv=OpenDriverA((long)&icopen); |
|---|
| 96 |
if (!hdrv) return 0; |
|---|
| 97 |
whic = (WINE_HIC*)malloc(sizeof(WINE_HIC)); |
|---|
| 98 |
whic->hdrv = hdrv; |
|---|
| 99 |
whic->driverproc= ((DRVR*)hdrv)->DriverProc; |
|---|
| 100 |
|
|---|
| 101 |
whic->driverid = ((DRVR*)hdrv)->dwDriverID; |
|---|
| 102 |
return (HIC)whic; |
|---|
| 103 |
} |
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
LRESULT VFWAPI |
|---|
| 109 |
ICGetInfo(HIC hic,ICINFO *picinfo,long cb) { |
|---|
| 110 |
LRESULT ret; |
|---|
| 111 |
|
|---|
| 112 |
ret = ICSendMessage(hic,ICM_GETINFO,(long)picinfo,cb); |
|---|
| 113 |
|
|---|
| 114 |
return ret; |
|---|
| 115 |
} |
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 |
long VFWAPIV |
|---|
| 121 |
ICCompress( |
|---|
| 122 |
HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData, |
|---|
| 123 |
LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid, |
|---|
| 124 |
long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality, |
|---|
| 125 |
LPBITMAPINFOHEADER lpbiPrev,void* lpPrev |
|---|
| 126 |
) { |
|---|
| 127 |
ICCOMPRESS iccmp; |
|---|
| 128 |
|
|---|
| 129 |
iccmp.dwFlags = dwFlags; |
|---|
| 130 |
|
|---|
| 131 |
iccmp.lpbiOutput = lpbiOutput; |
|---|
| 132 |
iccmp.lpOutput = lpData; |
|---|
| 133 |
iccmp.lpbiInput = lpbiInput; |
|---|
| 134 |
iccmp.lpInput = lpBits; |
|---|
| 135 |
|
|---|
| 136 |
iccmp.lpckid = lpckid; |
|---|
| 137 |
iccmp.lpdwFlags = lpdwFlags; |
|---|
| 138 |
iccmp.lFrameNum = lFrameNum; |
|---|
| 139 |
iccmp.dwFrameSize = dwFrameSize; |
|---|
| 140 |
iccmp.dwQuality = dwQuality; |
|---|
| 141 |
iccmp.lpbiPrev = lpbiPrev; |
|---|
| 142 |
iccmp.lpPrev = lpPrev; |
|---|
| 143 |
return ICSendMessage(hic,ICM_COMPRESS,(long)&iccmp,sizeof(iccmp)); |
|---|
| 144 |
} |
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
long VFWAPIV |
|---|
| 150 |
ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) { |
|---|
| 151 |
ICDECOMPRESS icd; |
|---|
| 152 |
int result; |
|---|
| 153 |
icd.dwFlags = dwFlags; |
|---|
| 154 |
icd.lpbiInput = lpbiFormat; |
|---|
| 155 |
icd.lpInput = lpData; |
|---|
| 156 |
|
|---|
| 157 |
icd.lpbiOutput = lpbi; |
|---|
| 158 |
icd.lpOutput = lpBits; |
|---|
| 159 |
icd.ckid = 0; |
|---|
| 160 |
result=ICSendMessage(hic,ICM_DECOMPRESS,(long)&icd,sizeof(icd)); |
|---|
| 161 |
return result; |
|---|
| 162 |
} |
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
long VFWAPIV |
|---|
| 168 |
ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) { |
|---|
| 169 |
ICDECOMPRESSEX icd; |
|---|
| 170 |
int result; |
|---|
| 171 |
|
|---|
| 172 |
icd.dwFlags = dwFlags; |
|---|
| 173 |
|
|---|
| 174 |
icd.lpbiSrc = lpbiFormat; |
|---|
| 175 |
icd.lpSrc = lpData; |
|---|
| 176 |
|
|---|
| 177 |
icd.lpbiDst = lpbi; |
|---|
| 178 |
icd.lpDst = lpBits; |
|---|
| 179 |
|
|---|
| 180 |
icd.xSrc=icd.ySrc=0; |
|---|
| 181 |
icd.dxSrc=lpbiFormat->biWidth; |
|---|
| 182 |
icd.dySrc=abs(lpbiFormat->biHeight); |
|---|
| 183 |
|
|---|
| 184 |
icd.xDst=icd.yDst=0; |
|---|
| 185 |
icd.dxDst=lpbi->biWidth; |
|---|
| 186 |
icd.dyDst=abs(lpbi->biHeight); |
|---|
| 187 |
|
|---|
| 188 |
|
|---|
| 189 |
result=ICSendMessage(hic,ICM_DECOMPRESSEX,(long)&icd,sizeof(icd)); |
|---|
| 190 |
return result; |
|---|
| 191 |
} |
|---|
| 192 |
|
|---|
| 193 |
long VFWAPIV |
|---|
| 194 |
ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi) { |
|---|
| 195 |
ICDECOMPRESSEX icd; |
|---|
| 196 |
int result; |
|---|
| 197 |
|
|---|
| 198 |
icd.dwFlags = 0; |
|---|
| 199 |
|
|---|
| 200 |
icd.lpbiSrc = lpbiFormat; |
|---|
| 201 |
icd.lpSrc = 0; |
|---|
| 202 |
|
|---|
| 203 |
icd.lpbiDst = lpbi; |
|---|
| 204 |
icd.lpDst = 0; |
|---|
| 205 |
|
|---|
| 206 |
icd.xSrc=icd.ySrc=0; |
|---|
| 207 |
icd.dxSrc=lpbiFormat->biWidth; |
|---|
| 208 |
icd.dySrc=abs(lpbiFormat->biHeight); |
|---|
| 209 |
|
|---|
| 210 |
icd.xDst=icd.yDst=0; |
|---|
| 211 |
icd.dxDst=lpbi->biWidth; |
|---|
| 212 |
icd.dyDst=abs(lpbi->biHeight); |
|---|
| 213 |
|
|---|
| 214 |
|
|---|
| 215 |
result=ICSendMessage(hic,command,(long)&icd,sizeof(icd)); |
|---|
| 216 |
return result; |
|---|
| 217 |
} |
|---|
| 218 |
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 |
|
|---|
| 222 |
|
|---|
| 223 |
LRESULT VFWAPI |
|---|
| 224 |
ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) { |
|---|
| 225 |
WINE_HIC *whic = (WINE_HIC*)hic; |
|---|
| 226 |
return SendDriverMessage(whic->hdrv, msg, lParam1,lParam2); |
|---|
| 227 |
} |
|---|
| 228 |
|
|---|
| 229 |
|
|---|
| 230 |
|
|---|
| 231 |
|
|---|
| 232 |
|
|---|
| 233 |
LRESULT VFWAPI ICClose(HIC hic) { |
|---|
| 234 |
WINE_HIC *whic = (WINE_HIC*)hic; |
|---|
| 235 |
|
|---|
| 236 |
|
|---|
| 237 |
DrvClose(whic->hdrv); |
|---|
| 238 |
|
|---|
| 239 |
free(whic); |
|---|
| 240 |
return 0; |
|---|
| 241 |
} |
|---|
| 242 |
|
|---|
| 243 |
int VFWAPI ICDoSomething() |
|---|
| 244 |
{ |
|---|
| 245 |
return 0; |
|---|
| 246 |
} |
|---|
| 247 |
|
|---|