Update shell xxxAW wrapper prototypes for fixed SHLWAPI functions.
[wine] / dlls / quartz / basefilt.h
1 /*
2  * Copyright (C) Hidenori TAKESHIMA
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef WINE_DSHOW_BASEFILT_H
20 #define WINE_DSHOW_BASEFILT_H
21
22 /*
23  * The following interfaces must be used as a part of aggregation.
24  * The punkControl must not be NULL since all IUnknown methods are
25  * implemented only for aggregation.
26  */
27
28 /*
29  * implements IBaseFilter (internal)
30  *
31  * a base class for implementing IBaseFilter.
32  */
33
34 #include "complist.h"
35 #include "mtype.h"
36
37 typedef struct CBaseFilterHandlers      CBaseFilterHandlers;
38 typedef struct CBasePinHandlers CBasePinHandlers;
39
40 typedef struct CBaseFilterImpl
41 {
42         /* IPersist - IMediaFilter - IBaseFilter */
43         ICOM_VFIELD(IBaseFilter);
44
45         /* IUnknown fields */
46         IUnknown*       punkControl;
47         /* IBaseFilter fields */
48         const CBaseFilterHandlers*      pHandlers;
49         CRITICAL_SECTION        csFilter;
50         const CLSID*    pclsidFilter;
51         QUARTZ_CompList*        pInPins;        /* a list of IPin-s. */
52         QUARTZ_CompList*        pOutPins;       /* a list of IPin-s. */
53         IFilterGraph*   pfg;
54         DWORD   cbNameGraph;
55         WCHAR*  pwszNameGraph;
56         IReferenceClock*        pClock;
57         REFERENCE_TIME  rtStart;
58         FILTER_STATE    fstate;
59 } CBaseFilterImpl;
60
61 struct CBaseFilterHandlers
62 {
63         HRESULT (*pOnActive)( CBaseFilterImpl* pImpl );
64         HRESULT (*pOnInactive)( CBaseFilterImpl* pImpl );
65         HRESULT (*pOnStop)( CBaseFilterImpl* pImpl );
66 };
67
68
69 HRESULT CBaseFilterImpl_InitIBaseFilter(
70         CBaseFilterImpl* This, IUnknown* punkControl,
71         const CLSID* pclsidFilter, LPCWSTR lpwszNameGraph,
72         const CBaseFilterHandlers* pHandlers );
73 void CBaseFilterImpl_UninitIBaseFilter( CBaseFilterImpl* This );
74
75
76 HRESULT CBaseFilterImpl_MediaEventNotify(
77         CBaseFilterImpl* This, long lEvent,LONG_PTR lParam1,LONG_PTR lParam2);
78
79
80 /*
81  * Implements IPin, IMemInputPin, and IQualityControl. (internal)
82  *
83  * a base class for implementing IPin.
84  */
85
86 typedef struct OutputPinAsyncImpl OutputPinAsyncImpl;
87
88 typedef struct CPinBaseImpl
89 {
90         /* IPin */
91         ICOM_VFIELD(IPin);
92
93         /* IUnknown fields */
94         IUnknown*       punkControl;
95         /* IPin fields */
96         const CBasePinHandlers* pHandlers;
97         DWORD   cbIdLen;
98         WCHAR*  pwszId;
99         BOOL    bOutput;
100
101         /* you can change AcceptTypes while pcsPin has been hold */
102         const AM_MEDIA_TYPE*    pmtAcceptTypes;
103         ULONG   cAcceptTypes;
104
105         CRITICAL_SECTION*       pcsPin;
106         CRITICAL_SECTION*       pcsPinReceive;
107         CBaseFilterImpl*        pFilter;
108         IPin*   pPinConnectedTo;
109         IMemInputPin*   pMemInputPinConnectedTo;
110         AM_MEDIA_TYPE*  pmtConn;
111         OutputPinAsyncImpl* pAsyncOut; /* for asynchronous output */
112 } CPinBaseImpl;
113
114 typedef struct CMemInputPinBaseImpl
115 {
116         /* IMemInputPin */
117         ICOM_VFIELD(IMemInputPin);
118
119         /* IUnknown fields */
120         IUnknown*       punkControl;
121         /* IMemInputPin fields */
122         CPinBaseImpl*   pPin;
123         IMemAllocator*  pAllocator;
124         BOOL    bReadonly;
125 } CMemInputPinBaseImpl;
126
127 typedef struct CQualityControlPassThruImpl
128 {
129         /* IQualityControl */
130         ICOM_VFIELD(IQualityControl);
131
132         /* IUnknown fields */
133         IUnknown*       punkControl;
134         /* IQualityControl fields */
135         CPinBaseImpl*   pPin;
136         IQualityControl*        pControl;
137 } CQualityControlPassThruImpl;
138
139
140 struct CBasePinHandlers
141 {
142         HRESULT (*pOnPreConnect)( CPinBaseImpl* pImpl, IPin* pPin );
143         HRESULT (*pOnPostConnect)( CPinBaseImpl* pImpl, IPin* pPin );
144         HRESULT (*pOnDisconnect)( CPinBaseImpl* pImpl );
145         HRESULT (*pCheckMediaType)( CPinBaseImpl* pImpl, const AM_MEDIA_TYPE* pmt );
146         HRESULT (*pQualityNotify)( CPinBaseImpl* pImpl, IBaseFilter* pFilter, Quality q );
147         HRESULT (*pReceive)( CPinBaseImpl* pImpl, IMediaSample* pSample );
148         HRESULT (*pReceiveCanBlock)( CPinBaseImpl* pImpl );
149         HRESULT (*pEndOfStream)( CPinBaseImpl* pImpl );
150         HRESULT (*pBeginFlush)( CPinBaseImpl* pImpl );
151         HRESULT (*pEndFlush)( CPinBaseImpl* pImpl );
152         HRESULT (*pNewSegment)( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
153 };
154
155
156
157 HRESULT CPinBaseImpl_InitIPin(
158         CPinBaseImpl* This, IUnknown* punkControl,
159         CRITICAL_SECTION* pcsPin,
160         CRITICAL_SECTION* pcsPinReceive,
161         CBaseFilterImpl* pFilter, LPCWSTR pwszId,
162         BOOL bOutput,
163         const CBasePinHandlers* pHandlers );
164 void CPinBaseImpl_UninitIPin( CPinBaseImpl* This );
165
166
167 HRESULT CMemInputPinBaseImpl_InitIMemInputPin(
168         CMemInputPinBaseImpl* This, IUnknown* punkControl,
169         CPinBaseImpl* pPin );
170 void CMemInputPinBaseImpl_UninitIMemInputPin(
171         CMemInputPinBaseImpl* This );
172
173
174 HRESULT CQualityControlPassThruImpl_InitIQualityControl(
175         CQualityControlPassThruImpl* This, IUnknown* punkControl,
176         CPinBaseImpl* pPin );
177 void CQualityControlPassThruImpl_UninitIQualityControl(
178         CQualityControlPassThruImpl* This );
179
180
181 HRESULT CPinBaseImpl_SendSample( CPinBaseImpl* This, IMediaSample* pSample );
182 HRESULT CPinBaseImpl_SendReceiveCanBlock( CPinBaseImpl* This );
183 HRESULT CPinBaseImpl_SendEndOfStream( CPinBaseImpl* This );
184 HRESULT CPinBaseImpl_SendBeginFlush( CPinBaseImpl* This );
185 HRESULT CPinBaseImpl_SendEndFlush( CPinBaseImpl* This );
186 HRESULT CPinBaseImpl_SendNewSegment( CPinBaseImpl* This, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
187
188
189 /***************************************************************************
190  *
191  *      handlers for output pins.
192  *
193  */
194
195 HRESULT OutputPinSync_Receive( CPinBaseImpl* pImpl, IMediaSample* pSample );
196 HRESULT OutputPinSync_ReceiveCanBlock( CPinBaseImpl* pImpl );
197 HRESULT OutputPinSync_EndOfStream( CPinBaseImpl* pImpl );
198 HRESULT OutputPinSync_BeginFlush( CPinBaseImpl* pImpl );
199 HRESULT OutputPinSync_EndFlush( CPinBaseImpl* pImpl );
200 HRESULT OutputPinSync_NewSegment( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
201
202 /***************************************************************************
203  *
204  *      handlers for output pins (async).
205  *
206  */
207
208 HRESULT OutputPinAsync_OnActive( CPinBaseImpl* pImpl );
209 HRESULT OutputPinAsync_OnInactive( CPinBaseImpl* pImpl );
210 HRESULT OutputPinAsync_Receive( CPinBaseImpl* pImpl, IMediaSample* pSample );
211 HRESULT OutputPinAsync_ReceiveCanBlock( CPinBaseImpl* pImpl );
212 HRESULT OutputPinAsync_EndOfStream( CPinBaseImpl* pImpl );
213 HRESULT OutputPinAsync_BeginFlush( CPinBaseImpl* pImpl );
214 HRESULT OutputPinAsync_EndFlush( CPinBaseImpl* pImpl );
215 HRESULT OutputPinAsync_NewSegment( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate );
216
217
218
219 #endif  /* WINE_DSHOW_BASEFILT_H */