-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSVCam.h
121 lines (89 loc) · 4.35 KB
/
SVCam.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#define DECLARE_PTR(type, ptr, expr) type* ptr = (type*)(expr);
EXTERN_C const GUID CLSID_SimpleVirtualCamFilter;
//------------------------------------------------------------------------------
// Forward Declarations
//------------------------------------------------------------------------------
// The class managing the output pin
class CSimpleVirtualCamFilterStream;
//------------------------------------------------------------------------------
// Class CSimpleVirtualCamFilter
//
// This is the main class for the virtual cam filter. It inherits from
// CSource, the DirectShow base class for source filters.
//------------------------------------------------------------------------------
class CSimpleVirtualCamFilter : public CSource
{
public:
// The only allowed way to create Bouncing balls!
static CUnknown * WINAPI CreateInstance(LPUNKNOWN lpunk, HRESULT *phr);
STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
IFilterGraph *GetGraph() { return m_pGraph; }
private:
// It is only allowed to to create these objects with CreateInstance
CSimpleVirtualCamFilter(LPUNKNOWN lpunk, HRESULT *phr);
}; // CSimpleVirtualCamFilter
//------------------------------------------------------------------------------
// Class CBallStream
//
// This class implements the stream which is used to output the bouncing ball
// data from the source filter. It inherits from DirectShows's base
// CSourceStream class.
//------------------------------------------------------------------------------
class CSimpleVirtualCamFilterStream : public CSourceStream, public IAMStreamConfig, public IKsPropertySet, public IAMFilterMiscFlags
{
public:
//////////////////////////////////////////////////////////////////////////
// IUnknown
//////////////////////////////////////////////////////////////////////////
STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
//////////////////////////////////////////////////////////////////////////
// IQualityControl
//////////////////////////////////////////////////////////////////////////
STDMETHODIMP Notify(IBaseFilter * pSender, Quality q);
//////////////////////////////////////////////////////////////////////////
// IAMStreamConfig
//////////////////////////////////////////////////////////////////////////
HRESULT STDMETHODCALLTYPE SetFormat(AM_MEDIA_TYPE *pmt);
HRESULT STDMETHODCALLTYPE GetFormat(AM_MEDIA_TYPE **ppmt);
HRESULT STDMETHODCALLTYPE GetNumberOfCapabilities(int *piCount, int *piSize);
HRESULT STDMETHODCALLTYPE GetStreamCaps(int iIndex, AM_MEDIA_TYPE **pmt, BYTE *pSCC);
//////////////////////////////////////////////////////////////////////////
// IKsPropertySet
//////////////////////////////////////////////////////////////////////////
HRESULT STDMETHODCALLTYPE Set(REFGUID guidPropSet, DWORD dwID, void *pInstanceData, DWORD cbInstanceData, void *pPropData, DWORD cbPropData);
HRESULT STDMETHODCALLTYPE Get(REFGUID guidPropSet, DWORD dwPropID, void *pInstanceData, DWORD cbInstanceData, void *pPropData, DWORD cbPropData, DWORD *pcbReturned);
HRESULT STDMETHODCALLTYPE QuerySupported(REFGUID guidPropSet, DWORD dwPropID, DWORD *pTypeSupport);
//////////////////////////////////////////////////////////////////////////
// IAMFilterMiscFlags
//////////////////////////////////////////////////////////////////////////
ULONG STDMETHODCALLTYPE GetMiscFlags(void);
//////////////////////////////////////////////////////////////////////////
// CSourceStream
//////////////////////////////////////////////////////////////////////////
CSimpleVirtualCamFilterStream(HRESULT *phr, CSimpleVirtualCamFilter *pParent, LPCWSTR pPinName);
~CSimpleVirtualCamFilterStream();
HRESULT FillBuffer(IMediaSample *pms);
HRESULT DecideBufferSize(IMemAllocator *pIMemAlloc, ALLOCATOR_PROPERTIES *pProperties);
HRESULT CheckMediaType(const CMediaType *pMediaType);
HRESULT GetMediaType(int iPosition, CMediaType *pmt);
HRESULT SetMediaType(const CMediaType *pmt);
HRESULT OnThreadCreate(void);
private:
CSimpleVirtualCamFilter *m_pParent;
REFERENCE_TIME m_rtLastTime;
HBITMAP m_hLogoBmp;
CCritSec m_cSharedState;
IReferenceClock *m_pClock;
}; // CSimpleVirtualCamFilterStream
/*
// This class is exported from the SVCam.dll
class SVCAM_API CSVCam {
public:
CSVCam(void);
// TODO: add your methods here.
};
extern SVCAM_API int nSVCam;
SVCAM_API int fnSVCam(void);
*/