| 1 |
#ifndef AVIFILE_DS_VIDEODECODER_H |
| 2 |
#define AVIFILE_DS_VIDEODECODER_H |
| 3 |
|
| 4 |
#include "dshow/DS_Filter.h" |
| 5 |
#include "videodecoder.h" |
| 6 |
|
| 7 |
AVM_BEGIN_NAMESPACE; |
| 8 |
|
| 9 |
class DS_VideoDecoder: public IVideoDecoder, public IRtConfig |
| 10 |
{ |
| 11 |
public: |
| 12 |
DS_VideoDecoder(const CodecInfo& info, const BITMAPINFOHEADER& format, int flip); |
| 13 |
virtual ~DS_VideoDecoder(); |
| 14 |
virtual int DecodeFrame(CImage* dest, const void* src, size_t size, |
| 15 |
int is_keyframe, bool render = true, |
| 16 |
CImage** pOut = 0); |
| 17 |
virtual CAPS GetCapabilities() const { return m_Caps; } |
| 18 |
virtual IRtConfig* GetRtConfig() { return (IRtConfig*) this; } |
| 19 |
virtual int SetDestFmt(int bits = 24, fourcc_t csp = 0); |
| 20 |
virtual int SetDirection(int d); |
| 21 |
virtual int Start(); |
| 22 |
virtual int Stop(); |
| 23 |
|
| 24 |
// IRtConfig interface |
| 25 |
virtual const avm::vector<AttributeInfo>& GetAttrs() const |
| 26 |
{ |
| 27 |
return m_Info.decoder_info; |
| 28 |
} |
| 29 |
virtual int GetValue(const char*, int*) const; |
| 30 |
virtual int SetValue(const char*, int); |
| 31 |
|
| 32 |
int init(); // avoid throws |
| 33 |
protected: |
| 34 |
int setCodecValues(); |
| 35 |
int getCodecValues(); |
| 36 |
DS_Filter* m_pDS_Filter; |
| 37 |
AM_MEDIA_TYPE m_sOurType, m_sDestType; |
| 38 |
VIDEOINFOHEADER* m_sVhdr; |
| 39 |
VIDEOINFOHEADER* m_sVhdr2; |
| 40 |
IDivxFilterInterface* m_pIDivx4; |
| 41 |
CAPS m_Caps; // capabilities of DirectShow decoder |
| 42 |
int m_iStatus; |
| 43 |
int m_iMaxAuto; |
| 44 |
int m_iLastPPMode; |
| 45 |
int m_iLastBrightness; |
| 46 |
int m_iLastContrast; |
| 47 |
int m_iLastSaturation; |
| 48 |
int m_iLastHue; |
| 49 |
enum { CT_NONE, CT_DIVX3, CT_DIVX4, CT_IV50 } m_CType; |
| 50 |
bool m_bHaveUpsideDownRGB; |
| 51 |
bool m_bSetFlg; |
| 52 |
bool m_bFlip; |
| 53 |
}; |
| 54 |
|
| 55 |
AVM_END_NAMESPACE; |
| 56 |
|
| 57 |
#endif /* AVIFILE_DS_VIDEODECODER_H */ |