Files
Work/avifile/VIDC.HPP
2024-08-07 09:12:07 -04:00

87 lines
3.1 KiB
C++

#ifndef _AVIFILE_VIDEOCODEC_HPP_
#define _AVIFILE_VIDEOCODEC_HPP_
#ifndef _COMMON_PROFILE_HPP_
#include <common/profile.hpp>
#endif
#ifndef _AVIFILE_AVIDEFS_HPP_
#include <avifile/avidefs.hpp>
#endif
#ifndef _AVIFILE_DRIVERNAME_HPP_
#include <avifile/drvname.hpp>
#endif
#ifndef _AVIFILE_ICMOPEN_HPP_
#include <avifile/icmopen.hpp>
#endif
#ifndef _AVIFILE_ICMINFO_HPP_
#include <avifile/icminfo.hpp>
#endif
#ifndef _AVIFILE_ICMDECOMPRESS_HPP_
#include <avifile/icmdcprs.hpp>
#endif
#ifndef _AVIFILE_ICMCOMPRESS_HPP_
#include <avifile/icmcprs.hpp>
#endif
#ifndef _AVIFILE_FOURCC_HPP_
#include <avifile/fourcc.hpp>
#endif
#ifndef _AVIFILE_AVIBITMAP_HPP_
#include <avifile/avibmp.hpp>
#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<DriverName> &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 canCompress(AVIBitmap &srcAVIBitmap,AVIBitmap &dstAVIBitmap);
ReturnCode canCompress(AVIBitmap &srcAVIBitmap);
ReturnCode canDecompress(AVIBitmap &someAVIBitmap);
ReturnCode canDecompress(AVIBitmap &srcAVIBitmap,AVIBitmap &dstAVIBitmap);
ReturnCode getCompressFormat(AVIBitmap &srcAVIBitmap);
ReturnCode getCompressFormat(AVIBitmap &srcAVIBitmap,AVIBitmap &dstAVIBitmap);
ReturnCode getFormat(AVIBitmap &srcAVIBitmap);
ReturnCode getFormat(AVIBitmap &srcAVIBitmap,AVIBitmap &dstAVIBitmap);
ReturnCode VideoCodec::getFormat(BitmapInfo &srcBitmapInfo,BitmapInfo &dstBitmapInfo);
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 compressFrame(AVIBitmap &srcAVIBitmap,AVIBitmap &dstAVIBitmap,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);
ReturnCode icmCompressBegin(AVIBitmap &srcAVIBitmap,AVIBitmap &dstAVIBitmap);
ReturnCode icmCompressEnd(void);
ReturnCode icmCompress(AVIBitmap &srcAVIBitmap,AVIBitmap &dstAVIBitmap,MovieData &srcMovieData,MovieData &dstMovieData);
DWORD mDriverID;
HINSTANCE mhVideoCodec;
LPFNDRIVERPROC mlpfnDriverProc;
};
inline
VideoCodec::VideoCodec(void)
: mhVideoCodec(0), mlpfnDriverProc(0), mDriverID(0)
{
}
inline
VideoCodec::~VideoCodec()
{
closeDriver();
}
#endif