[PATCH 2/5] strmbase: Get rid of the BaseOutputPinFuncTable typedef.

Zebediah Figura z.figura12 at gmail.com
Thu Sep 12 14:28:26 CDT 2019


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/qcap/avico.c               |  5 +++--
 dlls/qcap/avimux.c              |  5 +++--
 dlls/qcap/smartteefilter.c      | 10 ++++++----
 dlls/qcap/vfwcapture.c          |  5 +++--
 dlls/quartz/filesource.c        |  7 ++++---
 dlls/quartz/parser.c            |  5 +++--
 dlls/strmbase/pin.c             |  2 +-
 dlls/strmbase/transform.c       |  5 +++--
 dlls/winegstreamer/gstdemux.c   |  5 +++--
 dlls/wineqtdecoder/qtsplitter.c |  5 +++--
 include/wine/strmbase.h         |  9 +++++----
 11 files changed, 37 insertions(+), 26 deletions(-)

diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c
index c052bda5995..e7804c06a36 100644
--- a/dlls/qcap/avico.c
+++ b/dlls/qcap/avico.c
@@ -579,7 +579,8 @@ static HRESULT WINAPI AVICompressorOut_DecideAllocator(struct strmbase_source *b
     return BaseOutputPinImpl_DecideAllocator(base, pPin, pAlloc);
 }
 
-static const BaseOutputPinFuncTable AVICompressorBaseOutputPinVtbl = {
+static const struct strmbase_source_ops source_ops =
+{
     {
         NULL,
         AVICompressorOut_GetMediaType
@@ -608,7 +609,7 @@ IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr)
     strmbase_sink_init(&compressor->sink, &AVICompressorInputPinVtbl,
             &compressor->filter, sink_name, &AVICompressorBaseInputPinVtbl, NULL);
     strmbase_source_init(&compressor->source, &AVICompressorOutputPinVtbl,
-            &compressor->filter, source_name, &AVICompressorBaseOutputPinVtbl);
+            &compressor->filter, source_name, &source_ops);
 
     *phr = S_OK;
     return &compressor->filter.IUnknown_inner;
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c
index fbc74ae4880..304b34f5f9f 100644
--- a/dlls/qcap/avimux.c
+++ b/dlls/qcap/avimux.c
@@ -1221,7 +1221,8 @@ static HRESULT WINAPI AviMuxOut_DecideAllocator(struct strmbase_source *base,
     return IMemInputPin_NotifyAllocator(pPin, *pAlloc, TRUE);
 }
 
-static const BaseOutputPinFuncTable AviMuxOut_BaseOutputFuncTable = {
+static const struct strmbase_source_ops source_ops =
+{
     {
         AviMuxOut_CheckMediaType,
         AviMuxOut_GetMediaType
@@ -2018,7 +2019,7 @@ IUnknown * WINAPI QCAP_createAVIMux(IUnknown *outer, HRESULT *phr)
     info.pFilter = &avimux->filter.IBaseFilter_iface;
     lstrcpyW(info.achName, output_name);
     strmbase_source_init(&avimux->source, &AviMuxOut_PinVtbl, &avimux->filter,
-            output_name, &AviMuxOut_BaseOutputFuncTable);
+            output_name, &source_ops);
     avimux->IQualityControl_iface.lpVtbl = &AviMuxOut_QualityControlVtbl;
     avimux->cur_stream = 0;
     avimux->cur_time = 0;
diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c
index 353409dcfc1..dd819c23be0 100644
--- a/dlls/qcap/smartteefilter.c
+++ b/dlls/qcap/smartteefilter.c
@@ -389,7 +389,8 @@ static HRESULT WINAPI SmartTeeFilterCapture_DecideAllocator(struct strmbase_sour
     return IMemInputPin_NotifyAllocator(pPin, This->sink.pAllocator, TRUE);
 }
 
-static const BaseOutputPinFuncTable SmartTeeFilterCaptureFuncs = {
+static const struct strmbase_source_ops capture_ops =
+{
     {
         SmartTeeFilterCapture_CheckMediaType,
         SmartTeeFilterCapture_GetMediaType
@@ -461,7 +462,8 @@ static HRESULT WINAPI SmartTeeFilterPreview_DecideAllocator(struct strmbase_sour
     return IMemInputPin_NotifyAllocator(pPin, This->sink.pAllocator, TRUE);
 }
 
-static const BaseOutputPinFuncTable SmartTeeFilterPreviewFuncs = {
+static const struct strmbase_source_ops preview_ops =
+{
     {
         SmartTeeFilterPreview_CheckMediaType,
         SmartTeeFilterPreview_GetMediaType
@@ -498,9 +500,9 @@ IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr)
     }
 
     strmbase_source_init(&object->capture, &SmartTeeFilterCaptureVtbl,
-            &object->filter, captureW, &SmartTeeFilterCaptureFuncs);
+            &object->filter, captureW, &capture_ops);
     strmbase_source_init(&object->preview, &SmartTeeFilterPreviewVtbl,
-            &object->filter, previewW, &SmartTeeFilterPreviewFuncs);
+            &object->filter, previewW, &preview_ops);
 
     *phr = S_OK;
     return &object->filter.IUnknown_inner;
diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c
index ed8c050828a..17c40505bdb 100644
--- a/dlls/qcap/vfwcapture.c
+++ b/dlls/qcap/vfwcapture.c
@@ -554,7 +554,8 @@ static HRESULT WINAPI VfwPin_DecideBufferSize(struct strmbase_source *iface,
     return IMemAllocator_SetProperties(pAlloc, ppropInputRequest, &actual);
 }
 
-static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
+static const struct strmbase_source_ops source_ops =
+{
     {
         VfwPin_CheckMediaType,
         VfwPin_GetMediaType
@@ -651,7 +652,7 @@ IUnknown * WINAPI QCAP_createVFWCaptureFilter(IUnknown *outer, HRESULT *phr)
     object->init = FALSE;
 
     strmbase_source_init(&object->source, &VfwPin_Vtbl, &object->filter,
-            source_name, &output_BaseOutputFuncTable);
+            source_name, &source_ops);
 
     object->IKsPropertySet_iface.lpVtbl = &IKsPropertySet_VTable;
 
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c
index 006c6592b56..cbd54b60ccb 100644
--- a/dlls/quartz/filesource.c
+++ b/dlls/quartz/filesource.c
@@ -79,7 +79,7 @@ typedef struct AsyncReader
 } AsyncReader;
 
 static const IPinVtbl FileAsyncReaderPin_Vtbl;
-static const BaseOutputPinFuncTable output_BaseOutputFuncTable;
+static const struct strmbase_source_ops source_ops;
 
 static inline AsyncReader *impl_from_strmbase_filter(struct strmbase_filter *iface)
 {
@@ -489,7 +489,7 @@ static HRESULT WINAPI FileSource_Load(IFileSourceFilter * iface, LPCOLESTR pszFi
     }
 
     strmbase_source_init(&This->source, &FileAsyncReaderPin_Vtbl, &This->filter,
-            wszOutputPinName, &output_BaseOutputFuncTable);
+            wszOutputPinName, &source_ops);
     BaseFilterImpl_IncrementPinVersion(&This->filter);
 
     This->file = hFile;
@@ -702,7 +702,8 @@ static HRESULT WINAPI FileAsyncReaderPin_DecideBufferSize(struct strmbase_source
     return IMemAllocator_SetProperties(pAlloc, &This->allocProps, &actual);
 }
 
-static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
+static const struct strmbase_source_ops source_ops =
+{
     {
         FileAsyncReaderPin_CheckMediaType,
         FileAsyncReaderPin_GetMediaType
diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c
index 2768d013573..e4e6036aff7 100644
--- a/dlls/quartz/parser.c
+++ b/dlls/quartz/parser.c
@@ -334,7 +334,8 @@ HRESULT WINAPI Parser_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock
     return S_OK;
 }
 
-static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
+static const struct strmbase_source_ops source_ops =
+{
     {
         Parser_OutputPin_CheckMediaType,
         Parser_OutputPin_GetMediaType
@@ -360,7 +361,7 @@ HRESULT Parser_AddPin(ParserImpl *filter, const WCHAR *name,
     filter->sources[filter->cStreams] = object;
 
     strmbase_source_init(&object->pin, &Parser_OutputPin_Vtbl, &filter->filter,
-            name, &output_BaseOutputFuncTable);
+            name, &source_ops);
 
     object->pmt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
     CopyMediaType(object->pmt, mt);
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c
index cbf4db9fd05..2fb9cf012f2 100644
--- a/dlls/strmbase/pin.c
+++ b/dlls/strmbase/pin.c
@@ -708,7 +708,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This,
 }
 
 void strmbase_source_init(struct strmbase_source *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
-        const WCHAR *name, const BaseOutputPinFuncTable *func_table)
+        const WCHAR *name, const struct strmbase_source_ops *func_table)
 {
     memset(pin, 0, sizeof(*pin));
     pin->pin.IPin_iface.lpVtbl = vtbl;
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c
index fe4260edcaf..c5310cdab95 100644
--- a/dlls/strmbase/transform.c
+++ b/dlls/strmbase/transform.c
@@ -171,7 +171,8 @@ static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = {
     TransformFilter_Input_Receive
 };
 
-static const BaseOutputPinFuncTable tf_output_BaseOutputFuncTable = {
+static const struct strmbase_source_ops source_ops =
+{
     {
         TransformFilter_Output_CheckMediaType,
         TransformFilter_Output_GetMediaType
@@ -290,7 +291,7 @@ static HRESULT strmbase_transform_init(IUnknown *outer, const CLSID *clsid,
             wcsInputPinName, &tf_input_BaseInputFuncTable, NULL);
 
     strmbase_source_init(&filter->source, &TransformFilter_OutputPin_Vtbl, &filter->filter,
-            wcsOutputPinName, &tf_output_BaseOutputFuncTable);
+            wcsOutputPinName, &source_ops);
 
     QualityControlImpl_Create(&filter->sink.pin.IPin_iface,
             &filter->filter.IBaseFilter_iface, &filter->qcimpl);
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 1b02373e11d..c0ff9e53b49 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -1745,7 +1745,8 @@ static const IPinVtbl GST_OutputPin_Vtbl = {
     BasePinImpl_NewSegment
 };
 
-static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
+static const struct strmbase_source_ops source_ops =
+{
     {
         GSTOutPin_CheckMediaType,
         GSTOutPin_GetMediaType
@@ -1767,7 +1768,7 @@ static BOOL create_pin(GSTImpl *filter, const WCHAR *name, const AM_MEDIA_TYPE *
         return FALSE;
 
     strmbase_source_init(&pin->pin, &GST_OutputPin_Vtbl, &filter->filter, name,
-            &output_BaseOutputFuncTable);
+            &source_ops);
     pin->pmt = heap_alloc(sizeof(AM_MEDIA_TYPE));
     CopyMediaType(pin->pmt, mt);
     pin->caps_event = CreateEventW(NULL, FALSE, FALSE, NULL);
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c
index 7333e705b76..599407d4ca4 100644
--- a/dlls/wineqtdecoder/qtsplitter.c
+++ b/dlls/wineqtdecoder/qtsplitter.c
@@ -1408,7 +1408,8 @@ static const IQualityControlVtbl QTOutPin_QualityControl_Vtbl = {
     QT_QualityControl_SetSink
 };
 
-static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
+static const struct strmbase_source_ops source_ops =
+{
     {
         QTOutPin_CheckMediaType,
         QTOutPin_GetMediaType
@@ -1436,7 +1437,7 @@ static HRESULT QT_AddPin(QTSplitter *filter, const WCHAR *name,
         filter->pAudio_Pin = pin;
 
     strmbase_source_init(&pin->pin, &QT_OutputPin_Vtbl, &filter->filter, name,
-            &output_BaseOutputFuncTable);
+            &source_ops);
     pin->pmt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
     CopyMediaType(pin->pmt, mt);
     pin->IQualityControl_iface.lpVtbl = &QTOutPin_QualityControl_Vtbl;
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h
index e5bed6c547b..85801ebabcc 100644
--- a/include/wine/strmbase.h
+++ b/include/wine/strmbase.h
@@ -60,14 +60,15 @@ struct strmbase_source
 	IMemInputPin * pMemInputPin;
 	IMemAllocator * pAllocator;
 
-	const struct BaseOutputPinFuncTable* pFuncsTable;
+	const struct strmbase_source_ops *pFuncsTable;
 };
 
 typedef HRESULT (WINAPI *BaseOutputPin_AttemptConnection)(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt);
 typedef HRESULT (WINAPI *BaseOutputPin_DecideBufferSize)(struct strmbase_source *pin, IMemAllocator *allocator, ALLOCATOR_PROPERTIES *props);
 typedef HRESULT (WINAPI *BaseOutputPin_DecideAllocator)(struct strmbase_source *pin, IMemInputPin *peer, IMemAllocator **allocator);
 
-typedef struct BaseOutputPinFuncTable {
+struct strmbase_source_ops
+{
 	BasePinFuncTable base;
 
         /* Required for Connect(). */
@@ -76,7 +77,7 @@ typedef struct BaseOutputPinFuncTable {
 	BaseOutputPin_DecideBufferSize pfnDecideBufferSize;
 	/* Required for BaseOutputPinImpl_AttemptConnection */
 	BaseOutputPin_DecideAllocator pfnDecideAllocator;
-} BaseOutputPinFuncTable;
+};
 
 typedef struct BaseInputPin
 {
@@ -135,7 +136,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin,
 
 void strmbase_source_cleanup(struct strmbase_source *pin);
 void strmbase_source_init(struct strmbase_source *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
-        const WCHAR *name, const BaseOutputPinFuncTable *func_table);
+        const WCHAR *name, const struct strmbase_source_ops *func_table);
 
 /* Base Input Pin */
 HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv);
-- 
2.23.0




More information about the wine-devel mailing list