[PATCH 2/4] strmbase: Get rid of the BaseInputPin typedef.
Zebediah Figura
z.figura12 at gmail.com
Tue Nov 19 20:18:01 CST 2019
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
dlls/amstream/ddrawstream.c | 7 -------
dlls/qcap/avico.c | 4 ++--
dlls/qcap/avimux.c | 7 +++----
dlls/qcap/smartteefilter.c | 4 ++--
dlls/strmbase/pin.c | 40 ++++++++++++++++++-------------------
dlls/strmbase/renderer.c | 2 +-
dlls/strmbase/transform.c | 2 +-
include/wine/strmbase.h | 14 ++++++-------
8 files changed, 35 insertions(+), 45 deletions(-)
diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c
index a35a4b1c29..48ccc52d47 100644
--- a/dlls/amstream/ddrawstream.c
+++ b/dlls/amstream/ddrawstream.c
@@ -33,13 +33,6 @@ static const WCHAR sink_id[] = {'I','{','A','3','5','F','F','5','6','A',
static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectDrawSurface *surface,
const RECT *rect, IDirectDrawStreamSample **ddraw_stream_sample);
-struct ddraw_stream;
-
-typedef struct {
- BaseInputPin pin;
- struct ddraw_stream *parent;
-} DirectDrawMediaStreamInputPin;
-
struct ddraw_stream
{
IAMMediaStream IAMMediaStream_iface;
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c
index 8eae692dca..9b32ddb336 100644
--- a/dlls/qcap/avico.c
+++ b/dlls/qcap/avico.c
@@ -37,7 +37,7 @@ typedef struct {
struct strmbase_filter filter;
IPersistPropertyBag IPersistPropertyBag_iface;
- BaseInputPin sink;
+ struct strmbase_sink sink;
struct strmbase_source source;
DWORD fcc_handler;
@@ -412,7 +412,7 @@ static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void
return S_OK;
}
-static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample *pSample)
+static HRESULT WINAPI AVICompressorIn_Receive(struct strmbase_sink *base, IMediaSample *pSample)
{
AVICompressor *This = impl_from_strmbase_pin(&base->pin);
VIDEOINFOHEADER *src_videoinfo;
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c
index e8067dd61d..0e162dfcde 100644
--- a/dlls/qcap/avimux.c
+++ b/dlls/qcap/avimux.c
@@ -40,7 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qcap);
#define ALIGN(x) ((x+1)/2*2)
typedef struct {
- BaseInputPin pin;
+ struct strmbase_sink pin;
IAMStreamControl IAMStreamControl_iface;
IPropertyBag IPropertyBag_iface;
IQualityControl IQualityControl_iface;
@@ -1380,7 +1380,7 @@ static HRESULT sink_query_accept(struct strmbase_pin *base, const AM_MEDIA_TYPE
return S_FALSE;
}
-static HRESULT WINAPI AviMuxIn_Receive(BaseInputPin *base, IMediaSample *pSample)
+static HRESULT WINAPI AviMuxIn_Receive(struct strmbase_sink *base, IMediaSample *pSample)
{
AviMux *avimux = impl_from_strmbase_filter(base->pin.filter);
AviMuxIn *avimuxin = CONTAINING_RECORD(base, AviMuxIn, pin);
@@ -1698,8 +1698,7 @@ static const IAMStreamControlVtbl AviMuxIn_AMStreamControlVtbl = {
static inline AviMuxIn* AviMuxIn_from_IMemInputPin(IMemInputPin *iface)
{
- BaseInputPin *bip = CONTAINING_RECORD(iface, BaseInputPin, IMemInputPin_iface);
- return CONTAINING_RECORD(bip, AviMuxIn, pin);
+ return CONTAINING_RECORD(iface, AviMuxIn, pin.IMemInputPin_iface);
}
static HRESULT WINAPI AviMuxIn_MemInputPin_QueryInterface(
diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c
index d3acf47e7e..be19fd5c09 100644
--- a/dlls/qcap/smartteefilter.c
+++ b/dlls/qcap/smartteefilter.c
@@ -37,7 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qcap);
typedef struct {
struct strmbase_filter filter;
- BaseInputPin sink;
+ struct strmbase_sink sink;
struct strmbase_source capture, preview;
} SmartTeeFilter;
@@ -242,7 +242,7 @@ end:
return hr;
}
-static HRESULT WINAPI SmartTeeFilterInput_Receive(BaseInputPin *base, IMediaSample *inputSample)
+static HRESULT WINAPI SmartTeeFilterInput_Receive(struct strmbase_sink *base, IMediaSample *inputSample)
{
SmartTeeFilter *This = impl_from_strmbase_pin(&base->pin);
IMediaSample *captureSample = NULL;
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c
index 8c337ca471..39512c066b 100644
--- a/dlls/strmbase/pin.c
+++ b/dlls/strmbase/pin.c
@@ -719,11 +719,9 @@ void strmbase_source_cleanup(struct strmbase_source *pin)
pin->pAllocator = NULL;
}
-/*** Input Pin implementation ***/
-
-static inline BaseInputPin *impl_BaseInputPin_from_IPin( IPin *iface )
+static struct strmbase_sink *impl_sink_from_IPin(IPin *iface)
{
- return CONTAINING_RECORD(iface, BaseInputPin, pin.IPin_iface);
+ return CONTAINING_RECORD(iface, struct strmbase_sink, pin.IPin_iface);
}
HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pin, const AM_MEDIA_TYPE *pmt)
@@ -735,7 +733,7 @@ HRESULT WINAPI BaseInputPinImpl_Connect(IPin *iface, IPin *pin, const AM_MEDIA_T
HRESULT WINAPI BaseInputPinImpl_ReceiveConnection(IPin * iface, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt)
{
- BaseInputPin *This = impl_BaseInputPin_from_IPin(iface);
+ struct strmbase_sink *This = impl_sink_from_IPin(iface);
PIN_DIRECTION pindirReceive;
HRESULT hr = S_OK;
@@ -788,8 +786,8 @@ static HRESULT deliver_endofstream(IPin* pin, LPVOID unused)
HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface)
{
+ struct strmbase_sink *This = impl_sink_from_IPin(iface);
HRESULT hr = S_OK;
- BaseInputPin *This = impl_BaseInputPin_from_IPin(iface);
TRACE("(%p)->()\n", This);
@@ -812,7 +810,7 @@ static HRESULT deliver_beginflush(IPin* pin, LPVOID unused)
HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface)
{
- BaseInputPin *This = impl_BaseInputPin_from_IPin(iface);
+ struct strmbase_sink *This = impl_sink_from_IPin(iface);
HRESULT hr;
TRACE("(%p) semi-stub\n", This);
@@ -832,7 +830,7 @@ static HRESULT deliver_endflush(IPin* pin, LPVOID unused)
HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface)
{
- BaseInputPin *This = impl_BaseInputPin_from_IPin(iface);
+ struct strmbase_sink *This = impl_sink_from_IPin(iface);
HRESULT hr;
TRACE("(%p)->()\n", This);
@@ -873,35 +871,35 @@ HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME start, R
/*** IMemInputPin implementation ***/
-static inline BaseInputPin *impl_from_IMemInputPin( IMemInputPin *iface )
+static inline struct strmbase_sink *impl_from_IMemInputPin(IMemInputPin *iface)
{
- return CONTAINING_RECORD(iface, BaseInputPin, IMemInputPin_iface);
+ return CONTAINING_RECORD(iface, struct strmbase_sink, IMemInputPin_iface);
}
static HRESULT WINAPI MemInputPin_QueryInterface(IMemInputPin * iface, REFIID riid, LPVOID * ppv)
{
- BaseInputPin *This = impl_from_IMemInputPin(iface);
+ struct strmbase_sink *This = impl_from_IMemInputPin(iface);
return IPin_QueryInterface(&This->pin.IPin_iface, riid, ppv);
}
static ULONG WINAPI MemInputPin_AddRef(IMemInputPin * iface)
{
- BaseInputPin *This = impl_from_IMemInputPin(iface);
+ struct strmbase_sink *This = impl_from_IMemInputPin(iface);
return IPin_AddRef(&This->pin.IPin_iface);
}
static ULONG WINAPI MemInputPin_Release(IMemInputPin * iface)
{
- BaseInputPin *This = impl_from_IMemInputPin(iface);
+ struct strmbase_sink *This = impl_from_IMemInputPin(iface);
return IPin_Release(&This->pin.IPin_iface);
}
static HRESULT WINAPI MemInputPin_GetAllocator(IMemInputPin * iface, IMemAllocator ** ppAllocator)
{
- BaseInputPin *This = impl_from_IMemInputPin(iface);
+ struct strmbase_sink *This = impl_from_IMemInputPin(iface);
TRACE("(%p/%p)->(%p)\n", This, iface, ppAllocator);
@@ -914,7 +912,7 @@ static HRESULT WINAPI MemInputPin_GetAllocator(IMemInputPin * iface, IMemAllocat
static HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllocator * pAllocator, BOOL bReadOnly)
{
- BaseInputPin *This = impl_from_IMemInputPin(iface);
+ struct strmbase_sink *This = impl_from_IMemInputPin(iface);
TRACE("(%p/%p)->(%p, %d)\n", This, iface, pAllocator, bReadOnly);
@@ -942,7 +940,7 @@ static HRESULT WINAPI MemInputPin_NotifyAllocator(IMemInputPin * iface, IMemAllo
static HRESULT WINAPI MemInputPin_GetAllocatorRequirements(IMemInputPin * iface, ALLOCATOR_PROPERTIES * pProps)
{
- BaseInputPin *This = impl_from_IMemInputPin(iface);
+ struct strmbase_sink *This = impl_from_IMemInputPin(iface);
TRACE("(%p/%p)->(%p)\n", This, iface, pProps);
@@ -953,7 +951,7 @@ static HRESULT WINAPI MemInputPin_GetAllocatorRequirements(IMemInputPin * iface,
static HRESULT WINAPI MemInputPin_Receive(IMemInputPin * iface, IMediaSample * pSample)
{
- BaseInputPin *This = impl_from_IMemInputPin(iface);
+ struct strmbase_sink *This = impl_from_IMemInputPin(iface);
HRESULT hr = S_FALSE;
/* this trace commented out for performance reasons */
@@ -965,8 +963,8 @@ static HRESULT WINAPI MemInputPin_Receive(IMemInputPin * iface, IMediaSample * p
static HRESULT WINAPI MemInputPin_ReceiveMultiple(IMemInputPin * iface, IMediaSample ** pSamples, LONG nSamples, LONG *nSamplesProcessed)
{
+ struct strmbase_sink *This = impl_from_IMemInputPin(iface);
HRESULT hr = S_OK;
- BaseInputPin *This = impl_from_IMemInputPin(iface);
TRACE("(%p/%p)->(%p, %d, %p)\n", This, iface, pSamples, nSamples, nSamplesProcessed);
@@ -982,7 +980,7 @@ static HRESULT WINAPI MemInputPin_ReceiveMultiple(IMemInputPin * iface, IMediaSa
static HRESULT WINAPI MemInputPin_ReceiveCanBlock(IMemInputPin * iface)
{
- BaseInputPin *This = impl_from_IMemInputPin(iface);
+ struct strmbase_sink *This = impl_from_IMemInputPin(iface);
TRACE("(%p/%p)->()\n", This, iface);
@@ -1002,7 +1000,7 @@ static const IMemInputPinVtbl MemInputPin_Vtbl =
MemInputPin_ReceiveCanBlock
};
-void strmbase_sink_init(BaseInputPin *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
+void strmbase_sink_init(struct strmbase_sink *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
const WCHAR *name, const BaseInputPinFuncTable *func_table, IMemAllocator *allocator)
{
memset(pin, 0, sizeof(*pin));
@@ -1018,7 +1016,7 @@ void strmbase_sink_init(BaseInputPin *pin, const IPinVtbl *vtbl, struct strmbase
pin->IMemInputPin_iface.lpVtbl = &MemInputPin_Vtbl;
}
-void strmbase_sink_cleanup(BaseInputPin *pin)
+void strmbase_sink_cleanup(struct strmbase_sink *pin)
{
FreeMediaType(&pin->pin.mt);
if (pin->pAllocator)
diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c
index 57f440b9f4..2e8566b064 100644
--- a/dlls/strmbase/renderer.c
+++ b/dlls/strmbase/renderer.c
@@ -296,7 +296,7 @@ static HRESULT sink_query_interface(struct strmbase_pin *iface, REFIID iid, void
return S_OK;
}
-static HRESULT WINAPI BaseRenderer_Receive(BaseInputPin *pin, IMediaSample *sample)
+static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSample *sample)
{
struct strmbase_renderer *filter = impl_from_IPin(&pin->pin.IPin_iface);
return BaseRendererImpl_Receive(filter, sample);
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c
index f4c2c4be72..3811569da1 100644
--- a/dlls/strmbase/transform.c
+++ b/dlls/strmbase/transform.c
@@ -57,7 +57,7 @@ static HRESULT sink_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE
return S_OK;
}
-static HRESULT WINAPI TransformFilter_Input_Receive(BaseInputPin *This, IMediaSample *pInSample)
+static HRESULT WINAPI TransformFilter_Input_Receive(struct strmbase_sink *This, IMediaSample *pInSample)
{
TransformFilter *pTransform = impl_from_sink_IPin(&This->pin.IPin_iface);
HRESULT hr;
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h
index 01a2bc79c3..99c579f8df 100644
--- a/include/wine/strmbase.h
+++ b/include/wine/strmbase.h
@@ -75,7 +75,7 @@ struct strmbase_source_ops
BaseOutputPin_DecideAllocator pfnDecideAllocator;
};
-typedef struct BaseInputPin
+struct strmbase_sink
{
struct strmbase_pin pin;
@@ -85,9 +85,9 @@ typedef struct BaseInputPin
IMemAllocator *preferred_allocator;
const struct BaseInputPinFuncTable *pFuncsTable;
-} BaseInputPin;
+};
-typedef HRESULT (WINAPI *BaseInputPin_Receive)(BaseInputPin *This, IMediaSample *pSample);
+typedef HRESULT (WINAPI *BaseInputPin_Receive)(struct strmbase_sink *This, IMediaSample *pSample);
typedef struct BaseInputPinFuncTable {
BasePinFuncTable base;
@@ -142,9 +142,9 @@ HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface);
HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface);
HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
-void strmbase_sink_init(BaseInputPin *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
+void strmbase_sink_init(struct strmbase_sink *pin, const IPinVtbl *vtbl, struct strmbase_filter *filter,
const WCHAR *name, const BaseInputPinFuncTable *func_table, IMemAllocator *allocator);
-void strmbase_sink_cleanup(BaseInputPin *pin);
+void strmbase_sink_cleanup(struct strmbase_sink *pin);
struct strmbase_filter
{
@@ -207,7 +207,7 @@ typedef struct TransformFilter
IQualityControl source_IQualityControl_iface;
IQualityControl *source_qc_sink;
- BaseInputPin sink;
+ struct strmbase_sink sink;
AM_MEDIA_TYPE pmt;
CRITICAL_SECTION csReceive;
@@ -515,7 +515,7 @@ struct strmbase_renderer
{
struct strmbase_filter filter;
- BaseInputPin sink;
+ struct strmbase_sink sink;
IUnknown *pPosition;
CRITICAL_SECTION csRenderLock;
/* Signaled when the filter has completed a state change. The filter waits
--
2.24.0
More information about the wine-devel
mailing list