- removed (now obsolete) driver.h file (it's content is now in mmsystem.h) - upgraded vfw.h content
diff --git a/include/driver.h b/include/driver.h deleted file mode 100644 index deb20bc..0000000 --- a/include/driver.h +++ /dev/null
@@ -1,100 +0,0 @@ -/* - * Drivers definitions - */ - -#ifndef __WINE_DRIVER_H -#define __WINE_DRIVER_H - -#include "windef.h" - -#define DRV_LOAD 0x0001 -#define DRV_ENABLE 0x0002 -#define DRV_OPEN 0x0003 -#define DRV_CLOSE 0x0004 -#define DRV_DISABLE 0x0005 -#define DRV_FREE 0x0006 -#define DRV_CONFIGURE 0x0007 -#define DRV_QUERYCONFIGURE 0x0008 -#define DRV_INSTALL 0x0009 -#define DRV_REMOVE 0x000A -#define DRV_EXITSESSION 0x000B -#define DRV_EXITAPPLICATION 0x000C -#define DRV_POWER 0x000F - -#define DRV_RESERVED 0x0800 -#define DRV_USER 0x4000 - -#define DRVCNF_CANCEL 0x0000 -#define DRVCNF_OK 0x0001 -#define DRVCNF_RESTART 0x0002 - -#define DRVEA_NORMALEXIT 0x0001 -#define DRVEA_ABNORMALEXIT 0x0002 - -#define DRV_SUCCESS 0x0001 -#define DRV_FAILURE 0x0000 - -#define GND_FIRSTINSTANCEONLY 0x00000001 - -#define GND_FORWARD 0x00000000 -#define GND_REVERSE 0x00000002 - -typedef struct { - DWORD dwDCISize; - LPCSTR lpszDCISectionName; - LPCSTR lpszDCIAliasName; -} DRVCONFIGINFO16, *LPDRVCONFIGINFO16; - -typedef struct { - DWORD dwDCISize; - LPCWSTR lpszDCISectionName; - LPCWSTR lpszDCIAliasName; -} DRVCONFIGINFO, *LPDRVCONFIGINFO; - - -/* GetDriverInfo16 references this structure, so this a struct defined - * in the Win16 API. - * GetDriverInfo has been deprecated in Win32. - */ -typedef struct -{ - UINT16 length; - HDRVR16 hDriver; - HINSTANCE16 hModule; - CHAR szAliasName[128]; -} DRIVERINFOSTRUCT16, *LPDRIVERINFOSTRUCT16; - -LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, - LPARAM dwParam1, LPARAM dwParam2); -LRESULT WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR hdrvr, - UINT Msg, LPARAM lParam1, LPARAM lParam2); -HDRVR16 WINAPI OpenDriver16(LPCSTR szDriverName, LPCSTR szSectionName, - LPARAM lParam2); -HDRVR WINAPI OpenDriverA(LPCSTR szDriverName, LPCSTR szSectionName, - LPARAM lParam2); -HDRVR WINAPI OpenDriverW(LPCWSTR szDriverName, LPCWSTR szSectionName, - LPARAM lParam2); -#define OpenDriver WINELIB_NAME_AW(OpenDriver) -LRESULT WINAPI CloseDriver16(HDRVR16 hDriver, LPARAM lParam1, LPARAM lParam2); -LRESULT WINAPI CloseDriver(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2); -LRESULT WINAPI SendDriverMessage16( HDRVR16 hDriver, UINT16 message, - LPARAM lParam1, LPARAM lParam2 ); -LRESULT WINAPI SendDriverMessage( HDRVR hDriver, UINT message, - LPARAM lParam1, LPARAM lParam2 ); -HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDriver); -HMODULE WINAPI GetDriverModuleHandle(HDRVR hDriver); - -/* only win31 version for those exist */ -HDRVR16 WINAPI GetNextDriver16(HDRVR16, DWORD); -BOOL16 WINAPI GetDriverInfo16(HDRVR16, DRIVERINFOSTRUCT16 *); - -DWORD WINAPI GetDriverFlags( HDRVR hDriver ); -#ifdef __WINE__ -/* this call (GetDriverFlags) is not documented, nor the flags returned. - * here are Wine only definitions - */ -#define WINE_GDF_EXIST 0x80000000 -#define WINE_GDF_16BIT 0x10000000 -#endif - -#endif /* __WINE_DRIVER_H */
diff --git a/include/mmsystem.h b/include/mmsystem.h index 2f5829d..723df7d 100644 --- a/include/mmsystem.h +++ b/include/mmsystem.h
@@ -151,6 +151,96 @@ #define CALLBACK_FUNCTION 0x00030000l /* dwCallback is a FARPROC */ #define CALLBACK_EVENT 0x00050000l /* dwCallback is an EVENT Handler */ +#define DRV_LOAD 0x0001 +#define DRV_ENABLE 0x0002 +#define DRV_OPEN 0x0003 +#define DRV_CLOSE 0x0004 +#define DRV_DISABLE 0x0005 +#define DRV_FREE 0x0006 +#define DRV_CONFIGURE 0x0007 +#define DRV_QUERYCONFIGURE 0x0008 +#define DRV_INSTALL 0x0009 +#define DRV_REMOVE 0x000A +#define DRV_EXITSESSION 0x000B +#define DRV_EXITAPPLICATION 0x000C +#define DRV_POWER 0x000F + +#define DRV_RESERVED 0x0800 +#define DRV_USER 0x4000 + +#define DRVCNF_CANCEL 0x0000 +#define DRVCNF_OK 0x0001 +#define DRVCNF_RESTART 0x0002 + +#define DRVEA_NORMALEXIT 0x0001 +#define DRVEA_ABNORMALEXIT 0x0002 + +#define DRV_SUCCESS 0x0001 +#define DRV_FAILURE 0x0000 + +#define GND_FIRSTINSTANCEONLY 0x00000001 + +#define GND_FORWARD 0x00000000 +#define GND_REVERSE 0x00000002 + +typedef struct { + DWORD dwDCISize; + LPCSTR lpszDCISectionName; + LPCSTR lpszDCIAliasName; +} DRVCONFIGINFO16, *LPDRVCONFIGINFO16; + +typedef struct { + DWORD dwDCISize; + LPCWSTR lpszDCISectionName; + LPCWSTR lpszDCIAliasName; +} DRVCONFIGINFO, *LPDRVCONFIGINFO; + + +/* GetDriverInfo16 references this structure, so this a struct defined + * in the Win16 API. + * GetDriverInfo has been deprecated in Win32. + */ +typedef struct +{ + UINT16 length; + HDRVR16 hDriver; + HINSTANCE16 hModule; + CHAR szAliasName[128]; +} DRIVERINFOSTRUCT16, *LPDRIVERINFOSTRUCT16; + +LRESULT WINAPI DefDriverProc16(DWORD dwDevID, HDRVR16 hDriv, UINT16 wMsg, + LPARAM dwParam1, LPARAM dwParam2); +LRESULT WINAPI DefDriverProc(DWORD dwDriverIdentifier, HDRVR hdrvr, + UINT Msg, LPARAM lParam1, LPARAM lParam2); +HDRVR16 WINAPI OpenDriver16(LPCSTR szDriverName, LPCSTR szSectionName, + LPARAM lParam2); +HDRVR WINAPI OpenDriverA(LPCSTR szDriverName, LPCSTR szSectionName, + LPARAM lParam2); +HDRVR WINAPI OpenDriverW(LPCWSTR szDriverName, LPCWSTR szSectionName, + LPARAM lParam2); +#define OpenDriver WINELIB_NAME_AW(OpenDriver) +LRESULT WINAPI CloseDriver16(HDRVR16 hDriver, LPARAM lParam1, LPARAM lParam2); +LRESULT WINAPI CloseDriver(HDRVR hDriver, LPARAM lParam1, LPARAM lParam2); +LRESULT WINAPI SendDriverMessage16(HDRVR16 hDriver, UINT16 message, + LPARAM lParam1, LPARAM lParam2); +LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT message, + LPARAM lParam1, LPARAM lParam2); +HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDriver); +HMODULE WINAPI GetDriverModuleHandle(HDRVR hDriver); + +/* only win31 version for those exist */ +HDRVR16 WINAPI GetNextDriver16(HDRVR16, DWORD); +BOOL16 WINAPI GetDriverInfo16(HDRVR16, DRIVERINFOSTRUCT16 *); + +DWORD WINAPI GetDriverFlags(HDRVR hDriver); +#ifdef __WINE__ +/* this call (GetDriverFlags) is not documented, nor the flags returned. + * here are Wine only definitions + */ +#define WINE_GDF_EXIST 0x80000000 +#define WINE_GDF_16BIT 0x10000000 +#endif + typedef void CALLBACK (*LPDRVCALLBACK16) (HDRVR16 h, UINT16 uMessage, DWORD dwUser, DWORD dw1, DWORD dw2); typedef void CALLBACK (*LPDRVCALLBACK) (HDRVR h, UINT uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
diff --git a/include/msacm.h b/include/msacm.h index 5f55bcb..37a2777 100644 --- a/include/msacm.h +++ b/include/msacm.h
@@ -6,7 +6,6 @@ #define __WINE_MSACM_H #include "windef.h" -#include "driver.h" #include "mmsystem.h" #include "mmreg.h"
diff --git a/include/vfw.h b/include/vfw.h index 9ef93d1..466f82f 100644 --- a/include/vfw.h +++ b/include/vfw.h
@@ -10,13 +10,19 @@ #define VFWAPI WINAPI #define VFWAPIV WINAPIV +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + typedef HANDLE16 HDRAWDIB16; typedef HANDLE HDRAWDIB; HWND VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance, DWORD dwStyle, LPCSTR szFile); HWND VFWAPIV MCIWndCreateW(HWND hwndParent, HINSTANCE hInstance, DWORD dwStyle, LPCWSTR szFile); #define MCIWndCreate WINELIB_NAME_AW(MCIWndCreate) -DWORD VFWAPI VideoForWindowsVersion(void); +DWORD VFWAPI VideoForWindowsVersion(void); +LONG VFWAPI InitVFW(void); +LONG VFWAPI TermVFW(void); #ifndef mmioFOURCC #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \ @@ -46,12 +52,12 @@ /* HIC struct (same layout as Win95 one) */ typedef struct tagWINE_HIC { DWORD magic; /* 00: 'Smag' */ - HANDLE curthread; /* 04: */ + HANDLE curthread; /* 04: */ DWORD type; /* 08: */ DWORD handler; /* 0C: */ HDRVR hdrv; /* 10: */ DWORD private; /* 14:(handled by SendDriverMessage)*/ - FARPROC driverproc; /* 18:(handled by SendDriverMessage)*/ + FARPROC driverproc; /* 18:(handled by SendDriverMessage)*/ DWORD x1; /* 1c: name? */ WORD x2; /* 20: */ DWORD x3; /* 22: */ @@ -201,7 +207,7 @@ ); #define ICCompressGetFormat(hic, lpbiInput, lpbiOutput) \ - ICSendMessage( \ + ICSendMessage( \ hic,ICM_COMPRESS_GET_FORMAT,(DWORD)(LPVOID)(lpbiInput), \ (DWORD)(LPVOID)(lpbiOutput) \ ) @@ -214,7 +220,7 @@ (DWORD)(LPVOID)(lpbiOutput) \ ) -#define ICCompressGetSize(hic, lpbiInput, lpbiOutput) \ +#define ICCompressGetSize(hic, lpbiInput, lpbiOutput) \ ICSendMessage( \ hic, ICM_COMPRESS_GET_SIZE, (DWORD)(LPVOID)(lpbiInput), \ (DWORD)(LPVOID)(lpbiOutput) \ @@ -226,7 +232,6 @@ (DWORD)(LPVOID)(lpbiOutput) \ ) - #define ICCompressEnd(hic) ICSendMessage(hic, ICM_COMPRESS_END, 0, 0) /* ICCOMPRESSFRAMES.dwFlags */ @@ -250,6 +255,20 @@ LONG CALLBACK (*PutData)(LPARAM lOutput,LONG lFrame,LPVOID lpBits,LONG len); } ICCOMPRESSFRAMES; +typedef struct { + DWORD dwFlags; + LPARAM lParam; + /* messages for Status callback */ +#define ICSTATUS_START 0 +#define ICSTATUS_STATUS 1 +#define ICSTATUS_END 2 +#define ICSTATUS_ERROR 3 +#define ICSTATUS_YIELD 4 + /* FIXME: some X11 libs define Status as int... */ + /* LONG CALLBACK (*zStatus)(LPARAM lParam, UINT message, LONG l); */ + LONG CALLBACK (*zStatus)(LPARAM lParam, UINT message, LONG l); +} ICSETSTATUSPROC; + /* Values for wMode of ICOpen() */ #define ICMODE_COMPRESS 1 #define ICMODE_DECOMPRESS 2 @@ -331,7 +350,7 @@ /* Decompression stuff */ #define ICDECOMPRESS_HURRYUP 0x80000000 /* don't draw just buffer (hurry up!) */ #define ICDECOMPRESS_UPDATE 0x40000000 /* don't draw just update screen */ -#define ICDECOMPRESS_PREROL 0x20000000 /* this frame is before real start */ +#define ICDECOMPRESS_PREROLL 0x20000000 /* this frame is before real start */ #define ICDECOMPRESS_NULLFRAME 0x10000000 /* repeat last frame */ #define ICDECOMPRESS_NOTKEYFRAME 0x08000000 /* this frame is not a key frame */ @@ -352,15 +371,15 @@ LPVOID lpDst; /* changed for ICM_DECOMPRESSEX */ - INT xDst; /* destination rectangle */ - INT yDst; - INT dxDst; - INT dyDst; + INT xDst; /* destination rectangle */ + INT yDst; + INT dxDst; + INT dyDst; - INT xSrc; /* source rectangle */ - INT ySrc; - INT dxSrc; - INT dySrc; + INT xSrc; /* source rectangle */ + INT ySrc; + INT dxSrc; + INT dySrc; } ICDECOMPRESSEX; #include "pshpack1.h" @@ -372,15 +391,15 @@ LPBITMAPINFOHEADER lpbiDst; LPVOID lpDst; - INT16 xDst; /* destination rectangle */ - INT16 yDst; - INT16 dxDst; - INT16 dyDst; + INT16 xDst; /* destination rectangle */ + INT16 yDst; + INT16 dxDst; + INT16 dyDst; - INT16 xSrc; /* source rectangle */ - INT16 ySrc; - INT16 dxSrc; - INT16 dySrc; + INT16 xSrc; /* source rectangle */ + INT16 ySrc; + INT16 dxSrc; + INT16 dySrc; } ICDECOMPRESSEX16; #include "poppack.h" @@ -422,22 +441,159 @@ #define ICDecompressEnd(hic) ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0) +LRESULT VFWAPI ICSendMessage(HIC hic, UINT msg, DWORD dw1, DWORD dw2); +LRESULT VFWAPI ICSendMessage16(HIC16 hic, UINT16 msg, DWORD dw1, DWORD dw2); + +static LRESULT VFWAPI inline ICDecompressEx(HIC hic, DWORD dwFlags, + LPBITMAPINFOHEADER lpbiSrc, LPVOID lpSrc, + int xSrc, int ySrc, int dxSrc, int dySrc, + LPBITMAPINFOHEADER lpbiDst, LPVOID lpDst, + int xDst, int yDst, int dxDst, int dyDst) +{ + ICDECOMPRESSEX ic; + + ic.dwFlags = dwFlags; + ic.lpbiSrc = lpbiSrc; + ic.lpSrc = lpSrc; + ic.xSrc = xSrc; + ic.ySrc = ySrc; + ic.dxSrc = dxSrc; + ic.dySrc = dySrc; + ic.lpbiDst = lpbiDst; + ic.lpDst = lpDst; + ic.xDst = xDst; + ic.yDst = yDst; + ic.dxDst = dxDst; + ic.dyDst = dyDst; + return ICSendMessage(hic, ICM_DECOMPRESSEX, (DWORD)&ic, sizeof(ic)); +} + +static LRESULT VFWAPI inline ICDecompressExBegin(HIC hic, DWORD dwFlags, + LPBITMAPINFOHEADER lpbiSrc, + LPVOID lpSrc, + int xSrc, int ySrc, int dxSrc, int dySrc, + LPBITMAPINFOHEADER lpbiDst, + LPVOID lpDst, + int xDst, + int yDst, + int dxDst, + int dyDst) +{ + ICDECOMPRESSEX ic; + + ic.dwFlags = dwFlags; + ic.lpbiSrc = lpbiSrc; + ic.lpSrc = lpSrc; + ic.xSrc = xSrc; + ic.ySrc = ySrc; + ic.dxSrc = dxSrc; + ic.dySrc = dySrc; + ic.lpbiDst = lpbiDst; + ic.lpDst = lpDst; + ic.xDst = xDst; + ic.yDst = yDst; + ic.dxDst = dxDst; + ic.dyDst = dyDst; + return ICSendMessage(hic, ICM_DECOMPRESSEX_BEGIN, (DWORD)&ic, sizeof(ic)); +} +static LRESULT VFWAPI inline ICDecompressExQuery(HIC hic, DWORD dwFlags, + LPBITMAPINFOHEADER lpbiSrc, + LPVOID lpSrc, + int xSrc, int ySrc, int dxSrc, int dySrc, + LPBITMAPINFOHEADER lpbiDst, + LPVOID lpDst, + int xDst, + int yDst, + int dxDst, + int dyDst) +{ + ICDECOMPRESSEX ic; + + ic.dwFlags = dwFlags; + ic.lpbiSrc = lpbiSrc; + ic.lpSrc = lpSrc; + ic.xSrc = xSrc; + ic.ySrc = ySrc; + ic.dxSrc = dxSrc; + ic.dySrc = dySrc; + ic.lpbiDst = lpbiDst; + ic.lpDst = lpDst; + ic.xDst = xDst; + ic.yDst = yDst; + ic.dxDst = dxDst; + ic.dyDst = dyDst; + return ICSendMessage(hic, ICM_DECOMPRESSEX_QUERY, (DWORD)&ic, sizeof(ic)); +} + +#define ICDecompressExEnd(hic) \ + ICSendMessage(hic, ICM_DECOMPRESSEX_END, 0, 0) #define ICDRAW_QUERY 0x00000001L /* test for support */ #define ICDRAW_FULLSCREEN 0x00000002L /* draw to full screen */ #define ICDRAW_HDC 0x00000004L /* draw to a HDC/HWND */ +#define ICDRAW_ANIMATE 0x00000008L /* expect palette animation */ +#define ICDRAW_CONTINUE 0x00000010L /* draw is a continuation of previous draw */ +#define ICDRAW_MEMORYDC 0x00000020L /* DC is offscreen, by the way */ +#define ICDRAW_UPDATING 0x00000040L /* We're updating, as opposed to playing */ +#define ICDRAW_RENDER 0x00000080L /* used to render data not draw it */ +#define ICDRAW_BUFFER 0x00000100L /* buffer data offscreen, we will need to update it */ + +#define ICDecompressOpen(fccType, fccHandler, lpbiIn, lpbiOut) \ + ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, ICMODE_DECOMPRESS) + +#define ICDrawOpen(fccType, fccHandler, lpbiIn) \ + ICLocate(fccType, fccHandler, lpbiIn, NULL, ICMODE_DRAW) + +HANDLE VFWAPI ICImageCompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn, + LPVOID lpBits, LPBITMAPINFO lpbiOut, LONG lQuality, + LONG* plSize); + +HANDLE VFWAPI ICImageDecompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn, + LPVOID lpBits, LPBITMAPINFO lpbiOut); BOOL VFWAPI ICInfo(DWORD fccType, DWORD fccHandler, ICINFO * lpicinfo); +BOOL VFWAPI ICInstall(DWORD fccType, DWORD fccHandler, LPARAM lParam, LPSTR szDesc, UINT wFlags); +BOOL VFWAPI ICRemove(DWORD fccType, DWORD fccHandler, UINT wFlags); LRESULT VFWAPI ICGetInfo(HIC hic,ICINFO *picinfo, DWORD cb); HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode); -HIC16 VFWAPI ICOpen16(DWORD fccType, DWORD fccHangler, UINT16 wMode); +HIC16 VFWAPI ICOpen16(DWORD fccType, DWORD fccHangler, UINT16 wMode); HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHandler); -LRESULT VFWAPI ICClose(HIC hic); -LRESULT VFWAPI ICSendMessage(HIC hic, UINT msg, DWORD dw1, DWORD dw2); -LRESULT VFWAPI ICSendMessage16(HIC16 hic, UINT16 msg, DWORD dw1, DWORD dw2); -HIC VFWAPI ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags); -HIC16 VFWAPI ICLocate16(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags); +LRESULT VFWAPI ICClose(HIC hic); +HIC VFWAPI ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags); +HIC16 VFWAPI ICLocate16(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags); +HIC VFWAPI ICGetDisplayFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, int BitDepth, int dx, int dy); + +/* Values for wFlags of ICInstall() */ +#define ICINSTALL_UNICODE 0x8000 +#define ICINSTALL_FUNCTION 0x0001 +#define ICINSTALL_DRIVER 0x0002 +#define ICINSTALL_HDRV 0x0004 +#define ICINSTALL_DRIVERW 0x8002 + +#define ICGetState(hic, pv, cb) \ + ICSendMessage(hic, ICM_GETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb)) +#define ICSetState(hic, pv, cb) \ + ICSendMessage(hic, ICM_SETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb)) +#define ICGetStateSize(hic) \ + ICGetState(hic, NULL, 0) + +static DWORD inline ICGetDefaultQuality(HIC hic) +{ + DWORD dwICValue; + ICSendMessage(hic, ICM_GETDEFAULTQUALITY, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD)); + return dwICValue; +} + +static DWORD inline ICGetDefaultKeyFrameRate(HIC hic) +{ + DWORD dwICValue; + ICSendMessage(hic, ICM_GETDEFAULTKEYFRAMERATE, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD)); + return dwICValue; +} + +#define ICDrawWindow(hic, prc) \ + ICSendMessage(hic, ICM_DRAW_WINDOW, (DWORD)(LPVOID)(prc), sizeof(RECT)) /* As passed to ICM_DRAW_SUGGESTFORMAT */ typedef struct { @@ -462,6 +618,13 @@ HIC16 hicDecompressor; } ICDRAWSUGGEST16; +typedef struct { + DWORD dwFlags; + int iStart; + int iLen; + LPPALETTEENTRY lppe; +} ICPALETTE; + DWORD VFWAPIV ICDrawBegin( HIC hic, DWORD dwFlags,/* flags */ @@ -487,7 +650,7 @@ HPALETTE16 hpal, /* palette to draw with */ HWND16 hwnd, /* window to draw to */ HDC16 hdc, /* HDC to draw to */ - INT16 xDst, /* destination rectangle */ + INT16 xDst, /* destination rectangle */ INT16 yDst, INT16 dxDst, INT16 dyDst, @@ -557,7 +720,126 @@ DWORD VFWAPIV ICDraw(HIC hic,DWORD dwFlags,LPVOID lpFormat,LPVOID lpData,DWORD cbData,LONG lTime); +static LRESULT VFWAPI inline ICDrawSuggestFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn, + LPBITMAPINFOHEADER lpbiOut, + int dxSrc, int dySrc, + int dxDst, int dyDst, + HIC hicDecomp) +{ + ICDRAWSUGGEST ic; + + ic.lpbiIn = lpbiIn; + ic.lpbiSuggest = lpbiOut; + ic.dxSrc = dxSrc; + ic.dySrc = dySrc; + ic.dxDst = dxDst; + ic.dyDst = dyDst; + ic.hicDecompressor = hicDecomp; + return ICSendMessage(hic, ICM_DRAW_SUGGESTFORMAT, (DWORD)&ic, sizeof(ic)); +} + +#define ICDrawQuery(hic, lpbiInput) \ + ICSendMessage(hic, ICM_DRAW_QUERY, (DWORD)(LPVOID)(lpbiInput), 0L) + +#define ICDrawChangePalette(hic, lpbiInput) \ + ICSendMessage(hic, ICM_DRAW_CHANGEPALETTE, (DWORD)(LPVOID)(lpbiInput), 0L) + +#define ICGetBuffersWanted(hic, lpdwBuffers) \ + ICSendMessage(hic, ICM_GETBUFFERSWANTED, (DWORD)(LPVOID)(lpdwBuffers), 0) + +#define ICDrawEnd(hic) \ + ICSendMessage(hic, ICM_DRAW_END, 0, 0) + +#define ICDrawStart(hic) \ + ICSendMessage(hic, ICM_DRAW_START, 0, 0) + +#define ICDrawStartPlay(hic, lFrom, lTo) \ + ICSendMessage(hic, ICM_DRAW_START_PLAY, (DWORD)(lFrom), (DWORD)(lTo)) + +#define ICDrawStop(hic) \ + ICSendMessage(hic, ICM_DRAW_STOP, 0, 0) + +#define ICDrawStopPlay(hic) \ + ICSendMessage(hic, ICM_DRAW_STOP_PLAY, 0, 0) + +#define ICDrawGetTime(hic, lplTime) \ + ICSendMessage(hic, ICM_DRAW_GETTIME, (DWORD)(LPVOID)(lplTime), 0) + +#define ICDrawSetTime(hic, lTime) \ + ICSendMessage(hic, ICM_DRAW_SETTIME, (DWORD)lTime, 0) + +#define ICDrawRealize(hic, hdc, fBackground) \ + ICSendMessage(hic, ICM_DRAW_REALIZE, (DWORD)(UINT)(HDC)(hdc), (DWORD)(BOOL)(fBackground)) + +#define ICDrawFlush(hic) \ + ICSendMessage(hic, ICM_DRAW_FLUSH, 0, 0) + +#define ICDrawRenderBuffer(hic) \ + ICSendMessage(hic, ICM_DRAW_RENDERBUFFER, 0, 0) + +static LRESULT VFWAPI inline ICSetStatusProc(HIC hic, DWORD dwFlags, LRESULT lParam, + LONG (CALLBACK *fpfnStatus)(LPARAM, UINT, LONG)) +{ + ICSETSTATUSPROC ic; + + ic.dwFlags = dwFlags; + ic.lParam = lParam; + /* FIXME: see comment in ICSETSTATUSPROC definition */ + ic.zStatus = fpfnStatus; + + return ICSendMessage(hic, ICM_SET_STATUS_PROC, (DWORD)&ic, sizeof(ic)); +} + +typedef struct { + LONG cbSize; + DWORD dwFlags; + HIC hic; + DWORD fccType; + DWORD fccHandler; + LPBITMAPINFO lpbiIn; + LPBITMAPINFO lpbiOut; + LPVOID lpBitsOut; + LPVOID lpBitsPrev; + LONG lFrame; + LONG lKey; + LONG lDataRate; + LONG lQ; + LONG lKeyCount; + LPVOID lpState; + LONG cbState; +} COMPVARS, *PCOMPVARS; + +#define ICMF_COMPVARS_VALID 0x00000001 + +BOOL VFWAPI ICCompressorChoose(HWND hwnd, UINT uiFlags, LPVOID pvIn, LPVOID lpData, + PCOMPVARS pc, LPSTR lpszTitle); + +#define ICMF_CHOOSE_KEYFRAME 0x0001 +#define ICMF_CHOOSE_DATARATE 0x0002 +#define ICMF_CHOOSE_PREVIEW 0x0004 +#define ICMF_CHOOSE_ALLCOMPRESSORS 0x0008 + +BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn); +void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc); + +LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits, + BOOL *pfKey, LONG *plSize); +void VFWAPI ICCompressorFree(PCOMPVARS pc); + /********************* AVIFILE function declarations *************************/ +#define formtypeAVI mmioFOURCC('A', 'V', 'I', ' ') +#define listtypeAVIHEADER mmioFOURCC('h', 'd', 'r', 'l') +#define ckidAVIMAINHDR mmioFOURCC('a', 'v', 'i', 'h') +#define listtypeSTREAMHEADER mmioFOURCC('s', 't', 'r', 'l') +#define ckidSTREAMHEADER mmioFOURCC('s', 't', 'r', 'h') +#define ckidSTREAMFORMAT mmioFOURCC('s', 't', 'r', 'f') +#define ckidSTREAMHANDLERDATA mmioFOURCC('s', 't', 'r', 'd') +#define ckidSTREAMNAME mmioFOURCC('s', 't', 'r', 'n') + +#define listtypeAVIMOVIE mmioFOURCC('m', 'o', 'v', 'i') +#define listtypeAVIRECORD mmioFOURCC('r', 'e', 'c', ' ') + +#define ckidAVINEWINDEX mmioFOURCC('i', 'd', 'x', '1') #define streamtypeVIDEO mmioFOURCC('v', 'i', 'd', 's') #define streamtypeAUDIO mmioFOURCC('a', 'u', 'd', 's') @@ -621,6 +903,7 @@ /* AVIINDEXENTRY.dwFlags */ #define AVIIF_LIST 0x00000001 /* chunk is a 'LIST' */ +#define AVIIF_TWOCC 0x00000002 #define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */ #define AVIIF_NOTIME 0x00000100 /* this frame doesn't take any time */ @@ -826,7 +1109,16 @@ LONG WINAPI AVIStreamStart(PAVISTREAM iface); HRESULT WINAPI AVIStreamWrite(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten); HRESULT WINAPI AVIStreamWriteData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG size); +HRESULT WINAPI AVIStreamOpenFromFileA(PAVISTREAM *ppavi, LPCSTR szFile, + DWORD fccType, LONG lParam, + UINT mode, CLSID *pclsidHandler); +HRESULT WINAPI AVIStreamOpenFromFileW(PAVISTREAM *ppavi, LPCWSTR szFile, + DWORD fccType, LONG lParam, + UINT mode, CLSID *pclsidHandler); +#define AVIStreamOpenFromFile WINELIB_NAME_AW(AVIStreamOpenFromFile) +#define AVIStreamFormatSize(pavi, lPos, plSize) \ + AVIStreamReadFormat(pavi, lPos, NULL, plSize) /***************************************************************************** * IAVIFile interface @@ -930,48 +1222,56 @@ HDRAWDIB VFWAPI DrawDibOpen( void ); UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground); -BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, - HDC hdc, - INT dxDst, - INT dyDst, - LPBITMAPINFOHEADER lpbi, - INT dxSrc, - INT dySrc, - UINT wFlags); +BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, HDC hdc, INT dxDst, INT dyDst, + LPBITMAPINFOHEADER lpbi, INT dxSrc, INT dySrc, UINT wFlags); -BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, - HDC hdc, - INT xDst, - INT yDst, - INT dxDst, - INT dyDst, - LPBITMAPINFOHEADER lpbi, - LPVOID lpBits, - INT xSrc, - INT ySrc, - INT dxSrc, - INT dySrc, - UINT wFlags); +BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, INT xDst, INT yDst, INT dxDst, INT dyDst, + LPBITMAPINFOHEADER lpbi, LPVOID lpBits, + INT xSrc, INT ySrc, INT dxSrc, INT dySrc, UINT wFlags); /* DrawDibDraw flags */ -#define DDF_UPDATE 0x0002 +#define DDF_UPDATE 0x0002 #define DDF_SAME_HDC 0x0004 #define DDF_SAME_DRAW 0x0008 #define DDF_DONTDRAW 0x0010 -#define DDF_ANIMATE 0x0020 -#define DDF_BUFFER 0x0040 +#define DDF_ANIMATE 0x0020 +#define DDF_BUFFER 0x0040 #define DDF_JUSTDRAWIT 0x0080 #define DDF_FULLSCREEN 0x0100 #define DDF_BACKGROUNDPAL 0x0200 #define DDF_NOTKEYFRAME 0x0400 -#define DDF_HURRYUP 0x0800 +#define DDF_HURRYUP 0x0800 #define DDF_HALFTONE 0x1000 +#define DDF_PREROLL DDF_DONTDRAW +#define DDF_SAME_DIB DDF_SAME_DRAW +#define DDF_SAME_SIZE DDF_SAME_DRAW + BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal); HPALETTE VFWAPI DrawDibGetPalette(HDRAWDIB hdd); +BOOL VFWAPI DrawDibChangePalette(HDRAWDIB hdd, int iStart, int iLen, LPPALETTEENTRY lppe); +LPVOID VFWAPI DrawDibGetBuffer(HDRAWDIB hdd, LPBITMAPINFOHEADER lpbi, DWORD dwSize, DWORD dwFlags); + +BOOL VFWAPI DrawDibStart(HDRAWDIB hdd, DWORD rate); +BOOL VFWAPI DrawDibStop(HDRAWDIB hdd); +#define DrawDibUpdate(hdd, hdc, x, y) \ + DrawDibDraw(hdd, hdc, x, y, 0, 0, NULL, NULL, 0, 0, 0, 0, DDF_UPDATE) BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd); BOOL VFWAPI DrawDibClose(HDRAWDIB hdd); +/* display profiling */ +#define PD_CAN_DRAW_DIB 0x0001 +#define PD_CAN_STRETCHDIB 0x0002 +#define PD_STRETCHDIB_1_1_OK 0x0004 +#define PD_STRETCHDIB_1_2_OK 0x0008 +#define PD_STRETCHDIB_1_N_OK 0x0010 + +DWORD VFWAPI DrawDibProfileDisplay(LPBITMAPINFOHEADER lpbi); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* __WINE_VFW_H */