| 1 |
#ifndef AVIFILE_MODULE_H |
| 2 |
#define AVIFILE_MODULE_H |
| 3 |
|
| 4 |
#include "infotypes.h" |
| 5 |
#include "videoencoder.h" |
| 6 |
|
| 7 |
#include "loader.h" |
| 8 |
|
| 9 |
AVM_BEGIN_NAMESPACE; |
| 10 |
|
| 11 |
struct DRVR |
| 12 |
{ |
| 13 |
unsigned int uDriverSignature; |
| 14 |
int hDriverModule; |
| 15 |
DRIVERPROC DriverProc; |
| 16 |
unsigned long dwDriverID; |
| 17 |
}; |
| 18 |
|
| 19 |
class Module; |
| 20 |
|
| 21 |
class VideoCodecControl |
| 22 |
{ |
| 23 |
friend class Module; |
| 24 |
avm::vector<Module*> _modules; |
| 25 |
public: |
| 26 |
VideoCodecControl() {} |
| 27 |
Module* Create(const CodecInfo& info); |
| 28 |
~VideoCodecControl(); |
| 29 |
protected: |
| 30 |
void Erase(Module*); |
| 31 |
}; |
| 32 |
|
| 33 |
class Module |
| 34 |
{ |
| 35 |
public: |
| 36 |
enum Mode {Compress, Decompress}; |
| 37 |
Module(const char* name, VideoCodecControl& parent); //loads module |
| 38 |
~Module(); |
| 39 |
const char* GetName() const { return m_pName.c_str(); } |
| 40 |
HIC CreateHandle(unsigned int compressor, Mode mode); |
| 41 |
int CloseHandle(HIC); |
| 42 |
int GetLibHandle() { return m_pHandle; } |
| 43 |
void ForgetParent() { forgotten = 1; } |
| 44 |
int init(); |
| 45 |
protected: |
| 46 |
VideoCodecControl& _parent; |
| 47 |
avm::string m_pName; |
| 48 |
DRVR driver; |
| 49 |
int forgotten; |
| 50 |
int m_iRefCount; |
| 51 |
int m_pHandle; |
| 52 |
}; |
| 53 |
|
| 54 |
extern VideoCodecControl control; |
| 55 |
|
| 56 |
AVM_END_NAMESPACE; |
| 57 |
|
| 58 |
#endif // AVIFILE_MODULE_H |