Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/audiorecord.c | 2 +- dlls/qcap/avico.c | 6 +++--- dlls/qcap/avimux.c | 6 +++--- dlls/qcap/smartteefilter.c | 8 ++++---- dlls/qcap/vfwcapture.c | 4 ++-- dlls/qedit/samplegrabber.c | 6 +++--- dlls/quartz/filesource.c | 4 ++-- dlls/quartz/tests/videorenderer.c | 4 ++-- dlls/quartz/tests/vmr7.c | 4 ++-- dlls/quartz/tests/vmr9.c | 4 ++-- dlls/strmbase/enumpins.c | 10 ++++------ dlls/strmbase/filter.c | 14 +++----------- dlls/strmbase/renderer.c | 4 ++-- dlls/strmbase/transform.c | 6 +++--- dlls/winegstreamer/gstdemux.c | 6 +++--- dlls/wineqtdecoder/qtsplitter.c | 10 +++++----- include/wine/strmbase.h | 2 +- 17 files changed, 45 insertions(+), 55 deletions(-)
diff --git a/dlls/qcap/audiorecord.c b/dlls/qcap/audiorecord.c index 6446ee6b4e..0262bc5bd8 100644 --- a/dlls/qcap/audiorecord.c +++ b/dlls/qcap/audiorecord.c @@ -67,7 +67,7 @@ static const IBaseFilterVtbl AudioRecordVtbl = { BaseFilterImpl_QueryVendorInfo };
-static IPin *audio_record_get_pin(struct strmbase_filter *iface, unsigned int index) +static struct strmbase_pin *audio_record_get_pin(struct strmbase_filter *iface, unsigned int index) { FIXME("iface %p, index %u, stub!\n", iface, index); return NULL; diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 1cbeb70f03..2e81a6b0c4 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -178,14 +178,14 @@ static const IBaseFilterVtbl AVICompressorVtbl = { BaseFilterImpl_QueryVendorInfo, };
-static IPin *avi_compressor_get_pin(struct strmbase_filter *iface, unsigned int index) +static struct strmbase_pin *avi_compressor_get_pin(struct strmbase_filter *iface, unsigned int index) { AVICompressor *filter = impl_from_strmbase_filter(iface);
if (index == 0) - return &filter->sink.pin.IPin_iface; + return &filter->sink.pin; else if (index == 1) - return &filter->source.pin.IPin_iface; + return &filter->source.pin; return NULL; }
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index 51a1a503af..1995358ac2 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -113,14 +113,14 @@ static inline AviMux* impl_from_strmbase_filter(struct strmbase_filter *filter) return CONTAINING_RECORD(filter, AviMux, filter); }
-static IPin *avi_mux_get_pin(struct strmbase_filter *iface, unsigned int index) +static struct strmbase_pin *avi_mux_get_pin(struct strmbase_filter *iface, unsigned int index) { AviMux *filter = impl_from_strmbase_filter(iface);
if (!index) - return &filter->source.pin.IPin_iface; + return &filter->source.pin; else if (index <= filter->input_pin_no) - return &filter->in[index - 1]->pin.pin.IPin_iface; + return &filter->in[index - 1]->pin.pin; return NULL; }
diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index e3740bed13..fd0dd621e3 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -69,16 +69,16 @@ static const IBaseFilterVtbl SmartTeeFilterVtbl = { BaseFilterImpl_QueryVendorInfo };
-static IPin *smart_tee_get_pin(struct strmbase_filter *iface, unsigned int index) +static struct strmbase_pin *smart_tee_get_pin(struct strmbase_filter *iface, unsigned int index) { SmartTeeFilter *filter = impl_from_strmbase_filter(iface);
if (index == 0) - return &filter->sink.pin.IPin_iface; + return &filter->sink.pin; else if (index == 1) - return &filter->capture.pin.IPin_iface; + return &filter->capture.pin; else if (index == 2) - return &filter->preview.pin.IPin_iface; + return &filter->preview.pin; return NULL; }
diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index 0be0914836..883aade2dc 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -82,14 +82,14 @@ static inline VfwCapture *impl_from_IPersistPropertyBag(IPersistPropertyBag *ifa return CONTAINING_RECORD(iface, VfwCapture, IPersistPropertyBag_iface); }
-static IPin *vfw_capture_get_pin(struct strmbase_filter *iface, unsigned int index) +static struct strmbase_pin *vfw_capture_get_pin(struct strmbase_filter *iface, unsigned int index) { VfwCapture *This = impl_from_strmbase_filter(iface);
if (index >= 1) return NULL;
- return &This->source.pin.IPin_iface; + return &This->source.pin; }
static void vfw_capture_destroy(struct strmbase_filter *iface) diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c index 59238f5896..9dd8c02b23 100644 --- a/dlls/qedit/samplegrabber.c +++ b/dlls/qedit/samplegrabber.c @@ -100,14 +100,14 @@ static void SampleGrabber_cleanup(SG_Impl *This) IUnknown_Release(This->seekthru_unk); }
-static IPin *sample_grabber_get_pin(struct strmbase_filter *iface, unsigned int index) +static struct strmbase_pin *sample_grabber_get_pin(struct strmbase_filter *iface, unsigned int index) { SG_Impl *filter = impl_from_strmbase_filter(iface);
if (index == 0) - return &filter->sink.pin.IPin_iface; + return &filter->sink.pin; else if (index == 1) - return &filter->source.pin.IPin_iface; + return &filter->source.pin; return NULL; }
diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 59f1cc5a18..1c17980f58 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -341,12 +341,12 @@ BOOL get_media_type(const WCHAR *filename, GUID *majortype, GUID *subtype, GUID return FALSE; }
-static IPin *async_reader_get_pin(struct strmbase_filter *iface, unsigned int index) +static struct strmbase_pin *async_reader_get_pin(struct strmbase_filter *iface, unsigned int index) { AsyncReader *filter = impl_from_strmbase_filter(iface);
if (!index && filter->pszFileName) - return &filter->source.pin.IPin_iface; + return &filter->source.pin; return NULL; }
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 046d94b0b8..8ff7917a7b 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -519,11 +519,11 @@ static inline struct testfilter *impl_from_BaseFilter(struct strmbase_filter *if return CONTAINING_RECORD(iface, struct testfilter, filter); }
-static IPin *testfilter_get_pin(struct strmbase_filter *iface, unsigned int index) +static struct strmbase_pin *testfilter_get_pin(struct strmbase_filter *iface, unsigned int index) { struct testfilter *filter = impl_from_BaseFilter(iface); if (!index) - return &filter->source.pin.IPin_iface; + return &filter->source.pin; return NULL; }
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 568d74a26a..01d9ad10fa 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -879,11 +879,11 @@ static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filte return CONTAINING_RECORD(iface, struct testfilter, filter); }
-static IPin *testfilter_get_pin(struct strmbase_filter *iface, unsigned int index) +static struct strmbase_pin *testfilter_get_pin(struct strmbase_filter *iface, unsigned int index) { struct testfilter *filter = impl_from_strmbase_filter(iface); if (!index) - return &filter->source.pin.IPin_iface; + return &filter->source.pin; return NULL; }
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index c5a455afb2..9379fa11e4 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -883,11 +883,11 @@ static inline struct testfilter *impl_from_strmbase_filter(struct strmbase_filte return CONTAINING_RECORD(iface, struct testfilter, filter); }
-static IPin *testfilter_get_pin(struct strmbase_filter *iface, unsigned int index) +static struct strmbase_pin *testfilter_get_pin(struct strmbase_filter *iface, unsigned int index) { struct testfilter *filter = impl_from_strmbase_filter(iface); if (!index) - return &filter->source.pin.IPin_iface; + return &filter->source.pin; return NULL; }
diff --git a/dlls/strmbase/enumpins.c b/dlls/strmbase/enumpins.c index 5175158e96..1cfea85b0c 100644 --- a/dlls/strmbase/enumpins.c +++ b/dlls/strmbase/enumpins.c @@ -42,7 +42,6 @@ static const struct IEnumPinsVtbl IEnumPinsImpl_Vtbl; HRESULT enum_pins_create(struct strmbase_filter *base, IEnumPins **out) { IEnumPinsImpl *object; - IPin *pin;
if (!out) return E_POINTER; @@ -59,7 +58,7 @@ HRESULT enum_pins_create(struct strmbase_filter *base, IEnumPins **out) IBaseFilter_AddRef(&base->IBaseFilter_iface); object->Version = base->pin_version;
- while ((pin = base->ops->filter_get_pin(base, object->count))) + while (base->ops->filter_get_pin(base, object->count)) ++object->count;
TRACE("Created enumerator %p.\n", object); @@ -137,12 +136,12 @@ static HRESULT WINAPI IEnumPinsImpl_Next(IEnumPins * iface, ULONG cPins, IPin **
for (i = 0; i < cPins; ++i) { - IPin *pin = This->base->ops->filter_get_pin(This->base, This->uIndex + i); + struct strmbase_pin *pin = This->base->ops->filter_get_pin(This->base, This->uIndex + i);
if (!pin) break;
- IPin_AddRef(ppPins[i] = pin); + IPin_AddRef(ppPins[i] = &pin->IPin_iface); }
if (pcFetched) @@ -173,14 +172,13 @@ static HRESULT WINAPI IEnumPinsImpl_Skip(IEnumPins *iface, ULONG count) static HRESULT WINAPI IEnumPinsImpl_Reset(IEnumPins *iface) { IEnumPinsImpl *enum_pins = impl_from_IEnumPins(iface); - IPin *pin;
TRACE("iface %p.\n", iface);
if (enum_pins->Version != enum_pins->base->pin_version) { enum_pins->count = 0; - while ((pin = enum_pins->base->ops->filter_get_pin(enum_pins->base, enum_pins->count))) + while (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 ffe506d517..60e3823322 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -250,24 +250,16 @@ HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **enum_pins HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin **ret) { struct strmbase_filter *This = impl_from_IBaseFilter(iface); + struct strmbase_pin *pin; unsigned int i; - PIN_INFO info; - HRESULT hr; - IPin *pin;
TRACE("(%p)->(%s, %p)\n", This, debugstr_w(id), ret);
for (i = 0; (pin = This->ops->filter_get_pin(This, i)); ++i) { - hr = IPin_QueryPinInfo(pin, &info); - if (FAILED(hr)) - return hr; - - if (info.pFilter) IBaseFilter_Release(info.pFilter); - - if (!lstrcmpW(id, info.achName)) + if (!lstrcmpW(id, pin->name)) { - IPin_AddRef(*ret = pin); + IPin_AddRef(*ret = &pin->IPin_iface); return S_OK; } } diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index aa134ba5da..add999b4ec 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -163,12 +163,12 @@ static const IPinVtbl BaseRenderer_InputPin_Vtbl = BaseInputPinImpl_NewSegment };
-static IPin *renderer_get_pin(struct strmbase_filter *iface, unsigned int index) +static struct strmbase_pin *renderer_get_pin(struct strmbase_filter *iface, unsigned int index) { struct strmbase_renderer *filter = impl_from_strmbase_filter(iface);
if (index == 0) - return &filter->sink.pin.IPin_iface; + return &filter->sink.pin; return NULL; }
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index 12a99eef67..e7d4d66164 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -114,14 +114,14 @@ static HRESULT source_get_media_type(struct strmbase_pin *This, unsigned int iPo return S_OK; }
-static IPin *transform_get_pin(struct strmbase_filter *iface, unsigned int index) +static struct strmbase_pin *transform_get_pin(struct strmbase_filter *iface, unsigned int index) { TransformFilter *filter = impl_from_strmbase_filter(iface);
if (index == 0) - return &filter->sink.pin.IPin_iface; + return &filter->sink.pin; else if (index == 1) - return &filter->source.pin.IPin_iface; + return &filter->source.pin; return NULL; }
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 394b919df9..479077b48f 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1203,14 +1203,14 @@ static inline struct gstdemux_source *impl_from_IMediaSeeking(IMediaSeeking *ifa return CONTAINING_RECORD(iface, struct gstdemux_source, seek.IMediaSeeking_iface); }
-static IPin *gstdemux_get_pin(struct strmbase_filter *base, unsigned int index) +static struct strmbase_pin *gstdemux_get_pin(struct strmbase_filter *base, unsigned int index) { struct gstdemux *filter = impl_from_strmbase_filter(base);
if (!index) - return &filter->sink.IPin_iface; + return &filter->sink; else if (index <= filter->cStreams) - return &filter->ppPins[index - 1]->pin.pin.IPin_iface; + return &filter->ppPins[index - 1]->pin.pin; return NULL; }
diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index 2da0f691dc..fbec10a912 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -208,21 +208,21 @@ static inline QTInPin *impl_from_IPin(IPin *iface) * Base Filter */
-static IPin *qt_splitter_get_pin(struct strmbase_filter *base, unsigned int index) +static struct strmbase_pin *qt_splitter_get_pin(struct strmbase_filter *base, unsigned int index) { QTSplitter *filter = impl_from_strmbase_filter(base);
if (index == 0) - return &filter->pInputPin.pin.IPin_iface; + return &filter->pInputPin.pin; else if (index == 1) { if (filter->pVideo_Pin) - return &filter->pVideo_Pin->pin.pin.IPin_iface; + return &filter->pVideo_Pin->pin.pin; else if (filter->pAudio_Pin) - return &filter->pAudio_Pin->pin.pin.IPin_iface; + return &filter->pAudio_Pin->pin.pin; } else if (index == 2 && filter->pVideo_Pin && filter->pAudio_Pin) - return &filter->pAudio_Pin->pin.pin.IPin_iface; + return &filter->pAudio_Pin->pin.pin;
return NULL; } diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index fd79e9726d..dd2f8426bf 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -166,7 +166,7 @@ struct strmbase_filter
struct strmbase_filter_ops { - IPin *(*filter_get_pin)(struct strmbase_filter *iface, unsigned int index); + struct strmbase_pin *(*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);