2001-02-24 20:28:24 +00:00
|
|
|
/*
|
|
|
|
* Copyright 1998 Marcus Meissner
|
2005-04-15 20:17:14 +00:00
|
|
|
*
|
2006-06-22 13:34:00 +00:00
|
|
|
* Modified for use with MPlayer, detailed changelog at
|
|
|
|
* http://svn.mplayerhq.hu/mplayer/trunk/
|
2005-04-15 20:17:14 +00:00
|
|
|
*
|
2001-02-24 20:28:24 +00:00
|
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2001-07-13 08:51:50 +00:00
|
|
|
#include <stdlib.h>
|
2001-02-24 20:28:24 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2001-07-12 15:27:48 +00:00
|
|
|
#include "win32.h"
|
|
|
|
#include "loader.h"
|
|
|
|
|
2001-02-24 20:28:24 +00:00
|
|
|
#include "wine/winbase.h"
|
|
|
|
#include "wine/windef.h"
|
|
|
|
#include "wine/winuser.h"
|
|
|
|
#include "wine/vfw.h"
|
|
|
|
#include "wine/winestring.h"
|
|
|
|
#include "wine/driver.h"
|
|
|
|
#include "wine/avifmt.h"
|
2008-06-08 10:43:30 +00:00
|
|
|
#include "drv.h"
|
2001-07-12 15:27:48 +00:00
|
|
|
|
|
|
|
#define OpenDriverA DrvOpen
|
|
|
|
#define CloseDriver DrvClose
|
2001-02-24 20:28:24 +00:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* VideoForWindowsVersion [MSVFW.2][MSVIDEO.2]
|
|
|
|
* Returns the version in major.minor form.
|
|
|
|
* In Windows95 this returns 0x040003b6 (4.950)
|
|
|
|
*/
|
2002-09-13 19:42:33 +00:00
|
|
|
long VFWAPI VideoForWindowsVersion(void) {
|
2001-02-24 20:28:24 +00:00
|
|
|
return 0x040003B6; /* 4.950 */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* system.ini: [drivers] */
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ICInfo [MSVFW.33]
|
|
|
|
* Get information about an installable compressor. Return TRUE if there
|
|
|
|
* is one.
|
|
|
|
*/
|
|
|
|
int VFWAPI
|
|
|
|
ICInfo(
|
|
|
|
long fccType, /* [in] type of compressor ('vidc') */
|
|
|
|
long fccHandler, /* [in] <n>th compressor */
|
|
|
|
ICINFO *lpicinfo /* [out] information about compressor */
|
|
|
|
) {
|
|
|
|
/* does OpenDriver/CloseDriver */
|
|
|
|
lpicinfo->dwSize = sizeof(ICINFO);
|
|
|
|
lpicinfo->fccType = fccType;
|
|
|
|
lpicinfo->dwFlags = 0;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ICOpen [MSVFW.37]
|
|
|
|
* Opens an installable compressor. Return special handle.
|
|
|
|
*/
|
|
|
|
HIC VFWAPI
|
2002-09-13 19:42:33 +00:00
|
|
|
//ICOpen(long fccType,long fccHandler,unsigned int wMode) {
|
|
|
|
ICOpen(long filename,long fccHandler,unsigned int wMode) {
|
2001-02-24 20:28:24 +00:00
|
|
|
ICOPEN icopen;
|
|
|
|
HDRVR hdrv;
|
|
|
|
WINE_HIC *whic;
|
|
|
|
|
|
|
|
/* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
|
|
|
|
* same layout as ICOPEN
|
|
|
|
*/
|
2002-09-13 19:42:33 +00:00
|
|
|
icopen.fccType = 0x63646976; // "vidc" //fccType;
|
2001-02-24 20:28:24 +00:00
|
|
|
icopen.fccHandler = fccHandler;
|
|
|
|
icopen.dwSize = sizeof(ICOPEN);
|
|
|
|
icopen.dwFlags = wMode;
|
2002-09-13 19:42:33 +00:00
|
|
|
icopen.pV1Reserved = (void*)filename;
|
2001-02-24 20:28:24 +00:00
|
|
|
/* FIXME: do we need to fill out the rest too? */
|
|
|
|
hdrv=OpenDriverA((long)&icopen);
|
2002-09-13 19:42:33 +00:00
|
|
|
if (!hdrv) return 0;
|
2006-07-02 03:59:36 +00:00
|
|
|
whic = malloc(sizeof(WINE_HIC));
|
2001-02-24 20:28:24 +00:00
|
|
|
whic->hdrv = hdrv;
|
|
|
|
whic->driverproc= ((DRVR*)hdrv)->DriverProc;
|
|
|
|
// whic->private = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
|
2002-09-13 19:42:33 +00:00
|
|
|
whic->driverid = ((DRVR*)hdrv)->dwDriverID;
|
2001-02-24 20:28:24 +00:00
|
|
|
return (HIC)whic;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ICGetInfo [MSVFW.30]
|
|
|
|
*/
|
|
|
|
LRESULT VFWAPI
|
|
|
|
ICGetInfo(HIC hic,ICINFO *picinfo,long cb) {
|
|
|
|
LRESULT ret;
|
|
|
|
|
|
|
|
ret = ICSendMessage(hic,ICM_GETINFO,(long)picinfo,cb);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ICCompress [MSVFW.23]
|
|
|
|
*/
|
|
|
|
long VFWAPIV
|
|
|
|
ICCompress(
|
|
|
|
HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData,
|
|
|
|
LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid,
|
|
|
|
long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality,
|
|
|
|
LPBITMAPINFOHEADER lpbiPrev,void* lpPrev
|
|
|
|
) {
|
|
|
|
ICCOMPRESS iccmp;
|
|
|
|
|
|
|
|
iccmp.dwFlags = dwFlags;
|
|
|
|
|
|
|
|
iccmp.lpbiOutput = lpbiOutput;
|
|
|
|
iccmp.lpOutput = lpData;
|
|
|
|
iccmp.lpbiInput = lpbiInput;
|
|
|
|
iccmp.lpInput = lpBits;
|
|
|
|
|
|
|
|
iccmp.lpckid = lpckid;
|
|
|
|
iccmp.lpdwFlags = lpdwFlags;
|
|
|
|
iccmp.lFrameNum = lFrameNum;
|
|
|
|
iccmp.dwFrameSize = dwFrameSize;
|
|
|
|
iccmp.dwQuality = dwQuality;
|
|
|
|
iccmp.lpbiPrev = lpbiPrev;
|
|
|
|
iccmp.lpPrev = lpPrev;
|
|
|
|
return ICSendMessage(hic,ICM_COMPRESS,(long)&iccmp,sizeof(iccmp));
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ICDecompress [MSVFW.26]
|
|
|
|
*/
|
|
|
|
long VFWAPIV
|
|
|
|
ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) {
|
|
|
|
ICDECOMPRESS icd;
|
|
|
|
int result;
|
|
|
|
icd.dwFlags = dwFlags;
|
|
|
|
icd.lpbiInput = lpbiFormat;
|
|
|
|
icd.lpInput = lpData;
|
|
|
|
|
|
|
|
icd.lpbiOutput = lpbi;
|
|
|
|
icd.lpOutput = lpBits;
|
|
|
|
icd.ckid = 0;
|
|
|
|
result=ICSendMessage(hic,ICM_DECOMPRESS,(long)&icd,sizeof(icd));
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2001-07-08 17:20:46 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* ICDecompressEx [MSVFW.26]
|
|
|
|
*/
|
|
|
|
long VFWAPIV
|
|
|
|
ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) {
|
|
|
|
ICDECOMPRESSEX icd;
|
|
|
|
int result;
|
|
|
|
|
|
|
|
icd.dwFlags = dwFlags;
|
|
|
|
|
|
|
|
icd.lpbiSrc = lpbiFormat;
|
|
|
|
icd.lpSrc = lpData;
|
|
|
|
|
|
|
|
icd.lpbiDst = lpbi;
|
|
|
|
icd.lpDst = lpBits;
|
|
|
|
|
|
|
|
icd.xSrc=icd.ySrc=0;
|
|
|
|
icd.dxSrc=lpbiFormat->biWidth;
|
|
|
|
icd.dySrc=abs(lpbiFormat->biHeight);
|
|
|
|
|
|
|
|
icd.xDst=icd.yDst=0;
|
|
|
|
icd.dxDst=lpbi->biWidth;
|
|
|
|
icd.dyDst=abs(lpbi->biHeight);
|
|
|
|
|
|
|
|
//icd.ckid = 0;
|
|
|
|
result=ICSendMessage(hic,ICM_DECOMPRESSEX,(long)&icd,sizeof(icd));
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
long VFWAPIV
|
|
|
|
ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi) {
|
|
|
|
ICDECOMPRESSEX icd;
|
|
|
|
int result;
|
|
|
|
|
|
|
|
icd.dwFlags = 0;
|
|
|
|
|
|
|
|
icd.lpbiSrc = lpbiFormat;
|
|
|
|
icd.lpSrc = 0;
|
|
|
|
|
|
|
|
icd.lpbiDst = lpbi;
|
|
|
|
icd.lpDst = 0;
|
|
|
|
|
|
|
|
icd.xSrc=icd.ySrc=0;
|
|
|
|
icd.dxSrc=lpbiFormat->biWidth;
|
|
|
|
icd.dySrc=abs(lpbiFormat->biHeight);
|
|
|
|
|
|
|
|
icd.xDst=icd.yDst=0;
|
|
|
|
icd.dxDst=lpbi->biWidth;
|
|
|
|
icd.dyDst=abs(lpbi->biHeight);
|
|
|
|
|
|
|
|
//icd.ckid = 0;
|
|
|
|
result=ICSendMessage(hic,command,(long)&icd,sizeof(icd));
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-02-24 20:28:24 +00:00
|
|
|
/***********************************************************************
|
|
|
|
* ICSendMessage [MSVFW.40]
|
|
|
|
*/
|
|
|
|
LRESULT VFWAPI
|
|
|
|
ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) {
|
2002-09-13 19:42:33 +00:00
|
|
|
WINE_HIC *whic = (WINE_HIC*)hic;
|
|
|
|
return SendDriverMessage(whic->hdrv, msg, lParam1,lParam2);
|
2001-02-24 20:28:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ICClose [MSVFW.22]
|
|
|
|
*/
|
|
|
|
LRESULT VFWAPI ICClose(HIC hic) {
|
|
|
|
WINE_HIC *whic = (WINE_HIC*)hic;
|
|
|
|
/* FIXME: correct? */
|
|
|
|
// CloseDriver(whic->hdrv,0,0);
|
|
|
|
DrvClose(whic->hdrv);
|
|
|
|
//#warning FIXME: DrvClose
|
2002-09-13 19:42:33 +00:00
|
|
|
free(whic);
|
2001-02-24 20:28:24 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2002-09-13 19:42:33 +00:00
|
|
|
|
2001-02-24 20:28:24 +00:00
|
|
|
int VFWAPI ICDoSomething()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|