Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/renderer.c | 70 +++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 36 deletions(-)
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 86c4f7d1d7..81afc7c8d7 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -250,42 +250,6 @@ static const BaseInputPinFuncTable input_BaseInputFuncTable = .pfnReceive = BaseRenderer_Receive, };
-static const IBaseFilterVtbl strmbase_renderer_vtbl; - -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, &strmbase_renderer_vtbl, outer, clsid, &filter_ops); - - filter->pFuncsTable = pBaseFuncsTable; - - strmbase_sink_init(&filter->sink, &BaseRenderer_InputPin_Vtbl, &filter->filter, - sink_name, &input_BaseInputFuncTable, NULL); - - hr = CreatePosPassThru(outer ? outer : (IUnknown *)&filter->filter.IBaseFilter_iface, TRUE, - &filter->sink.pin.IPin_iface, &filter->pPosition); - if (FAILED(hr)) - { - strmbase_sink_cleanup(&filter->sink); - strmbase_filter_cleanup(&filter->filter); - return hr; - } - - InitializeCriticalSection(&filter->csRenderLock); - filter->csRenderLock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": BaseRenderer.csRenderLock"); - filter->state_event = CreateEventW(NULL, TRUE, TRUE, NULL); - filter->advise_event = CreateEventW(NULL, FALSE, FALSE, NULL); - filter->flush_event = CreateEventW(NULL, TRUE, TRUE, NULL); - - QualityControlImpl_Create(&filter->sink.pin.IPin_iface, &filter->filter.IBaseFilter_iface, &filter->qcimpl); - filter->qcimpl->IQualityControl_iface.lpVtbl = &Renderer_QualityControl_Vtbl; - - return S_OK; -} - void strmbase_renderer_cleanup(BaseRenderer *filter) { if (filter->sink.pin.peer) @@ -595,3 +559,37 @@ HRESULT WINAPI BaseRendererImpl_ClearPendingSample(BaseRenderer *iface) } return S_OK; } + +HRESULT WINAPI strmbase_renderer_init(BaseRenderer *filter, IUnknown *outer, + const CLSID *clsid, const WCHAR *sink_name, const BaseRendererFuncTable *func_table) +{ + HRESULT hr; + + memset(filter, 0, sizeof(*filter)); + strmbase_filter_init(&filter->filter, &strmbase_renderer_vtbl, outer, clsid, &filter_ops); + + filter->pFuncsTable = func_table; + + strmbase_sink_init(&filter->sink, &BaseRenderer_InputPin_Vtbl, &filter->filter, + sink_name, &input_BaseInputFuncTable, NULL); + + hr = CreatePosPassThru(outer ? outer : (IUnknown *)&filter->filter.IBaseFilter_iface, + TRUE, &filter->sink.pin.IPin_iface, &filter->pPosition); + if (FAILED(hr)) + { + strmbase_sink_cleanup(&filter->sink); + strmbase_filter_cleanup(&filter->filter); + return hr; + } + + InitializeCriticalSection(&filter->csRenderLock); + filter->csRenderLock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": BaseRenderer.csRenderLock"); + filter->state_event = CreateEventW(NULL, TRUE, TRUE, NULL); + filter->advise_event = CreateEventW(NULL, FALSE, FALSE, NULL); + filter->flush_event = CreateEventW(NULL, TRUE, TRUE, NULL); + + QualityControlImpl_Create(&filter->sink.pin.IPin_iface, &filter->filter.IBaseFilter_iface, &filter->qcimpl); + filter->qcimpl->IQualityControl_iface.lpVtbl = &Renderer_QualityControl_Vtbl; + + return S_OK; +}
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/evr/evr.c | 12 ++++---- dlls/qedit/nullrenderer.c | 12 ++++---- dlls/quartz/dsoundrender.c | 49 +++++++++++++++--------------- dlls/quartz/videorenderer.c | 35 +++++++++++----------- dlls/quartz/vmr9.c | 23 +++++++------- dlls/strmbase/renderer.c | 60 ++++++++++++++++++------------------- include/wine/strmbase.h | 56 ++++++++++++++++------------------ 7 files changed, 122 insertions(+), 125 deletions(-)
diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c index 8bd38c243d..b1721db027 100644 --- a/dlls/evr/evr.c +++ b/dlls/evr/evr.c @@ -33,29 +33,29 @@ WINE_DEFAULT_DEBUG_CHANNEL(evr);
typedef struct { - BaseRenderer renderer; + struct strmbase_renderer renderer; } evr_filter;
-static inline evr_filter *impl_from_BaseRenderer(BaseRenderer *iface) +static inline evr_filter *impl_from_strmbase_renderer(struct strmbase_renderer *iface) { return CONTAINING_RECORD(iface, evr_filter, renderer); }
-static void evr_destroy(BaseRenderer *iface) +static void evr_destroy(struct strmbase_renderer *iface) { - evr_filter *filter = impl_from_BaseRenderer(iface); + evr_filter *filter = impl_from_strmbase_renderer(iface);
strmbase_renderer_cleanup(&filter->renderer); CoTaskMemFree(filter); }
-static HRESULT WINAPI evr_DoRenderSample(BaseRenderer *iface, IMediaSample *sample) +static HRESULT WINAPI evr_DoRenderSample(struct strmbase_renderer *iface, IMediaSample *sample) { FIXME("Not implemented.\n"); return E_NOTIMPL; }
-static HRESULT WINAPI evr_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TYPE *mt) +static HRESULT WINAPI evr_CheckMediaType(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt) { FIXME("Not implemented.\n"); return E_NOTIMPL; diff --git a/dlls/qedit/nullrenderer.c b/dlls/qedit/nullrenderer.c index ee68e6244c..b9bc3fec25 100644 --- a/dlls/qedit/nullrenderer.c +++ b/dlls/qedit/nullrenderer.c @@ -28,28 +28,28 @@ WINE_DEFAULT_DEBUG_CHANNEL(qedit);
typedef struct NullRendererImpl { - BaseRenderer renderer; + struct strmbase_renderer renderer; } NullRendererImpl;
-static inline NullRendererImpl *impl_from_BaseRenderer(BaseRenderer *iface) +static inline NullRendererImpl *impl_from_strmbase_renderer(struct strmbase_renderer *iface) { return CONTAINING_RECORD(iface, NullRendererImpl, renderer); }
-static HRESULT WINAPI NullRenderer_DoRenderSample(BaseRenderer *iface, IMediaSample *pMediaSample) +static HRESULT WINAPI NullRenderer_DoRenderSample(struct strmbase_renderer *iface, IMediaSample *sample) { return S_OK; }
-static HRESULT WINAPI NullRenderer_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TYPE * pmt) +static HRESULT WINAPI NullRenderer_CheckMediaType(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt) { TRACE("Not a stub!\n"); return S_OK; }
-static void null_renderer_destroy(BaseRenderer *iface) +static void null_renderer_destroy(struct strmbase_renderer *iface) { - NullRendererImpl *filter = impl_from_BaseRenderer(iface); + NullRendererImpl *filter = impl_from_strmbase_renderer(iface);
strmbase_renderer_cleanup(&filter->renderer); CoTaskMemFree(filter); diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index c0ff8ca5af..54b4c59903 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -45,7 +45,7 @@ static const IAMDirectSoundVtbl IAMDirectSound_Vtbl;
typedef struct DSoundRenderImpl { - BaseRenderer renderer; + struct strmbase_renderer renderer;
IBasicAudio IBasicAudio_iface; IReferenceClock IReferenceClock_iface; @@ -66,7 +66,7 @@ typedef struct DSoundRenderImpl HANDLE advisethread, thread_wait; } DSoundRenderImpl;
-static inline DSoundRenderImpl *impl_from_BaseRenderer(BaseRenderer *iface) +static inline DSoundRenderImpl *impl_from_strmbase_renderer(struct strmbase_renderer *iface) { return CONTAINING_RECORD(iface, DSoundRenderImpl, renderer); } @@ -298,16 +298,17 @@ static HRESULT DSoundRender_SendSampleData(DSoundRenderImpl* This, REFERENCE_TIM return S_OK; }
-static HRESULT WINAPI DSoundRender_ShouldDrawSampleNow(BaseRenderer *This, IMediaSample *pMediaSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime) +static HRESULT WINAPI DSoundRender_ShouldDrawSampleNow(struct strmbase_renderer *iface, + IMediaSample *sample, REFERENCE_TIME *start, REFERENCE_TIME *end) { /* We time ourselves do not use the base renderers timing */ return S_OK; }
-static HRESULT WINAPI DSoundRender_PrepareReceive(BaseRenderer *iface, IMediaSample *pSample) +static HRESULT WINAPI DSoundRender_PrepareReceive(struct strmbase_renderer *iface, IMediaSample *pSample) { - DSoundRenderImpl *This = impl_from_BaseRenderer(iface); + DSoundRenderImpl *This = impl_from_strmbase_renderer(iface); HRESULT hr; AM_MEDIA_TYPE *amt;
@@ -340,9 +341,9 @@ static HRESULT WINAPI DSoundRender_PrepareReceive(BaseRenderer *iface, IMediaSam return S_OK; }
-static HRESULT WINAPI DSoundRender_DoRenderSample(BaseRenderer *iface, IMediaSample * pSample) +static HRESULT WINAPI DSoundRender_DoRenderSample(struct strmbase_renderer *iface, IMediaSample *pSample) { - DSoundRenderImpl *This = impl_from_BaseRenderer(iface); + DSoundRenderImpl *This = impl_from_strmbase_renderer(iface); LPBYTE pbSrcStream = NULL; LONG cbSrcStream = 0; REFERENCE_TIME tStart, tStop; @@ -397,7 +398,7 @@ static HRESULT WINAPI DSoundRender_DoRenderSample(BaseRenderer *iface, IMediaSam return hr; }
-static HRESULT WINAPI DSoundRender_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TYPE * pmt) +static HRESULT WINAPI DSoundRender_CheckMediaType(struct strmbase_renderer *iface, const AM_MEDIA_TYPE * pmt) { if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Audio)) return S_FALSE; @@ -408,9 +409,9 @@ static HRESULT WINAPI DSoundRender_CheckMediaType(BaseRenderer *iface, const AM_ return S_OK; }
-static void dsound_render_stop_stream(BaseRenderer *iface) +static void dsound_render_stop_stream(struct strmbase_renderer *iface) { - DSoundRenderImpl *This = impl_from_BaseRenderer(iface); + DSoundRenderImpl *This = impl_from_strmbase_renderer(iface);
TRACE("(%p/%p)->()\n", This, iface);
@@ -418,9 +419,9 @@ static void dsound_render_stop_stream(BaseRenderer *iface) This->writepos = This->buf_size; }
-static void dsound_render_start_stream(BaseRenderer *iface) +static void dsound_render_start_stream(struct strmbase_renderer *iface) { - DSoundRenderImpl *This = impl_from_BaseRenderer(iface); + DSoundRenderImpl *This = impl_from_strmbase_renderer(iface);
TRACE("(%p)\n", This);
@@ -430,9 +431,9 @@ static void dsound_render_start_stream(BaseRenderer *iface) } }
-static HRESULT WINAPI DSoundRender_CompleteConnect(BaseRenderer * iface, IPin * pReceivePin) +static HRESULT WINAPI DSoundRender_CompleteConnect(struct strmbase_renderer *iface, IPin *pReceivePin) { - DSoundRenderImpl *This = impl_from_BaseRenderer(iface); + DSoundRenderImpl *This = impl_from_strmbase_renderer(iface); const AM_MEDIA_TYPE *pmt = &This->renderer.sink.pin.mtCurrent; HRESULT hr = S_OK; WAVEFORMATEX *format; @@ -478,9 +479,9 @@ static HRESULT WINAPI DSoundRender_CompleteConnect(BaseRenderer * iface, IPin * return hr; }
-static HRESULT WINAPI DSoundRender_BreakConnect(BaseRenderer* iface) +static HRESULT WINAPI DSoundRender_BreakConnect(struct strmbase_renderer *iface) { - DSoundRenderImpl *This = impl_from_BaseRenderer(iface); + DSoundRenderImpl *This = impl_from_strmbase_renderer(iface);
TRACE("(%p)->()\n", iface);
@@ -498,9 +499,9 @@ static HRESULT WINAPI DSoundRender_BreakConnect(BaseRenderer* iface) return S_OK; }
-static HRESULT WINAPI DSoundRender_EndOfStream(BaseRenderer* iface) +static HRESULT WINAPI DSoundRender_EndOfStream(struct strmbase_renderer *iface) { - DSoundRenderImpl *This = impl_from_BaseRenderer(iface); + DSoundRenderImpl *This = impl_from_strmbase_renderer(iface); HRESULT hr;
TRACE("(%p)->()\n",iface); @@ -517,9 +518,9 @@ static HRESULT WINAPI DSoundRender_EndOfStream(BaseRenderer* iface) return hr; }
-static HRESULT WINAPI DSoundRender_EndFlush(BaseRenderer* iface) +static HRESULT WINAPI DSoundRender_EndFlush(struct strmbase_renderer *iface) { - DSoundRenderImpl *This = impl_from_BaseRenderer(iface); + DSoundRenderImpl *This = impl_from_strmbase_renderer(iface);
TRACE("\n");
@@ -540,9 +541,9 @@ static HRESULT WINAPI DSoundRender_EndFlush(BaseRenderer* iface) return S_OK; }
-static void dsound_render_destroy(BaseRenderer *iface) +static void dsound_render_destroy(struct strmbase_renderer *iface) { - DSoundRenderImpl *filter = impl_from_BaseRenderer(iface); + DSoundRenderImpl *filter = impl_from_strmbase_renderer(iface);
if (filter->threadid) { @@ -562,9 +563,9 @@ static void dsound_render_destroy(BaseRenderer *iface) CoTaskMemFree(filter); }
-static HRESULT dsound_render_query_interface(BaseRenderer *iface, REFIID iid, void **out) +static HRESULT dsound_render_query_interface(struct strmbase_renderer *iface, REFIID iid, void **out) { - DSoundRenderImpl *filter = impl_from_BaseRenderer(iface); + DSoundRenderImpl *filter = impl_from_strmbase_renderer(iface);
if (IsEqualGUID(iid, &IID_IBasicAudio)) *out = &filter->IBasicAudio_iface; diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 48b845a14b..0752a586bd 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz);
typedef struct VideoRendererImpl { - BaseRenderer renderer; + struct strmbase_renderer renderer; BaseControlWindow baseControlWindow; BaseControlVideo baseControlVideo;
@@ -61,7 +61,7 @@ static inline VideoRendererImpl *impl_from_BaseWindow(BaseWindow *iface) return CONTAINING_RECORD(iface, VideoRendererImpl, baseControlWindow.baseWindow); }
-static inline VideoRendererImpl *impl_from_BaseRenderer(BaseRenderer *iface) +static inline VideoRendererImpl *impl_from_strmbase_renderer(struct strmbase_renderer *iface) { return CONTAINING_RECORD(iface, VideoRendererImpl, renderer); } @@ -176,7 +176,8 @@ static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, return S_OK; }
-static HRESULT WINAPI VideoRenderer_ShouldDrawSampleNow(BaseRenderer *This, IMediaSample *pSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime) +static HRESULT WINAPI VideoRenderer_ShouldDrawSampleNow(struct strmbase_renderer *filter, + IMediaSample *pSample, REFERENCE_TIME *start, REFERENCE_TIME *end) { /* Preroll means the sample isn't shown, this is used for key frames and things like that */ if (IMediaSample_IsPreroll(pSample) == S_OK) @@ -184,9 +185,9 @@ static HRESULT WINAPI VideoRenderer_ShouldDrawSampleNow(BaseRenderer *This, IMed return S_FALSE; }
-static HRESULT WINAPI VideoRenderer_DoRenderSample(BaseRenderer* iface, IMediaSample * pSample) +static HRESULT WINAPI VideoRenderer_DoRenderSample(struct strmbase_renderer *iface, IMediaSample *pSample) { - VideoRendererImpl *This = impl_from_BaseRenderer(iface); + VideoRendererImpl *This = impl_from_strmbase_renderer(iface); LPBYTE pbSrcStream = NULL; LONG cbSrcStream = 0; HRESULT hr; @@ -235,9 +236,9 @@ static HRESULT WINAPI VideoRenderer_DoRenderSample(BaseRenderer* iface, IMediaSa return S_OK; }
-static HRESULT WINAPI VideoRenderer_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TYPE * pmt) +static HRESULT WINAPI VideoRenderer_CheckMediaType(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *pmt) { - VideoRendererImpl *This = impl_from_BaseRenderer(iface); + VideoRendererImpl *This = impl_from_strmbase_renderer(iface);
if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Video)) return S_FALSE; @@ -284,9 +285,9 @@ static HRESULT WINAPI VideoRenderer_CheckMediaType(BaseRenderer *iface, const AM return S_FALSE; }
-static void video_renderer_destroy(BaseRenderer *iface) +static void video_renderer_destroy(struct strmbase_renderer *iface) { - VideoRendererImpl *filter = impl_from_BaseRenderer(iface); + VideoRendererImpl *filter = impl_from_strmbase_renderer(iface);
BaseControlWindow_Destroy(&filter->baseControlWindow); BaseControlVideo_Destroy(&filter->baseControlVideo); @@ -295,9 +296,9 @@ static void video_renderer_destroy(BaseRenderer *iface) CoTaskMemFree(filter); }
-static HRESULT video_renderer_query_interface(BaseRenderer *iface, REFIID iid, void **out) +static HRESULT video_renderer_query_interface(struct strmbase_renderer *iface, REFIID iid, void **out) { - VideoRendererImpl *filter = impl_from_BaseRenderer(iface); + VideoRendererImpl *filter = impl_from_strmbase_renderer(iface);
if (IsEqualGUID(iid, &IID_IBasicVideo)) *out = &filter->baseControlVideo.IBasicVideo_iface; @@ -310,9 +311,9 @@ static HRESULT video_renderer_query_interface(BaseRenderer *iface, REFIID iid, v return S_OK; }
-static HRESULT video_renderer_pin_query_interface(BaseRenderer *iface, REFIID iid, void **out) +static HRESULT video_renderer_pin_query_interface(struct strmbase_renderer *iface, REFIID iid, void **out) { - VideoRendererImpl *filter = impl_from_BaseRenderer(iface); + VideoRendererImpl *filter = impl_from_strmbase_renderer(iface);
if (IsEqualGUID(iid, &IID_IOverlay)) *out = &filter->IOverlay_iface; @@ -323,9 +324,9 @@ static HRESULT video_renderer_pin_query_interface(BaseRenderer *iface, REFIID ii return S_OK; }
-static void video_renderer_stop_stream(BaseRenderer *iface) +static void video_renderer_stop_stream(struct strmbase_renderer *iface) { - VideoRendererImpl *This = impl_from_BaseRenderer(iface); + VideoRendererImpl *This = impl_from_strmbase_renderer(iface);
TRACE("(%p)->()\n", This);
@@ -334,9 +335,9 @@ static void video_renderer_stop_stream(BaseRenderer *iface) RedrawWindow(This->baseControlWindow.baseWindow.hWnd, NULL, NULL, RDW_INVALIDATE|RDW_ERASE); }
-static void video_renderer_init_stream(BaseRenderer *iface) +static void video_renderer_init_stream(struct strmbase_renderer *iface) { - VideoRendererImpl *filter = impl_from_BaseRenderer(iface); + VideoRendererImpl *filter = impl_from_strmbase_renderer(iface);
VideoRenderer_AutoShowWindow(filter); } diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index d631165d1b..6a039db99a 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(quartz);
struct quartz_vmr { - BaseRenderer renderer; + struct strmbase_renderer renderer; BaseControlWindow baseControlWindow; BaseControlVideo baseControlVideo;
@@ -256,7 +256,7 @@ static DWORD VMR9_SendSampleData(struct quartz_vmr *This, VMR9PresentationInfo * return hr; }
-static HRESULT WINAPI VMR9_DoRenderSample(BaseRenderer *iface, IMediaSample * pSample) +static HRESULT WINAPI VMR9_DoRenderSample(struct strmbase_renderer *iface, IMediaSample *pSample) { struct quartz_vmr *This = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface); LPBYTE pbSrcStream = NULL; @@ -321,7 +321,7 @@ static HRESULT WINAPI VMR9_DoRenderSample(BaseRenderer *iface, IMediaSample * pS return hr; }
-static HRESULT WINAPI VMR9_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TYPE * pmt) +static HRESULT WINAPI VMR9_CheckMediaType(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *pmt) { struct quartz_vmr *This = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface);
@@ -412,7 +412,7 @@ static HRESULT VMR9_maybe_init(struct quartz_vmr *This, BOOL force) return hr; }
-static void vmr_start_stream(BaseRenderer *iface) +static void vmr_start_stream(struct strmbase_renderer *iface) { struct quartz_vmr *This = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface);
@@ -430,7 +430,7 @@ static void vmr_start_stream(BaseRenderer *iface) GetClientRect(This->baseControlWindow.baseWindow.hWnd, &This->target_rect); }
-static void vmr_stop_stream(BaseRenderer *iface) +static void vmr_stop_stream(struct strmbase_renderer *iface) { struct quartz_vmr *This = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface);
@@ -440,7 +440,8 @@ static void vmr_stop_stream(BaseRenderer *iface) IVMRImagePresenter9_StopPresenting(This->presenter, This->cookie); }
-static HRESULT WINAPI VMR9_ShouldDrawSampleNow(BaseRenderer *This, IMediaSample *pSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime) +static HRESULT WINAPI VMR9_ShouldDrawSampleNow(struct strmbase_renderer *iface, + IMediaSample *pSample, REFERENCE_TIME *start, REFERENCE_TIME *end) { /* Preroll means the sample isn't shown, this is used for key frames and things like that */ if (IMediaSample_IsPreroll(pSample) == S_OK) @@ -448,7 +449,7 @@ static HRESULT WINAPI VMR9_ShouldDrawSampleNow(BaseRenderer *This, IMediaSample return S_FALSE; }
-static HRESULT WINAPI VMR9_CompleteConnect(BaseRenderer *This, IPin *pReceivePin) +static HRESULT WINAPI VMR9_CompleteConnect(struct strmbase_renderer *This, IPin *pReceivePin) { struct quartz_vmr *pVMR9 = impl_from_IBaseFilter(&This->filter.IBaseFilter_iface); HRESULT hr; @@ -462,7 +463,7 @@ static HRESULT WINAPI VMR9_CompleteConnect(BaseRenderer *This, IPin *pReceivePin return hr; }
-static HRESULT WINAPI VMR9_BreakConnect(BaseRenderer *This) +static HRESULT WINAPI VMR9_BreakConnect(struct strmbase_renderer *This) { struct quartz_vmr *pVMR9 = impl_from_IBaseFilter(&This->filter.IBaseFilter_iface); HRESULT hr = S_OK; @@ -483,7 +484,7 @@ static HRESULT WINAPI VMR9_BreakConnect(BaseRenderer *This) return hr; }
-static void vmr_destroy(BaseRenderer *iface) +static void vmr_destroy(struct strmbase_renderer *iface) { struct quartz_vmr *filter = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface);
@@ -506,7 +507,7 @@ static void vmr_destroy(BaseRenderer *iface) CoTaskMemFree(filter); }
-static HRESULT vmr_query_interface(BaseRenderer *iface, REFIID iid, void **out) +static HRESULT vmr_query_interface(struct strmbase_renderer *iface, REFIID iid, void **out) { struct quartz_vmr *filter = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface);
@@ -541,7 +542,7 @@ static HRESULT vmr_query_interface(BaseRenderer *iface, REFIID iid, void **out) return S_OK; }
-static HRESULT vmr_pin_query_interface(BaseRenderer *iface, REFIID iid, void **out) +static HRESULT vmr_pin_query_interface(struct strmbase_renderer *iface, REFIID iid, void **out) { struct quartz_vmr *filter = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface);
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 81afc7c8d7..8ff687e453 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -22,14 +22,14 @@
WINE_DEFAULT_DEBUG_CHANNEL(strmbase);
-static inline BaseRenderer *impl_from_IBaseFilter(IBaseFilter *iface) +static inline struct strmbase_renderer *impl_from_IBaseFilter(IBaseFilter *iface) { - return CONTAINING_RECORD(iface, BaseRenderer, filter.IBaseFilter_iface); + return CONTAINING_RECORD(iface, struct strmbase_renderer, filter.IBaseFilter_iface); }
-static inline BaseRenderer *impl_from_strmbase_filter(struct strmbase_filter *iface) +static inline struct strmbase_renderer *impl_from_strmbase_filter(struct strmbase_filter *iface) { - return CONTAINING_RECORD(iface, BaseRenderer, filter); + return CONTAINING_RECORD(iface, struct strmbase_renderer, filter); }
static const IQualityControlVtbl Renderer_QualityControl_Vtbl = { @@ -40,14 +40,14 @@ static const IQualityControlVtbl Renderer_QualityControl_Vtbl = { QualityControlImpl_SetSink };
-static inline BaseRenderer *impl_from_IPin(IPin *iface) +static inline struct strmbase_renderer *impl_from_IPin(IPin *iface) { - return CONTAINING_RECORD(iface, BaseRenderer, sink.pin.IPin_iface); + return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface); }
static HRESULT WINAPI BaseRenderer_InputPin_ReceiveConnection(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt) { - BaseRenderer *filter = impl_from_IPin(iface); + struct strmbase_renderer *filter = impl_from_IPin(iface); HRESULT hr;
TRACE("iface %p, peer %p, mt %p.\n", iface, peer, mt); @@ -67,7 +67,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_ReceiveConnection(IPin *iface, IPin
static HRESULT WINAPI BaseRenderer_InputPin_Disconnect(IPin * iface) { - BaseRenderer *filter = impl_from_IPin(iface); + struct strmbase_renderer *filter = impl_from_IPin(iface); HRESULT hr;
TRACE("iface %p.\n", iface); @@ -87,7 +87,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_Disconnect(IPin * iface)
static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface) { - BaseRenderer *pFilter = impl_from_IPin(iface); + struct strmbase_renderer *pFilter = impl_from_IPin(iface); HRESULT hr;
TRACE("iface %p.\n", iface); @@ -109,7 +109,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface)
static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush(IPin * iface) { - BaseRenderer *pFilter = impl_from_IPin(iface); + struct strmbase_renderer *pFilter = impl_from_IPin(iface); HRESULT hr;
TRACE("iface %p.\n", iface); @@ -126,7 +126,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_BeginFlush(IPin * iface)
static HRESULT WINAPI BaseRenderer_InputPin_EndFlush(IPin * iface) { - BaseRenderer *pFilter = impl_from_IPin(iface); + struct strmbase_renderer *pFilter = impl_from_IPin(iface); HRESULT hr;
TRACE("iface %p.\n", iface); @@ -170,7 +170,7 @@ static const IPinVtbl BaseRenderer_InputPin_Vtbl =
static IPin *renderer_get_pin(struct strmbase_filter *iface, unsigned int index) { - BaseRenderer *filter = impl_from_strmbase_filter(iface); + struct strmbase_renderer *filter = impl_from_strmbase_filter(iface);
if (index == 0) return &filter->sink.pin.IPin_iface; @@ -179,13 +179,13 @@ static IPin *renderer_get_pin(struct strmbase_filter *iface, unsigned int index)
static void renderer_destroy(struct strmbase_filter *iface) { - BaseRenderer *filter = impl_from_strmbase_filter(iface); + struct strmbase_renderer *filter = impl_from_strmbase_filter(iface); filter->pFuncsTable->renderer_destroy(filter); }
static HRESULT renderer_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) { - BaseRenderer *filter = impl_from_strmbase_filter(iface); + struct strmbase_renderer *filter = impl_from_strmbase_filter(iface); HRESULT hr;
if (filter->pFuncsTable->renderer_query_interface @@ -214,13 +214,13 @@ static const struct strmbase_filter_ops filter_ops =
static HRESULT sink_query_accept(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt) { - BaseRenderer *filter = impl_from_IPin(&pin->IPin_iface); + struct strmbase_renderer *filter = impl_from_IPin(&pin->IPin_iface); return filter->pFuncsTable->pfnCheckMediaType(filter, mt); }
static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) { - BaseRenderer *filter = impl_from_IPin(&iface->IPin_iface); + struct strmbase_renderer *filter = impl_from_IPin(&iface->IPin_iface); HRESULT hr;
if (filter->pFuncsTable->renderer_pin_query_interface @@ -238,7 +238,7 @@ static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void
static HRESULT WINAPI BaseRenderer_Receive(BaseInputPin *pin, IMediaSample *sample) { - BaseRenderer *filter = impl_from_IPin(&pin->pin.IPin_iface); + struct strmbase_renderer *filter = impl_from_IPin(&pin->pin.IPin_iface); return BaseRendererImpl_Receive(filter, sample); }
@@ -250,7 +250,7 @@ static const BaseInputPinFuncTable input_BaseInputFuncTable = .pfnReceive = BaseRenderer_Receive, };
-void strmbase_renderer_cleanup(BaseRenderer *filter) +void strmbase_renderer_cleanup(struct strmbase_renderer *filter) { if (filter->sink.pin.peer) IPin_Disconnect(filter->sink.pin.peer); @@ -271,7 +271,7 @@ void strmbase_renderer_cleanup(BaseRenderer *filter) strmbase_filter_cleanup(&filter->filter); }
-HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSample) +HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *This, IMediaSample *pSample) { HRESULT hr = S_OK; REFERENCE_TIME start, stop; @@ -373,7 +373,7 @@ HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSamp
static HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter *iface) { - BaseRenderer *This = impl_from_IBaseFilter(iface); + struct strmbase_renderer *This = impl_from_IBaseFilter(iface);
TRACE("(%p)->()\n", This);
@@ -393,7 +393,7 @@ static HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter *iface)
static HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter *iface, REFERENCE_TIME tStart) { - BaseRenderer *This = impl_from_IBaseFilter(iface); + struct strmbase_renderer *This = impl_from_IBaseFilter(iface);
TRACE("iface %p, start %s.\n", iface, debugstr_time(tStart));
@@ -427,7 +427,7 @@ out:
static HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter *iface) { - BaseRenderer *This = impl_from_IBaseFilter(iface); + struct strmbase_renderer *This = impl_from_IBaseFilter(iface); HRESULT hr = S_OK;
TRACE("(%p)->()\n", This); @@ -463,7 +463,7 @@ static HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter *iface)
static HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock) { - BaseRenderer *This = impl_from_IBaseFilter(iface); + struct strmbase_renderer *This = impl_from_IBaseFilter(iface); HRESULT hr;
EnterCriticalSection(&This->filter.csFilter); @@ -477,7 +477,7 @@ static HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IRefere static HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState) { HRESULT hr; - BaseRenderer *This = impl_from_IBaseFilter(iface); + struct strmbase_renderer *This = impl_from_IBaseFilter(iface);
TRACE("(%p)->(%d, %p)\n", This, dwMilliSecsTimeout, pState);
@@ -510,7 +510,7 @@ static const IBaseFilterVtbl strmbase_renderer_vtbl = BaseFilterImpl_QueryVendorInfo };
-HRESULT WINAPI BaseRendererImpl_EndOfStream(BaseRenderer* iface) +HRESULT WINAPI BaseRendererImpl_EndOfStream(struct strmbase_renderer *iface) { IMediaEventSink* pEventSink; IFilterGraph *graph; @@ -533,7 +533,7 @@ HRESULT WINAPI BaseRendererImpl_EndOfStream(BaseRenderer* iface) return hr; }
-HRESULT WINAPI BaseRendererImpl_BeginFlush(BaseRenderer* iface) +HRESULT WINAPI BaseRendererImpl_BeginFlush(struct strmbase_renderer *iface) { TRACE("(%p)\n", iface); BaseRendererImpl_ClearPendingSample(iface); @@ -541,7 +541,7 @@ HRESULT WINAPI BaseRendererImpl_BeginFlush(BaseRenderer* iface) return S_OK; }
-HRESULT WINAPI BaseRendererImpl_EndFlush(BaseRenderer* iface) +HRESULT WINAPI BaseRendererImpl_EndFlush(struct strmbase_renderer *iface) { TRACE("(%p)\n", iface); QualityControlRender_Start(iface->qcimpl, iface->stream_start); @@ -550,7 +550,7 @@ HRESULT WINAPI BaseRendererImpl_EndFlush(BaseRenderer* iface) return S_OK; }
-HRESULT WINAPI BaseRendererImpl_ClearPendingSample(BaseRenderer *iface) +HRESULT WINAPI BaseRendererImpl_ClearPendingSample(struct strmbase_renderer *iface) { if (iface->pMediaSample) { @@ -560,7 +560,7 @@ HRESULT WINAPI BaseRendererImpl_ClearPendingSample(BaseRenderer *iface) return S_OK; }
-HRESULT WINAPI strmbase_renderer_init(BaseRenderer *filter, IUnknown *outer, +HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer, const CLSID *clsid, const WCHAR *sink_name, const BaseRendererFuncTable *func_table) { HRESULT hr; @@ -583,7 +583,7 @@ HRESULT WINAPI strmbase_renderer_init(BaseRenderer *filter, IUnknown *outer, }
InitializeCriticalSection(&filter->csRenderLock); - filter->csRenderLock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": BaseRenderer.csRenderLock"); + filter->csRenderLock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__": strmbase_renderer.csRenderLock"); filter->state_event = CreateEventW(NULL, TRUE, TRUE, NULL); filter->advise_event = CreateEventW(NULL, FALSE, FALSE, NULL); filter->flush_event = CreateEventW(NULL, TRUE, TRUE, NULL); diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index acfe6d8ab4..3c90223955 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -505,8 +505,7 @@ HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo); #endif #endif
-/* BaseRenderer Filter */ -typedef struct BaseRendererTag +struct strmbase_renderer { struct strmbase_filter filter;
@@ -529,50 +528,45 @@ typedef struct BaseRendererTag struct QualityControlImpl *qcimpl;
const struct BaseRendererFuncTable *pFuncsTable; -} BaseRenderer; +};
-typedef HRESULT (WINAPI *BaseRenderer_CheckMediaType)(BaseRenderer *This, const AM_MEDIA_TYPE *pmt); -typedef HRESULT (WINAPI *BaseRenderer_DoRenderSample)(BaseRenderer *This, IMediaSample *pMediaSample); -typedef VOID (WINAPI *BaseRenderer_OnReceiveFirstSample)(BaseRenderer *This, IMediaSample *pMediaSample); -typedef VOID (WINAPI *BaseRenderer_OnRenderEnd)(BaseRenderer *This, IMediaSample *pMediaSample); -typedef VOID (WINAPI *BaseRenderer_OnRenderStart)(BaseRenderer *This, IMediaSample *pMediaSample); -typedef VOID (WINAPI *BaseRenderer_OnWaitEnd)(BaseRenderer *This); -typedef VOID (WINAPI *BaseRenderer_OnWaitStart)(BaseRenderer *This); -typedef VOID (WINAPI *BaseRenderer_PrepareRender)(BaseRenderer *This); -typedef HRESULT (WINAPI *BaseRenderer_ShouldDrawSampleNow)(BaseRenderer *This, IMediaSample *pMediaSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime); -typedef HRESULT (WINAPI *BaseRenderer_PrepareReceive)(BaseRenderer *This, IMediaSample *pMediaSample); -typedef HRESULT (WINAPI *BaseRenderer_EndOfStream)(BaseRenderer *This); -typedef HRESULT (WINAPI *BaseRenderer_BeginFlush) (BaseRenderer *This); -typedef HRESULT (WINAPI *BaseRenderer_EndFlush) (BaseRenderer *This); -typedef HRESULT (WINAPI *BaseRenderer_BreakConnect) (BaseRenderer *This); -typedef HRESULT (WINAPI *BaseRenderer_CompleteConnect) (BaseRenderer *This, IPin *pReceivePin); +typedef HRESULT (WINAPI *BaseRenderer_CheckMediaType)(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt); +typedef HRESULT (WINAPI *BaseRenderer_DoRenderSample)(struct strmbase_renderer *iface, IMediaSample *sample); +typedef HRESULT (WINAPI *BaseRenderer_ShouldDrawSampleNow)(struct strmbase_renderer *iface, + IMediaSample *sample, REFERENCE_TIME *start, REFERENCE_TIME *end); +typedef HRESULT (WINAPI *BaseRenderer_PrepareReceive)(struct strmbase_renderer *iface, IMediaSample *sample); +typedef HRESULT (WINAPI *BaseRenderer_EndOfStream)(struct strmbase_renderer *iface); +typedef HRESULT (WINAPI *BaseRenderer_BeginFlush) (struct strmbase_renderer *iface); +typedef HRESULT (WINAPI *BaseRenderer_EndFlush) (struct strmbase_renderer *iface); +typedef HRESULT (WINAPI *BaseRenderer_BreakConnect) (struct strmbase_renderer *iface); +typedef HRESULT (WINAPI *BaseRenderer_CompleteConnect) (struct strmbase_renderer *iface, IPin *peer);
typedef struct BaseRendererFuncTable { BaseRenderer_CheckMediaType pfnCheckMediaType; BaseRenderer_DoRenderSample pfnDoRenderSample; - void (*renderer_init_stream)(BaseRenderer *iface); - void (*renderer_start_stream)(BaseRenderer *iface); - void (*renderer_stop_stream)(BaseRenderer *iface); + void (*renderer_init_stream)(struct strmbase_renderer *iface); + void (*renderer_start_stream)(struct strmbase_renderer *iface); + void (*renderer_stop_stream)(struct strmbase_renderer *iface); 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); - HRESULT (*renderer_pin_query_interface)(BaseRenderer *iface, REFIID iid, void **out); + void (*renderer_destroy)(struct strmbase_renderer *iface); + HRESULT (*renderer_query_interface)(struct strmbase_renderer *iface, REFIID iid, void **out); + HRESULT (*renderer_pin_query_interface)(struct strmbase_renderer *iface, REFIID iid, void **out); } BaseRendererFuncTable;
-HRESULT WINAPI BaseRendererImpl_Receive(BaseRenderer *This, IMediaSample * pSample); -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 BaseRendererImpl_BeginFlush(struct strmbase_renderer *filter); +HRESULT WINAPI BaseRendererImpl_ClearPendingSample(struct strmbase_renderer *filter); +HRESULT WINAPI BaseRendererImpl_EndOfStream(struct strmbase_renderer *filter); +HRESULT WINAPI BaseRendererImpl_EndFlush(struct strmbase_renderer *filter); +HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *filter, IMediaSample *sample);
-HRESULT WINAPI strmbase_renderer_init(BaseRenderer *filter, IUnknown *outer, +HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer, const CLSID *clsid, const WCHAR *sink_name, const BaseRendererFuncTable *func_table); -void strmbase_renderer_cleanup(BaseRenderer *filter); +void strmbase_renderer_cleanup(struct strmbase_renderer *filter);
/* Dll Functions */ BOOL WINAPI STRMBASE_DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/evr/evr.c | 2 +- dlls/qedit/nullrenderer.c | 4 ++-- dlls/quartz/dsoundrender.c | 4 ++-- dlls/quartz/videorenderer.c | 4 ++-- dlls/quartz/vmr9.c | 4 ++-- dlls/strmbase/renderer.c | 4 ++-- include/wine/strmbase.h | 9 +++++---- 7 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c index b1721db027..acaa9927c1 100644 --- a/dlls/evr/evr.c +++ b/dlls/evr/evr.c @@ -61,7 +61,7 @@ static HRESULT WINAPI evr_CheckMediaType(struct strmbase_renderer *iface, const return E_NOTIMPL; }
-static const BaseRendererFuncTable renderer_ops = +static const struct strmbase_renderer_ops renderer_ops = { .pfnCheckMediaType = evr_CheckMediaType, .pfnDoRenderSample = evr_DoRenderSample, diff --git a/dlls/qedit/nullrenderer.c b/dlls/qedit/nullrenderer.c index b9bc3fec25..b3267d1ba1 100644 --- a/dlls/qedit/nullrenderer.c +++ b/dlls/qedit/nullrenderer.c @@ -55,7 +55,7 @@ static void null_renderer_destroy(struct strmbase_renderer *iface) CoTaskMemFree(filter); }
-static const BaseRendererFuncTable RendererFuncTable = +static const struct strmbase_renderer_ops renderer_ops = { .pfnCheckMediaType = NullRenderer_CheckMediaType, .pfnDoRenderSample = NullRenderer_DoRenderSample, @@ -74,7 +74,7 @@ HRESULT NullRenderer_create(IUnknown *outer, void **out) pNullRenderer = CoTaskMemAlloc(sizeof(NullRendererImpl));
hr = strmbase_renderer_init(&pNullRenderer->renderer, outer, - &CLSID_NullRenderer, sink_name, &RendererFuncTable); + &CLSID_NullRenderer, sink_name, &renderer_ops);
if (FAILED(hr)) CoTaskMemFree(pNullRenderer); diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index 54b4c59903..ed257c373f 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -580,7 +580,7 @@ static HRESULT dsound_render_query_interface(struct strmbase_renderer *iface, RE return S_OK; }
-static const BaseRendererFuncTable BaseFuncTable = +static const struct strmbase_renderer_ops renderer_ops = { .pfnCheckMediaType = DSoundRender_CheckMediaType, .pfnDoRenderSample = DSoundRender_DoRenderSample, @@ -611,7 +611,7 @@ HRESULT DSoundRender_create(IUnknown *outer, void **out) ZeroMemory(pDSoundRender, sizeof(DSoundRenderImpl));
hr = strmbase_renderer_init(&pDSoundRender->renderer, - outer, &CLSID_DSoundRender, sink_name, &BaseFuncTable); + outer, &CLSID_DSoundRender, sink_name, &renderer_ops);
pDSoundRender->IBasicAudio_iface.lpVtbl = &IBasicAudio_Vtbl; pDSoundRender->IReferenceClock_iface.lpVtbl = &IReferenceClock_Vtbl; diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 0752a586bd..b21cc281b9 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -367,7 +367,7 @@ static BOOL WINAPI VideoRenderer_OnSize(BaseWindow *iface, LONG Width, LONG Heig return TRUE; }
-static const BaseRendererFuncTable BaseFuncTable = +static const struct strmbase_renderer_ops renderer_ops = { .pfnCheckMediaType = VideoRenderer_CheckMediaType, .pfnDoRenderSample = VideoRenderer_DoRenderSample, @@ -760,7 +760,7 @@ HRESULT VideoRenderer_create(IUnknown *outer, void **out) pVideoRenderer->IOverlay_iface.lpVtbl = &overlay_vtbl;
hr = strmbase_renderer_init(&pVideoRenderer->renderer, outer, - &CLSID_VideoRenderer, sink_name, &BaseFuncTable); + &CLSID_VideoRenderer, sink_name, &renderer_ops);
if (FAILED(hr)) goto fail; diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 6a039db99a..1a4f85c87c 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -555,7 +555,7 @@ static HRESULT vmr_pin_query_interface(struct strmbase_renderer *iface, REFIID i return S_OK; }
-static const BaseRendererFuncTable BaseFuncTable = +static const struct strmbase_renderer_ops renderer_ops = { .pfnCheckMediaType = VMR9_CheckMediaType, .pfnDoRenderSample = VMR9_DoRenderSample, @@ -2229,7 +2229,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, outer, clsid, sink_name, &BaseFuncTable); + hr = strmbase_renderer_init(&pVMR->renderer, outer, clsid, sink_name, &renderer_ops); if (FAILED(hr)) goto fail;
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 8ff687e453..c75452aea6 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -561,14 +561,14 @@ HRESULT WINAPI BaseRendererImpl_ClearPendingSample(struct strmbase_renderer *ifa }
HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer, - const CLSID *clsid, const WCHAR *sink_name, const BaseRendererFuncTable *func_table) + const CLSID *clsid, const WCHAR *sink_name, const struct strmbase_renderer_ops *ops) { HRESULT hr;
memset(filter, 0, sizeof(*filter)); strmbase_filter_init(&filter->filter, &strmbase_renderer_vtbl, outer, clsid, &filter_ops);
- filter->pFuncsTable = func_table; + filter->pFuncsTable = ops;
strmbase_sink_init(&filter->sink, &BaseRenderer_InputPin_Vtbl, &filter->filter, sink_name, &input_BaseInputFuncTable, NULL); diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 3c90223955..791901077d 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -527,7 +527,7 @@ struct strmbase_renderer IQualityControl *pQSink; struct QualityControlImpl *qcimpl;
- const struct BaseRendererFuncTable *pFuncsTable; + const struct strmbase_renderer_ops *pFuncsTable; };
typedef HRESULT (WINAPI *BaseRenderer_CheckMediaType)(struct strmbase_renderer *iface, const AM_MEDIA_TYPE *mt); @@ -541,7 +541,8 @@ typedef HRESULT (WINAPI *BaseRenderer_EndFlush) (struct strmbase_renderer *iface typedef HRESULT (WINAPI *BaseRenderer_BreakConnect) (struct strmbase_renderer *iface); typedef HRESULT (WINAPI *BaseRenderer_CompleteConnect) (struct strmbase_renderer *iface, IPin *peer);
-typedef struct BaseRendererFuncTable { +struct strmbase_renderer_ops +{ BaseRenderer_CheckMediaType pfnCheckMediaType; BaseRenderer_DoRenderSample pfnDoRenderSample; void (*renderer_init_stream)(struct strmbase_renderer *iface); @@ -556,7 +557,7 @@ typedef struct BaseRendererFuncTable { void (*renderer_destroy)(struct strmbase_renderer *iface); HRESULT (*renderer_query_interface)(struct strmbase_renderer *iface, REFIID iid, void **out); HRESULT (*renderer_pin_query_interface)(struct strmbase_renderer *iface, REFIID iid, void **out); -} BaseRendererFuncTable; +};
HRESULT WINAPI BaseRendererImpl_BeginFlush(struct strmbase_renderer *filter); HRESULT WINAPI BaseRendererImpl_ClearPendingSample(struct strmbase_renderer *filter); @@ -565,7 +566,7 @@ HRESULT WINAPI BaseRendererImpl_EndFlush(struct strmbase_renderer *filter); HRESULT WINAPI BaseRendererImpl_Receive(struct strmbase_renderer *filter, IMediaSample *sample);
HRESULT WINAPI strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer, - const CLSID *clsid, const WCHAR *sink_name, const BaseRendererFuncTable *func_table); + const CLSID *clsid, const WCHAR *sink_name, const struct strmbase_renderer_ops *ops); void strmbase_renderer_cleanup(struct strmbase_renderer *filter);
/* Dll Functions */
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/enumpins.c | 6 +++--- dlls/strmbase/filter.c | 12 ++++++------ include/wine/strmbase.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/strmbase/enumpins.c b/dlls/strmbase/enumpins.c index 222f61c2fc..5175158e96 100644 --- a/dlls/strmbase/enumpins.c +++ b/dlls/strmbase/enumpins.c @@ -59,7 +59,7 @@ HRESULT enum_pins_create(struct strmbase_filter *base, IEnumPins **out) IBaseFilter_AddRef(&base->IBaseFilter_iface); object->Version = base->pin_version;
- while ((pin = base->pFuncsTable->filter_get_pin(base, object->count))) + while ((pin = base->ops->filter_get_pin(base, object->count))) ++object->count;
TRACE("Created enumerator %p.\n", object); @@ -137,7 +137,7 @@ static HRESULT WINAPI IEnumPinsImpl_Next(IEnumPins * iface, ULONG cPins, IPin **
for (i = 0; i < cPins; ++i) { - IPin *pin = This->base->pFuncsTable->filter_get_pin(This->base, This->uIndex + i); + IPin *pin = This->base->ops->filter_get_pin(This->base, This->uIndex + i);
if (!pin) break; @@ -180,7 +180,7 @@ static HRESULT WINAPI IEnumPinsImpl_Reset(IEnumPins *iface) if (enum_pins->Version != enum_pins->base->pin_version) { enum_pins->count = 0; - while ((pin = enum_pins->base->pFuncsTable->filter_get_pin(enum_pins->base, enum_pins->count))) + while ((pin = enum_pins->base->ops->filter_get_pin(enum_pins->base, enum_pins->count))) ++enum_pins->count; }
diff --git a/dlls/strmbase/filter.c b/dlls/strmbase/filter.c index c9d15e31c7..e1885cd935 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -36,8 +36,8 @@ static HRESULT WINAPI filter_inner_QueryInterface(IUnknown *iface, REFIID iid, v
*out = NULL;
- if (filter->pFuncsTable->filter_query_interface - && SUCCEEDED(hr = filter->pFuncsTable->filter_query_interface(filter, iid, out))) + if (filter->ops->filter_query_interface + && SUCCEEDED(hr = filter->ops->filter_query_interface(filter, iid, out))) { return hr; } @@ -78,7 +78,7 @@ static ULONG WINAPI filter_inner_Release(IUnknown *iface) TRACE("%p decreasing refcount to %u.\n", filter, refcount);
if (!refcount) - filter->pFuncsTable->filter_destroy(filter); + filter->ops->filter_destroy(filter);
return refcount; } @@ -229,7 +229,7 @@ HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin
TRACE("(%p)->(%s, %p)\n", This, debugstr_w(id), ret);
- for (i = 0; (pin = This->pFuncsTable->filter_get_pin(This, i)); ++i) + for (i = 0; (pin = This->ops->filter_get_pin(This, i)); ++i) { hr = IPin_QueryPinInfo(pin, &info); if (FAILED(hr)) @@ -292,7 +292,7 @@ VOID WINAPI BaseFilterImpl_IncrementPinVersion(struct strmbase_filter *filter) }
void strmbase_filter_init(struct strmbase_filter *filter, const IBaseFilterVtbl *vtbl, IUnknown *outer, - const CLSID *clsid, const struct strmbase_filter_ops *func_table) + const CLSID *clsid, const struct strmbase_filter_ops *ops) { memset(filter, 0, sizeof(*filter));
@@ -306,7 +306,7 @@ void strmbase_filter_init(struct strmbase_filter *filter, const IBaseFilterVtbl filter->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": strmbase_filter.csFilter"); filter->clsid = *clsid; filter->pin_version = 1; - filter->pFuncsTable = func_table; + filter->ops = ops; }
void strmbase_filter_cleanup(struct strmbase_filter *This) diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 791901077d..3f0883fcb6 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -162,7 +162,7 @@ struct strmbase_filter CLSID clsid; LONG pin_version;
- const struct strmbase_filter_ops *pFuncsTable; + const struct strmbase_filter_ops *ops; };
struct strmbase_filter_ops
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/filter.c | 64 +++++++++++++++++++++++++++++------------ include/wine/strmbase.h | 6 ++++ 2 files changed, 52 insertions(+), 18 deletions(-)
diff --git a/dlls/strmbase/filter.c b/dlls/strmbase/filter.c index e1885cd935..ffe506d517 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -126,54 +126,82 @@ HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter * iface, CLSID * pClsid) HRESULT WINAPI BaseFilterImpl_Stop(IBaseFilter *iface) { struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + HRESULT hr = S_OK;
- TRACE("iface %p.\n", iface); + TRACE("filter %p.\n", filter);
EnterCriticalSection(&filter->csFilter); - filter->state = State_Stopped; + + if (filter->state == State_Running && filter->ops->filter_stop_stream) + hr = filter->ops->filter_stop_stream(filter); + if (SUCCEEDED(hr) && filter->ops->filter_cleanup_stream) + hr = filter->ops->filter_cleanup_stream(filter); + if (SUCCEEDED(hr)) + filter->state = State_Stopped; + LeaveCriticalSection(&filter->csFilter);
- return S_OK; + return hr; }
HRESULT WINAPI BaseFilterImpl_Pause(IBaseFilter *iface) { struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + HRESULT hr = S_OK;
- TRACE("iface %p.\n", iface); + TRACE("filter %p.\n", filter);
EnterCriticalSection(&filter->csFilter); - filter->state = State_Paused; + + if (filter->state == State_Stopped && filter->ops->filter_init_stream) + hr = filter->ops->filter_init_stream(filter); + else if (filter->state == State_Running && filter->ops->filter_stop_stream) + hr = filter->ops->filter_stop_stream(filter); + if (SUCCEEDED(hr)) + filter->state = State_Paused; + LeaveCriticalSection(&filter->csFilter);
- return S_OK; + return hr; }
HRESULT WINAPI BaseFilterImpl_Run(IBaseFilter *iface, REFERENCE_TIME start) { struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + HRESULT hr = S_OK;
- TRACE("iface %p, start %s.\n", iface, debugstr_time(start)); + TRACE("filter %p, start %s.\n", filter, debugstr_time(start));
EnterCriticalSection(&filter->csFilter); - filter->state = State_Running; + + if (filter->state == State_Stopped && filter->ops->filter_init_stream) + hr = filter->ops->filter_init_stream(filter); + if (SUCCEEDED(hr) && filter->ops->filter_start_stream) + hr = filter->ops->filter_start_stream(filter, start); + if (SUCCEEDED(hr)) + filter->state = State_Running; + LeaveCriticalSection(&filter->csFilter);
- return S_OK; + return hr; }
-HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState ) +HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter *iface, DWORD timeout, FILTER_STATE *state) { - struct strmbase_filter *This = impl_from_IBaseFilter(iface); - TRACE("(%p)->(%d, %p)\n", This, dwMilliSecsTimeout, pState); + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); + HRESULT hr = S_OK;
- EnterCriticalSection(&This->csFilter); - { - *pState = This->state; - } - LeaveCriticalSection(&This->csFilter); + TRACE("filter %p, timeout %u, state %p.\n", filter, timeout, state);
- return S_OK; + EnterCriticalSection(&filter->csFilter); + + if (filter->ops->filter_wait_state) + hr = filter->ops->filter_wait_state(filter, timeout); + *state = filter->state; + + LeaveCriticalSection(&filter->csFilter); + + return hr; }
HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock) diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 3f0883fcb6..a4920054e6 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -170,6 +170,12 @@ struct strmbase_filter_ops IPin *(*filter_get_pin)(struct strmbase_filter *iface, unsigned int index); void (*filter_destroy)(struct strmbase_filter *iface); HRESULT (*filter_query_interface)(struct strmbase_filter *iface, REFIID iid, void **out); + + HRESULT (*filter_init_stream)(struct strmbase_filter *iface); + HRESULT (*filter_start_stream)(struct strmbase_filter *iface, REFERENCE_TIME time); + HRESULT (*filter_stop_stream)(struct strmbase_filter *iface); + HRESULT (*filter_cleanup_stream)(struct strmbase_filter *iface); + HRESULT (*filter_wait_state)(struct strmbase_filter *iface, DWORD timeout); };
HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/transform.c | 111 ++++++++++++++------------------------ 1 file changed, 41 insertions(+), 70 deletions(-)
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index 3fd9d8bd6f..d0484a2543 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -155,10 +155,48 @@ static void transform_destroy(struct strmbase_filter *iface) CoTaskMemFree(filter); }
+static HRESULT transform_init_stream(struct strmbase_filter *iface) +{ + TransformFilter *filter = impl_from_strmbase_filter(iface); + HRESULT hr = S_OK; + + EnterCriticalSection(&filter->csReceive); + + filter->sink.end_of_stream = FALSE; + if (filter->pFuncsTable->pfnStartStreaming) + hr = filter->pFuncsTable->pfnStartStreaming(filter); + if (SUCCEEDED(hr)) + hr = BaseOutputPinImpl_Active(&filter->source); + + LeaveCriticalSection(&filter->csReceive); + + return hr; +} + +static HRESULT transform_cleanup_stream(struct strmbase_filter *iface) +{ + TransformFilter *filter = impl_from_strmbase_filter(iface); + HRESULT hr = S_OK; + + EnterCriticalSection(&filter->csReceive); + + filter->sink.end_of_stream = FALSE; + if (filter->pFuncsTable->pfnStopStreaming) + hr = filter->pFuncsTable->pfnStopStreaming(filter); + if (SUCCEEDED(hr)) + hr = BaseOutputPinImpl_Inactive(&filter->source); + + LeaveCriticalSection(&filter->csReceive); + + return hr; +} + static const struct strmbase_filter_ops filter_ops = { .filter_get_pin = transform_get_pin, .filter_destroy = transform_destroy, + .filter_init_stream = transform_init_stream, + .filter_cleanup_stream = transform_cleanup_stream, };
static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out) @@ -207,73 +245,6 @@ static const struct strmbase_source_ops source_ops = .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, };
-static HRESULT WINAPI TransformFilterImpl_Stop(IBaseFilter *iface) -{ - TransformFilter *This = impl_from_IBaseFilter(iface); - HRESULT hr = S_OK; - - TRACE("(%p/%p)\n", This, iface); - - EnterCriticalSection(&This->csReceive); - { - This->filter.state = State_Stopped; - if (This->pFuncsTable->pfnStopStreaming) - hr = This->pFuncsTable->pfnStopStreaming(This); - if (SUCCEEDED(hr)) - hr = BaseOutputPinImpl_Inactive(&This->source); - } - LeaveCriticalSection(&This->csReceive); - - return hr; -} - -static HRESULT WINAPI TransformFilterImpl_Pause(IBaseFilter *iface) -{ - TransformFilter *This = impl_from_IBaseFilter(iface); - HRESULT hr; - - TRACE("(%p/%p)->()\n", This, iface); - - EnterCriticalSection(&This->csReceive); - { - if (This->filter.state == State_Stopped) - hr = IBaseFilter_Run(iface, -1); - else - hr = S_OK; - - if (SUCCEEDED(hr)) - This->filter.state = State_Paused; - } - LeaveCriticalSection(&This->csReceive); - - return hr; -} - -static HRESULT WINAPI TransformFilterImpl_Run(IBaseFilter *iface, REFERENCE_TIME tStart) -{ - HRESULT hr = S_OK; - TransformFilter *This = impl_from_IBaseFilter(iface); - - TRACE("iface %p, start %s.\n", iface, debugstr_time(tStart)); - - EnterCriticalSection(&This->csReceive); - { - if (This->filter.state == State_Stopped) - { - This->sink.end_of_stream = FALSE; - if (This->pFuncsTable->pfnStartStreaming) - hr = This->pFuncsTable->pfnStartStreaming(This); - if (SUCCEEDED(hr)) - hr = BaseOutputPinImpl_Active(&This->source); - } - - if (SUCCEEDED(hr)) - This->filter.state = State_Running; - } - LeaveCriticalSection(&This->csReceive); - - return hr; -}
static const IBaseFilterVtbl transform_vtbl = { @@ -281,9 +252,9 @@ static const IBaseFilterVtbl transform_vtbl = BaseFilterImpl_AddRef, BaseFilterImpl_Release, BaseFilterImpl_GetClassID, - TransformFilterImpl_Stop, - TransformFilterImpl_Pause, - TransformFilterImpl_Run, + BaseFilterImpl_Stop, + BaseFilterImpl_Pause, + BaseFilterImpl_Run, BaseFilterImpl_GetState, BaseFilterImpl_SetSyncSource, BaseFilterImpl_GetSyncSource,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58342
Your paranoid android.
=== debian10 (32 bit report) ===
quartz: filtergraph.c:781: Test failed: Wait timed out.
=== debian10 (64 bit WoW report) ===
quartz: filtergraph: Timeout