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 CBaseFilterImpl* pFilter;
89 IPin* pPinConnectedTo;
90 IMemInputPin* pMemInputPinConnectedTo;
91 AM_MEDIA_TYPE* pmtConn;
92 OutputPinAsyncImpl* pAsyncOut; /* for asynchronous output */
95 typedef struct CMemInputPinBaseImpl
98 ICOM_VFIELD(IMemInputPin);
100 /* IUnknown fields */
101 IUnknown* punkControl;
102 /* IMemInputPin fields */
104 IMemAllocator* pAllocator;
106 } CMemInputPinBaseImpl;
108 typedef struct CQualityControlPassThruImpl
110 /* IQualityControl */
111 ICOM_VFIELD(IQualityControl);
113 /* IUnknown fields */
114 IUnknown* punkControl;
115 /* IQualityControl fields */
117 IQualityControl* pControl;
118 } CQualityControlPassThruImpl;
121 struct CBasePinHandlers
123 HRESULT (*pOnPreConnect)( CPinBaseImpl* pImpl, IPin* pPin );
124 HRESULT (*pOnPostConnect)( CPinBaseImpl* pImpl, IPin* pPin );
125 HRESULT (*pOnDisconnect)( CPinBaseImpl* pImpl );
126 HRESULT (*pCheckMediaType)( CPinBaseImpl* pImpl, const AM_MEDIA_TYPE* pmt );
127 HRESULT (*pQualityNotify)( CPinBaseImpl* pImpl, IBaseFilter* pFilter, Quality q );
128 HRESULT (*pReceive)( CPinBaseImpl* pImpl, IMediaSample* pSample );
129 HRESULT (*pReceiveCanBlock)( CPinBaseImpl* pImpl );
130 HRESULT (*pEndOfStream)( CPinBaseImpl* pImpl );
131 HRESULT (*pBeginFlush)( CPinBaseImpl* pImpl );
132 HRESULT (*pEndFlush)( CPinBaseImpl* pImpl );
133 HRESULT (*pNewSegment)( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
138 HRESULT CPinBaseImpl_InitIPin(
139 CPinBaseImpl* This, IUnknown* punkControl,
140 CRITICAL_SECTION* pcsPin,
141 CBaseFilterImpl* pFilter, LPCWSTR pwszId,
143 const CBasePinHandlers* pHandlers );
144 void CPinBaseImpl_UninitIPin( CPinBaseImpl* This );
147 HRESULT CMemInputPinBaseImpl_InitIMemInputPin(
148 CMemInputPinBaseImpl* This, IUnknown* punkControl,
149 CPinBaseImpl* pPin );
150 void CMemInputPinBaseImpl_UninitIMemInputPin(
151 CMemInputPinBaseImpl* This );
154 HRESULT CQualityControlPassThruImpl_InitIQualityControl(
155 CQualityControlPassThruImpl* This, IUnknown* punkControl,
156 CPinBaseImpl* pPin );
157 void CQualityControlPassThruImpl_UninitIQualityControl(
158 CQualityControlPassThruImpl* This );
161 HRESULT CPinBaseImpl_SendSample( CPinBaseImpl* This, IMediaSample* pSample );
162 HRESULT CPinBaseImpl_SendEndOfStream( CPinBaseImpl* This );
163 HRESULT CPinBaseImpl_SendBeginFlush( CPinBaseImpl* This );
164 HRESULT CPinBaseImpl_SendEndFlush( CPinBaseImpl* This );
165 HRESULT CPinBaseImpl_SendNewSegment( CPinBaseImpl* This, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
168 /***************************************************************************
170 * handlers for output pins.
174 HRESULT OutputPinSync_Receive( CPinBaseImpl* pImpl, IMediaSample* pSample );
175 HRESULT OutputPinSync_ReceiveCanBlock( CPinBaseImpl* pImpl );
176 HRESULT OutputPinSync_EndOfStream( CPinBaseImpl* pImpl );
177 HRESULT OutputPinSync_BeginFlush( CPinBaseImpl* pImpl );
178 HRESULT OutputPinSync_EndFlush( CPinBaseImpl* pImpl );
179 HRESULT OutputPinSync_NewSegment( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
181 /***************************************************************************
183 * handlers for output pins (async).
187 HRESULT OutputPinAsync_OnActive( CPinBaseImpl* pImpl );
188 HRESULT OutputPinAsync_OnInactive( CPinBaseImpl* pImpl );
189 HRESULT OutputPinAsync_Receive( CPinBaseImpl* pImpl, IMediaSample* pSample );
190 HRESULT OutputPinAsync_ReceiveCanBlock( CPinBaseImpl* pImpl );
191 HRESULT OutputPinAsync_EndOfStream( CPinBaseImpl* pImpl );
192 HRESULT OutputPinAsync_BeginFlush( CPinBaseImpl* pImpl );
193 HRESULT OutputPinAsync_EndFlush( CPinBaseImpl* pImpl );
194 HRESULT OutputPinAsync_NewSegment( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
198 #endif /* WINE_DSHOW_BASEFILT_H */