2 * Header file for Wine's strmbase implementation
4 * Copyright 2003 Robert Shearman
5 * Copyright 2010 Aric Stewart, CodeWeavers
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.
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.
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
22 HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE * pDest, const AM_MEDIA_TYPE *pSrc);
23 void WINAPI FreeMediaType(AM_MEDIA_TYPE * pMediaType);
24 AM_MEDIA_TYPE * WINAPI CreateMediaType(AM_MEDIA_TYPE const * pSrc);
25 void WINAPI DeleteMediaType(AM_MEDIA_TYPE * pMediaType);
29 typedef struct BasePin
33 LPCRITICAL_SECTION pCritSec;
36 AM_MEDIA_TYPE mtCurrent;
37 REFERENCE_TIME tStart;
41 const struct BasePinFuncTable* pFuncsTable;
44 typedef HRESULT (WINAPI *BasePin_CheckMediaType)(BasePin *This, const AM_MEDIA_TYPE *pmt);
45 typedef HRESULT (WINAPI *BasePin_AttemptConnection)(BasePin *This, IPin *pReceivePin, const AM_MEDIA_TYPE *pmt);
46 typedef LONG (WINAPI *BasePin_GetMediaTypeVersion)(BasePin *This);
47 typedef HRESULT (WINAPI *BasePin_GetMediaType)(BasePin *This, int iPosition, AM_MEDIA_TYPE *amt);
49 typedef struct BasePinFuncTable {
50 /* Required for Input Pins*/
51 BasePin_CheckMediaType pfnCheckMediaType;
52 /* Required for Output Pins*/
53 BasePin_AttemptConnection pfnAttemptConnection;
54 /* Required for BasePinImpl_EnumMediaTypes */
55 BasePin_GetMediaTypeVersion pfnGetMediaTypeVersion;
56 BasePin_GetMediaType pfnGetMediaType;
59 typedef struct BaseOutputPin
61 /* inheritance C style! */
63 IMemInputPin * pMemInputPin;
64 IMemAllocator * pAllocator;
66 const struct BaseOutputPinFuncTable* pFuncsTable;
69 typedef HRESULT (WINAPI *BaseOutputPin_DecideBufferSize)(BaseOutputPin *This, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest);
70 typedef HRESULT (WINAPI *BaseOutputPin_DecideAllocator)(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc);
71 typedef HRESULT (WINAPI *BaseOutputPin_BreakConnect)(BaseOutputPin * This);
73 typedef struct BaseOutputPinFuncTable {
74 /* Required for BaseOutputPinImpl_DecideAllocator */
75 BaseOutputPin_DecideBufferSize pfnDecideBufferSize;
76 /* Required for BaseOutputPinImpl_AttemptConnection */
77 BaseOutputPin_DecideAllocator pfnDecideAllocator;
78 BaseOutputPin_BreakConnect pfnBreakConnect;
79 } BaseOutputPinFuncTable;
81 typedef struct BaseInputPin
83 /* inheritance C style! */
86 IMemInputPin IMemInputPin_iface;
87 IMemAllocator * pAllocator;
88 BOOL flushing, end_of_stream;
89 IMemAllocator *preferred_allocator;
91 const struct BaseInputPinFuncTable* pFuncsTable;
94 typedef HRESULT (WINAPI *BaseInputPin_Receive)(BaseInputPin *This, IMediaSample *pSample);
96 typedef struct BaseInputPinFuncTable {
98 BaseInputPin_Receive pfnReceive;
99 } BaseInputPinFuncTable;
102 HRESULT WINAPI BasePinImpl_GetMediaType(BasePin *This, int iPosition, AM_MEDIA_TYPE *pmt);
103 LONG WINAPI BasePinImpl_GetMediaTypeVersion(BasePin *This);
104 ULONG WINAPI BasePinImpl_AddRef(IPin * iface);
105 HRESULT WINAPI BasePinImpl_Disconnect(IPin * iface);
106 HRESULT WINAPI BasePinImpl_ConnectedTo(IPin * iface, IPin ** ppPin);
107 HRESULT WINAPI BasePinImpl_ConnectionMediaType(IPin * iface, AM_MEDIA_TYPE * pmt);
108 HRESULT WINAPI BasePinImpl_QueryPinInfo(IPin * iface, PIN_INFO * pInfo);
109 HRESULT WINAPI BasePinImpl_QueryDirection(IPin * iface, PIN_DIRECTION * pPinDir);
110 HRESULT WINAPI BasePinImpl_QueryId(IPin * iface, LPWSTR * Id);
111 HRESULT WINAPI BasePinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
112 HRESULT WINAPI BasePinImpl_EnumMediaTypes(IPin * iface, IEnumMediaTypes ** ppEnum);
113 HRESULT WINAPI BasePinImpl_QueryInternalConnections(IPin * iface, IPin ** apPin, ULONG * cPin);
114 HRESULT WINAPI BasePinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
116 /* Base Output Pin */
117 HRESULT WINAPI BaseOutputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv);
118 ULONG WINAPI BaseOutputPinImpl_Release(IPin * iface);
119 HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
120 HRESULT WINAPI BaseOutputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
121 HRESULT WINAPI BaseOutputPinImpl_Disconnect(IPin * iface);
122 HRESULT WINAPI BaseOutputPinImpl_EndOfStream(IPin * iface);
123 HRESULT WINAPI BaseOutputPinImpl_BeginFlush(IPin * iface);
124 HRESULT WINAPI BaseOutputPinImpl_EndFlush(IPin * iface);
126 HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin * This, IMediaSample ** ppSample, REFERENCE_TIME * tStart, REFERENCE_TIME * tStop, DWORD dwFlags);
127 HRESULT WINAPI BaseOutputPinImpl_Deliver(BaseOutputPin * This, IMediaSample * pSample);
128 HRESULT WINAPI BaseOutputPinImpl_BreakConnect(BaseOutputPin * This);
129 HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin * This);
130 HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin * This);
131 HRESULT WINAPI BaseOutputPinImpl_InitAllocator(BaseOutputPin *This, IMemAllocator **pMemAlloc);
132 HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc);
133 HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin *This, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
135 HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO * pPinInfo, const BasePinFuncTable* pBaseFuncsTable, const BaseOutputPinFuncTable* pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin ** ppPin);
138 HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv);
139 ULONG WINAPI BaseInputPinImpl_Release(IPin * iface);
140 HRESULT WINAPI BaseInputPinImpl_Connect(IPin * iface, IPin * pConnector, const AM_MEDIA_TYPE * pmt);
141 HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt);
142 HRESULT WINAPI BaseInputPinImpl_QueryAccept(IPin * iface, const AM_MEDIA_TYPE * pmt);
143 HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface);
144 HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface);
145 HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface);
146 HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
148 HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, const BasePinFuncTable* pBaseFuncsTable, const BaseInputPinFuncTable* pBaseInputFuncsTable, LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin ** ppPin);
150 typedef struct BaseFilter
152 IBaseFilter IBaseFilter_iface;
154 CRITICAL_SECTION csFilter;
157 REFERENCE_TIME rtStreamStart;
158 IReferenceClock * pClock;
159 FILTER_INFO filterInfo;
163 const struct BaseFilterFuncTable* pFuncsTable;
166 typedef IPin* (WINAPI *BaseFilter_GetPin)(BaseFilter* iface, int iPosition);
167 typedef LONG (WINAPI *BaseFilter_GetPinCount)(BaseFilter* iface);
168 typedef LONG (WINAPI *BaseFilter_GetPinVersion)(BaseFilter* iface);
170 typedef struct BaseFilterFuncTable {
172 BaseFilter_GetPin pfnGetPin;
173 BaseFilter_GetPinCount pfnGetPinCount;
174 } BaseFilterFuncTable;
176 HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv);
177 ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter * iface);
178 ULONG WINAPI BaseFilterImpl_Release(IBaseFilter * iface);
179 HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter * iface, CLSID * pClsid);
180 HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState );
181 HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock);
182 HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock);
183 HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum);
184 HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo);
185 HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName );
186 HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo);
188 LONG WINAPI BaseFilterImpl_GetPinVersion(BaseFilter* This);
189 VOID WINAPI BaseFilterImpl_IncrementPinVersion(BaseFilter* This);
191 HRESULT WINAPI BaseFilter_Init(BaseFilter * This, const IBaseFilterVtbl *Vtbl, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseFilterFuncTable* pBaseFuncsTable);
194 HRESULT WINAPI EnumMediaTypes_Construct(BasePin *iface, BasePin_GetMediaType enumFunc, BasePin_GetMediaTypeVersion versionFunc, IEnumMediaTypes ** ppEnum);
196 HRESULT WINAPI EnumPins_Construct(BaseFilter *base, BaseFilter_GetPin receive_pin, BaseFilter_GetPinCount receive_pincount, BaseFilter_GetPinVersion receive_version, IEnumPins ** ppEnum);
198 /* Transform Filter */
199 typedef struct TransformFilter
206 CRITICAL_SECTION csReceive;
208 const struct TransformFilterFuncTable * pFuncsTable;
209 struct QualityControlImpl *qcimpl;
212 typedef HRESULT (WINAPI *TransformFilter_DecideBufferSize) (TransformFilter *iface, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest);
213 typedef HRESULT (WINAPI *TransformFilter_StartStreaming) (TransformFilter *iface);
214 typedef HRESULT (WINAPI *TransformFilter_StopStreaming) (TransformFilter *iface);
215 typedef HRESULT (WINAPI *TransformFilter_Receive) (TransformFilter* iface, IMediaSample* pIn);
216 typedef HRESULT (WINAPI *TransformFilter_CompleteConnect) (TransformFilter *iface, PIN_DIRECTION dir, IPin *pPin);
217 typedef HRESULT (WINAPI *TransformFilter_BreakConnect) (TransformFilter *iface, PIN_DIRECTION dir);
218 typedef HRESULT (WINAPI *TransformFilter_SetMediaType) (TransformFilter *iface, PIN_DIRECTION dir, const AM_MEDIA_TYPE *pMediaType);
219 typedef HRESULT (WINAPI *TransformFilter_CheckInputType) (TransformFilter *iface, const AM_MEDIA_TYPE *pMediaType);
220 typedef HRESULT (WINAPI *TransformFilter_EndOfStream) (TransformFilter *iface);
221 typedef HRESULT (WINAPI *TransformFilter_BeginFlush) (TransformFilter *iface);
222 typedef HRESULT (WINAPI *TransformFilter_EndFlush) (TransformFilter *iface);
223 typedef HRESULT (WINAPI *TransformFilter_NewSegment) (TransformFilter *iface,
224 REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
225 typedef HRESULT (WINAPI *TransformFilter_Notify) (TransformFilter *iface, IBaseFilter *sender, Quality qm);
227 typedef struct TransformFilterFuncTable {
229 TransformFilter_DecideBufferSize pfnDecideBufferSize;
231 TransformFilter_StartStreaming pfnStartStreaming;
232 TransformFilter_Receive pfnReceive;
233 TransformFilter_StopStreaming pfnStopStreaming;
234 TransformFilter_CheckInputType pfnCheckInputType;
235 TransformFilter_SetMediaType pfnSetMediaType;
236 TransformFilter_CompleteConnect pfnCompleteConnect;
237 TransformFilter_BreakConnect pfnBreakConnect;
238 TransformFilter_EndOfStream pfnEndOfStream;
239 TransformFilter_BeginFlush pfnBeginFlush;
240 TransformFilter_EndFlush pfnEndFlush;
241 TransformFilter_NewSegment pfnNewSegment;
242 TransformFilter_Notify pfnNotify;
243 } TransformFilterFuncTable;
245 HRESULT WINAPI TransformFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv);
246 ULONG WINAPI TransformFilterImpl_Release(IBaseFilter * iface);
247 HRESULT WINAPI TransformFilterImpl_Stop(IBaseFilter * iface);
248 HRESULT WINAPI TransformFilterImpl_Pause(IBaseFilter * iface);
249 HRESULT WINAPI TransformFilterImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart);
250 HRESULT WINAPI TransformFilterImpl_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin);
251 HRESULT WINAPI TransformFilterImpl_Notify(TransformFilter *iface, IBaseFilter *sender, Quality qm);
253 HRESULT TransformFilter_Construct( const IBaseFilterVtbl *filterVtbl, LONG filter_size, const CLSID* pClsid, const TransformFilterFuncTable* pFuncsTable, IBaseFilter ** ppTransformFilter);
256 typedef HRESULT (WINAPI *SourceSeeking_ChangeRate)(IMediaSeeking *iface);
257 typedef HRESULT (WINAPI *SourceSeeking_ChangeStart)(IMediaSeeking *iface);
258 typedef HRESULT (WINAPI *SourceSeeking_ChangeStop)(IMediaSeeking *iface);
260 typedef struct SourceSeeking
262 IMediaSeeking IMediaSeeking_iface;
265 SourceSeeking_ChangeStop fnChangeStop;
266 SourceSeeking_ChangeStart fnChangeStart;
267 SourceSeeking_ChangeRate fnChangeRate;
268 DWORD dwCapabilities;
270 LONGLONG llCurrent, llStop, llDuration;
272 PCRITICAL_SECTION crst;
275 HRESULT SourceSeeking_Init(SourceSeeking *pSeeking, const IMediaSeekingVtbl *Vtbl, SourceSeeking_ChangeStop fnChangeStop, SourceSeeking_ChangeStart fnChangeStart, SourceSeeking_ChangeRate fnChangeRate, PCRITICAL_SECTION crit_sect);
277 HRESULT WINAPI SourceSeekingImpl_GetCapabilities(IMediaSeeking * iface, DWORD * pCapabilities);
278 HRESULT WINAPI SourceSeekingImpl_CheckCapabilities(IMediaSeeking * iface, DWORD * pCapabilities);
279 HRESULT WINAPI SourceSeekingImpl_IsFormatSupported(IMediaSeeking * iface, const GUID * pFormat);
280 HRESULT WINAPI SourceSeekingImpl_QueryPreferredFormat(IMediaSeeking * iface, GUID * pFormat);
281 HRESULT WINAPI SourceSeekingImpl_GetTimeFormat(IMediaSeeking * iface, GUID * pFormat);
282 HRESULT WINAPI SourceSeekingImpl_IsUsingTimeFormat(IMediaSeeking * iface, const GUID * pFormat);
283 HRESULT WINAPI SourceSeekingImpl_SetTimeFormat(IMediaSeeking * iface, const GUID * pFormat);
284 HRESULT WINAPI SourceSeekingImpl_GetDuration(IMediaSeeking * iface, LONGLONG * pDuration);
285 HRESULT WINAPI SourceSeekingImpl_GetStopPosition(IMediaSeeking * iface, LONGLONG * pStop);
286 HRESULT WINAPI SourceSeekingImpl_GetCurrentPosition(IMediaSeeking * iface, LONGLONG * pCurrent);
287 HRESULT WINAPI SourceSeekingImpl_ConvertTimeFormat(IMediaSeeking * iface, LONGLONG * pTarget, const GUID * pTargetFormat, LONGLONG Source, const GUID * pSourceFormat);
288 HRESULT WINAPI SourceSeekingImpl_SetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, DWORD dwCurrentFlags, LONGLONG * pStop, DWORD dwStopFlags);
289 HRESULT WINAPI SourceSeekingImpl_GetPositions(IMediaSeeking * iface, LONGLONG * pCurrent, LONGLONG * pStop);
290 HRESULT WINAPI SourceSeekingImpl_GetAvailable(IMediaSeeking * iface, LONGLONG * pEarliest, LONGLONG * pLatest);
291 HRESULT WINAPI SourceSeekingImpl_SetRate(IMediaSeeking * iface, double dRate);
292 HRESULT WINAPI SourceSeekingImpl_GetRate(IMediaSeeking * iface, double * dRate);
293 HRESULT WINAPI SourceSeekingImpl_GetPreroll(IMediaSeeking * iface, LONGLONG * pPreroll);
296 HRESULT WINAPI RendererPosPassThru_RegisterMediaTime(IUnknown *iface, REFERENCE_TIME start);
297 HRESULT WINAPI RendererPosPassThru_ResetMediaTime(IUnknown *iface);
298 HRESULT WINAPI RendererPosPassThru_EOS(IUnknown *iface);
300 HRESULT WINAPI CreatePosPassThru(IUnknown* pUnkOuter, BOOL bRenderer, IPin *pPin, IUnknown **ppPassThru);
301 HRESULT WINAPI PosPassThru_Construct(IUnknown* pUnkOuter, LPVOID *ppPassThru);
303 /* Filter Registration */
305 typedef REGPINTYPES AMOVIESETUP_MEDIATYPE;
306 typedef REGFILTERPINS AMOVIESETUP_PIN;
308 typedef struct AMOVIESETUP_FILTER {
313 const AMOVIESETUP_PIN *pPin;
314 } AMOVIESETUP_FILTER, *LPAMOVIESETUP_FILTER;
316 typedef IUnknown *(CALLBACK *LPFNNewCOMObject)(LPUNKNOWN pUnkOuter, HRESULT *phr);
317 typedef void (CALLBACK *LPFNInitRoutine)(BOOL bLoading, const CLSID *rclsid);
319 typedef struct tagFactoryTemplate {
321 const CLSID *m_ClsID;
322 LPFNNewCOMObject m_lpfnNew;
323 LPFNInitRoutine m_lpfnInit;
324 const AMOVIESETUP_FILTER *m_pAMovieSetup_Filter;
327 HRESULT WINAPI AMovieDllRegisterServer2(BOOL bRegister);
328 HRESULT WINAPI AMovieSetupRegisterFilter2(const AMOVIESETUP_FILTER *pFilter, IFilterMapper2 *pIFM2, BOOL bRegister);
331 typedef struct tagOutputQueue {
332 CRITICAL_SECTION csQueue;
334 BaseOutputPin * pInputPin;
337 HANDLE hProcessQueue;
344 struct list *SampleList;
346 const struct OutputQueueFuncTable* pFuncsTable;
349 typedef DWORD (WINAPI *OutputQueue_ThreadProc)(OutputQueue *This);
351 typedef struct OutputQueueFuncTable
353 OutputQueue_ThreadProc pfnThreadProc;
354 } OutputQueueFuncTable;
356 HRESULT WINAPI OutputQueue_Construct( BaseOutputPin *pInputPin, BOOL bAuto,
357 BOOL bQueue, LONG lBatchSize, BOOL bBatchExact, DWORD dwPriority,
358 const OutputQueueFuncTable* pFuncsTable, OutputQueue **ppOutputQueue );
359 HRESULT WINAPI OutputQueue_Destroy(OutputQueue *pOutputQueue);
360 HRESULT WINAPI OutputQueue_ReceiveMultiple(OutputQueue *pOutputQueue, IMediaSample **ppSamples, LONG nSamples, LONG *nSamplesProcessed);
361 HRESULT WINAPI OutputQueue_Receive(OutputQueue *pOutputQueue, IMediaSample *pSample);
362 VOID WINAPI OutputQueue_EOS(OutputQueue *pOutputQueue);
363 VOID WINAPI OutputQueue_SendAnyway(OutputQueue *pOutputQueue);
364 DWORD WINAPI OutputQueueImpl_ThreadProc(OutputQueue *pOutputQueue);
366 typedef struct tagBaseWindow
375 DWORD WindowStylesEx;
378 const struct BaseWindowFuncTable* pFuncsTable;
381 typedef LPWSTR (WINAPI *BaseWindow_GetClassWindowStyles)(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx);
382 typedef RECT (WINAPI *BaseWindow_GetDefaultRect)(BaseWindow *This);
383 typedef BOOL (WINAPI *BaseWindow_PossiblyEatMessage)(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam);
384 typedef LRESULT (WINAPI *BaseWindow_OnReceiveMessage)(BaseWindow *This, HWND hwnd, INT uMsg, WPARAM wParam, LPARAM lParam);
385 typedef BOOL (WINAPI *BaseWindow_OnSize)(BaseWindow *This, LONG Height, LONG Width);
387 typedef struct BaseWindowFuncTable
390 BaseWindow_GetClassWindowStyles pfnGetClassWindowStyles;
391 BaseWindow_GetDefaultRect pfnGetDefaultRect;
392 /* Optional, WinProc Related */
393 BaseWindow_OnReceiveMessage pfnOnReceiveMessage;
394 BaseWindow_PossiblyEatMessage pfnPossiblyEatMessage;
395 BaseWindow_OnSize pfnOnSize;
396 } BaseWindowFuncTable;
398 HRESULT WINAPI BaseWindow_Init(BaseWindow *pBaseWindow, const BaseWindowFuncTable* pFuncsTable);
399 HRESULT WINAPI BaseWindow_Destroy(BaseWindow *pBaseWindow);
401 HRESULT WINAPI BaseWindowImpl_PrepareWindow(BaseWindow *This);
402 HRESULT WINAPI BaseWindowImpl_DoneWithWindow(BaseWindow *This);
403 RECT WINAPI BaseWindowImpl_GetDefaultRect(BaseWindow *This);
404 LRESULT WINAPI BaseWindowImpl_OnReceiveMessage(BaseWindow *This, HWND hwnd, INT uMsg, WPARAM wParam, LPARAM lParam);
405 BOOL WINAPI BaseWindowImpl_OnSize(BaseWindow *This, LONG Height, LONG Width);
408 ITypeInfo *pTypeInfo;
411 HRESULT WINAPI BaseDispatch_Init(BaseDispatch *This, REFIID riid);
412 HRESULT WINAPI BaseDispatch_Destroy(BaseDispatch *This);
413 HRESULT WINAPI BaseDispatchImpl_GetIDsOfNames(BaseDispatch *This, REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid);
414 HRESULT WINAPI BaseDispatchImpl_GetTypeInfo(BaseDispatch *This, REFIID riid, UINT itinfo, LCID lcid, ITypeInfo **pptinfo);
415 HRESULT WINAPI BaseDispatchImpl_GetTypeInfoCount(BaseDispatch *This, UINT *pctinfo);
417 #ifdef __IVideoWindow_FWD_DEFINED__
418 typedef struct tagBaseControlWindow
420 BaseWindow baseWindow;
421 IVideoWindow IVideoWindow_iface;
422 BaseDispatch baseDispatch;
428 CRITICAL_SECTION* pInterfaceLock;
432 HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, const IVideoWindowVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin* pPin, const BaseWindowFuncTable* pFuncsTable);
433 HRESULT WINAPI BaseControlWindow_Destroy(BaseControlWindow *pControlWindow);
435 BOOL WINAPI BaseControlWindowImpl_PossiblyEatMessage(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam);
436 HRESULT WINAPI BaseControlWindowImpl_GetTypeInfoCount(IVideoWindow *iface, UINT*pctinfo);
437 HRESULT WINAPI BaseControlWindowImpl_GetTypeInfo(IVideoWindow *iface, UINT iTInfo, LCID lcid, ITypeInfo**ppTInfo);
438 HRESULT WINAPI BaseControlWindowImpl_GetIDsOfNames(IVideoWindow *iface, REFIID riid, LPOLESTR*rgszNames, UINT cNames, LCID lcid, DISPID*rgDispId);
439 HRESULT WINAPI BaseControlWindowImpl_Invoke(IVideoWindow *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS*pDispParams, VARIANT*pVarResult, EXCEPINFO*pExepInfo, UINT*puArgErr);
440 HRESULT WINAPI BaseControlWindowImpl_put_Caption(IVideoWindow *iface, BSTR strCaption);
441 HRESULT WINAPI BaseControlWindowImpl_get_Caption(IVideoWindow *iface, BSTR *strCaption);
442 HRESULT WINAPI BaseControlWindowImpl_put_WindowStyle(IVideoWindow *iface, LONG WindowStyle);
443 HRESULT WINAPI BaseControlWindowImpl_get_WindowStyle(IVideoWindow *iface, LONG *WindowStyle);
444 HRESULT WINAPI BaseControlWindowImpl_put_WindowStyleEx(IVideoWindow *iface, LONG WindowStyleEx);
445 HRESULT WINAPI BaseControlWindowImpl_get_WindowStyleEx(IVideoWindow *iface, LONG *WindowStyleEx);
446 HRESULT WINAPI BaseControlWindowImpl_put_AutoShow(IVideoWindow *iface, LONG AutoShow);
447 HRESULT WINAPI BaseControlWindowImpl_get_AutoShow(IVideoWindow *iface, LONG *AutoShow);
448 HRESULT WINAPI BaseControlWindowImpl_put_WindowState(IVideoWindow *iface, LONG WindowState);
449 HRESULT WINAPI BaseControlWindowImpl_get_WindowState(IVideoWindow *iface, LONG *WindowState);
450 HRESULT WINAPI BaseControlWindowImpl_put_BackgroundPalette(IVideoWindow *iface, LONG BackgroundPalette);
451 HRESULT WINAPI BaseControlWindowImpl_get_BackgroundPalette(IVideoWindow *iface, LONG *pBackgroundPalette);
452 HRESULT WINAPI BaseControlWindowImpl_put_Visible(IVideoWindow *iface, LONG Visible);
453 HRESULT WINAPI BaseControlWindowImpl_get_Visible(IVideoWindow *iface, LONG *pVisible);
454 HRESULT WINAPI BaseControlWindowImpl_put_Left(IVideoWindow *iface, LONG Left);
455 HRESULT WINAPI BaseControlWindowImpl_get_Left(IVideoWindow *iface, LONG *pLeft);
456 HRESULT WINAPI BaseControlWindowImpl_put_Width(IVideoWindow *iface, LONG Width);
457 HRESULT WINAPI BaseControlWindowImpl_get_Width(IVideoWindow *iface, LONG *pWidth);
458 HRESULT WINAPI BaseControlWindowImpl_put_Top(IVideoWindow *iface, LONG Top);
459 HRESULT WINAPI BaseControlWindowImpl_get_Top(IVideoWindow *iface, LONG *pTop);
461 HRESULT WINAPI BaseControlWindowImpl_put_Height(IVideoWindow *iface, LONG Height);
462 HRESULT WINAPI BaseControlWindowImpl_get_Height(IVideoWindow *iface, LONG *pHeight);
463 HRESULT WINAPI BaseControlWindowImpl_put_Owner(IVideoWindow *iface, OAHWND Owner);
464 HRESULT WINAPI BaseControlWindowImpl_get_Owner(IVideoWindow *iface, OAHWND *Owner);
465 HRESULT WINAPI BaseControlWindowImpl_put_MessageDrain(IVideoWindow *iface, OAHWND Drain);
466 HRESULT WINAPI BaseControlWindowImpl_get_MessageDrain(IVideoWindow *iface, OAHWND *Drain);
467 HRESULT WINAPI BaseControlWindowImpl_get_BorderColor(IVideoWindow *iface, LONG *Color);
468 HRESULT WINAPI BaseControlWindowImpl_put_BorderColor(IVideoWindow *iface, LONG Color);
469 HRESULT WINAPI BaseControlWindowImpl_get_FullScreenMode(IVideoWindow *iface, LONG *FullScreenMode);
470 HRESULT WINAPI BaseControlWindowImpl_put_FullScreenMode(IVideoWindow *iface, LONG FullScreenMode);
471 HRESULT WINAPI BaseControlWindowImpl_SetWindowForeground(IVideoWindow *iface, LONG Focus);
472 HRESULT WINAPI BaseControlWindowImpl_SetWindowPosition(IVideoWindow *iface, LONG Left, LONG Top, LONG Width, LONG Height);
473 HRESULT WINAPI BaseControlWindowImpl_GetWindowPosition(IVideoWindow *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight);
474 HRESULT WINAPI BaseControlWindowImpl_NotifyOwnerMessage(IVideoWindow *iface, OAHWND hwnd, LONG uMsg, LONG_PTR wParam, LONG_PTR lParam);
475 HRESULT WINAPI BaseControlWindowImpl_GetMinIdealImageSize(IVideoWindow *iface, LONG *pWidth, LONG *pHeight);
476 HRESULT WINAPI BaseControlWindowImpl_GetMaxIdealImageSize(IVideoWindow *iface, LONG *pWidth, LONG *pHeight);
477 HRESULT WINAPI BaseControlWindowImpl_GetRestorePosition(IVideoWindow *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight);
478 HRESULT WINAPI BaseControlWindowImpl_HideCursor(IVideoWindow *iface, LONG HideCursor);
479 HRESULT WINAPI BaseControlWindowImpl_IsCursorHidden(IVideoWindow *iface, LONG *CursorHidden);
482 #ifdef __IBasicVideo_FWD_DEFINED__
484 typedef struct tagBaseControlVideo
486 IBasicVideo IBasicVideo_iface;
487 BaseDispatch baseDispatch;
490 CRITICAL_SECTION* pInterfaceLock;
493 const struct BaseControlVideoFuncTable* pFuncsTable;
496 typedef HRESULT (WINAPI *BaseControlVideo_GetSourceRect)(BaseControlVideo* This, RECT *pSourceRect);
497 typedef HRESULT (WINAPI *BaseControlVideo_GetStaticImage)(BaseControlVideo* This, LONG *pBufferSize, LONG *pDIBImage);
498 typedef HRESULT (WINAPI *BaseControlVideo_GetTargetRect)(BaseControlVideo* This, RECT *pTargetRect);
499 typedef VIDEOINFOHEADER* (WINAPI *BaseControlVideo_GetVideoFormat)(BaseControlVideo* This);
500 typedef HRESULT (WINAPI *BaseControlVideo_IsDefaultSourceRect)(BaseControlVideo* This);
501 typedef HRESULT (WINAPI *BaseControlVideo_IsDefaultTargetRect)(BaseControlVideo* This);
502 typedef HRESULT (WINAPI *BaseControlVideo_SetDefaultSourceRect)(BaseControlVideo* This);
503 typedef HRESULT (WINAPI *BaseControlVideo_SetDefaultTargetRect)(BaseControlVideo* This);
504 typedef HRESULT (WINAPI *BaseControlVideo_SetSourceRect)(BaseControlVideo* This, RECT *pSourceRect);
505 typedef HRESULT (WINAPI *BaseControlVideo_SetTargetRect)(BaseControlVideo* This, RECT *pTargetRect);
507 typedef struct BaseControlVideoFuncTable {
509 BaseControlVideo_GetSourceRect pfnGetSourceRect;
510 BaseControlVideo_GetStaticImage pfnGetStaticImage;
511 BaseControlVideo_GetTargetRect pfnGetTargetRect;
512 BaseControlVideo_GetVideoFormat pfnGetVideoFormat;
513 BaseControlVideo_IsDefaultSourceRect pfnIsDefaultSourceRect;
514 BaseControlVideo_IsDefaultTargetRect pfnIsDefaultTargetRect;
515 BaseControlVideo_SetDefaultSourceRect pfnSetDefaultSourceRect;
516 BaseControlVideo_SetDefaultTargetRect pfnSetDefaultTargetRect;
517 BaseControlVideo_SetSourceRect pfnSetSourceRect;
518 BaseControlVideo_SetTargetRect pfnSetTargetRect;
519 } BaseControlVideoFuncTable;
521 HRESULT WINAPI BaseControlVideo_Init(BaseControlVideo *pControlVideo, const IBasicVideoVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin* pPin, const BaseControlVideoFuncTable* pFuncsTable);
522 HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo);
524 HRESULT WINAPI BaseControlVideoImpl_GetTypeInfoCount(IBasicVideo *iface, UINT*pctinfo);
525 HRESULT WINAPI BaseControlVideoImpl_GetTypeInfo(IBasicVideo *iface, UINT iTInfo, LCID lcid, ITypeInfo**ppTInfo);
526 HRESULT WINAPI BaseControlVideoImpl_GetIDsOfNames(IBasicVideo *iface, REFIID riid, LPOLESTR*rgszNames, UINT cNames, LCID lcid, DISPID*rgDispId);
527 HRESULT WINAPI BaseControlVideoImpl_Invoke(IBasicVideo *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS*pDispParams, VARIANT*pVarResult, EXCEPINFO*pExepInfo, UINT*puArgErr);
528 HRESULT WINAPI BaseControlVideoImpl_get_AvgTimePerFrame(IBasicVideo *iface, REFTIME *pAvgTimePerFrame);
529 HRESULT WINAPI BaseControlVideoImpl_get_BitRate(IBasicVideo *iface, LONG *pBitRate);
530 HRESULT WINAPI BaseControlVideoImpl_get_BitErrorRate(IBasicVideo *iface, LONG *pBitErrorRate);
531 HRESULT WINAPI BaseControlVideoImpl_get_VideoWidth(IBasicVideo *iface, LONG *pVideoWidth);
532 HRESULT WINAPI BaseControlVideoImpl_get_VideoHeight(IBasicVideo *iface, LONG *pVideoHeight);
533 HRESULT WINAPI BaseControlVideoImpl_put_SourceLeft(IBasicVideo *iface, LONG SourceLeft);
534 HRESULT WINAPI BaseControlVideoImpl_get_SourceLeft(IBasicVideo *iface, LONG *pSourceLeft);
535 HRESULT WINAPI BaseControlVideoImpl_put_SourceWidth(IBasicVideo *iface, LONG SourceWidth);
536 HRESULT WINAPI BaseControlVideoImpl_get_SourceWidth(IBasicVideo *iface, LONG *pSourceWidth);
537 HRESULT WINAPI BaseControlVideoImpl_put_SourceTop(IBasicVideo *iface, LONG SourceTop);
538 HRESULT WINAPI BaseControlVideoImpl_get_SourceTop(IBasicVideo *iface, LONG *pSourceTop);
539 HRESULT WINAPI BaseControlVideoImpl_put_SourceHeight(IBasicVideo *iface, LONG SourceHeight);
540 HRESULT WINAPI BaseControlVideoImpl_get_SourceHeight(IBasicVideo *iface, LONG *pSourceHeight);
541 HRESULT WINAPI BaseControlVideoImpl_put_DestinationLeft(IBasicVideo *iface, LONG DestinationLeft);
542 HRESULT WINAPI BaseControlVideoImpl_get_DestinationLeft(IBasicVideo *iface, LONG *pDestinationLeft);
543 HRESULT WINAPI BaseControlVideoImpl_put_DestinationWidth(IBasicVideo *iface, LONG DestinationWidth);
544 HRESULT WINAPI BaseControlVideoImpl_get_DestinationWidth(IBasicVideo *iface, LONG *pDestinationWidth);
545 HRESULT WINAPI BaseControlVideoImpl_put_DestinationTop(IBasicVideo *iface, LONG DestinationTop);
546 HRESULT WINAPI BaseControlVideoImpl_get_DestinationTop(IBasicVideo *iface, LONG *pDestinationTop);
547 HRESULT WINAPI BaseControlVideoImpl_put_DestinationHeight(IBasicVideo *iface, LONG DestinationHeight);
548 HRESULT WINAPI BaseControlVideoImpl_get_DestinationHeight(IBasicVideo *iface, LONG *pDestinationHeight);
549 HRESULT WINAPI BaseControlVideoImpl_SetSourcePosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height);
550 HRESULT WINAPI BaseControlVideoImpl_GetSourcePosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight);
551 HRESULT WINAPI BaseControlVideoImpl_SetDefaultSourcePosition(IBasicVideo *iface);
552 HRESULT WINAPI BaseControlVideoImpl_SetDestinationPosition(IBasicVideo *iface, LONG Left, LONG Top, LONG Width, LONG Height);
553 HRESULT WINAPI BaseControlVideoImpl_GetDestinationPosition(IBasicVideo *iface, LONG *pLeft, LONG *pTop, LONG *pWidth, LONG *pHeight);
554 HRESULT WINAPI BaseControlVideoImpl_SetDefaultDestinationPosition(IBasicVideo *iface);
555 HRESULT WINAPI BaseControlVideoImpl_GetVideoSize(IBasicVideo *iface, LONG *pWidth, LONG *pHeight);
556 HRESULT WINAPI BaseControlVideoImpl_GetVideoPaletteEntries(IBasicVideo *iface, LONG StartIndex, LONG Entries, LONG *pRetrieved, LONG *pPalette);
557 HRESULT WINAPI BaseControlVideoImpl_GetCurrentImage(IBasicVideo *iface, LONG *pBufferSize, LONG *pDIBImage);
558 HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultSource(IBasicVideo *iface);
559 HRESULT WINAPI BaseControlVideoImpl_IsUsingDefaultDestination(IBasicVideo *iface);
563 /* BaseRenderer Filter */
564 typedef struct BaseRendererTag
568 BaseInputPin *pInputPin;
570 CRITICAL_SECTION csRenderLock;
574 IMediaSample *pMediaSample;
576 IQualityControl *pQSink;
577 struct QualityControlImpl *qcimpl;
579 const struct BaseRendererFuncTable * pFuncsTable;
582 typedef HRESULT (WINAPI *BaseRenderer_CheckMediaType)(BaseRenderer *This, const AM_MEDIA_TYPE *pmt);
583 typedef HRESULT (WINAPI *BaseRenderer_DoRenderSample)(BaseRenderer *This, IMediaSample *pMediaSample);
584 typedef VOID (WINAPI *BaseRenderer_OnReceiveFirstSample)(BaseRenderer *This, IMediaSample *pMediaSample);
585 typedef VOID (WINAPI *BaseRenderer_OnRenderEnd)(BaseRenderer *This, IMediaSample *pMediaSample);
586 typedef VOID (WINAPI *BaseRenderer_OnRenderStart)(BaseRenderer *This, IMediaSample *pMediaSample);
587 typedef VOID (WINAPI *BaseRenderer_OnStartStreaming)(BaseRenderer *This);
588 typedef VOID (WINAPI *BaseRenderer_OnStopStreaming)(BaseRenderer *This);
589 typedef VOID (WINAPI *BaseRenderer_OnWaitEnd)(BaseRenderer *This);
590 typedef VOID (WINAPI *BaseRenderer_OnWaitStart)(BaseRenderer *This);
591 typedef VOID (WINAPI *BaseRenderer_PrepareRender)(BaseRenderer *This);
592 typedef HRESULT (WINAPI *BaseRenderer_ShouldDrawSampleNow)(BaseRenderer *This, IMediaSample *pMediaSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime);
593 typedef HRESULT (WINAPI *BaseRenderer_PrepareReceive)(BaseRenderer *This, IMediaSample *pMediaSample);
594 typedef HRESULT (WINAPI *BaseRenderer_EndOfStream)(BaseRenderer *This);
595 typedef HRESULT (WINAPI *BaseRenderer_BeginFlush) (BaseRenderer *This);
596 typedef HRESULT (WINAPI *BaseRenderer_EndFlush) (BaseRenderer *This);
597 typedef HRESULT (WINAPI *BaseRenderer_BreakConnect) (BaseRenderer *This);
598 typedef HRESULT (WINAPI *BaseRenderer_CompleteConnect) (BaseRenderer *This, IPin *pReceivePin);
600 typedef struct BaseRendererFuncTable {
602 BaseRenderer_CheckMediaType pfnCheckMediaType;
603 BaseRenderer_DoRenderSample pfnDoRenderSample;
604 /* Optional, Data Handlers */
605 BaseRenderer_OnReceiveFirstSample pfnOnReceiveFirstSample;
606 BaseRenderer_OnRenderEnd pfnOnRenderEnd;
607 BaseRenderer_OnRenderStart pfnOnRenderStart;
608 BaseRenderer_OnStartStreaming pfnOnStartStreaming;
609 BaseRenderer_OnStopStreaming pfnOnStopStreaming;
610 BaseRenderer_OnWaitEnd pfnOnWaitEnd;
611 BaseRenderer_OnWaitStart pfnOnWaitStart;
612 BaseRenderer_PrepareRender pfnPrepareRender;
613 BaseRenderer_ShouldDrawSampleNow pfnShouldDrawSampleNow;
614 BaseRenderer_PrepareReceive pfnPrepareReceive;
615 /* Optional, Input Pin */
616 BaseRenderer_CompleteConnect pfnCompleteConnect;
617 BaseRenderer_BreakConnect pfnBreakConnect;
618 BaseRenderer_EndOfStream pfnEndOfStream;
619 BaseRenderer_BeginFlush pfnBeginFlush;
620 BaseRenderer_EndFlush pfnEndFlush;
621 } BaseRendererFuncTable;
623 HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv);
624 ULONG WINAPI BaseRendererImpl_Release(IBaseFilter * iface);
625 HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSample);
626 HRESULT WINAPI BaseRendererImpl_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin);
627 HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter * iface);
628 HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart);
629 HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter * iface);
630 HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock);
631 HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState);
632 HRESULT WINAPI BaseRendererImpl_EndOfStream(BaseRenderer* iface);
633 HRESULT WINAPI BaseRendererImpl_BeginFlush(BaseRenderer* iface);
634 HRESULT WINAPI BaseRendererImpl_EndFlush(BaseRenderer* iface);
635 HRESULT WINAPI BaseRendererImpl_ClearPendingSample(BaseRenderer *iface);
637 HRESULT WINAPI BaseRenderer_Init(BaseRenderer *This, const IBaseFilterVtbl *Vtbl, IUnknown *pUnkOuter, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseRendererFuncTable* pBaseFuncsTable);
639 #ifdef __IBasicAudio_FWD_DEFINED__
640 typedef struct tagBasicAudio
642 IBasicAudio IBasicAudio_iface;
643 BaseDispatch baseDispatch;
646 HRESULT WINAPI BasicAudio_Init(BasicAudio *This, const IBasicAudioVtbl *Vtbl);
647 HRESULT WINAPI BasicAudio_Destroy(BasicAudio *pBasicAudio);
649 HRESULT WINAPI BasicAudioImpl_GetTypeInfoCount(IBasicAudio *iface, UINT*pctinfo);
650 HRESULT WINAPI BasicAudioImpl_GetTypeInfo(IBasicAudio *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
651 HRESULT WINAPI BasicAudioImpl_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
652 HRESULT WINAPI BasicAudioImpl_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr);
656 BOOL WINAPI STRMBASE_DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv);
657 HRESULT WINAPI STRMBASE_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv);
658 HRESULT WINAPI STRMBASE_DllCanUnloadNow(void);