From eeb7bc58aab3beb10359dfe9018e0ccee7f44464 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 28 Aug 2019 20:24:30 -0500 Subject: [PATCH] strmbase: Get rid of the BaseFilter typedef. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/qcap/audiorecord.c | 18 ++++++------ dlls/qcap/avico.c | 20 ++++++------- dlls/qcap/avimux.c | 20 ++++++------- dlls/qcap/smartteefilter.c | 16 +++++----- dlls/qcap/vfwcapture.c | 16 +++++----- dlls/qedit/samplegrabber.c | 16 +++++----- dlls/quartz/avisplit.c | 2 +- dlls/quartz/filesource.c | 16 +++++----- dlls/quartz/mpegsplit.c | 4 +-- dlls/quartz/parser.c | 6 ++-- dlls/quartz/parser.h | 4 +-- dlls/quartz/waveparser.c | 2 +- dlls/strmbase/enumpins.c | 4 +-- dlls/strmbase/filter.c | 50 ++++++++++++++++---------------- dlls/strmbase/renderer.c | 14 ++++----- dlls/strmbase/strmbase_private.h | 2 +- dlls/strmbase/transform.c | 10 +++---- dlls/strmbase/video.c | 2 +- dlls/strmbase/window.c | 4 ++- dlls/winegstreamer/gstdemux.c | 6 ++-- dlls/wineqtdecoder/qtsplitter.c | 12 ++++---- include/wine/strmbase.h | 29 +++++++++--------- 22 files changed, 138 insertions(+), 135 deletions(-) diff --git a/dlls/qcap/audiorecord.c b/dlls/qcap/audiorecord.c index fd0ca32ee18..6d487dbe2d9 100644 --- a/dlls/qcap/audiorecord.c +++ b/dlls/qcap/audiorecord.c @@ -35,20 +35,20 @@ WINE_DEFAULT_DEBUG_CHANNEL(qcap); typedef struct { - BaseFilter filter; + struct strmbase_filter filter; IPersistPropertyBag IPersistPropertyBag_iface; BaseOutputPin *output; } AudioRecord; -static inline AudioRecord *impl_from_BaseFilter(BaseFilter *filter) +static inline AudioRecord *impl_from_strmbase_filter(struct strmbase_filter *filter) { return CONTAINING_RECORD(filter, AudioRecord, filter); } static inline AudioRecord *impl_from_IBaseFilter(IBaseFilter *iface) { - BaseFilter *filter = CONTAINING_RECORD(iface, BaseFilter, IBaseFilter_iface); - return impl_from_BaseFilter(filter); + struct strmbase_filter *filter = CONTAINING_RECORD(iface, struct strmbase_filter, IBaseFilter_iface); + return impl_from_strmbase_filter(filter); } static inline AudioRecord *impl_from_IPersistPropertyBag(IPersistPropertyBag *iface) @@ -95,23 +95,23 @@ static const IBaseFilterVtbl AudioRecordVtbl = { BaseFilterImpl_QueryVendorInfo }; -static IPin *audio_record_get_pin(BaseFilter *iface, unsigned int index) +static IPin *audio_record_get_pin(struct strmbase_filter *iface, unsigned int index) { FIXME("iface %p, index %u, stub!\n", iface, index); return NULL; } -static void audio_record_destroy(BaseFilter *iface) +static void audio_record_destroy(struct strmbase_filter *iface) { - AudioRecord *filter = impl_from_BaseFilter(iface); + AudioRecord *filter = impl_from_strmbase_filter(iface); strmbase_filter_cleanup(&filter->filter); CoTaskMemFree(filter); } -static HRESULT audio_record_query_interface(BaseFilter *iface, REFIID iid, void **out) +static HRESULT audio_record_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) { - AudioRecord *filter = impl_from_BaseFilter(iface); + AudioRecord *filter = impl_from_strmbase_filter(iface); if (IsEqualGUID(iid, &IID_IPersistPropertyBag)) *out = &filter->IPersistPropertyBag_iface; diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 38ba2c70e10..5a2e35c7d11 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qcap); typedef struct { - BaseFilter filter; + struct strmbase_filter filter; IPersistPropertyBag IPersistPropertyBag_iface; BaseInputPin sink; @@ -51,15 +51,15 @@ typedef struct { DWORD frame_cnt; } AVICompressor; -static inline AVICompressor *impl_from_BaseFilter(BaseFilter *filter) +static inline AVICompressor *impl_from_strmbase_filter(struct strmbase_filter *filter) { return CONTAINING_RECORD(filter, AVICompressor, filter); } static inline AVICompressor *impl_from_IBaseFilter(IBaseFilter *iface) { - BaseFilter *filter = CONTAINING_RECORD(iface, BaseFilter, IBaseFilter_iface); - return impl_from_BaseFilter(filter); + struct strmbase_filter *filter = CONTAINING_RECORD(iface, struct strmbase_filter, IBaseFilter_iface); + return impl_from_strmbase_filter(filter); } static inline AVICompressor *impl_from_BasePin(BasePin *pin) @@ -178,9 +178,9 @@ static const IBaseFilterVtbl AVICompressorVtbl = { BaseFilterImpl_QueryVendorInfo, }; -static IPin *avi_compressor_get_pin(BaseFilter *iface, unsigned int index) +static IPin *avi_compressor_get_pin(struct strmbase_filter *iface, unsigned int index) { - AVICompressor *filter = impl_from_BaseFilter(iface); + AVICompressor *filter = impl_from_strmbase_filter(iface); if (index == 0) return &filter->sink.pin.IPin_iface; @@ -189,9 +189,9 @@ static IPin *avi_compressor_get_pin(BaseFilter *iface, unsigned int index) return NULL; } -static void avi_compressor_destroy(BaseFilter *iface) +static void avi_compressor_destroy(struct strmbase_filter *iface) { - AVICompressor *filter = impl_from_BaseFilter(iface); + AVICompressor *filter = impl_from_strmbase_filter(iface); if (filter->hic) ICClose(filter->hic); @@ -202,9 +202,9 @@ static void avi_compressor_destroy(BaseFilter *iface) heap_free(filter); } -static HRESULT avi_compressor_query_interface(BaseFilter *iface, REFIID iid, void **out) +static HRESULT avi_compressor_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) { - AVICompressor *filter = impl_from_BaseFilter(iface); + AVICompressor *filter = impl_from_strmbase_filter(iface); if (IsEqualGUID(iid, &IID_IPersistPropertyBag)) *out = &filter->IPersistPropertyBag_iface; diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index a825c121aff..9785ec50551 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -70,7 +70,7 @@ typedef struct { } AviMuxIn; typedef struct { - BaseFilter filter; + struct strmbase_filter filter; IConfigAviMux IConfigAviMux_iface; IConfigInterleaving IConfigInterleaving_iface; IMediaSeeking IMediaSeeking_iface; @@ -108,14 +108,14 @@ typedef struct { static HRESULT create_input_pin(AviMux*); -static inline AviMux* impl_from_BaseFilter(BaseFilter *filter) +static inline AviMux* impl_from_strmbase_filter(struct strmbase_filter *filter) { return CONTAINING_RECORD(filter, AviMux, filter); } -static IPin *avi_mux_get_pin(BaseFilter *iface, unsigned int index) +static IPin *avi_mux_get_pin(struct strmbase_filter *iface, unsigned int index) { - AviMux *filter = impl_from_BaseFilter(iface); + AviMux *filter = impl_from_strmbase_filter(iface); if (!index) return &filter->source.pin.IPin_iface; @@ -124,9 +124,9 @@ static IPin *avi_mux_get_pin(BaseFilter *iface, unsigned int index) return NULL; } -static void avi_mux_destroy(BaseFilter *iface) +static void avi_mux_destroy(struct strmbase_filter *iface) { - AviMux *filter = impl_from_BaseFilter(iface); + AviMux *filter = impl_from_strmbase_filter(iface); int i; strmbase_source_cleanup(&filter->source); @@ -146,9 +146,9 @@ static void avi_mux_destroy(BaseFilter *iface) ObjectRefCount(FALSE); } -static HRESULT avi_mux_query_interface(BaseFilter *iface, REFIID iid, void **out) +static HRESULT avi_mux_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) { - AviMux *filter = impl_from_BaseFilter(iface); + AviMux *filter = impl_from_strmbase_filter(iface); if (IsEqualGUID(iid, &IID_IConfigAviMux)) *out = &filter->IConfigAviMux_iface; @@ -176,8 +176,8 @@ static const struct strmbase_filter_ops filter_ops = static inline AviMux* impl_from_IBaseFilter(IBaseFilter *iface) { - BaseFilter *filter = CONTAINING_RECORD(iface, BaseFilter, IBaseFilter_iface); - return impl_from_BaseFilter(filter); + struct strmbase_filter *filter = CONTAINING_RECORD(iface, struct strmbase_filter, IBaseFilter_iface); + return impl_from_strmbase_filter(filter); } static HRESULT out_flush(AviMux *This) diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index ec124494e55..6d452287f88 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -36,20 +36,20 @@ WINE_DEFAULT_DEBUG_CHANNEL(qcap); typedef struct { - BaseFilter filter; + struct strmbase_filter filter; BaseInputPin sink; BaseOutputPin capture, preview; } SmartTeeFilter; -static inline SmartTeeFilter *impl_from_BaseFilter(BaseFilter *filter) +static inline SmartTeeFilter *impl_from_strmbase_filter(struct strmbase_filter *filter) { return CONTAINING_RECORD(filter, SmartTeeFilter, filter); } static inline SmartTeeFilter *impl_from_IBaseFilter(IBaseFilter *iface) { - BaseFilter *filter = CONTAINING_RECORD(iface, BaseFilter, IBaseFilter_iface); - return impl_from_BaseFilter(filter); + struct strmbase_filter *filter = CONTAINING_RECORD(iface, struct strmbase_filter, IBaseFilter_iface); + return impl_from_strmbase_filter(filter); } static inline SmartTeeFilter *impl_from_BasePin(BasePin *pin) @@ -117,9 +117,9 @@ static const IBaseFilterVtbl SmartTeeFilterVtbl = { BaseFilterImpl_QueryVendorInfo }; -static IPin *smart_tee_get_pin(BaseFilter *iface, unsigned int index) +static IPin *smart_tee_get_pin(struct strmbase_filter *iface, unsigned int index) { - SmartTeeFilter *filter = impl_from_BaseFilter(iface); + SmartTeeFilter *filter = impl_from_strmbase_filter(iface); if (index == 0) return &filter->sink.pin.IPin_iface; @@ -130,9 +130,9 @@ static IPin *smart_tee_get_pin(BaseFilter *iface, unsigned int index) return NULL; } -static void smart_tee_destroy(BaseFilter *iface) +static void smart_tee_destroy(struct strmbase_filter *iface) { - SmartTeeFilter *filter = impl_from_BaseFilter(iface); + SmartTeeFilter *filter = impl_from_strmbase_filter(iface); strmbase_sink_cleanup(&filter->sink); strmbase_source_cleanup(&filter->capture); diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index c4208ea16d4..6010fad9c58 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -46,7 +46,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qcap); typedef struct VfwCapture { - BaseFilter filter; + struct strmbase_filter filter; IAMStreamConfig IAMStreamConfig_iface; IAMVideoProcAmp IAMVideoProcAmp_iface; IPersistPropertyBag IPersistPropertyBag_iface; @@ -57,7 +57,7 @@ typedef struct VfwCapture IKsPropertySet IKsPropertySet_iface; } VfwCapture; -static inline VfwCapture *impl_from_BaseFilter(BaseFilter *iface) +static inline VfwCapture *impl_from_strmbase_filter(struct strmbase_filter *iface) { return CONTAINING_RECORD(iface, VfwCapture, filter); } @@ -87,9 +87,9 @@ static inline VfwCapture *impl_from_IPin(IPin *iface) return CONTAINING_RECORD(iface, VfwCapture, source.pin.IPin_iface); } -static IPin *vfw_capture_get_pin(BaseFilter *iface, unsigned int index) +static IPin *vfw_capture_get_pin(struct strmbase_filter *iface, unsigned int index) { - VfwCapture *This = impl_from_BaseFilter(iface); + VfwCapture *This = impl_from_strmbase_filter(iface); if (index >= 1) return NULL; @@ -97,9 +97,9 @@ static IPin *vfw_capture_get_pin(BaseFilter *iface, unsigned int index) return &This->source.pin.IPin_iface; } -static void vfw_capture_destroy(BaseFilter *iface) +static void vfw_capture_destroy(struct strmbase_filter *iface) { - VfwCapture *filter = impl_from_BaseFilter(iface); + VfwCapture *filter = impl_from_strmbase_filter(iface); if (filter->init) { @@ -119,9 +119,9 @@ static void vfw_capture_destroy(BaseFilter *iface) ObjectRefCount(FALSE); } -static HRESULT vfw_capture_query_interface(BaseFilter *iface, REFIID iid, void **out) +static HRESULT vfw_capture_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) { - VfwCapture *filter = impl_from_BaseFilter(iface); + VfwCapture *filter = impl_from_strmbase_filter(iface); if (IsEqualGUID(iid, &IID_IPersistPropertyBag)) *out = &filter->IPersistPropertyBag_iface; diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c index 4f923fa5dda..a275d56738b 100644 --- a/dlls/qedit/samplegrabber.c +++ b/dlls/qedit/samplegrabber.c @@ -211,7 +211,7 @@ static inline SG_Pin *impl_from_IPin(IPin *iface) /* Sample Grabber filter implementation */ typedef struct _SG_Impl { - BaseFilter filter; + struct strmbase_filter filter; ISampleGrabber ISampleGrabber_iface; /* IMediaSeeking and IMediaPosition are implemented by ISeekingPassThru */ IUnknown* seekthru_unk; @@ -234,7 +234,7 @@ enum { OneShot_Past, }; -static inline SG_Impl *impl_from_BaseFilter(BaseFilter *iface) +static inline SG_Impl *impl_from_strmbase_filter(struct strmbase_filter *iface) { return CONTAINING_RECORD(iface, SG_Impl, filter); } @@ -273,9 +273,9 @@ static void SampleGrabber_cleanup(SG_Impl *This) IUnknown_Release(This->seekthru_unk); } -static IPin *sample_grabber_get_pin(BaseFilter *iface, unsigned int index) +static IPin *sample_grabber_get_pin(struct strmbase_filter *iface, unsigned int index) { - SG_Impl *filter = impl_from_BaseFilter(iface); + SG_Impl *filter = impl_from_strmbase_filter(iface); if (index == 0) return &filter->pin_in.IPin_iface; @@ -284,18 +284,18 @@ static IPin *sample_grabber_get_pin(BaseFilter *iface, unsigned int index) return NULL; } -static void sample_grabber_destroy(BaseFilter *iface) +static void sample_grabber_destroy(struct strmbase_filter *iface) { - SG_Impl *filter = impl_from_BaseFilter(iface); + SG_Impl *filter = impl_from_strmbase_filter(iface); SampleGrabber_cleanup(filter); strmbase_filter_cleanup(&filter->filter); CoTaskMemFree(filter); } -static HRESULT sample_grabber_query_interface(BaseFilter *iface, REFIID iid, void **out) +static HRESULT sample_grabber_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) { - SG_Impl *filter = impl_from_BaseFilter(iface); + SG_Impl *filter = impl_from_strmbase_filter(iface); if (IsEqualGUID(iid, &IID_ISampleGrabber)) *out = &filter->ISampleGrabber_iface; diff --git a/dlls/quartz/avisplit.c b/dlls/quartz/avisplit.c index 27857c0171d..9d665b401c6 100644 --- a/dlls/quartz/avisplit.c +++ b/dlls/quartz/avisplit.c @@ -1404,7 +1404,7 @@ static const IBaseFilterVtbl AVISplitterImpl_Vtbl = BaseFilterImpl_QueryVendorInfo, }; -static void avi_splitter_destroy(BaseFilter *iface) +static void avi_splitter_destroy(struct strmbase_filter *iface) { AVISplitterImpl *filter = impl_from_IBaseFilter(&iface->IBaseFilter_iface); AVISplitter_Flush(filter); diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index df2e071fc7f..5e1880c84e1 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -58,7 +58,7 @@ typedef struct DATAREQUEST typedef struct AsyncReader { - BaseFilter filter; + struct strmbase_filter filter; IFileSourceFilter IFileSourceFilter_iface; BaseOutputPin source; @@ -81,7 +81,7 @@ typedef struct AsyncReader static const IPinVtbl FileAsyncReaderPin_Vtbl; static const BaseOutputPinFuncTable output_BaseOutputFuncTable; -static inline AsyncReader *impl_from_BaseFilter(BaseFilter *iface) +static inline AsyncReader *impl_from_strmbase_filter(struct strmbase_filter *iface) { return CONTAINING_RECORD(iface, AsyncReader, filter); } @@ -338,18 +338,18 @@ BOOL get_media_type(const WCHAR *filename, GUID *majortype, GUID *subtype, GUID return FALSE; } -static IPin *async_reader_get_pin(BaseFilter *iface, unsigned int index) +static IPin *async_reader_get_pin(struct strmbase_filter *iface, unsigned int index) { - AsyncReader *filter = impl_from_BaseFilter(iface); + AsyncReader *filter = impl_from_strmbase_filter(iface); if (!index && filter->pszFileName) return &filter->source.pin.IPin_iface; return NULL; } -static void async_reader_destroy(BaseFilter *iface) +static void async_reader_destroy(struct strmbase_filter *iface) { - AsyncReader *filter = impl_from_BaseFilter(iface); + AsyncReader *filter = impl_from_strmbase_filter(iface); if (filter->pszFileName) { @@ -379,9 +379,9 @@ static void async_reader_destroy(BaseFilter *iface) CoTaskMemFree(filter); } -static HRESULT async_reader_query_interface(BaseFilter *iface, REFIID iid, void **out) +static HRESULT async_reader_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) { - AsyncReader *filter = impl_from_BaseFilter(iface); + AsyncReader *filter = impl_from_strmbase_filter(iface); if (IsEqualGUID(iid, &IID_IFileSourceFilter)) { diff --git a/dlls/quartz/mpegsplit.c b/dlls/quartz/mpegsplit.c index 5c38596b1e9..48da7fb0b36 100644 --- a/dlls/quartz/mpegsplit.c +++ b/dlls/quartz/mpegsplit.c @@ -836,13 +836,13 @@ static const IAMStreamSelectVtbl AMStreamSelectVtbl = AMStreamSelect_Enable }; -static void mpeg_splitter_destroy(BaseFilter *iface) +static void mpeg_splitter_destroy(struct strmbase_filter *iface) { MPEGSplitterImpl *filter = impl_from_IBaseFilter(&iface->IBaseFilter_iface); Parser_Destroy(&filter->Parser); } -static HRESULT mpeg_splitter_query_interface(BaseFilter *iface, REFIID iid, void **out) +static HRESULT mpeg_splitter_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) { MPEGSplitterImpl *filter = impl_from_IBaseFilter(&iface->IBaseFilter_iface); diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 3a36dca7884..7382048eec2 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -56,14 +56,14 @@ static inline ParserImpl *impl_from_IBaseFilter( IBaseFilter *iface ) return CONTAINING_RECORD(iface, ParserImpl, filter.IBaseFilter_iface); } -static inline ParserImpl *impl_from_BaseFilter( BaseFilter *iface ) +static inline ParserImpl *impl_from_strmbase_filter(struct strmbase_filter *iface) { return CONTAINING_RECORD(iface, ParserImpl, filter); } -IPin *parser_get_pin(BaseFilter *iface, unsigned int index) +IPin *parser_get_pin(struct strmbase_filter *iface, unsigned int index) { - ParserImpl *filter = impl_from_BaseFilter(iface); + ParserImpl *filter = impl_from_strmbase_filter(iface); if (!index) return &filter->pInputPin->pin.IPin_iface; diff --git a/dlls/quartz/parser.h b/dlls/quartz/parser.h index 70d6318af80..0caa8af831e 100644 --- a/dlls/quartz/parser.h +++ b/dlls/quartz/parser.h @@ -40,7 +40,7 @@ typedef struct Parser_OutputPin struct ParserImpl { - BaseFilter filter; + struct strmbase_filter filter; PFN_DISCONNECT fnDisconnect; @@ -67,7 +67,7 @@ extern HRESULT WINAPI Parser_Run(IBaseFilter * iface, REFERENCE_TIME tStart); extern HRESULT WINAPI Parser_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState); extern HRESULT WINAPI Parser_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock); -IPin *parser_get_pin(BaseFilter *iface, unsigned int index) DECLSPEC_HIDDEN; +IPin *parser_get_pin(struct strmbase_filter *iface, unsigned int index) DECLSPEC_HIDDEN; /* COM helpers */ static inline Parser_OutputPin *unsafe_impl_Parser_OutputPin_from_IPin( IPin *iface ) diff --git a/dlls/quartz/waveparser.c b/dlls/quartz/waveparser.c index d08cad144d2..03a39749cc6 100644 --- a/dlls/quartz/waveparser.c +++ b/dlls/quartz/waveparser.c @@ -408,7 +408,7 @@ static const IBaseFilterVtbl WAVEParser_Vtbl = BaseFilterImpl_QueryVendorInfo, }; -static void wave_parser_destroy(BaseFilter *iface) +static void wave_parser_destroy(struct strmbase_filter *iface) { WAVEParserImpl *filter = impl_from_IBaseFilter(&iface->IBaseFilter_iface); Parser_Destroy(&filter->Parser); diff --git a/dlls/strmbase/enumpins.c b/dlls/strmbase/enumpins.c index 6e3357f5605..222f61c2fcd 100644 --- a/dlls/strmbase/enumpins.c +++ b/dlls/strmbase/enumpins.c @@ -28,7 +28,7 @@ typedef struct IEnumPinsImpl IEnumPins IEnumPins_iface; LONG refCount; unsigned int uIndex, count; - BaseFilter *base; + struct strmbase_filter *base; DWORD Version; } IEnumPinsImpl; @@ -39,7 +39,7 @@ static inline IEnumPinsImpl *impl_from_IEnumPins(IEnumPins *iface) static const struct IEnumPinsVtbl IEnumPinsImpl_Vtbl; -HRESULT enum_pins_create(BaseFilter *base, IEnumPins **out) +HRESULT enum_pins_create(struct strmbase_filter *base, IEnumPins **out) { IEnumPinsImpl *object; IPin *pin; diff --git a/dlls/strmbase/filter.c b/dlls/strmbase/filter.c index 078d991c249..b52a99d25b2 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -22,14 +22,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(strmbase); -static inline BaseFilter *impl_from_IUnknown(IUnknown *iface) +static inline struct strmbase_filter *impl_from_IUnknown(IUnknown *iface) { - return CONTAINING_RECORD(iface, BaseFilter, IUnknown_inner); + return CONTAINING_RECORD(iface, struct strmbase_filter, IUnknown_inner); } static HRESULT WINAPI filter_inner_QueryInterface(IUnknown *iface, REFIID iid, void **out) { - BaseFilter *filter = impl_from_IUnknown(iface); + struct strmbase_filter *filter = impl_from_IUnknown(iface); HRESULT hr; TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); @@ -62,7 +62,7 @@ static HRESULT WINAPI filter_inner_QueryInterface(IUnknown *iface, REFIID iid, v static ULONG WINAPI filter_inner_AddRef(IUnknown *iface) { - BaseFilter *filter = impl_from_IUnknown(iface); + struct strmbase_filter *filter = impl_from_IUnknown(iface); ULONG refcount = InterlockedIncrement(&filter->refcount); TRACE("%p increasing refcount to %u.\n", filter, refcount); @@ -72,7 +72,7 @@ static ULONG WINAPI filter_inner_AddRef(IUnknown *iface) static ULONG WINAPI filter_inner_Release(IUnknown *iface) { - BaseFilter *filter = impl_from_IUnknown(iface); + struct strmbase_filter *filter = impl_from_IUnknown(iface); ULONG refcount = InterlockedDecrement(&filter->refcount); TRACE("%p decreasing refcount to %u.\n", filter, refcount); @@ -90,32 +90,32 @@ static const IUnknownVtbl filter_inner_vtbl = filter_inner_Release, }; -static inline BaseFilter *impl_from_IBaseFilter(IBaseFilter *iface) +static inline struct strmbase_filter *impl_from_IBaseFilter(IBaseFilter *iface) { - return CONTAINING_RECORD(iface, BaseFilter, IBaseFilter_iface); + return CONTAINING_RECORD(iface, struct strmbase_filter, IBaseFilter_iface); } HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter *iface, REFIID iid, void **out) { - BaseFilter *filter = impl_from_IBaseFilter(iface); + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); return IUnknown_QueryInterface(filter->outer_unk, iid, out); } ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface) { - BaseFilter *filter = impl_from_IBaseFilter(iface); + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); return IUnknown_AddRef(filter->outer_unk); } ULONG WINAPI BaseFilterImpl_Release(IBaseFilter *iface) { - BaseFilter *filter = impl_from_IBaseFilter(iface); + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); return IUnknown_Release(filter->outer_unk); } HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter * iface, CLSID * pClsid) { - BaseFilter *This = impl_from_IBaseFilter(iface); + struct strmbase_filter *This = impl_from_IBaseFilter(iface); TRACE("(%p)->(%p)\n", This, pClsid); *pClsid = This->clsid; @@ -125,7 +125,7 @@ HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter * iface, CLSID * pClsid) HRESULT WINAPI BaseFilterImpl_Stop(IBaseFilter *iface) { - BaseFilter *filter = impl_from_IBaseFilter(iface); + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); TRACE("iface %p.\n", iface); @@ -138,7 +138,7 @@ HRESULT WINAPI BaseFilterImpl_Stop(IBaseFilter *iface) HRESULT WINAPI BaseFilterImpl_Pause(IBaseFilter *iface) { - BaseFilter *filter = impl_from_IBaseFilter(iface); + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); TRACE("iface %p.\n", iface); @@ -151,7 +151,7 @@ HRESULT WINAPI BaseFilterImpl_Pause(IBaseFilter *iface) HRESULT WINAPI BaseFilterImpl_Run(IBaseFilter *iface, REFERENCE_TIME start) { - BaseFilter *filter = impl_from_IBaseFilter(iface); + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); TRACE("iface %p, start %s.\n", iface, wine_dbgstr_longlong(start)); @@ -164,7 +164,7 @@ HRESULT WINAPI BaseFilterImpl_Run(IBaseFilter *iface, REFERENCE_TIME start) HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState ) { - BaseFilter *This = impl_from_IBaseFilter(iface); + struct strmbase_filter *This = impl_from_IBaseFilter(iface); TRACE("(%p)->(%d, %p)\n", This, dwMilliSecsTimeout, pState); EnterCriticalSection(&This->csFilter); @@ -178,7 +178,7 @@ HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTim HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock) { - BaseFilter *This = impl_from_IBaseFilter(iface); + struct strmbase_filter *This = impl_from_IBaseFilter(iface); TRACE("(%p)->(%p)\n", This, pClock); EnterCriticalSection(&This->csFilter); @@ -196,7 +196,7 @@ HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter * iface, IReferenceClock HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock) { - BaseFilter *This = impl_from_IBaseFilter(iface); + struct strmbase_filter *This = impl_from_IBaseFilter(iface); TRACE("(%p)->(%p)\n", This, ppClock); EnterCriticalSection(&This->csFilter); @@ -212,7 +212,7 @@ HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter * iface, IReferenceClock HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **enum_pins) { - BaseFilter *filter = impl_from_IBaseFilter(iface); + struct strmbase_filter *filter = impl_from_IBaseFilter(iface); TRACE("iface %p, enum_pins %p.\n", iface, enum_pins); @@ -221,7 +221,7 @@ HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **enum_pins HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin **ret) { - BaseFilter *This = impl_from_IBaseFilter(iface); + struct strmbase_filter *This = impl_from_IBaseFilter(iface); unsigned int i; PIN_INFO info; HRESULT hr; @@ -249,7 +249,7 @@ HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo) { - BaseFilter *This = impl_from_IBaseFilter(iface); + struct strmbase_filter *This = impl_from_IBaseFilter(iface); TRACE("(%p)->(%p)\n", This, pInfo); lstrcpyW(pInfo->achName, This->filterInfo.achName); @@ -263,7 +263,7 @@ HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO * HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName ) { - BaseFilter *This = impl_from_IBaseFilter(iface); + struct strmbase_filter *This = impl_from_IBaseFilter(iface); TRACE("(%p)->(%p, %s)\n", This, pGraph, debugstr_w(pName)); @@ -286,12 +286,12 @@ HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVend return E_NOTIMPL; } -VOID WINAPI BaseFilterImpl_IncrementPinVersion(BaseFilter *filter) +VOID WINAPI BaseFilterImpl_IncrementPinVersion(struct strmbase_filter *filter) { InterlockedIncrement(&filter->pin_version); } -void strmbase_filter_init(BaseFilter *filter, const IBaseFilterVtbl *vtbl, IUnknown *outer, +void strmbase_filter_init(struct strmbase_filter *filter, const IBaseFilterVtbl *vtbl, IUnknown *outer, const CLSID *clsid, const struct strmbase_filter_ops *func_table) { memset(filter, 0, sizeof(*filter)); @@ -302,13 +302,13 @@ void strmbase_filter_init(BaseFilter *filter, const IBaseFilterVtbl *vtbl, IUnkn filter->refcount = 1; InitializeCriticalSection(&filter->csFilter); - filter->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BaseFilter.csFilter"); + filter->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": strmbase_filter.csFilter"); filter->clsid = *clsid; filter->pin_version = 1; filter->pFuncsTable = func_table; } -void strmbase_filter_cleanup(BaseFilter *This) +void strmbase_filter_cleanup(struct strmbase_filter *This) { if (This->pClock) IReferenceClock_Release(This->pClock); diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index c842120538c..d39700b7bcd 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -27,7 +27,7 @@ static inline BaseRenderer *impl_from_IBaseFilter(IBaseFilter *iface) return CONTAINING_RECORD(iface, BaseRenderer, filter.IBaseFilter_iface); } -static inline BaseRenderer *impl_from_BaseFilter(BaseFilter *iface) +static inline BaseRenderer *impl_from_strmbase_filter(struct strmbase_filter *iface) { return CONTAINING_RECORD(iface, BaseRenderer, filter); } @@ -167,24 +167,24 @@ static const IPinVtbl BaseRenderer_InputPin_Vtbl = BaseInputPinImpl_NewSegment }; -static IPin *renderer_get_pin(BaseFilter *iface, unsigned int index) +static IPin *renderer_get_pin(struct strmbase_filter *iface, unsigned int index) { - BaseRenderer *filter = impl_from_BaseFilter(iface); + BaseRenderer *filter = impl_from_strmbase_filter(iface); if (index == 0) return &filter->sink.pin.IPin_iface; return NULL; } -static void renderer_destroy(BaseFilter *iface) +static void renderer_destroy(struct strmbase_filter *iface) { - BaseRenderer *filter = impl_from_BaseFilter(iface); + BaseRenderer *filter = impl_from_strmbase_filter(iface); filter->pFuncsTable->renderer_destroy(filter); } -static HRESULT renderer_query_interface(BaseFilter *iface, REFIID iid, void **out) +static HRESULT renderer_query_interface(struct strmbase_filter *iface, REFIID iid, void **out) { - BaseRenderer *filter = impl_from_BaseFilter(iface); + BaseRenderer *filter = impl_from_strmbase_filter(iface); HRESULT hr; if (filter->pFuncsTable->renderer_query_interface diff --git a/dlls/strmbase/strmbase_private.h b/dlls/strmbase/strmbase_private.h index 06fbe62a425..9904754e4a1 100644 --- a/dlls/strmbase/strmbase_private.h +++ b/dlls/strmbase/strmbase_private.h @@ -62,7 +62,7 @@ void QualityControlRender_DoQOS(QualityControlImpl *priv); void QualityControlRender_BeginRender(QualityControlImpl *This, REFERENCE_TIME start, REFERENCE_TIME stop); void QualityControlRender_EndRender(QualityControlImpl *This); -HRESULT enum_pins_create(BaseFilter *base, IEnumPins **enum_pins); +HRESULT enum_pins_create(struct strmbase_filter *filter, IEnumPins **enum_pins); HRESULT WINAPI RendererPosPassThru_RegisterMediaTime(IUnknown *iface, REFERENCE_TIME start); HRESULT WINAPI RendererPosPassThru_ResetMediaTime(IUnknown *iface); diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index ff75f08f5c4..e03874b7d67 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -35,7 +35,7 @@ static inline TransformFilter *impl_from_IBaseFilter( IBaseFilter *iface ) return CONTAINING_RECORD(iface, TransformFilter, filter.IBaseFilter_iface); } -static inline TransformFilter *impl_from_BaseFilter( BaseFilter *iface ) +static inline TransformFilter *impl_from_strmbase_filter(struct strmbase_filter *iface) { return CONTAINING_RECORD(iface, TransformFilter, filter); } @@ -121,9 +121,9 @@ static HRESULT WINAPI TransformFilter_Output_GetMediaType(BasePin *This, int iPo return S_OK; } -static IPin *transform_get_pin(BaseFilter *iface, unsigned int index) +static IPin *transform_get_pin(struct strmbase_filter *iface, unsigned int index) { - TransformFilter *filter = impl_from_BaseFilter(iface); + TransformFilter *filter = impl_from_strmbase_filter(iface); if (index == 0) return &filter->sink.pin.IPin_iface; @@ -132,9 +132,9 @@ static IPin *transform_get_pin(BaseFilter *iface, unsigned int index) return NULL; } -static void transform_destroy(BaseFilter *iface) +static void transform_destroy(struct strmbase_filter *iface) { - TransformFilter *filter = impl_from_BaseFilter(iface); + TransformFilter *filter = impl_from_strmbase_filter(iface); if (filter->sink.pin.pConnectedTo) IPin_Disconnect(filter->sink.pin.pConnectedTo); diff --git a/dlls/strmbase/video.c b/dlls/strmbase/video.c index 81478d6443e..3460b80fba2 100644 --- a/dlls/strmbase/video.c +++ b/dlls/strmbase/video.c @@ -647,7 +647,7 @@ static const IBasicVideoVtbl basic_video_vtbl = basic_video_IsUsingDefaultDestination }; -HRESULT WINAPI strmbase_video_init(BaseControlVideo *video, BaseFilter *filter, +HRESULT WINAPI strmbase_video_init(BaseControlVideo *video, struct strmbase_filter *filter, CRITICAL_SECTION *cs, BasePin *pin, const BaseControlVideoFuncTable *func_table) { video->IBasicVideo_iface.lpVtbl = &basic_video_vtbl; diff --git a/dlls/strmbase/window.c b/dlls/strmbase/window.c index 1ca06f77145..fe8b58565c0 100644 --- a/dlls/strmbase/window.c +++ b/dlls/strmbase/window.c @@ -193,7 +193,9 @@ BOOL WINAPI BaseControlWindowImpl_PossiblyEatMessage(BaseWindow *This, UINT uMsg return FALSE; } -HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, const IVideoWindowVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin* pPin,const BaseWindowFuncTable *pFuncsTable) +HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, + const IVideoWindowVtbl *lpVtbl, struct strmbase_filter *owner, + CRITICAL_SECTION *lock, BasePin* pPin,const BaseWindowFuncTable *pFuncsTable) { HRESULT hr; diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index c270f153e00..9e634bc997a 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -55,7 +55,7 @@ typedef struct GSTInPin { } GSTInPin; typedef struct GSTImpl { - BaseFilter filter; + struct strmbase_filter filter; GSTInPin pInputPin; GSTOutPin **ppPins; @@ -1196,7 +1196,7 @@ static inline GSTOutPin *impl_from_IMediaSeeking( IMediaSeeking *iface ) return CONTAINING_RECORD(iface, GSTOutPin, seek.IMediaSeeking_iface); } -static IPin *gstdemux_get_pin(BaseFilter *base, unsigned int index) +static IPin *gstdemux_get_pin(struct strmbase_filter *base, unsigned int index) { GSTImpl *filter = impl_from_IBaseFilter(&base->IBaseFilter_iface); @@ -1207,7 +1207,7 @@ static IPin *gstdemux_get_pin(BaseFilter *base, unsigned int index) return NULL; } -static void gstdemux_destroy(BaseFilter *iface) +static void gstdemux_destroy(struct strmbase_filter *iface) { GSTImpl *filter = impl_from_IBaseFilter(&iface->IBaseFilter_iface); IPin *connected = NULL; diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index ebffc94fc76..e7597e16ca8 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -144,7 +144,7 @@ typedef struct QTInPin { } QTInPin; typedef struct QTSplitter { - BaseFilter filter; + struct strmbase_filter filter; QTInPin pInputPin; QTOutPin *pVideo_Pin; @@ -188,7 +188,7 @@ static inline QTSplitter *impl_from_IMediaSeeking( IMediaSeeking *iface ) return CONTAINING_RECORD(iface, QTSplitter, sourceSeeking.IMediaSeeking_iface); } -static inline QTSplitter *impl_from_BaseFilter( BaseFilter *iface ) +static inline QTSplitter *impl_from_strmbase_filter(struct strmbase_filter *iface) { return CONTAINING_RECORD(iface, QTSplitter, filter); } @@ -202,9 +202,9 @@ static inline QTSplitter *impl_from_IBaseFilter( IBaseFilter *iface ) * Base Filter */ -static IPin *qt_splitter_get_pin(BaseFilter *base, unsigned int index) +static IPin *qt_splitter_get_pin(struct strmbase_filter *base, unsigned int index) { - QTSplitter *filter = impl_from_BaseFilter(base); + QTSplitter *filter = impl_from_strmbase_filter(base); if (index == 0) return &filter->pInputPin.pin.IPin_iface; @@ -221,9 +221,9 @@ static IPin *qt_splitter_get_pin(BaseFilter *base, unsigned int index) return NULL; } -static void qt_splitter_destroy(BaseFilter *iface) +static void qt_splitter_destroy(struct strmbase_filter *iface) { - QTSplitter *filter = impl_from_BaseFilter(iface); + QTSplitter *filter = impl_from_strmbase_filter(iface); IPin *peer = NULL; EnterCriticalSection(&filter->csReceive); diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 649d272b874..d23231e09a7 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -156,7 +156,7 @@ void strmbase_sink_init(BaseInputPin *pin, const IPinVtbl *vtbl, const PIN_INFO const BaseInputPinFuncTable *func_table, CRITICAL_SECTION *cs, IMemAllocator *allocator); void strmbase_sink_cleanup(BaseInputPin *pin); -typedef struct BaseFilter +struct strmbase_filter { IBaseFilter IBaseFilter_iface; IUnknown IUnknown_inner; @@ -172,13 +172,13 @@ typedef struct BaseFilter LONG pin_version; const struct strmbase_filter_ops *pFuncsTable; -} BaseFilter; +}; struct strmbase_filter_ops { - IPin *(*filter_get_pin)(BaseFilter *iface, unsigned int index); - void (*filter_destroy)(BaseFilter *iface); - HRESULT (*filter_query_interface)(BaseFilter *iface, REFIID iid, void **out); + 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 WINAPI BaseFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv); @@ -197,11 +197,11 @@ HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO * HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName ); HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo); -VOID WINAPI BaseFilterImpl_IncrementPinVersion(BaseFilter* This); +VOID WINAPI BaseFilterImpl_IncrementPinVersion(struct strmbase_filter *filter); -void strmbase_filter_init(BaseFilter *filter, const IBaseFilterVtbl *vtbl, IUnknown *outer, +void strmbase_filter_init(struct strmbase_filter *filter, const IBaseFilterVtbl *vtbl, IUnknown *outer, const CLSID *clsid, const struct strmbase_filter_ops *func_table); -void strmbase_filter_cleanup(BaseFilter *filter); +void strmbase_filter_cleanup(struct strmbase_filter *filter); /* Enums */ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *iface, BasePin_GetMediaType enumFunc, BasePin_GetMediaTypeVersion versionFunc, IEnumMediaTypes ** ppEnum); @@ -209,7 +209,7 @@ HRESULT WINAPI EnumMediaTypes_Construct(BasePin *iface, BasePin_GetMediaType enu /* Transform Filter */ typedef struct TransformFilter { - BaseFilter filter; + struct strmbase_filter filter; BaseOutputPin source; BaseInputPin sink; @@ -429,12 +429,13 @@ typedef struct tagBaseControlWindow BOOL AutoShow; HWND hwndDrain; HWND hwndOwner; - BaseFilter* pFilter; + struct strmbase_filter *pFilter; CRITICAL_SECTION* pInterfaceLock; BasePin* pPin; } BaseControlWindow; -HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, const IVideoWindowVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin* pPin, const BaseWindowFuncTable* pFuncsTable); +HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *window, const IVideoWindowVtbl *vtbl, + struct strmbase_filter *filter, CRITICAL_SECTION *lock, BasePin *pin, const BaseWindowFuncTable *ops); HRESULT WINAPI BaseControlWindow_Destroy(BaseControlWindow *pControlWindow); BOOL WINAPI BaseControlWindowImpl_PossiblyEatMessage(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam); @@ -494,7 +495,7 @@ typedef struct tagBaseControlVideo { IBasicVideo IBasicVideo_iface; - BaseFilter* pFilter; + struct strmbase_filter *pFilter; CRITICAL_SECTION* pInterfaceLock; BasePin* pPin; @@ -526,7 +527,7 @@ typedef struct BaseControlVideoFuncTable { BaseControlVideo_SetTargetRect pfnSetTargetRect; } BaseControlVideoFuncTable; -HRESULT WINAPI strmbase_video_init(BaseControlVideo *video, BaseFilter *filter, +HRESULT WINAPI strmbase_video_init(BaseControlVideo *video, struct strmbase_filter *filter, CRITICAL_SECTION *cs, BasePin *pin, const BaseControlVideoFuncTable *func_table); HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo); #endif @@ -535,7 +536,7 @@ HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo); /* BaseRenderer Filter */ typedef struct BaseRendererTag { - BaseFilter filter; + struct strmbase_filter filter; BaseInputPin sink; IUnknown *pPosition;