home *** CD-ROM | disk | FTP | other *** search
- /*
- * Header file for comunication with AVI installable compressors/decompressors
- *
- * Copyright (c) 1990-1993, Microsoft Corp. All rights reserved.
- *
- * Installable compressors should be listed in SYSTEM.INI as
- * follows:
- *
- * [Instalable Compressors]
- * VIDC.MSSQ = mssqcomp.drv
- * VIDC.XXXX = foodrv.drv
- *
- * [Drivers]
- * VIDC.MSSQ = mssqcomp.drv
- * VIDC.XXXX = foodrv.drv
- *
- * That is, an identifying FOURCC should be the key, and the value
- * should be the driver filename
- *
- */
-
- #ifndef _INC_COMPMAN
- #define _INC_COMPMAN
-
- #ifndef _LOADDS
- #define _LOADDS _loadds
- #endif
-
- #ifndef RC_INVOKED
- #pragma pack(1) /* Assume byte packing throughout */
- #endif /* RC_INVOKED */
-
- #ifdef __cplusplus
- extern "C" { /* Assume C declarations for C++ */
- #endif /* __cplusplus */
-
- /************************************************************************
-
- messages and structures.
-
- ************************************************************************/
-
- #include <compddk.h> // include this file for the messages.
-
- /************************************************************************
-
- data types.
-
- ************************************************************************/
-
- typedef HANDLE HIC; /* Handle to a Insatlable Compressor */
-
- /************************************************************************
-
- ICM function declarations
-
- ************************************************************************/
-
- BOOL FAR PASCAL _LOADDS ICInfo(DWORD fccType, DWORD fccHandler, ICINFO FAR * lpicinfo);
- BOOL FAR PASCAL _LOADDS ICInstall(DWORD fccType, DWORD fccHandler, LPARAM lParam, LPSTR szDesc, UINT wFlags);
- BOOL FAR PASCAL _LOADDS ICRemove(DWORD fccType, DWORD fccHandler, UINT wFlags);
-
- HIC FAR PASCAL _LOADDS ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode);
- LRESULT FAR PASCAL _LOADDS ICClose(HANDLE hic);
- LRESULT FAR PASCAL _LOADDS ICSendMessage(HIC hic, UINT msg, DWORD dw1, DWORD dw2);
- LRESULT FAR PASCAL _LOADDS ICGetInfo(HIC hic, ICINFO FAR *picinfo, DWORD cb);
-
- /* Values for wFlags of ICInstall() */
- #define ICINSTALL_FUNCTION 0x0001 // lParam is a DriverProc (function ptr)
- #define ICINSTALL_DRIVER 0x0002 // lParam is a driver name (string)
- #define ICINSTALL_HDRV 0x0004 // lParam is a HDRVR (driver handle)
-
- /************************************************************************
-
- query macros
-
- ************************************************************************/
- #define ICMF_CONFIGURE_QUERY 0x00000001
- #define ICMF_ABOUT_QUERY 0x00000001
-
- #define ICQueryAbout(hic) \
- (ICSendMessage(hic, ICM_ABOUT, (DWORD) -1, ICMF_ABOUT_QUERY) == ICERR_OK)
-
- #define ICAbout(hic, hwnd) \
- ICSendMessage(hic, ICM_ABOUT, (DWORD)(UINT)(hwnd), 0)
-
- #define ICQueryConfigure(hic) \
- (ICSendMessage(hic, ICM_CONFIGURE, (DWORD) -1, ICMF_CONFIGURE_QUERY) == ICERR_OK)
-
- #define ICConfigure(hic, hwnd) \
- ICSendMessage(hic, ICM_CONFIGURE, (DWORD)(UINT)(hwnd), 0)
-
- /************************************************************************
-
- get/set state macros
-
- ************************************************************************/
-
- #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)
-
- /************************************************************************
-
- get value macros
-
- ************************************************************************/
- DWORD dwICValue;
-
- #define ICGetDefaultQuality(hic) \
- (ICSendMessage(hic, ICM_GETDEFAULTQUALITY, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD)), dwICValue)
-
- #define ICGetDefaultKeyFrameRate(hic) \
- (ICSendMessage(hic, ICM_GETDEFAULTKEYFRAMERATE, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD)), dwICValue)
-
- /************************************************************************
-
- draw window macro
-
- ************************************************************************/
- #define ICDrawWindow(hic, prc) \
- ICSendMessage(hic, ICM_DRAW_WINDOW, (DWORD)(LPVOID)(prc), sizeof(RECT))
-
-
-
- /************************************************************************
-
- compression functions
-
- ************************************************************************/
- /*
- * ICCompress()
- *
- * compress a single frame
- *
- */
- DWORD FAR _LOADDS CDECL ICCompress(
- HIC hic,
- DWORD dwFlags, // flags
- LPBITMAPINFOHEADER lpbiOutput, // output format
- LPVOID lpData, // output data
- LPBITMAPINFOHEADER lpbiInput, // format of frame to compress
- LPVOID lpBits, // frame data to compress
- LPDWORD lpckid, // ckid for data in AVI file
- LPDWORD lpdwFlags, // flags in the AVI index.
- LONG lFrameNum, // frame number of seq.
- DWORD dwFrameSize, // reqested size in bytes. (if non zero)
- DWORD dwQuality, // quality within one frame
- LPBITMAPINFOHEADER lpbiPrev, // format of previous frame
- LPVOID lpPrev); // previous frame
-
- /*
- * ICCompressBegin()
- *
- * start compression from a source format (lpbiInput) to a dest
- * format (lpbiOuput) is supported.
- *
- */
- #define ICCompressBegin(hic, lpbiInput, lpbiOutput) \
- ICSendMessage(hic, ICM_COMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
-
- /*
- * ICCompressQuery()
- *
- * determines if compression from a source format (lpbiInput) to a dest
- * format (lpbiOuput) is supported.
- *
- */
- #define ICCompressQuery(hic, lpbiInput, lpbiOutput) \
- ICSendMessage(hic, ICM_COMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
-
- /*
- * ICCompressGetFormat()
- *
- * get the ouput format, (format of compressed data)
- * if lpbiOuput is NULL return the size in bytes needed for format.
- *
- */
- #define ICCompressGetFormat(hic, lpbiInput, lpbiOutput) \
- ICSendMessage(hic, ICM_COMPRESS_GET_FORMAT, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
-
- #define ICCompressGetFormatSize(hic, lpbi) \
- ICCompressGetFormat(hic, lpbi, NULL)
-
- /*
- * ICCompressSize()
- *
- * return the maximal size of a compressed frame
- *
- */
- #define ICCompressGetSize(hic, lpbiInput, lpbiOutput) \
- ICSendMessage(hic, ICM_COMPRESS_GET_SIZE, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
-
- #define ICCompressEnd(hic) \
- ICSendMessage(hic, ICM_COMPRESS_END, 0, 0)
-
- /************************************************************************
-
- decompression functions
-
- ************************************************************************/
-
- /*
- * ICDecompress()
- *
- * decompress a single frame
- *
- */
- #define ICDECOMPRESS_HURRYUP 0x80000000L // don't draw just buffer (hurry up!)
-
- DWORD FAR _LOADDS CDECL ICDecompress(
- HIC hic,
- DWORD dwFlags, // flags (from AVI index...)
- LPBITMAPINFOHEADER lpbiFormat, // BITMAPINFO of compressed data
- // biSizeImage has the chunk size
- LPVOID lpData, // data
- LPBITMAPINFOHEADER lpbi, // DIB to decompress to
- LPVOID lpBits);
-
- /*
- * ICDecompressBegin()
- *
- * start compression from a source format (lpbiInput) to a dest
- * format (lpbiOuput) is supported.
- *
- */
- #define ICDecompressBegin(hic, lpbiInput, lpbiOutput) \
- ICSendMessage(hic, ICM_DECOMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
-
- /*
- * ICDecompressQuery()
- *
- * determines if compression from a source format (lpbiInput) to a dest
- * format (lpbiOuput) is supported.
- *
- */
- #define ICDecompressQuery(hic, lpbiInput, lpbiOutput) \
- ICSendMessage(hic, ICM_DECOMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
-
- /*
- * ICDecompressGetFormat()
- *
- * get the ouput format, (format of un-compressed data)
- * if lpbiOuput is NULL return the size in bytes needed for format.
- *
- */
- #define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput) \
- ((LONG) ICSendMessage(hic, ICM_DECOMPRESS_GET_FORMAT, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput)))
-
- #define ICDecompressGetFormatSize(hic, lpbi) \
- ICDecompressGetFormat(hic, lpbi, NULL)
-
- /*
- * ICDecompressGetPalette()
- *
- * get the ouput palette
- *
- */
- #define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput) \
- ICSendMessage(hic, ICM_DECOMPRESS_GET_PALETTE, (DWORD)(LPVOID)(lpbiInput), (DWORD)(LPVOID)(lpbiOutput))
-
- #define ICDecompressEnd(hic) \
- ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0)
-
- /************************************************************************
-
- drawing functions
-
- ************************************************************************/
-
- /*
- * ICDrawBegin()
- *
- * start decompressing data with format (lpbiInput) directly to the screen
- *
- * return zero if the decompressor supports drawing.
- *
- */
-
- #define ICDRAW_QUERY 0x00000001L // test for support
- #define ICDRAW_FULLSCREEN 0x00000002L // draw to full screen
- #define ICDRAW_HDC 0x00000004L // draw to a HDC/HWND
-
- DWORD FAR _LOADDS CDECL ICDrawBegin(
- HIC hic,
- DWORD dwFlags, // flags
- HPALETTE hpal, // palette to draw with
- HWND hwnd, // window to draw to
- HDC hdc, // HDC to draw to
- int xDst, // destination rectangle
- int yDst,
- int dxDst,
- int dyDst,
- LPBITMAPINFOHEADER lpbi, // format of frame to draw
- int xSrc, // source rectangle
- int ySrc,
- int dxSrc,
- int dySrc,
- DWORD dwRate, // frames/second = (dwRate/dwScale)
- DWORD dwScale);
-
- /*
- * ICDraw()
- *
- * decompress data directly to the screen
- *
- */
-
- #define ICDRAW_HURRYUP 0x80000000L // don't draw just buffer (hurry up!)
- #define ICDRAW_UPDATE 0x40000000L // don't draw just update screen
-
- DWORD FAR _LOADDS CDECL ICDraw(
- HIC hic,
- DWORD dwFlags, // flags
- LPVOID lpFormat, // format of frame to decompress
- LPVOID lpData, // frame data to decompress
- DWORD cbData, // size of data
- LONG lTime); // time to draw this frame
-
- /*
- * ICDrawQuery()
- *
- * determines if the compressor is willing to render the specified format.
- *
- */
- #define ICDrawQuery(hic, lpbiInput) \
- ICSendMessage(hic, ICM_DRAW_QUERY, (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 ICDrawStop(hic) \
- ICSendMessage(hic, ICM_DRAW_STOP, 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)
-
-
- /************************************************************************
-
- helper routines for DrawDib and MCIAVI...
-
- ************************************************************************/
-
- #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)
-
- HIC FAR _LOADDS PASCAL ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags);
- HIC FAR _LOADDS PASCAL ICGetDisplayFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, int BitDepth, int dx, int dy);
-
-
-
- #ifdef __cplusplus
- } /* End of extern "C" { */
- #endif /* __cplusplus */
-
- #ifndef RC_INVOKED
- #pragma pack() /* Revert to default packing */
- #endif /* RC_INVOKED */
-
- #endif /* _INC_COMPMAN */
-