/******************************************************** Video encoder interface Copyright 2000 Eugene Kuznetsov (divx@euro.ru) *********************************************************/ #ifndef __VideoEncoder_H #define __VideoEncoder_H #include #include #include "Module.h" class VideoEncoder: public IVideoEncoder { // HIC hic; // the heart of encoder VideoCodec* codec; const CodecInfo& record; int m_comp_id; int m_iState; BitmapInfo *m_bh; BITMAPINFOHEADER *m_obh; int m_iFrameNum; int m_iQual; int m_iKfFreq; char* m_prev; public: // VideoEncoder(int compressor, const BITMAPINFOHEADER& header); VideoEncoder(int compressor, const CodecInfo& info, const BITMAPINFOHEADER& header); // :m_iState(0), m_dBitRate(0), m_prev(0){} ~VideoEncoder(); // // Should be called before operation // Specifies source video format and compressor // // void Init(int compressor, const char*) throw(FatalError&);//BITMAPINFOHEADER* void Close(); // // Starts encoding // void Start(); // // Stops encoding // void Stop(); // // Queries encoder about desired buffer size for compression // You should allocate at least this much bytes for dest ( arg for EncodeFrame ) // int QueryOutputSize(); const BITMAPINFOHEADER& QueryOutputFormat() const; // // Encodes single frame // On success, is_keyframe contains 0 if frame was encoded into delta frame, otherwise AVIIF_KEYFRAME (?) // size receives size of compressed frame // int EncodeFrame(CImage* src, char* dest, int* is_keyframe, int* size, int* lpckid=0); // // Quality takes values from 0 to 10000, 10000 the best // int SetQuality(int quality); int GetQuality(); int SetKeyFrame(int frequency); int GetKeyFrame(){return m_iKfFreq;} virtual const CodecInfo& GetCodecInfo() const {return record;} }; class CodecInfoKeeper { public: CodecInfoKeeper(); }; #endif