#ifndef AVIFILE_VIDEOCODEC_H
#define AVIFILE_VIDEOCODEC_H

#include "Module.h"
struct ICCOMPRESSFRAMES;
struct ICINFO;

class VideoCodec
{
    Module* _module;
public:
    int _handle;
    VideoCodec(Module* module, int compressor, Module::Mode mode);
    ~VideoCodec();
    HRESULT GetFormat(BITMAPINFOHEADER*,BITMAPINFOHEADER*);
    
    HRESULT GetDefaultKeyFrameRate(int* lpint);
    HRESULT GetDefaultQuality(int* lpint);		
    HRESULT CompressBegin( BITMAPINFOHEADER* lpbiInput, BITMAPINFOHEADER* lpbiOutput);
    HRESULT CompressGetSize( BITMAPINFOHEADER* lpbiInput, BITMAPINFOHEADER* lpbiOutput);
    HRESULT CompressQuery( BITMAPINFOHEADER* lpbiInput, BITMAPINFOHEADER* lpbiOutput);
    HRESULT CompressEnd();   
    HRESULT Compress(long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData,
		     LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid,
		     long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality,
		     LPBITMAPINFOHEADER lpbiPrev,void* lpPrev);
    HRESULT DecompressBegin(BITMAPINFOHEADER* lpbiInput, BITMAPINFOHEADER*  lpbiOutput);
    HRESULT DecompressQuery(BITMAPINFOHEADER* lpbiInput, BITMAPINFOHEADER* lpbiOutput);	
    HRESULT DecompressGetFormat(BITMAPINFOHEADER* lpbiInput, BITMAPINFOHEADER* lpbiOutput);
    HRESULT DecompressEnd();
    HRESULT Decompress(long dwFlags,LPBITMAPINFOHEADER lpbiFormat, void* lpData,
		       const LPBITMAPINFOHEADER lpbi,void* lpBits);
    HRESULT CompressFramesInfo(ICCOMPRESSFRAMES* picf);
    HRESULT GetInfo(ICINFO *pici);
};

#endif //AVIFILE_VIDEOCODEC_H
