[PATCH 4/5] strmbase: Set the IQualityControl vtbl in QualityControlImpl_Create().

Zebediah Figura z.figura12 at gmail.com
Thu Jul 16 20:34:26 CDT 2020


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/strmbase/qualitycontrol.c   | 48 +++++++++++++++++++-------------
 dlls/strmbase/renderer.c         |  9 ------
 dlls/strmbase/strmbase_private.h |  5 ----
 3 files changed, 29 insertions(+), 33 deletions(-)

diff --git a/dlls/strmbase/qualitycontrol.c b/dlls/strmbase/qualitycontrol.c
index 918757caa81..c4e055858ef 100644
--- a/dlls/strmbase/qualitycontrol.c
+++ b/dlls/strmbase/qualitycontrol.c
@@ -27,20 +27,6 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(strmbase_qc);
 
-HRESULT QualityControlImpl_Create(struct strmbase_pin *pin, struct strmbase_qc **ppv)
-{
-    struct strmbase_qc *This;
-    *ppv = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(struct strmbase_qc));
-    if (!*ppv)
-        return E_OUTOFMEMORY;
-    This = *ppv;
-    This->pin = pin;
-    This->tonotify = NULL;
-    This->current_rstart = This->current_rstop = -1;
-    TRACE("-> %p\n", This);
-    return S_OK;
-}
-
 void QualityControlImpl_Destroy(struct strmbase_qc *This)
 {
     HeapFree(GetProcessHeap(),0,This);
@@ -51,25 +37,25 @@ static inline struct strmbase_qc *impl_from_IQualityControl(IQualityControl *ifa
     return CONTAINING_RECORD(iface, struct strmbase_qc, IQualityControl_iface);
 }
 
-HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv)
+static HRESULT WINAPI quality_control_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv)
 {
     struct strmbase_qc *This = impl_from_IQualityControl(iface);
     return IBaseFilter_QueryInterface(&This->pin->filter->IBaseFilter_iface, riid, ppv);
 }
 
-ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface)
+static ULONG WINAPI quality_control_AddRef(IQualityControl *iface)
 {
     struct strmbase_qc *This = impl_from_IQualityControl(iface);
     return IBaseFilter_AddRef(&This->pin->filter->IBaseFilter_iface);
 }
 
-ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface)
+static ULONG WINAPI quality_control_Release(IQualityControl *iface)
 {
     struct strmbase_qc *This = impl_from_IQualityControl(iface);
     return IBaseFilter_Release(&This->pin->filter->IBaseFilter_iface);
 }
 
-HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm)
+static HRESULT WINAPI quality_control_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm)
 {
     struct strmbase_qc *This = impl_from_IQualityControl(iface);
     HRESULT hr = S_FALSE;
@@ -94,7 +80,7 @@ HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *se
     return hr;
 }
 
-HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityControl *tonotify)
+static HRESULT WINAPI quality_control_SetSink(IQualityControl *iface, IQualityControl *tonotify)
 {
     struct strmbase_qc *This = impl_from_IQualityControl(iface);
     TRACE("%p %p\n", This, tonotify);
@@ -102,6 +88,15 @@ HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityContro
     return S_OK;
 }
 
+static const IQualityControlVtbl quality_control_vtbl =
+{
+    quality_control_QueryInterface,
+    quality_control_AddRef,
+    quality_control_Release,
+    quality_control_Notify,
+    quality_control_SetSink,
+};
+
 /* Macros copied from gstreamer, weighted average between old average and new ones */
 #define DO_RUNNING_AVG(avg,val,size) (((val) + ((size)-1) * (avg)) / (size))
 
@@ -317,3 +312,18 @@ void QualityControlRender_EndRender(struct strmbase_qc *This)
     else
         This->avg_render = UPDATE_RUNNING_AVG (This->avg_render, elapsed);
 }
+
+HRESULT QualityControlImpl_Create(struct strmbase_pin *pin, struct strmbase_qc **ppv)
+{
+    struct strmbase_qc *This;
+    *ppv = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(struct strmbase_qc));
+    if (!*ppv)
+        return E_OUTOFMEMORY;
+    This = *ppv;
+    This->pin = pin;
+    This->tonotify = NULL;
+    This->current_rstart = This->current_rstop = -1;
+    This->IQualityControl_iface.lpVtbl = &quality_control_vtbl;
+    TRACE("-> %p\n", This);
+    return S_OK;
+}
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c
index f1e74f64764..3895cb31194 100644
--- a/dlls/strmbase/renderer.c
+++ b/dlls/strmbase/renderer.c
@@ -27,14 +27,6 @@ static inline struct strmbase_renderer *impl_from_strmbase_filter(struct strmbas
     return CONTAINING_RECORD(iface, struct strmbase_renderer, filter);
 }
 
-static const IQualityControlVtbl Renderer_QualityControl_Vtbl = {
-    QualityControlImpl_QueryInterface,
-    QualityControlImpl_AddRef,
-    QualityControlImpl_Release,
-    QualityControlImpl_Notify,
-    QualityControlImpl_SetSink
-};
-
 static inline struct strmbase_renderer *impl_from_IPin(IPin *iface)
 {
     return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface);
@@ -406,5 +398,4 @@ void strmbase_renderer_init(struct strmbase_renderer *filter, IUnknown *outer,
     filter->flush_event = CreateEventW(NULL, TRUE, TRUE, NULL);
 
     QualityControlImpl_Create(&filter->sink.pin, &filter->qcimpl);
-    filter->qcimpl->IQualityControl_iface.lpVtbl = &Renderer_QualityControl_Vtbl;
 }
diff --git a/dlls/strmbase/strmbase_private.h b/dlls/strmbase/strmbase_private.h
index 8df1cac71eb..15be9498e7d 100644
--- a/dlls/strmbase/strmbase_private.h
+++ b/dlls/strmbase/strmbase_private.h
@@ -70,11 +70,6 @@ struct strmbase_qc
 
 HRESULT QualityControlImpl_Create(struct strmbase_pin *pin, struct strmbase_qc **out);
 void QualityControlImpl_Destroy(struct strmbase_qc *qc);
-HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv);
-ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface);
-ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface);
-HRESULT WINAPI QualityControlImpl_Notify(IQualityControl *iface, IBaseFilter *sender, Quality qm);
-HRESULT WINAPI QualityControlImpl_SetSink(IQualityControl *iface, IQualityControl *tonotify);
 
 void QualityControlRender_Start(struct strmbase_qc *This, REFERENCE_TIME tStart);
 void QualityControlRender_DoQOS(struct strmbase_qc *priv);
-- 
2.27.0




More information about the wine-devel mailing list