Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/nullrenderer.c | 26 +++++--------------------- dlls/quartz/dsoundrender.c | 36 ++++++++++++++---------------------- dlls/quartz/videorenderer.c | 32 ++++++++++---------------------- dlls/quartz/vmr9.c | 33 +++++++++++---------------------- dlls/strmbase/renderer.c | 23 ++--------------------- include/wine/strmbase.h | 34 ++++++++++++---------------------- 6 files changed, 54 insertions(+), 130 deletions(-)
diff --git a/dlls/qedit/nullrenderer.c b/dlls/qedit/nullrenderer.c index 82e6284bfe4..2c9aff8bc0f 100644 --- a/dlls/qedit/nullrenderer.c +++ b/dlls/qedit/nullrenderer.c @@ -55,27 +55,11 @@ static void null_renderer_destroy(BaseRenderer *iface) CoTaskMemFree(filter); }
-static const BaseRendererFuncTable RendererFuncTable = { - NullRenderer_CheckMediaType, - NullRenderer_DoRenderSample, - /**/ - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - /**/ - NULL, - NULL, - NULL, - NULL, - NULL, - null_renderer_destroy, +static const BaseRendererFuncTable RendererFuncTable = +{ + .pfnCheckMediaType = NullRenderer_CheckMediaType, + .pfnDoRenderSample = NullRenderer_DoRenderSample, + .renderer_destroy = null_renderer_destroy, };
static const IBaseFilterVtbl NullRenderer_Vtbl = diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 3f1e5429fc6..5cd5e11f9fe 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -601,28 +601,20 @@ static HRESULT dsound_render_query_interface(BaseRenderer *iface, REFIID iid, vo return S_OK; }
-static const BaseRendererFuncTable BaseFuncTable = { - DSoundRender_CheckMediaType, - DSoundRender_DoRenderSample, - /**/ - NULL, - NULL, - NULL, - DSoundRender_OnStartStreaming, - DSoundRender_OnStopStreaming, - NULL, - NULL, - NULL, - DSoundRender_ShouldDrawSampleNow, - DSoundRender_PrepareReceive, - /**/ - DSoundRender_CompleteConnect, - DSoundRender_BreakConnect, - DSoundRender_EndOfStream, - NULL, - DSoundRender_EndFlush, - dsound_render_destroy, - dsound_render_query_interface, +static const BaseRendererFuncTable BaseFuncTable = +{ + .pfnCheckMediaType = DSoundRender_CheckMediaType, + .pfnDoRenderSample = DSoundRender_DoRenderSample, + .pfnOnStartStreaming = DSoundRender_OnStartStreaming, + .pfnOnStopStreaming = DSoundRender_OnStopStreaming, + .pfnShouldDrawSampleNow = DSoundRender_ShouldDrawSampleNow, + .pfnPrepareReceive = DSoundRender_PrepareReceive, + .pfnCompleteConnect = DSoundRender_CompleteConnect, + .pfnBreakConnect = DSoundRender_BreakConnect, + .pfnEndOfStream = DSoundRender_EndOfStream, + .pfnEndFlush = DSoundRender_EndFlush, + .renderer_destroy = dsound_render_destroy, + .renderer_query_interface = dsound_render_query_interface, };
HRESULT DSoundRender_create(IUnknown *outer, void **out) diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 9a10fd275a0..ae866c8c62e 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -469,28 +469,16 @@ static BOOL WINAPI VideoRenderer_OnSize(BaseWindow *iface, LONG Width, LONG Heig return BaseWindowImpl_OnSize(iface, Width, Height); }
-static const BaseRendererFuncTable BaseFuncTable = { - VideoRenderer_CheckMediaType, - VideoRenderer_DoRenderSample, - /**/ - NULL, - NULL, - NULL, - VideoRenderer_OnStartStreaming, - VideoRenderer_OnStopStreaming, - NULL, - NULL, - NULL, - VideoRenderer_ShouldDrawSampleNow, - NULL, - /**/ - NULL, - NULL, - NULL, - NULL, - VideoRenderer_EndFlush, - video_renderer_destroy, - video_renderer_query_interface, +static const BaseRendererFuncTable BaseFuncTable = +{ + .pfnCheckMediaType = VideoRenderer_CheckMediaType, + .pfnDoRenderSample = VideoRenderer_DoRenderSample, + .pfnOnStartStreaming = VideoRenderer_OnStartStreaming, + .pfnOnStopStreaming = VideoRenderer_OnStopStreaming, + .pfnShouldDrawSampleNow = VideoRenderer_ShouldDrawSampleNow, + .pfnEndFlush = VideoRenderer_EndFlush, + .renderer_destroy = video_renderer_destroy, + .renderer_query_interface = video_renderer_query_interface, };
static const BaseWindowFuncTable renderer_BaseWindowFuncTable = { diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index ee2d7a92956..bafe91da36a 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -558,28 +558,17 @@ static HRESULT vmr_query_interface(BaseRenderer *iface, REFIID iid, void **out) return S_OK; }
-static const BaseRendererFuncTable BaseFuncTable = { - VMR9_CheckMediaType, - VMR9_DoRenderSample, - /**/ - NULL, - NULL, - NULL, - VMR9_OnStartStreaming, - VMR9_OnStopStreaming, - NULL, - NULL, - NULL, - VMR9_ShouldDrawSampleNow, - NULL, - /**/ - VMR9_CompleteConnect, - VMR9_BreakConnect, - NULL, - NULL, - NULL, - vmr_destroy, - vmr_query_interface, +static const BaseRendererFuncTable BaseFuncTable = +{ + .pfnCheckMediaType = VMR9_CheckMediaType, + .pfnDoRenderSample = VMR9_DoRenderSample, + .pfnOnStartStreaming = VMR9_OnStartStreaming, + .pfnOnStopStreaming = VMR9_OnStopStreaming, + .pfnShouldDrawSampleNow = VMR9_ShouldDrawSampleNow, + .pfnCompleteConnect = VMR9_CompleteConnect, + .pfnBreakConnect = VMR9_BreakConnect, + .renderer_destroy = vmr_destroy, + .renderer_query_interface = vmr_query_interface, };
static LPWSTR WINAPI VMR9_GetClassWindowStyles(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx) diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 46f0da2fa5d..b73ce5469cd 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -117,12 +117,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush(IPin * iface) EnterCriticalSection(&pFilter->filter.csFilter); hr = BaseInputPinImpl_BeginFlush(iface); if (SUCCEEDED(hr)) - { - if (pFilter->pFuncsTable->pfnBeginFlush) - hr = pFilter->pFuncsTable->pfnBeginFlush(pFilter); - else - hr = BaseRendererImpl_BeginFlush(pFilter); - } + hr = BaseRendererImpl_BeginFlush(pFilter); LeaveCriticalSection(&pFilter->filter.csFilter); LeaveCriticalSection(&pFilter->csRenderLock); return hr; @@ -334,17 +329,9 @@ HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSamp return hr; }
- if (This->pFuncsTable->pfnPrepareRender) - This->pFuncsTable->pfnPrepareRender(This); - EnterCriticalSection(&This->csRenderLock); - if ( This->filter.state == State_Paused ) - { - if (This->pFuncsTable->pfnOnReceiveFirstSample) - This->pFuncsTable->pfnOnReceiveFirstSample(This, pSample); - + if (This->filter.state == State_Paused) SetEvent(This->state_event); - }
/* Wait for render Time */ if (This->filter.pClock && SUCCEEDED(IMediaSample_GetTime(pSample, &start, &stop))) @@ -361,9 +348,6 @@ HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSamp REFERENCE_TIME now; DWORD_PTR cookie;
- if (This->pFuncsTable->pfnOnWaitStart) - This->pFuncsTable->pfnOnWaitStart(This); - IReferenceClock_GetTime(This->filter.pClock, &now);
if (now - This->filter.rtStreamStart - start <= -10000) @@ -380,9 +364,6 @@ HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSamp
EnterCriticalSection(&This->csRenderLock); } - - if (This->pFuncsTable->pfnOnWaitEnd) - This->pFuncsTable->pfnOnWaitEnd(This); } else { diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index a499374fe40..6e369b872f9 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -576,28 +576,18 @@ typedef HRESULT (WINAPI *BaseRenderer_BreakConnect) (BaseRenderer *This); typedef HRESULT (WINAPI *BaseRenderer_CompleteConnect) (BaseRenderer *This, IPin *pReceivePin);
typedef struct BaseRendererFuncTable { - /* Required */ - BaseRenderer_CheckMediaType pfnCheckMediaType; - BaseRenderer_DoRenderSample pfnDoRenderSample; - /* Optional, Data Handlers */ - BaseRenderer_OnReceiveFirstSample pfnOnReceiveFirstSample; - BaseRenderer_OnRenderEnd pfnOnRenderEnd; - BaseRenderer_OnRenderStart pfnOnRenderStart; - BaseRenderer_OnStartStreaming pfnOnStartStreaming; - BaseRenderer_OnStopStreaming pfnOnStopStreaming; - BaseRenderer_OnWaitEnd pfnOnWaitEnd; - BaseRenderer_OnWaitStart pfnOnWaitStart; - BaseRenderer_PrepareRender pfnPrepareRender; - BaseRenderer_ShouldDrawSampleNow pfnShouldDrawSampleNow; - BaseRenderer_PrepareReceive pfnPrepareReceive; - /* Optional, Input Pin */ - BaseRenderer_CompleteConnect pfnCompleteConnect; - BaseRenderer_BreakConnect pfnBreakConnect; - BaseRenderer_EndOfStream pfnEndOfStream; - BaseRenderer_BeginFlush pfnBeginFlush; - BaseRenderer_EndFlush pfnEndFlush; - void (*renderer_destroy)(BaseRenderer *iface); - HRESULT (*renderer_query_interface)(BaseRenderer *iface, REFIID iid, void **out); + BaseRenderer_CheckMediaType pfnCheckMediaType; + BaseRenderer_DoRenderSample pfnDoRenderSample; + BaseRenderer_OnStartStreaming pfnOnStartStreaming; + BaseRenderer_OnStopStreaming pfnOnStopStreaming; + BaseRenderer_ShouldDrawSampleNow pfnShouldDrawSampleNow; + BaseRenderer_PrepareReceive pfnPrepareReceive; + BaseRenderer_CompleteConnect pfnCompleteConnect; + BaseRenderer_BreakConnect pfnBreakConnect; + BaseRenderer_EndOfStream pfnEndOfStream; + BaseRenderer_EndFlush pfnEndFlush; + void (*renderer_destroy)(BaseRenderer *iface); + HRESULT (*renderer_query_interface)(BaseRenderer *iface, REFIID iid, void **out); } BaseRendererFuncTable;
HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSample);