xref: /reactos/sdk/include/reactos/wine/strmbase.h (revision fbbe3b38)
1 /*
2  * Header file for Wine's strmbase implementation
3  *
4  * Copyright 2003 Robert Shearman
5  * Copyright 2010 Aric Stewart, CodeWeavers
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21 
22 #pragma once
23 
24 #include "wine/list.h"
25 
26 HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE * pDest, const AM_MEDIA_TYPE *pSrc);
27 void WINAPI FreeMediaType(AM_MEDIA_TYPE * pMediaType);
28 AM_MEDIA_TYPE * WINAPI CreateMediaType(AM_MEDIA_TYPE const * pSrc);
29 void WINAPI DeleteMediaType(AM_MEDIA_TYPE * pMediaType);
30 
31 /* Pin functions */
32 
33 typedef struct BasePin
34 {
35 	IPin IPin_iface;
36 	LONG refCount;
37 	LPCRITICAL_SECTION pCritSec;
38 	PIN_INFO pinInfo;
39 	IPin * pConnectedTo;
40 	AM_MEDIA_TYPE mtCurrent;
41 	REFERENCE_TIME tStart;
42 	REFERENCE_TIME tStop;
43 	double dRate;
44 
45 	const struct BasePinFuncTable* pFuncsTable;
46 } BasePin;
47 
48 typedef HRESULT (WINAPI *BasePin_CheckMediaType)(BasePin *This, const AM_MEDIA_TYPE *pmt);
49 typedef HRESULT (WINAPI *BasePin_AttemptConnection)(BasePin *This, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt);
50 typedef LONG (WINAPI *BasePin_GetMediaTypeVersion)(BasePin *This);
51 typedef HRESULT (WINAPI *BasePin_GetMediaType)(BasePin *This, int iPosition, AM_MEDIA_TYPE *amt);
52 
53 typedef struct BasePinFuncTable {
54 	/* Required for Input Pins*/
55 	BasePin_CheckMediaType pfnCheckMediaType;
56 	/* Required for Output Pins*/
57 	BasePin_AttemptConnection pfnAttemptConnection;
58 	/* Required for BasePinImpl_EnumMediaTypes */
59 	BasePin_GetMediaTypeVersion pfnGetMediaTypeVersion;
60 	BasePin_GetMediaType pfnGetMediaType;
61 } BasePinFuncTable;
62 
63 typedef struct BaseOutputPin
64 {
65 	/* inheritance C style! */
66 	BasePin pin;
67 	IMemInputPin * pMemInputPin;
68 	IMemAllocator * pAllocator;
69 
70 	const struct BaseOutputPinFuncTable* pFuncsTable;
71 } BaseOutputPin;
72 
73 typedef HRESULT (WINAPI *BaseOutputPin_DecideBufferSize)(BaseOutputPin *This, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest);
74 typedef HRESULT (WINAPI *BaseOutputPin_DecideAllocator)(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc);
75 typedef HRESULT (WINAPI *BaseOutputPin_BreakConnect)(BaseOutputPin * This);
76 
77 typedef struct BaseOutputPinFuncTable {
78 	BasePinFuncTable base;
79 
80 	/* Required for BaseOutputPinImpl_DecideAllocator */
81 	BaseOutputPin_DecideBufferSize pfnDecideBufferSize;
82 	/* Required for BaseOutputPinImpl_AttemptConnection */
83 	BaseOutputPin_DecideAllocator pfnDecideAllocator;
84 	BaseOutputPin_BreakConnect pfnBreakConnect;
85 } BaseOutputPinFuncTable;
86 
87 typedef struct BaseInputPin
88 {
89 	/* inheritance C style! */
90 	BasePin pin;
91 
92 	IMemInputPin IMemInputPin_iface;
93 	IMemAllocator * pAllocator;
94 	BOOL flushing, end_of_stream;
95 	IMemAllocator *preferred_allocator;
96 
97 	const struct BaseInputPinFuncTable* pFuncsTable;
98 } BaseInputPin;
99 
100 typedef HRESULT (WINAPI *BaseInputPin_Receive)(BaseInputPin *This, IMediaSample *pSample);
101 
102 typedef struct BaseInputPinFuncTable {
103 	BasePinFuncTable base;
104 	/* Optional */
105 	BaseInputPin_Receive pfnReceive;
106 } BaseInputPinFuncTable;
107 
108 /* Base Pin */
109 HRESULT WINAPI BasePinImpl_GetMediaType(BasePin *This, int iPosition, AM_MEDIA_TYPE *pmt);
110 LONG WINAPI BasePinImpl_GetMediaTypeVersion(BasePin *This);
111 ULONG WINAPI BasePinImpl_AddRef(IPin * iface);
112 HRESULT WINAPI BasePinImpl_Disconnect(IPin * iface);
113 HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin);
114 HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt);
115 HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin * iface, PIN_INFO * pInfo);
116 HRESULT WINAPI BasePinImpl_QueryDirection(IPin * iface, PIN_DIRECTION * pPinDir);
117 HRESULT WINAPI BasePinImpl_QueryId(IPin * iface, LPWSTR * Id);
118 HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
119 HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin * iface, IEnumMediaTypes ** ppEnum);
120 HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin);
121 HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
122 
123 /* Base Output Pin */
124 HRESULT WINAPI BaseOutputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv);
125 ULONG WINAPI BaseOutputPinImpl_Release(IPin * iface);
126 HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
127 HRESULT WINAPI BaseOutputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
128 HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin * iface);
129 HRESULT WINAPI BaseOutputPinImpl_EndOfStream(IPin * iface);
130 HRESULT WINAPI BaseOutputPinImpl_BeginFlush(IPin * iface);
131 HRESULT WINAPI BaseOutputPinImpl_EndFlush(IPin * iface);
132 
133 HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin * This, IMediaSample ** ppSample, REFERENCE_TIME * tStart, REFERENCE_TIME * tStop, DWORD dwFlags);
134 HRESULT WINAPI BaseOutputPinImpl_Deliver(BaseOutputPin * This, IMediaSample * pSample);
135 HRESULT WINAPI BaseOutputPinImpl_BreakConnect(BaseOutputPin * This);
136 HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin * This);
137 HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin * This);
138 HRESULT WINAPI BaseOutputPinImpl_InitAllocator(BaseOutputPin *This, IMemAllocator **pMemAlloc);
139 HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc);
140 HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin *This, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
141 
142 HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO * pPinInfo, const BaseOutputPinFuncTable* pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin ** ppPin);
143 HRESULT WINAPI BaseOutputPin_Destroy(BaseOutputPin *This);
144 
145 /* Base Input Pin */
146 HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv);
147 ULONG   WINAPI BaseInputPinImpl_Release(IPin * iface);
148 HRESULT WINAPI BaseInputPinImpl_Connect(IPin * iface, IPin * pConnector, const AM_MEDIA_TYPE * pmt);
149 HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
150 HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
151 HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface);
152 HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface);
153 HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface);
154 HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
155 
156 HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO * pPinInfo,
157         const BaseInputPinFuncTable* pBaseInputFuncsTable,
158         LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin ** ppPin);
159 HRESULT WINAPI BaseInputPin_Destroy(BaseInputPin *This);
160 
161 typedef struct BaseFilter
162 {
163 	IBaseFilter IBaseFilter_iface;
164 	LONG refCount;
165 	CRITICAL_SECTION csFilter;
166 
167 	FILTER_STATE state;
168 	REFERENCE_TIME rtStreamStart;
169 	IReferenceClock * pClock;
170 	FILTER_INFO filterInfo;
171 	CLSID clsid;
172 	LONG pinVersion;
173 
174 	const struct BaseFilterFuncTable* pFuncsTable;
175 } BaseFilter;
176 
177 typedef IPin* (WINAPI *BaseFilter_GetPin)(BaseFilter* iface, int iPosition);
178 typedef LONG (WINAPI *BaseFilter_GetPinCount)(BaseFilter* iface);
179 typedef LONG (WINAPI *BaseFilter_GetPinVersion)(BaseFilter* iface);
180 
181 typedef struct BaseFilterFuncTable {
182 	/* Required */
183 	BaseFilter_GetPin pfnGetPin;
184 	BaseFilter_GetPinCount pfnGetPinCount;
185 } BaseFilterFuncTable;
186 
187 HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv);
188 ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter * iface);
189 ULONG WINAPI BaseFilterImpl_Release(IBaseFilter * iface);
190 HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter * iface, CLSID * pClsid);
191 HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState );
192 HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock);
193 HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock);
194 HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum);
195 HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo);
196 HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName );
197 HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo);
198 
199 LONG WINAPI BaseFilterImpl_GetPinVersion(BaseFilter* This);
200 VOID WINAPI BaseFilterImpl_IncrementPinVersion(BaseFilter* This);
201 
202 HRESULT WINAPI BaseFilter_Init(BaseFilter * This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable* pBaseFuncsTable);
203 HRESULT WINAPI BaseFilter_Destroy(BaseFilter * This);
204 
205 /* Enums */
206 HRESULT WINAPI EnumMediaTypes_Construct(BasePin *iface, BasePin_GetMediaType enumFunc, BasePin_GetMediaTypeVersion versionFunc, IEnumMediaTypes ** ppEnum);
207 
208 HRESULT WINAPI EnumPins_Construct(BaseFilter *base,  BaseFilter_GetPin receive_pin, BaseFilter_GetPinCount receive_pincount, BaseFilter_GetPinVersion receive_version, IEnumPins ** ppEnum);
209 
210 /* Transform Filter */
211 typedef struct TransformFilter
212 {
213 	BaseFilter filter;
214 
215 	IPin **ppPins;
216 	ULONG npins;
217 	AM_MEDIA_TYPE pmt;
218 	CRITICAL_SECTION csReceive;
219 
220 	const struct TransformFilterFuncTable * pFuncsTable;
221 	struct QualityControlImpl *qcimpl;
222         /* IMediaSeeking and IMediaPosition are implemented by ISeekingPassThru */
223         IUnknown *seekthru_unk;
224 } TransformFilter;
225 
226 typedef HRESULT (WINAPI *TransformFilter_DecideBufferSize) (TransformFilter *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest);
227 typedef HRESULT (WINAPI *TransformFilter_StartStreaming) (TransformFilter *iface);
228 typedef HRESULT (WINAPI *TransformFilter_StopStreaming) (TransformFilter *iface);
229 typedef HRESULT (WINAPI *TransformFilter_Receive) (TransformFilter* iface, IMediaSample* pIn);
230 typedef HRESULT (WINAPI *TransformFilter_CompleteConnect) (TransformFilter *iface, PIN_DIRECTION dir, IPin *pPin);
231 typedef HRESULT (WINAPI *TransformFilter_BreakConnect) (TransformFilter *iface, PIN_DIRECTION dir);
232 typedef HRESULT (WINAPI *TransformFilter_SetMediaType) (TransformFilter *iface, PIN_DIRECTION dir, const AM_MEDIA_TYPE *pMediaType);
233 typedef HRESULT (WINAPI *TransformFilter_CheckInputType) (TransformFilter *iface, const AM_MEDIA_TYPE *pMediaType);
234 typedef HRESULT (WINAPI *TransformFilter_EndOfStream) (TransformFilter *iface);
235 typedef HRESULT (WINAPI *TransformFilter_BeginFlush) (TransformFilter *iface);
236 typedef HRESULT (WINAPI *TransformFilter_EndFlush) (TransformFilter *iface);
237 typedef HRESULT (WINAPI *TransformFilter_NewSegment) (TransformFilter *iface,
238 REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
239 typedef HRESULT (WINAPI *TransformFilter_Notify) (TransformFilter *iface, IBaseFilter *sender, Quality qm);
240 
241 typedef struct TransformFilterFuncTable {
242 	/* Required */
243 	TransformFilter_DecideBufferSize pfnDecideBufferSize;
244 	/* Optional */
245 	TransformFilter_StartStreaming pfnStartStreaming;
246 	TransformFilter_Receive pfnReceive;
247 	TransformFilter_StopStreaming pfnStopStreaming;
248 	TransformFilter_CheckInputType pfnCheckInputType;
249 	TransformFilter_SetMediaType pfnSetMediaType;
250 	TransformFilter_CompleteConnect pfnCompleteConnect;
251 	TransformFilter_BreakConnect pfnBreakConnect;
252 	TransformFilter_EndOfStream pfnEndOfStream;
253 	TransformFilter_BeginFlush pfnBeginFlush;
254 	TransformFilter_EndFlush pfnEndFlush;
255 	TransformFilter_NewSegment pfnNewSegment;
256 	TransformFilter_Notify pfnNotify;
257 } TransformFilterFuncTable;
258 
259 HRESULT WINAPI TransformFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv);
260 ULONG WINAPI TransformFilterImpl_Release(IBaseFilter * iface);
261 HRESULT WINAPI TransformFilterImpl_Stop(IBaseFilter * iface);
262 HRESULT WINAPI TransformFilterImpl_Pause(IBaseFilter * iface);
263 HRESULT WINAPI TransformFilterImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart);
264 HRESULT WINAPI TransformFilterImpl_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin);
265 HRESULT WINAPI TransformFilterImpl_Notify(TransformFilter *iface, IBaseFilter *sender, Quality qm);
266 
267 HRESULT TransformFilter_Construct( const IBaseFilterVtbl *filterVtbl, LONG filter_size, const CLSID* pClsid, const TransformFilterFuncTable* pFuncsTable, IBaseFilter ** ppTransformFilter);
268 
269 /* Source Seeking */
270 typedef HRESULT (WINAPI *SourceSeeking_ChangeRate)(IMediaSeeking *iface);
271 typedef HRESULT (WINAPI *SourceSeeking_ChangeStart)(IMediaSeeking *iface);
272 typedef HRESULT (WINAPI *SourceSeeking_ChangeStop)(IMediaSeeking *iface);
273 
274 typedef struct SourceSeeking
275 {
276 	IMediaSeeking IMediaSeeking_iface;
277 
278 	ULONG refCount;
279 	SourceSeeking_ChangeStop fnChangeStop;
280 	SourceSeeking_ChangeStart fnChangeStart;
281 	SourceSeeking_ChangeRate fnChangeRate;
282 	DWORD dwCapabilities;
283 	double dRate;
284 	LONGLONG llCurrent, llStop, llDuration;
285 	GUID timeformat;
286 	PCRITICAL_SECTION crst;
287 } SourceSeeking;
288 
289 HRESULT SourceSeeking_Init(SourceSeeking *pSeeking, const IMediaSeekingVtbl *Vtbl, SourceSeeking_ChangeStop fnChangeStop, SourceSeeking_ChangeStart fnChangeStart, SourceSeeking_ChangeRate fnChangeRate, PCRITICAL_SECTION crit_sect);
290 
291 HRESULT WINAPI SourceSeekingImpl_GetCapabilities(IMediaSeeking * iface, DWORD * pCapabilities);
292 HRESULT WINAPI SourceSeekingImpl_CheckCapabilities(IMediaSeeking * iface, DWORD * pCapabilities);
293 HRESULT WINAPI SourceSeekingImpl_IsFormatSupported(IMediaSeeking * iface, const GUID * pFormat);
294 HRESULT WINAPI SourceSeekingImpl_QueryPreferredFormat(IMediaSeeking * iface, GUID * pFormat);
295 HRESULT WINAPI SourceSeekingImpl_GetTimeFormat(IMediaSeeking * iface, GUID * pFormat);
296 HRESULT WINAPI SourceSeekingImpl_IsUsingTimeFormat(IMediaSeeking * iface, const GUID * pFormat);
297 HRESULT WINAPI SourceSeekingImpl_SetTimeFormat(IMediaSeeking * iface, const GUID * pFormat);
298 HRESULT WINAPI SourceSeekingImpl_GetDuration(IMediaSeeking * iface, LONGLONG * pDuration);
299 HRESULT WINAPI SourceSeekingImpl_GetStopPosition(IMediaSeeking * iface, LONGLONG * pStop);
300 HRESULT WINAPI SourceSeekingImpl_GetCurrentPosition(IMediaSeeking * iface, LONGLONG * pCurrent);
301 HRESULT WINAPI SourceSeekingImpl_ConvertTimeFormat(IMediaSeeking * iface, LONGLONG * pTarget, const GUID * pTargetFormat, LONGLONG Source, const GUID * pSourceFormat);
302 HRESULT WINAPI SourceSeekingImpl_SetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, DWORD dwCurrentFlags, LONGLONG * pStop, DWORD dwStopFlags);
303 HRESULT WINAPI SourceSeekingImpl_GetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, LONGLONG * pStop);
304 HRESULT WINAPI SourceSeekingImpl_GetAvailable(IMediaSeeking * iface, LONGLONG * pEarliest, LONGLONG * pLatest);
305 HRESULT WINAPI SourceSeekingImpl_SetRate(IMediaSeeking * iface, double dRate);
306 HRESULT WINAPI SourceSeekingImpl_GetRate(IMediaSeeking * iface, double * dRate);
307 HRESULT WINAPI SourceSeekingImpl_GetPreroll(IMediaSeeking * iface, LONGLONG * pPreroll);
308 
309 /* PosPassThru */
310 HRESULT WINAPI RendererPosPassThru_RegisterMediaTime(IUnknown *iface, REFERENCE_TIME start);
311 HRESULT WINAPI RendererPosPassThru_ResetMediaTime(IUnknown *iface);
312 HRESULT WINAPI RendererPosPassThru_EOS(IUnknown *iface);
313 
314 HRESULT WINAPI CreatePosPassThru(IUnknown* pUnkOuter, BOOL bRenderer, IPin *pPin, IUnknown **ppPassThru);
315 HRESULT WINAPI PosPassThru_Construct(IUnknown* pUnkOuter, LPVOID *ppPassThru);
316 
317 /* Filter Registration */
318 
319 typedef REGPINTYPES AMOVIESETUP_MEDIATYPE;
320 typedef REGFILTERPINS AMOVIESETUP_PIN;
321 
322 typedef struct AMOVIESETUP_FILTER {
323 	const CLSID *clsid;
324 	const WCHAR *name;
325 	DWORD merit;
326 	UINT pins;
327 	const AMOVIESETUP_PIN *pPin;
328 } AMOVIESETUP_FILTER, *LPAMOVIESETUP_FILTER;
329 
330 typedef IUnknown *(CALLBACK *LPFNNewCOMObject)(LPUNKNOWN pUnkOuter, HRESULT *phr);
331 typedef void (CALLBACK *LPFNInitRoutine)(BOOL bLoading, const CLSID *rclsid);
332 
333 typedef struct tagFactoryTemplate {
334 	const WCHAR *m_Name;
335 	const CLSID *m_ClsID;
336 	LPFNNewCOMObject m_lpfnNew;
337 	LPFNInitRoutine m_lpfnInit;
338 	const AMOVIESETUP_FILTER *m_pAMovieSetup_Filter;
339 } FactoryTemplate;
340 
341 HRESULT WINAPI AMovieDllRegisterServer2(BOOL bRegister);
342 HRESULT WINAPI AMovieSetupRegisterFilter2(const AMOVIESETUP_FILTER *pFilter, IFilterMapper2  *pIFM2, BOOL  bRegister);
343 
344 /* Output Queue */
345 typedef struct tagOutputQueue {
346     CRITICAL_SECTION csQueue;
347 
348     BaseOutputPin * pInputPin;
349 
350     HANDLE hThread;
351     HANDLE hProcessQueue;
352 
353     LONG lBatchSize;
354     BOOL bBatchExact;
355     BOOL bTerminate;
356     BOOL bSendAnyway;
357 
358     struct list SampleList;
359 
360     const struct OutputQueueFuncTable* pFuncsTable;
361 } OutputQueue;
362 
363 typedef DWORD (WINAPI *OutputQueue_ThreadProc)(OutputQueue *This);
364 
365 typedef struct OutputQueueFuncTable
366 {
367     OutputQueue_ThreadProc pfnThreadProc;
368 } OutputQueueFuncTable;
369 
370 HRESULT WINAPI OutputQueue_Construct( BaseOutputPin *pInputPin, BOOL bAuto,
371     BOOL bQueue, LONG lBatchSize, BOOL bBatchExact, DWORD dwPriority,
372     const OutputQueueFuncTable* pFuncsTable, OutputQueue **ppOutputQueue );
373 HRESULT WINAPI OutputQueue_Destroy(OutputQueue *pOutputQueue);
374 HRESULT WINAPI OutputQueue_ReceiveMultiple(OutputQueue *pOutputQueue, IMediaSample **ppSamples, LONG nSamples, LONG *nSamplesProcessed);
375 HRESULT WINAPI OutputQueue_Receive(OutputQueue *pOutputQueue, IMediaSample *pSample);
376 VOID WINAPI OutputQueue_EOS(OutputQueue *pOutputQueue);
377 VOID WINAPI OutputQueue_SendAnyway(OutputQueue *pOutputQueue);
378 DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue);
379 
380 typedef struct tagBaseWindow
381 {
382 	HWND hWnd;
383 	LONG Width;
384 	LONG Height;
385 	HINSTANCE hInstance;
386 	LPWSTR pClassName;
387 	DWORD ClassStyles;
388 	DWORD WindowStyles;
389 	DWORD WindowStylesEx;
390 	HDC hDC;
391 
392 	const struct BaseWindowFuncTable* pFuncsTable;
393 } BaseWindow;
394 
395 typedef LPWSTR (WINAPI *BaseWindow_GetClassWindowStyles)(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx);
396 typedef RECT (WINAPI *BaseWindow_GetDefaultRect)(BaseWindow *This);
397 typedef BOOL (WINAPI *BaseWindow_PossiblyEatMessage)(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam);
398 typedef LRESULT (WINAPI *BaseWindow_OnReceiveMessage)(BaseWindow *This, HWND hwnd, INT uMsg, WPARAM wParam, LPARAM lParam);
399 typedef BOOL (WINAPI *BaseWindow_OnSize)(BaseWindow *This, LONG Height, LONG Width);
400 
401 typedef struct BaseWindowFuncTable
402 {
403 	/* Required */
404 	BaseWindow_GetClassWindowStyles pfnGetClassWindowStyles;
405 	BaseWindow_GetDefaultRect pfnGetDefaultRect;
406 	/* Optional, WinProc Related */
407 	BaseWindow_OnReceiveMessage pfnOnReceiveMessage;
408 	BaseWindow_PossiblyEatMessage pfnPossiblyEatMessage;
409 	BaseWindow_OnSize pfnOnSize;
410 } BaseWindowFuncTable;
411 
412 HRESULT WINAPI BaseWindow_Init(BaseWindow *pBaseWindow, const BaseWindowFuncTable* pFuncsTable);
413 HRESULT WINAPI BaseWindow_Destroy(BaseWindow *pBaseWindow);
414 
415 HRESULT WINAPI BaseWindowImpl_PrepareWindow(BaseWindow *This);
416 HRESULT WINAPI BaseWindowImpl_DoneWithWindow(BaseWindow *This);
417 RECT WINAPI BaseWindowImpl_GetDefaultRect(BaseWindow *This);
418 LRESULT WINAPI BaseWindowImpl_OnReceiveMessage(BaseWindow *This, HWND hwnd, INT uMsg, WPARAM wParam, LPARAM lParam);
419 BOOL WINAPI BaseWindowImpl_OnSize(BaseWindow *This, LONG Height, LONG Width);
420 
421 typedef struct{
422     ITypeInfo *pTypeInfo;
423 } BaseDispatch;
424 
425 HRESULT WINAPI BaseDispatch_Init(BaseDispatch *This, REFIID riid);
426 HRESULT WINAPI BaseDispatch_Destroy(BaseDispatch *This);
427 HRESULT WINAPI BaseDispatchImpl_GetIDsOfNames(BaseDispatch *This, REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid);
428 HRESULT WINAPI BaseDispatchImpl_GetTypeInfo(BaseDispatch *This, REFIID riid, UINT itinfo, LCID lcid, ITypeInfo **pptinfo);
429 HRESULT WINAPI BaseDispatchImpl_GetTypeInfoCount(BaseDispatch *This, UINT *pctinfo);
430 
431 #ifdef __IVideoWindow_FWD_DEFINED__
432 typedef struct tagBaseControlWindow
433 {
434 	BaseWindow baseWindow;
435 	IVideoWindow IVideoWindow_iface;
436 	BaseDispatch baseDispatch;
437 
438 	BOOL AutoShow;
439 	HWND hwndDrain;
440 	HWND hwndOwner;
441 	BaseFilter* pFilter;
442 	CRITICAL_SECTION* pInterfaceLock;
443 	BasePin*  pPin;
444 } BaseControlWindow;
445 
446 HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, const IVideoWindowVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin* pPin, const BaseWindowFuncTable* pFuncsTable);
447 HRESULT WINAPI BaseControlWindow_Destroy(BaseControlWindow *pControlWindow);
448 
449 BOOL WINAPI BaseControlWindowImpl_PossiblyEatMessage(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam);
450 HRESULT WINAPI BaseControlWindowImpl_GetTypeInfoCount(IVideoWindow *iface, UINT*pctinfo);
451 HRESULT WINAPI BaseControlWindowImpl_GetTypeInfo(IVideoWindow *iface, UINT iTInfo, LCID lcid, ITypeInfo**ppTInfo);
452 HRESULT WINAPI BaseControlWindowImpl_GetIDsOfNames(IVideoWindow *iface, REFIID riid, LPOLESTR*rgszNames, UINT cNames, LCID lcid, DISPID*rgDispId);
453 HRESULT WINAPI BaseControlWindowImpl_Invoke(IVideoWindow *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS*pDispParams, VARIANT*pVarResult, EXCEPINFO*pExepInfo, UINT*puArgErr);
454 HRESULT WINAPI BaseControlWindowImpl_put_Caption(IVideoWindow *iface, BSTR strCaption);
455 HRESULT WINAPI BaseControlWindowImpl_get_Caption(IVideoWindow *iface, BSTR *strCaption);
456 HRESULT WINAPI BaseControlWindowImpl_put_WindowStyle(IVideoWindow *iface, LONG WindowStyle);
457 HRESULT WINAPI BaseControlWindowImpl_get_WindowStyle(IVideoWindow *iface, LONG *WindowStyle);
458 HRESULT WINAPI BaseControlWindowImpl_put_WindowStyleEx(IVideoWindow *iface, LONG WindowStyleEx);
459 HRESULT WINAPI BaseControlWindowImpl_get_WindowStyleEx(IVideoWindow *iface, LONG *WindowStyleEx);
460 HRESULT WINAPI BaseControlWindowImpl_put_AutoShow(IVideoWindow *iface, LONG AutoShow);
461 HRESULT WINAPI BaseControlWindowImpl_get_AutoShow(IVideoWindow *iface, LONG *AutoShow);
462 HRESULT WINAPI BaseControlWindowImpl_put_WindowState(IVideoWindow *iface, LONG WindowState);
463 HRESULT WINAPI BaseControlWindowImpl_get_WindowState(IVideoWindow *iface, LONG *WindowState);
464 HRESULT WINAPI BaseControlWindowImpl_put_BackgroundPalette(IVideoWindow *iface, LONG BackgroundPalette);
465 HRESULT WINAPI BaseControlWindowImpl_get_BackgroundPalette(IVideoWindow *iface, LONG *pBackgroundPalette);
466 HRESULT WINAPI BaseControlWindowImpl_put_Visible(IVideoWindow *iface, LONG Visible);
467 HRESULT WINAPI BaseControlWindowImpl_get_Visible(IVideoWindow *iface, LONG *pVisible);
468 HRESULT WINAPI BaseControlWindowImpl_put_Left(IVideoWindow *iface, LONG Left);
469 HRESULT WINAPI BaseControlWindowImpl_get_Left(IVideoWindow *iface, LONG *pLeft);
470 HRESULT WINAPI BaseControlWindowImpl_put_Width(IVideoWindow *iface, LONG Width);
471 HRESULT WINAPI BaseControlWindowImpl_get_Width(IVideoWindow *iface, LONG *pWidth);
472 HRESULT WINAPI BaseControlWindowImpl_put_Top(IVideoWindow *iface, LONG Top);
473 HRESULT WINAPI BaseControlWindowImpl_get_Top(IVideoWindow *iface, LONG *pTop);
474 
475 HRESULT WINAPI BaseControlWindowImpl_put_Height(IVideoWindow *iface, LONG Height);
476 HRESULT WINAPI BaseControlWindowImpl_get_Height(IVideoWindow *iface, LONG *pHeight);
477 HRESULT WINAPI BaseControlWindowImpl_put_Owner(IVideoWindow *iface, OAHWND Owner);
478 HRESULT WINAPI BaseControlWindowImpl_get_Owner(IVideoWindow *iface, OAHWND *Owner);
479 HRESULT WINAPI BaseControlWindowImpl_put_MessageDrain(IVideoWindow *iface, OAHWND Drain);
480 HRESULT WINAPI BaseControlWindowImpl_get_MessageDrain(IVideoWindow *iface, OAHWND *Drain);
481 HRESULT WINAPI BaseControlWindowImpl_get_BorderColor(IVideoWindow *iface, LONG *Color);
482 HRESULT WINAPI BaseControlWindowImpl_put_BorderColor(IVideoWindow *iface, LONG Color);
483 HRESULT WINAPI BaseControlWindowImpl_get_FullScreenMode(IVideoWindow *iface, LONG *FullScreenMode);
484 HRESULT WINAPI BaseControlWindowImpl_put_FullScreenMode(IVideoWindow *iface, LONG FullScreenMode);
485 HRESULT WINAPI BaseControlWindowImpl_SetWindowForeground(IVideoWindow *iface, LONG Focus);
486 HRESULT WINAPI BaseControlWindowImpl_SetWindowPosition(IVideoWindow *iface, LONG Left, LONG Top, LONG Width, LONG Height);
487 HRESULT WINAPI BaseControlWindowImpl_GetWindowPosition(IVideoWindow *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight);
488 HRESULT WINAPI BaseControlWindowImpl_NotifyOwnerMessage(IVideoWindow *iface, OAHWND hwnd, LONG uMsg, LONG_PTR wParam, LONG_PTR lParam);
489 HRESULT WINAPI BaseControlWindowImpl_GetMinIdealImageSize(IVideoWindow *iface, LONG *pWidth, LONG *pHeight);
490 HRESULT WINAPI BaseControlWindowImpl_GetMaxIdealImageSize(IVideoWindow *iface, LONG *pWidth, LONG *pHeight);
491 HRESULT WINAPI BaseControlWindowImpl_GetRestorePosition(IVideoWindow *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight);
492 HRESULT WINAPI BaseControlWindowImpl_HideCursor(IVideoWindow *iface, LONG HideCursor);
493 HRESULT WINAPI BaseControlWindowImpl_IsCursorHidden(IVideoWindow *iface, LONG *CursorHidden);
494 #endif
495 
496 #ifdef __IBasicVideo_FWD_DEFINED__
497 #ifdef __amvideo_h__
498 typedef struct tagBaseControlVideo
499 {
500 	IBasicVideo IBasicVideo_iface;
501 	BaseDispatch baseDispatch;
502 
503 	BaseFilter* pFilter;
504 	CRITICAL_SECTION* pInterfaceLock;
505 	BasePin*  pPin;
506 
507 	const struct BaseControlVideoFuncTable* pFuncsTable;
508 } BaseControlVideo;
509 
510 typedef HRESULT (WINAPI *BaseControlVideo_GetSourceRect)(BaseControlVideo* This, RECT *pSourceRect);
511 typedef HRESULT (WINAPI *BaseControlVideo_GetStaticImage)(BaseControlVideo* This, LONG *pBufferSize, LONG *pDIBImage);
512 typedef HRESULT (WINAPI *BaseControlVideo_GetTargetRect)(BaseControlVideo* This, RECT *pTargetRect);
513 typedef VIDEOINFOHEADER* (WINAPI *BaseControlVideo_GetVideoFormat)(BaseControlVideo* This);
514 typedef HRESULT (WINAPI *BaseControlVideo_IsDefaultSourceRect)(BaseControlVideo* This);
515 typedef HRESULT (WINAPI *BaseControlVideo_IsDefaultTargetRect)(BaseControlVideo* This);
516 typedef HRESULT (WINAPI *BaseControlVideo_SetDefaultSourceRect)(BaseControlVideo* This);
517 typedef HRESULT (WINAPI *BaseControlVideo_SetDefaultTargetRect)(BaseControlVideo* This);
518 typedef HRESULT (WINAPI *BaseControlVideo_SetSourceRect)(BaseControlVideo* This, RECT *pSourceRect);
519 typedef HRESULT (WINAPI *BaseControlVideo_SetTargetRect)(BaseControlVideo* This, RECT *pTargetRect);
520 
521 typedef struct BaseControlVideoFuncTable {
522 	/* Required */
523 	BaseControlVideo_GetSourceRect pfnGetSourceRect;
524 	BaseControlVideo_GetStaticImage pfnGetStaticImage;
525 	BaseControlVideo_GetTargetRect pfnGetTargetRect;
526 	BaseControlVideo_GetVideoFormat pfnGetVideoFormat;
527 	BaseControlVideo_IsDefaultSourceRect pfnIsDefaultSourceRect;
528 	BaseControlVideo_IsDefaultTargetRect pfnIsDefaultTargetRect;
529 	BaseControlVideo_SetDefaultSourceRect pfnSetDefaultSourceRect;
530 	BaseControlVideo_SetDefaultTargetRect pfnSetDefaultTargetRect;
531 	BaseControlVideo_SetSourceRect pfnSetSourceRect;
532 	BaseControlVideo_SetTargetRect pfnSetTargetRect;
533 } BaseControlVideoFuncTable;
534 
535 HRESULT WINAPI BaseControlVideo_Init(BaseControlVideo *pControlVideo, const IBasicVideoVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin* pPin, const BaseControlVideoFuncTable* pFuncsTable);
536 HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo);
537 
538 HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount(IBasicVideo *iface, UINT*pctinfo);
539 HRESULT WINAPI BaseControlVideoImpl_GetTypeInfo(IBasicVideo *iface, UINT iTInfo, LCID lcid, ITypeInfo**ppTInfo);
540 HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames(IBasicVideo *iface, REFIID riid, LPOLESTR*rgszNames, UINT cNames, LCID lcid, DISPID*rgDispId);
541 HRESULT WINAPI BaseControlVideoImpl_Invoke(IBasicVideo *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS*pDispParams, VARIANT*pVarResult, EXCEPINFO*pExepInfo, UINT*puArgErr);
542 HRESULT WINAPI BaseControlVideoImpl_get_AvgTimePerFrame(IBasicVideo *iface, REFTIME *pAvgTimePerFrame);
543 HRESULT WINAPI BaseControlVideoImpl_get_BitRate(IBasicVideo *iface, LONG *pBitRate);
544 HRESULT WINAPI BaseControlVideoImpl_get_BitErrorRate(IBasicVideo *iface, LONG *pBitErrorRate);
545 HRESULT WINAPI BaseControlVideoImpl_get_VideoWidth(IBasicVideo *iface, LONG *pVideoWidth);
546 HRESULT WINAPI BaseControlVideoImpl_get_VideoHeight(IBasicVideo *iface, LONG *pVideoHeight);
547 HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG SourceLeft);
548 HRESULT WINAPI BaseControlVideoImpl_get_SourceLeft(IBasicVideo *iface, LONG *pSourceLeft);
549 HRESULT WINAPI BaseControlVideoImpl_put_SourceWidth(IBasicVideo *iface, LONG SourceWidth);
550 HRESULT WINAPI BaseControlVideoImpl_get_SourceWidth(IBasicVideo *iface, LONG *pSourceWidth);
551 HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG SourceTop);
552 HRESULT WINAPI BaseControlVideoImpl_get_SourceTop(IBasicVideo *iface, LONG *pSourceTop);
553 HRESULT WINAPI BaseControlVideoImpl_put_SourceHeight(IBasicVideo *iface, LONG SourceHeight);
554 HRESULT WINAPI BaseControlVideoImpl_get_SourceHeight(IBasicVideo *iface, LONG *pSourceHeight);
555 HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG DestinationLeft);
556 HRESULT WINAPI BaseControlVideoImpl_get_DestinationLeft(IBasicVideo *iface, LONG *pDestinationLeft);
557 HRESULT WINAPI BaseControlVideoImpl_put_DestinationWidth(IBasicVideo *iface, LONG DestinationWidth);
558 HRESULT WINAPI BaseControlVideoImpl_get_DestinationWidth(IBasicVideo *iface, LONG *pDestinationWidth);
559 HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG DestinationTop);
560 HRESULT WINAPI BaseControlVideoImpl_get_DestinationTop(IBasicVideo *iface, LONG *pDestinationTop);
561 HRESULT WINAPI BaseControlVideoImpl_put_DestinationHeight(IBasicVideo *iface, LONG DestinationHeight);
562 HRESULT WINAPI BaseControlVideoImpl_get_DestinationHeight(IBasicVideo *iface, LONG *pDestinationHeight);
563 HRESULT WINAPI BaseControlVideoImpl_SetSourcePosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height);
564 HRESULT WINAPI BaseControlVideoImpl_GetSourcePosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight);
565 HRESULT WINAPI BaseControlVideoImpl_SetDefaultSourcePosition(IBasicVideo *iface);
566 HRESULT WINAPI BaseControlVideoImpl_SetDestinationPosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height);
567 HRESULT WINAPI BaseControlVideoImpl_GetDestinationPosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight);
568 HRESULT WINAPI BaseControlVideoImpl_SetDefaultDestinationPosition(IBasicVideo *iface);
569 HRESULT WINAPI BaseControlVideoImpl_GetVideoSize(IBasicVideo *iface, LONG *pWidth, LONG *pHeight);
570 HRESULT WINAPI BaseControlVideoImpl_GetVideoPaletteEntries(IBasicVideo *iface, LONG StartIndex, LONG Entries, LONG *pRetrieved, LONG *pPalette);
571 HRESULT WINAPI BaseControlVideoImpl_GetCurrentImage(IBasicVideo *iface, LONG *pBufferSize, LONG *pDIBImage);
572 HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultSource(IBasicVideo *iface);
573 HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultDestination(IBasicVideo *iface);
574 #endif
575 #endif
576 
577 /* BaseRenderer Filter */
578 typedef struct BaseRendererTag
579 {
580 	BaseFilter filter;
581 
582 	BaseInputPin *pInputPin;
583 	IUnknown *pPosition;
584 	CRITICAL_SECTION csRenderLock;
585 	HANDLE evComplete;
586 	HANDLE ThreadSignal;
587 	HANDLE RenderEvent;
588 	IMediaSample *pMediaSample;
589 
590 	IQualityControl *pQSink;
591 	struct QualityControlImpl *qcimpl;
592 
593 	const struct BaseRendererFuncTable * pFuncsTable;
594 } BaseRenderer;
595 
596 typedef HRESULT (WINAPI *BaseRenderer_CheckMediaType)(BaseRenderer *This, const AM_MEDIA_TYPE *pmt);
597 typedef HRESULT (WINAPI *BaseRenderer_DoRenderSample)(BaseRenderer *This, IMediaSample *pMediaSample);
598 typedef VOID (WINAPI *BaseRenderer_OnReceiveFirstSample)(BaseRenderer *This, IMediaSample *pMediaSample);
599 typedef VOID (WINAPI *BaseRenderer_OnRenderEnd)(BaseRenderer *This, IMediaSample *pMediaSample);
600 typedef VOID (WINAPI *BaseRenderer_OnRenderStart)(BaseRenderer *This, IMediaSample *pMediaSample);
601 typedef VOID (WINAPI *BaseRenderer_OnStartStreaming)(BaseRenderer *This);
602 typedef VOID (WINAPI *BaseRenderer_OnStopStreaming)(BaseRenderer *This);
603 typedef VOID (WINAPI *BaseRenderer_OnWaitEnd)(BaseRenderer *This);
604 typedef VOID (WINAPI *BaseRenderer_OnWaitStart)(BaseRenderer *This);
605 typedef VOID (WINAPI *BaseRenderer_PrepareRender)(BaseRenderer *This);
606 typedef HRESULT (WINAPI *BaseRenderer_ShouldDrawSampleNow)(BaseRenderer *This, IMediaSample *pMediaSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime);
607 typedef HRESULT (WINAPI *BaseRenderer_PrepareReceive)(BaseRenderer *This, IMediaSample *pMediaSample);
608 typedef HRESULT (WINAPI *BaseRenderer_EndOfStream)(BaseRenderer *This);
609 typedef HRESULT (WINAPI *BaseRenderer_BeginFlush) (BaseRenderer *This);
610 typedef HRESULT (WINAPI *BaseRenderer_EndFlush) (BaseRenderer *This);
611 typedef HRESULT (WINAPI *BaseRenderer_BreakConnect) (BaseRenderer *This);
612 typedef HRESULT (WINAPI *BaseRenderer_CompleteConnect) (BaseRenderer *This, IPin *pReceivePin);
613 
614 typedef struct BaseRendererFuncTable {
615 	/* Required */
616 	BaseRenderer_CheckMediaType pfnCheckMediaType;
617 	BaseRenderer_DoRenderSample pfnDoRenderSample;
618 	/* Optional, Data Handlers */
619 	BaseRenderer_OnReceiveFirstSample  pfnOnReceiveFirstSample;
620 	BaseRenderer_OnRenderEnd  pfnOnRenderEnd;
621 	BaseRenderer_OnRenderStart  pfnOnRenderStart;
622 	BaseRenderer_OnStartStreaming  pfnOnStartStreaming;
623 	BaseRenderer_OnStopStreaming  pfnOnStopStreaming;
624 	BaseRenderer_OnWaitEnd  pfnOnWaitEnd;
625 	BaseRenderer_OnWaitStart  pfnOnWaitStart;
626 	BaseRenderer_PrepareRender  pfnPrepareRender;
627 	BaseRenderer_ShouldDrawSampleNow  pfnShouldDrawSampleNow;
628 	BaseRenderer_PrepareReceive pfnPrepareReceive;
629 	/* Optional, Input Pin */
630 	BaseRenderer_CompleteConnect pfnCompleteConnect;
631 	BaseRenderer_BreakConnect pfnBreakConnect;
632 	BaseRenderer_EndOfStream pfnEndOfStream;
633 	BaseRenderer_BeginFlush pfnBeginFlush;
634 	BaseRenderer_EndFlush pfnEndFlush;
635 } BaseRendererFuncTable;
636 
637 HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv);
638 ULONG   WINAPI BaseRendererImpl_Release(IBaseFilter * iface);
639 HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSample);
640 HRESULT WINAPI BaseRendererImpl_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin);
641 HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter * iface);
642 HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart);
643 HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter * iface);
644 HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock);
645 HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState);
646 HRESULT WINAPI BaseRendererImpl_EndOfStream(BaseRenderer* iface);
647 HRESULT WINAPI BaseRendererImpl_BeginFlush(BaseRenderer* iface);
648 HRESULT WINAPI BaseRendererImpl_EndFlush(BaseRenderer* iface);
649 HRESULT WINAPI BaseRendererImpl_ClearPendingSample(BaseRenderer *iface);
650 
651 HRESULT WINAPI BaseRenderer_Init(BaseRenderer *This, const IBaseFilterVtbl *Vtbl, IUnknown *pUnkOuter, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseRendererFuncTable* pBaseFuncsTable);
652 
653 #ifdef __IBasicAudio_FWD_DEFINED__
654 typedef struct tagBasicAudio
655 {
656 	IBasicAudio IBasicAudio_iface;
657 	BaseDispatch baseDispatch;
658 } BasicAudio;
659 
660 HRESULT WINAPI BasicAudio_Init(BasicAudio *This, const IBasicAudioVtbl *Vtbl);
661 HRESULT WINAPI BasicAudio_Destroy(BasicAudio *pBasicAudio);
662 
663 HRESULT WINAPI BasicAudioImpl_GetTypeInfoCount(IBasicAudio *iface, UINT*pctinfo);
664 HRESULT WINAPI BasicAudioImpl_GetTypeInfo(IBasicAudio *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
665 HRESULT WINAPI BasicAudioImpl_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
666 HRESULT WINAPI BasicAudioImpl_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr);
667 #endif
668 
669 /* Dll Functions */
670 BOOL WINAPI STRMBASE_DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv);
671 HRESULT WINAPI STRMBASE_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv);
672 HRESULT WINAPI STRMBASE_DllCanUnloadNow(void);
673