From 5b9ae5ad8dbdf70080a6c85939d9dc2d852f4fb7 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Tue, 3 Jul 2018 23:56:51 +0200 Subject: [PATCH] strmbase: Implement CBaseFilter::FindPin(). Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/strmbase/filter.c | 31 +++++++++++++++++++++++++++++++ include/wine/strmbase.h | 1 + 2 files changed, 32 insertions(+) diff --git a/dlls/strmbase/filter.c b/dlls/strmbase/filter.c index f1b2d498643..7d33f80cc7b 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -141,6 +141,37 @@ HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum) return EnumPins_Construct(This, This->pFuncsTable->pfnGetPin, This->pFuncsTable->pfnGetPinCount, BaseFilterImpl_GetPinVersion, ppEnum); } +HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin **ret) +{ + BaseFilter *This = impl_from_IBaseFilter(iface); + PIN_INFO info; + HRESULT hr; + IPin *pin; + int i; + + TRACE("(%p)->(%s, %p)\n", This, debugstr_w(id), ret); + + for (i = 0; i < This->pFuncsTable->pfnGetPinCount(This); ++i) + { + pin = This->pFuncsTable->pfnGetPin(This, i); + hr = IPin_QueryPinInfo(pin, &info); + if (FAILED(hr)) + { + IPin_Release(pin); + return hr; + } + + if (!strcmpW(id, info.achName)) + { + *ret = pin; + return S_OK; + } + + IPin_Release(pin); + } + + return VFW_E_NOT_FOUND; +} HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo) { diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index abe92aea869..b07dfa222f0 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -190,6 +190,7 @@ HRESULT WINAPI BaseFilterImpl_GetState(IBaseFilter * iface, DWORD dwMilliSecsTim HRESULT WINAPI BaseFilterImpl_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock); HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock); HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum); +HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin **pin); HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo); HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName ); HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo);