1 #ifndef WINE_DSHOW_BASEFILT_H
2 #define WINE_DSHOW_BASEFILT_H
5 * The following interfaces must be used as a part of aggregation.
6 * The punkControl must not be NULL since all IUnknown methods are
7 * implemented only for aggregation.
11 * implements IBaseFilter (internal)
13 * a base class for implementing IBaseFilter.
19 typedef struct CBaseFilterHandlers CBaseFilterHandlers;
20 typedef struct CBasePinHandlers CBasePinHandlers;
22 typedef struct CBaseFilterImpl
24 /* IPersist - IMediaFilter - IBaseFilter */
25 ICOM_VFIELD(IBaseFilter);
28 IUnknown* punkControl;
29 /* IBaseFilter fields */
30 const CBaseFilterHandlers* pHandlers;
31 CRITICAL_SECTION csFilter;
32 const CLSID* pclsidFilter;
33 QUARTZ_CompList* pInPins; /* a list of IPin-s. */
34 QUARTZ_CompList* pOutPins; /* a list of IPin-s. */
38 IReferenceClock* pClock;
39 REFERENCE_TIME rtStart;
43 struct CBaseFilterHandlers
45 HRESULT (*pOnActive)( CBaseFilterImpl* pImpl );
46 HRESULT (*pOnInactive)( CBaseFilterImpl* pImpl );
47 HRESULT (*pOnStop)( CBaseFilterImpl* pImpl );
51 HRESULT CBaseFilterImpl_InitIBaseFilter(
52 CBaseFilterImpl* This, IUnknown* punkControl,
53 const CLSID* pclsidFilter, LPCWSTR lpwszNameGraph,
54 const CBaseFilterHandlers* pHandlers );
55 void CBaseFilterImpl_UninitIBaseFilter( CBaseFilterImpl* This );
58 HRESULT CBaseFilterImpl_MediaEventNotify(
59 CBaseFilterImpl* This, long lEvent,LONG_PTR lParam1,LONG_PTR lParam2);
63 * Implements IPin, IMemInputPin, and IQualityControl. (internal)
65 * a base class for implementing IPin.
68 typedef struct OutputPinAsyncImpl OutputPinAsyncImpl;
70 typedef struct CPinBaseImpl
76 IUnknown* punkControl;
78 const CBasePinHandlers* pHandlers;
83 /* you can change AcceptTypes while pcsPin has been hold */
84 const AM_MEDIA_TYPE* pmtAcceptTypes;
87 CRITICAL_SECTION* pcsPin;
88 CRITICAL_SECTION* pcsPinReceive;
89 CBaseFilterImpl* pFilter;
90 IPin* pPinConnectedTo;
91 IMemInputPin* pMemInputPinConnectedTo;
92 AM_MEDIA_TYPE* pmtConn;
93 OutputPinAsyncImpl* pAsyncOut; /* for asynchronous output */
96 typedef struct CMemInputPinBaseImpl
99 ICOM_VFIELD(IMemInputPin);
101 /* IUnknown fields */
102 IUnknown* punkControl;
103 /* IMemInputPin fields */
105 IMemAllocator* pAllocator;
107 } CMemInputPinBaseImpl;
109 typedef struct CQualityControlPassThruImpl
111 /* IQualityControl */
112 ICOM_VFIELD(IQualityControl);
114 /* IUnknown fields */
115 IUnknown* punkControl;
116 /* IQualityControl fields */
118 IQualityControl* pControl;
119 } CQualityControlPassThruImpl;
122 struct CBasePinHandlers
124 HRESULT (*pOnPreConnect)( CPinBaseImpl* pImpl, IPin* pPin );
125 HRESULT (*pOnPostConnect)( CPinBaseImpl* pImpl, IPin* pPin );
126 HRESULT (*pOnDisconnect)( CPinBaseImpl* pImpl );
127 HRESULT (*pCheckMediaType)( CPinBaseImpl* pImpl, const AM_MEDIA_TYPE* pmt );
128 HRESULT (*pQualityNotify)( CPinBaseImpl* pImpl, IBaseFilter* pFilter, Quality q );
129 HRESULT (*pReceive)( CPinBaseImpl* pImpl, IMediaSample* pSample );
130 HRESULT (*pReceiveCanBlock)( CPinBaseImpl* pImpl );
131 HRESULT (*pEndOfStream)( CPinBaseImpl* pImpl );
132 HRESULT (*pBeginFlush)( CPinBaseImpl* pImpl );
133 HRESULT (*pEndFlush)( CPinBaseImpl* pImpl );
134 HRESULT (*pNewSegment)( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
139 HRESULT CPinBaseImpl_InitIPin(
140 CPinBaseImpl* This, IUnknown* punkControl,
141 CRITICAL_SECTION* pcsPin,
142 CRITICAL_SECTION* pcsPinReceive,
143 CBaseFilterImpl* pFilter, LPCWSTR pwszId,
145 const CBasePinHandlers* pHandlers );
146 void CPinBaseImpl_UninitIPin( CPinBaseImpl* This );
149 HRESULT CMemInputPinBaseImpl_InitIMemInputPin(
150 CMemInputPinBaseImpl* This, IUnknown* punkControl,
151 CPinBaseImpl* pPin );
152 void CMemInputPinBaseImpl_UninitIMemInputPin(
153 CMemInputPinBaseImpl* This );
156 HRESULT CQualityControlPassThruImpl_InitIQualityControl(
157 CQualityControlPassThruImpl* This, IUnknown* punkControl,
158 CPinBaseImpl* pPin );
159 void CQualityControlPassThruImpl_UninitIQualityControl(
160 CQualityControlPassThruImpl* This );
163 HRESULT CPinBaseImpl_SendSample( CPinBaseImpl* This, IMediaSample* pSample );
164 HRESULT CPinBaseImpl_SendReceiveCanBlock( CPinBaseImpl* This );
165 HRESULT CPinBaseImpl_SendEndOfStream( CPinBaseImpl* This );
166 HRESULT CPinBaseImpl_SendBeginFlush( CPinBaseImpl* This );
167 HRESULT CPinBaseImpl_SendEndFlush( CPinBaseImpl* This );
168 HRESULT CPinBaseImpl_SendNewSegment( CPinBaseImpl* This, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
171 /***************************************************************************
173 * handlers for output pins.
177 HRESULT OutputPinSync_Receive( CPinBaseImpl* pImpl, IMediaSample* pSample );
178 HRESULT OutputPinSync_ReceiveCanBlock( CPinBaseImpl* pImpl );
179 HRESULT OutputPinSync_EndOfStream( CPinBaseImpl* pImpl );
180 HRESULT OutputPinSync_BeginFlush( CPinBaseImpl* pImpl );
181 HRESULT OutputPinSync_EndFlush( CPinBaseImpl* pImpl );
182 HRESULT OutputPinSync_NewSegment( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
184 /***************************************************************************
186 * handlers for output pins (async).
190 HRESULT OutputPinAsync_OnActive( CPinBaseImpl* pImpl );
191 HRESULT OutputPinAsync_OnInactive( CPinBaseImpl* pImpl );
192 HRESULT OutputPinAsync_Receive( CPinBaseImpl* pImpl, IMediaSample* pSample );
193 HRESULT OutputPinAsync_ReceiveCanBlock( CPinBaseImpl* pImpl );
194 HRESULT OutputPinAsync_EndOfStream( CPinBaseImpl* pImpl );
195 HRESULT OutputPinAsync_BeginFlush( CPinBaseImpl* pImpl );
196 HRESULT OutputPinAsync_EndFlush( CPinBaseImpl* pImpl );
197 HRESULT OutputPinAsync_NewSegment( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
201 #endif /* WINE_DSHOW_BASEFILT_H */