6 #ifndef _INC_cVidCapVFW_H
7 #define _INC_cVidCapVFW_H
12 #include "../GrayLibBase.h"
14 #if defined(_WIN32) && ! defined(UNDER_CE) && defined(_MSC_VER)
15 #include "../AV/cWaveFormat.h"
16 #include "../Windows/cWindow.h"
17 #include "../Image/cSurfaceInfo.h"
22 struct tagCapDriverCaps;
23 struct tagCapInfoChunk;
24 struct tagCaptureParms;
38 virtual ~cVidCapVFW(
void);
40 static bool GRAYCALL GetDescription(UINT nCaptureDriverIndex,
cString& sDeviceName,
cString& sDeviceVersion);
43 HRESULT CreateCapture(DWORD dwStyle = WS_OVERLAPPED,
const cRectI* pRect =
nullptr, HWND hWndParent = HWND_DESKTOP,
DLGID_t nID = 0);
46 BOOL Connect(
int nCaptureDriverIndex);
48 BOOL CaptureSequence();
50 BOOL GetStatus(OUT
struct tagCapStatus& status)
const;
51 BOOL GetCaps(OUT
struct tagCapDriverCaps& caps)
const;
52 BOOL GetName(OUT
cString& sName)
const;
53 BOOL GetVersion(OUT
cString& sVersion)
const;
54 BOOL SetOverlay(BOOL bOverlay);
55 BOOL SetPreview(BOOL bPreview);
56 BOOL HasOverlay()
const;
57 BOOL IsOverlay()
const;
58 BOOL IsPreview()
const;
59 BOOL SetPreviewRate(WORD wPreviewRate);
60 BOOL SetScale(BOOL bScale);
61 BOOL SetScroll(
const CPoint& point);
62 BOOL HasVideoOutputDlg()
const;
63 BOOL ShowVideoOutputDlg();
64 BOOL HasVideoFormatDlg()
const;
65 BOOL ShowVideoFormatDlg();
66 BOOL HasVideoSourceDlg()
const;
67 BOOL ShowVideoSourceDlg();
68 BOOL ShowCompressionDlg();
69 BOOL GetAudioFormat(cWaveFormatEx*& pWaveFormat, DWORD& dwSize)
const;
70 BOOL SetAudioFormat(cWaveFormatEx* pWaveFormat);
72 BOOL GetVideoFormat(cSurfaceBitmapInfo*& pBitmapInfo)
const;
73 BOOL SetVideoFormat(cSurfaceBitmapInfo* pBitmapInfo);
74 BOOL FileAllocate(DWORD dwSize);
75 BOOL GetCaptureFile(
cStringF& sFilename)
const;
76 BOOL SaveAs(
const cStringF& sFilename);
77 BOOL SetCaptureFile(
const cStringF& sFilename);
79 BOOL SetMCIDevice(
const cStringF& sName);
80 BOOL CaptureSingleFrame();
81 BOOL CaptureSingleFrameOpen();
82 BOOL CaptureSingleFrameClose();
84 BOOL SaveDib(
const CString& sFilename);
86 BOOL GrabFrameNoStop();
87 BOOL SetInfoChunk(
const struct tagCapInfoChunk* pInfoChunk);
88 DWORD GetUserData()
const;
89 BOOL SetUserData(DWORD dwData);
90 BOOL AutoCreatePalette(
int nFrames,
int nColors);
91 BOOL ManualCreatePalette(BOOL bGrab,
int nColors);
92 BOOL OpenPalette(
const CString& sFilename);
94 BOOL SavePalette(
const CString& sFilename);
95 BOOL GetSetup(
struct tagCaptureParms& params)
const;
96 BOOL SetSetup(
struct tagCaptureParms& params);
99 BOOL EnableCapControlCallback();
100 BOOL RemoveCapControlCallback();
101 BOOL EnableErrorCallback();
102 BOOL RemoveErrorCallback();
103 BOOL EnableFrameCallback();
104 BOOL RemoveFrameCallback();
105 BOOL EnableStatusCallback();
106 BOOL RemoveStatusCallback();
107 BOOL EnableVideoStreamCallback();
108 BOOL RemoveVideoStreamCallback();
109 BOOL EnableWaveStreamCallback();
110 BOOL RemoveWaveStreamCallback();
111 BOOL EnableYieldCallback();
112 BOOL RemoveYieldCallback();
115 virtual LRESULT OnVideoStream(
struct videohdr_tag* );
116 virtual LRESULT OnWaveStream(
struct wavehdr_tag* );
117 virtual LRESULT OnYield();
118 virtual LRESULT OnControl(
int nState);
119 virtual LRESULT OnError(
int nID, LPCTSTR lpsz);
120 virtual LRESULT OnFrame(
struct videohdr_tag* );
121 virtual LRESULT OnStatus(
int nID, LPCTSTR lpsz);
123 static LRESULT CALLBACK _Control(HWND hWnd,
int nState);
124 static LRESULT CALLBACK _Error(HWND hWnd,
int nID, LPCTSTR lpsz);
125 static LRESULT CALLBACK _Frame(HWND hWnd,
struct videohdr_tag* lpVHdr);
126 static LRESULT CALLBACK _Yield(HWND hWnd);
127 static LRESULT CALLBACK _WaveStream(HWND hWnd,
struct wavehdr_tag* lpWHdr);
128 static LRESULT CALLBACK _VideoStream(HWND hWnd,
struct videohdr_tag* lpVHdr);
129 static LRESULT CALLBACK _Status(HWND hWnd,
int nID, LPCTSTR lpsz);
#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
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#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
UINT DLGID_t
old window format this was a WORD, EX format this is UINT32.
Definition: cResDialog.h:68
cPoint2i CPoint
Compatible with MFC 2d CPoint,CRect.
Definition: cPoint2.h:65
cStringT< FILECHAR_t > cStringF
A file name. checks USE_UNICODE_FN. related to cFilePath.
Definition: cFilePath.h:17
cString CString
Definition: cString.h:639
cStringT< GChar_t > cString
Definition: cString.h:636