1 | /**
|
---|
2 | * This file has no copyright assigned and is placed in the Public Domain.
|
---|
3 | * This file is part of the mingw-w64 runtime package.
|
---|
4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
---|
5 | */
|
---|
6 | #ifndef _MSPTERM_H_
|
---|
7 | #define _MSPTERM_H_
|
---|
8 |
|
---|
9 | template <class T> class ITTerminalVtblBase : public ITTerminal {
|
---|
10 | };
|
---|
11 |
|
---|
12 | class CBaseTerminal : virtual public CComObjectRootEx<CComMultiThreadModelNoCS>,public IDispatchImpl<ITTerminalVtblBase<CBaseTerminal>,&IID_ITTerminal,&LIBID_TAPI3Lib>,public ITTerminalControl
|
---|
13 | {
|
---|
14 | BEGIN_COM_MAP(CBaseTerminal)
|
---|
15 | COM_INTERFACE_ENTRY(IDispatch)
|
---|
16 | COM_INTERFACE_ENTRY(ITTerminal)
|
---|
17 | COM_INTERFACE_ENTRY(ITTerminalControl)
|
---|
18 | COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal,m_pFTM)
|
---|
19 | END_COM_MAP()
|
---|
20 | DECLARE_VQI()
|
---|
21 | DECLARE_GET_CONTROLLING_UNKNOWN()
|
---|
22 | public:
|
---|
23 | CBaseTerminal();
|
---|
24 | virtual ~CBaseTerminal();
|
---|
25 | public:
|
---|
26 | STDMETHOD(get_TerminalClass)(BSTR *pVal);
|
---|
27 | STDMETHOD(get_TerminalType)(TERMINAL_TYPE *pVal);
|
---|
28 | STDMETHOD(get_State)(TERMINAL_STATE *pVal);
|
---|
29 | STDMETHOD(get_Name)(BSTR *pVal);
|
---|
30 | STDMETHOD(get_MediaType)(__LONG32 *plMediaType);
|
---|
31 | STDMETHOD(get_Direction)(TERMINAL_DIRECTION *pDirection);
|
---|
32 | public:
|
---|
33 | virtual HRESULT Initialize(IID iidTerminalClass,DWORD dwMediaType,TERMINAL_DIRECTION Direction,MSP_HANDLE htAddress);
|
---|
34 | public:
|
---|
35 | STDMETHOD (get_AddressHandle)(MSP_HANDLE *phtAddress);
|
---|
36 | STDMETHOD (ConnectTerminal)(IGraphBuilder *pGraph,DWORD dwTerminalDirection,DWORD *pdwNumPins,IPin **ppPins);
|
---|
37 | STDMETHOD (CompleteConnectTerminal)(void);
|
---|
38 | STDMETHOD (DisconnectTerminal)(IGraphBuilder *pGraph,DWORD dwReserved);
|
---|
39 | STDMETHOD (RunRenderFilter)(void) = 0;
|
---|
40 | STDMETHOD (StopRenderFilter)(void) = 0;
|
---|
41 | protected:
|
---|
42 | CMSPCritSection m_CritSec;
|
---|
43 | public:
|
---|
44 | TERMINAL_DIRECTION m_TerminalDirection;
|
---|
45 | TERMINAL_TYPE m_TerminalType;
|
---|
46 | TERMINAL_STATE m_TerminalState;
|
---|
47 | TCHAR m_szName[MAX_PATH + 1];
|
---|
48 | IID m_TerminalClassID;
|
---|
49 | DWORD m_dwMediaType;
|
---|
50 | MSP_HANDLE m_htAddress;
|
---|
51 | IUnknown *m_pFTM;
|
---|
52 | CComPtr<IGraphBuilder> m_pGraph;
|
---|
53 | virtual HRESULT AddFiltersToGraph() = 0;
|
---|
54 | virtual HRESULT ConnectFilters() { return S_OK; }
|
---|
55 | virtual HRESULT GetNumExposedPins(IGraphBuilder *pGraph,DWORD *pdwNumPins) = 0;
|
---|
56 | virtual HRESULT GetExposedPins(IPin **ppPins) = 0;
|
---|
57 | virtual DWORD GetSupportedMediaTypes(void) = 0;
|
---|
58 | virtual HRESULT RemoveFiltersFromGraph() = 0;
|
---|
59 | WINBOOL MediaTypeSupported(__LONG32 lMediaType);
|
---|
60 | };
|
---|
61 |
|
---|
62 | class CSingleFilterTerminal : public CBaseTerminal {
|
---|
63 | public:
|
---|
64 | CComPtr<IPin> m_pIPin;
|
---|
65 | CComPtr<IBaseFilter> m_pIFilter;
|
---|
66 | public:
|
---|
67 | STDMETHOD(RunRenderFilter)(void);
|
---|
68 | STDMETHOD(StopRenderFilter)(void);
|
---|
69 | virtual HRESULT GetNumExposedPins(IGraphBuilder *pGraph,DWORD *pdwNumPins);
|
---|
70 | virtual HRESULT GetExposedPins(IPin **ppPins);
|
---|
71 | virtual HRESULT RemoveFiltersFromGraph();
|
---|
72 | };
|
---|
73 |
|
---|
74 | class CSingleFilterStaticTerminal : public CSingleFilterTerminal {
|
---|
75 | public:
|
---|
76 | CComPtr<IMoniker> m_pMoniker;
|
---|
77 | WINBOOL m_bMark;
|
---|
78 | virtual HRESULT CompareMoniker(IMoniker *pMoniker);
|
---|
79 | };
|
---|
80 | #endif
|
---|