6 #ifndef _INC_cVideoVFW_H
7 #define _INC_cVideoVFW_H
14 #if defined(_WIN32) && ! defined(UNDER_CE)
15 #include "../WinAPI/WinTypes.h"
45 class GRAYLIB_LINK cVideoVFWComp :
public IVideoCompress,
public cVideoVFW
66 cParams(
FOURCC fccHandler = cVideoVFW::k_FormNull, LONG lKeyRate = 1, LONG lDataRate = 300,
AV_QUALITY_t nQuality = k_AV_QUALITY_DEF) noexcept
67 : m_fccHandler(fccHandler)
68 , m_lKeyRate(lKeyRate)
69 , m_lDataRate(lDataRate)
70 , m_nQuality(nQuality)
74 bool isCodecNull() const noexcept
77 return(m_fccHandler == cVideoVFW::k_FormNull);
79 bool isValidFormat() const noexcept
84 bool SetCodecParams(
FOURCC fccHandler = k_FormNull, LONG lKeyRate = 1, LONG lDataRate = 300,
AV_QUALITY_t nQuality = k_AV_QUALITY_DEF) noexcept
87 m_fccHandler = fccHandler;
88 m_lKeyRate = lKeyRate;
89 m_lDataRate = lDataRate;
90 m_nQuality = nQuality;
96 bool put_CodecStr(
const char* pszValue);
101 cSurfaceBitmapInfo m_biIn;
106 cVideoVFWComp(
const cParams& params);
107 cVideoVFWComp(
const cVideoVFWComp& copythis);
108 virtual ~cVideoVFWComp();
110 bool isCodecAlloc() const noexcept
113 return(m_v.cbSize != 0);
115 bool isCodecNull() const noexcept
118 return(m_v.fccHandler == k_FormNull);
120 bool isCodecOpen()
const
127 bool isCompStarted()
const
133 ASSERT(m_v.lpbiOut !=
nullptr);
139 HRESULT OpenCodec(WORD wMode = ICMODE_FASTCOMPRESS);
143 bool GetCodecInfo(ICINFO& icInfo)
const;
144 HRESULT GetCompFormat(
const tagBITMAPINFO* lpbiIn, tagBITMAPINFO* lpbiOut =
nullptr)
const;
145 bool GetCodecParams(cParams& params)
const;
146 bool SetCodecParams(
const cParams& params);
148 bool CompSupportsConfigureDlg()
const;
149 HRESULT CompConfigureDlg(HWND hWndApp);
150 bool CompChooseDlg(HWND hWndApp,
const char* lpszTitle);
157 virtual HRESULT CompStart(
const cSurfaceInfo& rInfo, cSurfaceBitmapInfo* pbiOut)
override;
158 virtual HRESULT CompFrame(
const cSurfaceBase& frame, OUT
const void*& rpCompRet, OUT
size_t& rnSizeRet, OUT
bool& rbIsKey)
override;
159 virtual void CompEnd();
166 class GRAYLIB_LINK cVideoVFWDecomp :
public IVideoDecompress,
public cVideoVFW
172 cHandlePtr<HIC> m_hic;
173 ICDECOMPRESS m_Decomp;
175 cVideoVFWDecomp() noexcept
179 virtual ~cVideoVFWDecomp()
182 virtual HRESULT DecompStart(
const cSurfaceBitmapInfo* pbiInp, cSurfaceInfo* pFrameInfo)
override
188 virtual HRESULT DecompFrame(
const void* pCompData,
size_t nSizeComp, cSurfaceBase& frame)
override
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
#define UNREFERENCED_PARAMETER(P)
< _WIN32 type thing. get rid of stupid warning.
Definition: SysTypes.h:299
#define UNREFERENCED_REFERENCE(x)
Definition: SysTypes.h:318
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define ASSERT(exp)
Definition: cDebugAssert.h:87
UINT32 FOURCC
32 bit code. Also defined in _MMSYSTEM_H
Definition: cFourCC.h:19
#define MAKEFOURCC(ch0, ch1, ch2, ch3)
Definition: cFourCC.h:24
#define HANDLE_NULL
Invalid OS handle for _WIN32. Not invalid OS handle for linux.
Definition: cOSHandle.h:21
#define UNITTEST_FRIEND(n)
Define this in the class body to be unit tested. Allow the unit test to access private/protected stuf...
Definition: cUnitTestDecl.h:17
void CloseHandle()
Definition: cHandlePtr.h:79
short AV_QUALITY_t
0 to 10000 e.g. 9900 = 99%. same as ICQUALITY_LOW,ICQUALITY_HIGH
Definition: cAVSink.h:21
< The main namespace for all Core functions.
Definition: GrayCore.cpp:14
int StrLen_t
the length of a string in chars (bytes for UTF8, wchar_t for UNICODE). or offset in characters....
Definition: StrConst.h:32