#ifndef _AVIFILE_VIDEOCODEC_HPP_ #define _AVIFILE_VIDEOCODEC_HPP_ #ifndef _COMMON_PROFILE_HPP_ #include #endif #ifndef _AVIFILE_AVIDEFS_HPP_ #include #endif #ifndef _AVIFILE_DRIVERNAME_HPP_ #include #endif #ifndef _AVIFILE_ICMOPEN_HPP_ #include #endif #ifndef _AVIFILE_ICMINFO_HPP_ #include #endif #ifndef _AVIFILE_ICMDECOMPRESS_HPP_ #include #endif #ifndef _AVIFILE_FOURCC_HPP_ #include #endif #ifndef _AVIFILE_AVIBITMAP_HPP_ #include #endif class VideoCodec { public: enum ReturnCode{OkResult=ICERR_OK,FailResult=ICERR_UNSUPPORTED,BadFormatResult=ICERR_BADFORMAT}; typedef LRESULT (FAR PASCAL *LPFNDRIVERPROC)(DWORD dwID,HDRVR hdrvr,UINT uMsg,LONG lParam1,LONG lParam2); VideoCodec(void); virtual ~VideoCodec(); void closeDriver(void); static WORD enumerateDrivers(Block &driverStrings); WORD locateDriver(DWORD fccType,DriverName &driverName); ReturnCode openDriver(DWORD fccType); ReturnCode openDriver(const String &driverName); ReturnCode openDriver(const DriverName &driverName); ReturnCode driverLoad(void); ReturnCode driverEnable(void); ReturnCode canDecompress(AVIBitmap &someAVIBitmap); ReturnCode canDecompress(AVIBitmap &srcAVIBitmap,AVIBitmap &dstAVIBitmap); ReturnCode getFormat(AVIBitmap &srcAVIBitmap); ReturnCode getFormat(AVIBitmap &srcAVIBitmap,AVIBitmap &dstAVIBitmap); ReturnCode getPalette(AVIBitmap &srcAVIBitmap,AVIBitmap &dstAVIBitmap); ReturnCode driverProc(ICMOpen &someICMOpen); ReturnCode driverProc(ICMInfo &someICMInfo); ReturnCode decompressFrame(AVIBitmap &srcBitmap,AVIBitmap &dstBitmap,MovieData &srcMovieData,MovieData &dstMovieData); ReturnCode icmConfigure(HWND hDisplayWindow); private: enum {DriverID=0x01,DriverHandle=0x01}; ReturnCode icmDecompressBegin(AVIBitmap &srcAVIBitmap,AVIBitmap &dstAVIBitmap); ReturnCode icmDecompress(AVIBitmap &srcAVIBitmap,AVIBitmap &dstAVIBitmap,MovieData &srcMovieData,MovieData &dstMovieData); ReturnCode icmDecompressEnd(void); DWORD mDriverID; HINSTANCE mhVideoCodec; LPFNDRIVERPROC mlpfnDriverProc; }; inline VideoCodec::VideoCodec(void) : mhVideoCodec(0), mlpfnDriverProc(0), mDriverID(0) { } inline VideoCodec::~VideoCodec() { closeDriver(); } #endif