Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/evr/evr.c | 21 +-------------------- dlls/qedit/nullrenderer.c | 21 +-------------------- dlls/quartz/dsoundrender.c | 22 +--------------------- dlls/quartz/videorenderer.c | 23 ++--------------------- dlls/quartz/vmr9.c | 21 +-------------------- dlls/strmbase/renderer.c | 37 ++++++++++++++++++++++++++++--------- include/wine/strmbase.h | 10 ++-------- 7 files changed, 36 insertions(+), 119 deletions(-)
diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c index 94f88ffeca..8bd38c243d 100644 --- a/dlls/evr/evr.c +++ b/dlls/evr/evr.c @@ -36,25 +36,6 @@ typedef struct BaseRenderer renderer; } evr_filter;
-static const IBaseFilterVtbl basefilter_vtbl = -{ - BaseFilterImpl_QueryInterface, - BaseFilterImpl_AddRef, - BaseFilterImpl_Release, - BaseFilterImpl_GetClassID, - BaseRendererImpl_Stop, - BaseRendererImpl_Pause, - BaseRendererImpl_Run, - BaseRendererImpl_GetState, - BaseRendererImpl_SetSyncSource, - BaseFilterImpl_GetSyncSource, - BaseFilterImpl_EnumPins, - BaseFilterImpl_FindPin, - BaseFilterImpl_QueryFilterInfo, - BaseFilterImpl_JoinFilterGraph, - BaseFilterImpl_QueryVendorInfo -}; - static inline evr_filter *impl_from_BaseRenderer(BaseRenderer *iface) { return CONTAINING_RECORD(iface, evr_filter, renderer); @@ -98,7 +79,7 @@ HRESULT evr_filter_create(IUnknown *outer, void **out) if (!object) return E_OUTOFMEMORY;
- strmbase_renderer_init(&object->renderer, &basefilter_vtbl, outer, + strmbase_renderer_init(&object->renderer, outer, &CLSID_EnhancedVideoRenderer, sink_name, &renderer_ops);
*out = &object->renderer.filter.IUnknown_inner; diff --git a/dlls/qedit/nullrenderer.c b/dlls/qedit/nullrenderer.c index 2c9aff8bc0..ee68e6244c 100644 --- a/dlls/qedit/nullrenderer.c +++ b/dlls/qedit/nullrenderer.c @@ -62,25 +62,6 @@ static const BaseRendererFuncTable RendererFuncTable = .renderer_destroy = null_renderer_destroy, };
-static const IBaseFilterVtbl NullRenderer_Vtbl = -{ - BaseFilterImpl_QueryInterface, - BaseFilterImpl_AddRef, - BaseFilterImpl_Release, - BaseFilterImpl_GetClassID, - BaseRendererImpl_Stop, - BaseRendererImpl_Pause, - BaseRendererImpl_Run, - BaseRendererImpl_GetState, - BaseRendererImpl_SetSyncSource, - BaseFilterImpl_GetSyncSource, - BaseFilterImpl_EnumPins, - BaseFilterImpl_FindPin, - BaseFilterImpl_QueryFilterInfo, - BaseFilterImpl_JoinFilterGraph, - BaseFilterImpl_QueryVendorInfo -}; - HRESULT NullRenderer_create(IUnknown *outer, void **out) { static const WCHAR sink_name[] = {'I','n',0}; @@ -92,7 +73,7 @@ HRESULT NullRenderer_create(IUnknown *outer, void **out)
pNullRenderer = CoTaskMemAlloc(sizeof(NullRendererImpl));
- hr = strmbase_renderer_init(&pNullRenderer->renderer, &NullRenderer_Vtbl, outer, + hr = strmbase_renderer_init(&pNullRenderer->renderer, outer, &CLSID_NullRenderer, sink_name, &RendererFuncTable);
if (FAILED(hr)) diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 6ba6e4c7ae..c0ff8ca5af 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -39,7 +39,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz); */ static const REFERENCE_TIME DSoundRenderer_Max_Fill = 150 * 10000;
-static const IBaseFilterVtbl DSoundRender_Vtbl; static const IBasicAudioVtbl IBasicAudio_Vtbl; static const IReferenceClockVtbl IReferenceClock_Vtbl; static const IAMDirectSoundVtbl IAMDirectSound_Vtbl; @@ -610,7 +609,7 @@ HRESULT DSoundRender_create(IUnknown *outer, void **out) return E_OUTOFMEMORY; ZeroMemory(pDSoundRender, sizeof(DSoundRenderImpl));
- hr = strmbase_renderer_init(&pDSoundRender->renderer, &DSoundRender_Vtbl, + hr = strmbase_renderer_init(&pDSoundRender->renderer, outer, &CLSID_DSoundRender, sink_name, &BaseFuncTable);
pDSoundRender->IBasicAudio_iface.lpVtbl = &IBasicAudio_Vtbl; @@ -652,25 +651,6 @@ HRESULT DSoundRender_create(IUnknown *outer, void **out) return hr; }
-static const IBaseFilterVtbl DSoundRender_Vtbl = -{ - BaseFilterImpl_QueryInterface, - BaseFilterImpl_AddRef, - BaseFilterImpl_Release, - BaseFilterImpl_GetClassID, - BaseRendererImpl_Stop, - BaseRendererImpl_Pause, - BaseRendererImpl_Run, - BaseRendererImpl_GetState, - BaseRendererImpl_SetSyncSource, - BaseFilterImpl_GetSyncSource, - BaseFilterImpl_EnumPins, - BaseFilterImpl_FindPin, - BaseFilterImpl_QueryFilterInfo, - BaseFilterImpl_JoinFilterGraph, - BaseFilterImpl_QueryVendorInfo -}; - /*** IUnknown methods ***/ static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface, REFIID riid, diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 24b76e6e47..48b845a14b 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -543,25 +543,6 @@ static const BaseControlVideoFuncTable renderer_BaseControlVideoFuncTable = { VideoRenderer_SetTargetRect };
-static const IBaseFilterVtbl VideoRenderer_Vtbl = -{ - BaseFilterImpl_QueryInterface, - BaseFilterImpl_AddRef, - BaseFilterImpl_Release, - BaseFilterImpl_GetClassID, - BaseRendererImpl_Stop, - BaseRendererImpl_Pause, - BaseRendererImpl_Run, - BaseRendererImpl_GetState, - BaseRendererImpl_SetSyncSource, - BaseFilterImpl_GetSyncSource, - BaseFilterImpl_EnumPins, - BaseFilterImpl_FindPin, - BaseFilterImpl_QueryFilterInfo, - BaseFilterImpl_JoinFilterGraph, - BaseFilterImpl_QueryVendorInfo -}; - static HRESULT WINAPI VideoWindow_get_FullScreenMode(IVideoWindow *iface, LONG *FullScreenMode) { @@ -777,8 +758,8 @@ HRESULT VideoRenderer_create(IUnknown *outer, void **out)
pVideoRenderer->IOverlay_iface.lpVtbl = &overlay_vtbl;
- hr = strmbase_renderer_init(&pVideoRenderer->renderer, &VideoRenderer_Vtbl, - outer, &CLSID_VideoRenderer, sink_name, &BaseFuncTable); + hr = strmbase_renderer_init(&pVideoRenderer->renderer, outer, + &CLSID_VideoRenderer, sink_name, &BaseFuncTable);
if (FAILED(hr)) goto fail; diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index c3b948f599..d631165d1b 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -758,25 +758,6 @@ static const BaseControlVideoFuncTable renderer_BaseControlVideoFuncTable = { VMR9_SetTargetRect };
-static const IBaseFilterVtbl VMR_Vtbl = -{ - BaseFilterImpl_QueryInterface, - BaseFilterImpl_AddRef, - BaseFilterImpl_Release, - BaseFilterImpl_GetClassID, - BaseRendererImpl_Stop, - BaseRendererImpl_Pause, - BaseRendererImpl_Run, - BaseRendererImpl_GetState, - BaseRendererImpl_SetSyncSource, - BaseFilterImpl_GetSyncSource, - BaseFilterImpl_EnumPins, - BaseFilterImpl_FindPin, - BaseFilterImpl_QueryFilterInfo, - BaseFilterImpl_JoinFilterGraph, - BaseFilterImpl_QueryVendorInfo -}; - static const IVideoWindowVtbl IVideoWindow_VTable = { BaseControlWindowImpl_QueryInterface, @@ -2247,7 +2228,7 @@ static HRESULT vmr_create(IUnknown *outer, void **out, const CLSID *clsid) pVMR->IVMRWindowlessControl9_iface.lpVtbl = &VMR9_WindowlessControl_Vtbl; pVMR->IOverlay_iface.lpVtbl = &overlay_vtbl;
- hr = strmbase_renderer_init(&pVMR->renderer, &VMR_Vtbl, outer, clsid, sink_name, &BaseFuncTable); + hr = strmbase_renderer_init(&pVMR->renderer, outer, clsid, sink_name, &BaseFuncTable); if (FAILED(hr)) goto fail;
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 0f714c2a88..86c4f7d1d7 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -250,15 +250,15 @@ static const BaseInputPinFuncTable input_BaseInputFuncTable = .pfnReceive = BaseRenderer_Receive, };
+static const IBaseFilterVtbl strmbase_renderer_vtbl;
-HRESULT WINAPI strmbase_renderer_init(BaseRenderer *filter, const IBaseFilterVtbl *vtbl, - IUnknown *outer, const CLSID *clsid, const WCHAR *sink_name, - const BaseRendererFuncTable *pBaseFuncsTable) +HRESULT WINAPI strmbase_renderer_init(BaseRenderer *filter, IUnknown *outer, + const CLSID *clsid, const WCHAR *sink_name, const BaseRendererFuncTable *pBaseFuncsTable) { HRESULT hr;
memset(filter, 0, sizeof(*filter)); - strmbase_filter_init(&filter->filter, vtbl, outer, clsid, &filter_ops); + strmbase_filter_init(&filter->filter, &strmbase_renderer_vtbl, outer, clsid, &filter_ops);
filter->pFuncsTable = pBaseFuncsTable;
@@ -407,7 +407,7 @@ HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSamp return hr; }
-HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter * iface) +static HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter *iface) { BaseRenderer *This = impl_from_IBaseFilter(iface);
@@ -427,7 +427,7 @@ HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter * iface) return S_OK; }
-HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart) +static HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter *iface, REFERENCE_TIME tStart) { BaseRenderer *This = impl_from_IBaseFilter(iface);
@@ -461,7 +461,7 @@ out: return S_OK; }
-HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter * iface) +static HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter *iface) { BaseRenderer *This = impl_from_IBaseFilter(iface); HRESULT hr = S_OK; @@ -497,7 +497,7 @@ HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter * iface) return hr; }
-HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock) +static HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock) { BaseRenderer *This = impl_from_IBaseFilter(iface); HRESULT hr; @@ -510,7 +510,7 @@ HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceCloc }
-HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState) +static HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState) { HRESULT hr; BaseRenderer *This = impl_from_IBaseFilter(iface); @@ -527,6 +527,25 @@ HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsT return hr; }
+static const IBaseFilterVtbl strmbase_renderer_vtbl = +{ + BaseFilterImpl_QueryInterface, + BaseFilterImpl_AddRef, + BaseFilterImpl_Release, + BaseFilterImpl_GetClassID, + BaseRendererImpl_Stop, + BaseRendererImpl_Pause, + BaseRendererImpl_Run, + BaseRendererImpl_GetState, + BaseRendererImpl_SetSyncSource, + BaseFilterImpl_GetSyncSource, + BaseFilterImpl_EnumPins, + BaseFilterImpl_FindPin, + BaseFilterImpl_QueryFilterInfo, + BaseFilterImpl_JoinFilterGraph, + BaseFilterImpl_QueryVendorInfo +}; + HRESULT WINAPI BaseRendererImpl_EndOfStream(BaseRenderer* iface) { IMediaEventSink* pEventSink; diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index f9136fadff..acfe6d8ab4 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -565,19 +565,13 @@ typedef struct BaseRendererFuncTable { } BaseRendererFuncTable;
HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSample); -HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter * iface); -HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart); -HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter * iface); -HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock); -HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState); HRESULT WINAPI BaseRendererImpl_EndOfStream(BaseRenderer* iface); HRESULT WINAPI BaseRendererImpl_BeginFlush(BaseRenderer* iface); HRESULT WINAPI BaseRendererImpl_EndFlush(BaseRenderer* iface); HRESULT WINAPI BaseRendererImpl_ClearPendingSample(BaseRenderer *iface);
-HRESULT WINAPI strmbase_renderer_init(BaseRenderer *filter, const IBaseFilterVtbl *vtbl, - IUnknown *outer, const CLSID *clsid, const WCHAR *sink_name, - const BaseRendererFuncTable *func_table); +HRESULT WINAPI strmbase_renderer_init(BaseRenderer *filter, IUnknown *outer, + const CLSID *clsid, const WCHAR *sink_name, const BaseRendererFuncTable *func_table); void strmbase_renderer_cleanup(BaseRenderer *filter);
/* Dll Functions */