Module: wine Branch: master Commit: 6f71e2c48dcfdc5d2c5087b2d685d7fea85a44e8 URL: https://source.winehq.org/git/wine.git/?a=commit;h=6f71e2c48dcfdc5d2c5087b2d...
Author: Zebediah Figura z.figura12@gmail.com Date: Thu Jan 30 19:05:18 2020 -0600
strmbase: Store the filter name and graph directly in the strmbase_filter structure.
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/qcap/avimux.c | 5 ++--- dlls/qcap/vfwcapture.c | 4 ++-- dlls/qedit/samplegrabber.c | 2 -- dlls/strmbase/filter.c | 40 +++++++++++++++++++++------------------- dlls/strmbase/renderer.c | 2 +- include/wine/strmbase.h | 3 ++- 6 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index e402479fb1..91a0b17f8e 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -772,8 +772,7 @@ static HRESULT WINAPI ConfigInterleaving_put_Mode(
if(This->mode != mode) { if(This->source.pin.peer) { - HRESULT hr = IFilterGraph_Reconnect(This->filter.filterInfo.pGraph, - &This->source.pin.IPin_iface); + HRESULT hr = IFilterGraph_Reconnect(This->filter.graph, &This->source.pin.IPin_iface); if(FAILED(hr)) return hr; } @@ -1152,7 +1151,7 @@ static HRESULT WINAPI AviMuxOut_AttemptConnection(struct strmbase_source *iface, if (!filter->in[i]->pin.pin.peer) continue;
- hr = IFilterGraph_Reconnect(filter->filter.filterInfo.pGraph, &filter->in[i]->pin.pin.IPin_iface); + hr = IFilterGraph_Reconnect(filter->filter.graph, &filter->in[i]->pin.pin.IPin_iface); if (FAILED(hr)) { IPin_Disconnect(&iface->pin.IPin_iface); diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index b4716bf192..30869ede13 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -216,9 +216,9 @@ AMStreamConfig_SetFormat(IAMStreamConfig *iface, AM_MEDIA_TYPE *pmt) }
hr = qcap_driver_set_format(This->driver_info, pmt); - if (SUCCEEDED(hr) && This->filter.filterInfo.pGraph && This->source.pin.peer) + if (SUCCEEDED(hr) && This->filter.graph && This->source.pin.peer) { - hr = IFilterGraph_Reconnect(This->filter.filterInfo.pGraph, &This->source.pin.IPin_iface); + hr = IFilterGraph_Reconnect(This->filter.graph, &This->source.pin.IPin_iface); if (SUCCEEDED(hr)) TRACE("Reconnection completed, with new media format..\n"); } diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c index edb814468a..7652f70d95 100644 --- a/dlls/qedit/samplegrabber.c +++ b/dlls/qedit/samplegrabber.c @@ -80,8 +80,6 @@ static inline SG_Impl *impl_from_IMemInputPin(IMemInputPin *iface) static void SampleGrabber_cleanup(SG_Impl *This) { TRACE("(%p)\n", This); - if (This->filter.filterInfo.pGraph) - WARN("(%p) still joined to filter graph %p\n", This, This->filter.filterInfo.pGraph); if (This->allocator) IMemAllocator_Release(This->allocator); if (This->grabberIface) diff --git a/dlls/strmbase/filter.c b/dlls/strmbase/filter.c index 43da4b3fb9..84521b8099 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -443,35 +443,37 @@ static HRESULT WINAPI filter_FindPin(IBaseFilter *iface, const WCHAR *id, IPin * return VFW_E_NOT_FOUND; }
-static HRESULT WINAPI filter_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo) +static HRESULT WINAPI filter_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *info) { - struct strmbase_filter *This = impl_from_IBaseFilter(iface); - TRACE("(%p)->(%p)\n", This, pInfo); + struct strmbase_filter *filter = impl_from_IBaseFilter(iface);
- lstrcpyW(pInfo->achName, This->filterInfo.achName); - pInfo->pGraph = This->filterInfo.pGraph; + TRACE("filter %p, info %p.\n", filter, info);
- if (pInfo->pGraph) - IFilterGraph_AddRef(pInfo->pGraph); + lstrcpyW(info->achName, filter->name); + info->pGraph = filter->graph; + + if (info->pGraph) + IFilterGraph_AddRef(info->pGraph);
return S_OK; }
-static HRESULT WINAPI filter_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, const WCHAR *pName) +static HRESULT WINAPI filter_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *graph, const WCHAR *name) { - struct strmbase_filter *This = impl_from_IBaseFilter(iface); + struct strmbase_filter *filter = impl_from_IBaseFilter(iface);
- TRACE("(%p)->(%p, %s)\n", This, pGraph, debugstr_w(pName)); + TRACE("filter %p, graph %p, name %s.\n", filter, graph, debugstr_w(name));
- EnterCriticalSection(&This->csFilter); - { - if (pName) - lstrcpynW(This->filterInfo.achName, pName, MAX_FILTER_NAME); - else - *This->filterInfo.achName = '\0'; - This->filterInfo.pGraph = pGraph; /* NOTE: do NOT increase ref. count */ - } - LeaveCriticalSection(&This->csFilter); + EnterCriticalSection(&filter->csFilter); + + if (name) + lstrcpynW(filter->name, name, ARRAY_SIZE(filter->name)); + else + filter->name[0] = 0; + /* The graph references us, so we cannot also reference the graph. */ + filter->graph = graph; + + LeaveCriticalSection(&filter->csFilter);
return S_OK; } diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 1bc581963c..974823b046 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -199,7 +199,7 @@ static void sink_disconnect(struct strmbase_sink *iface) static HRESULT sink_eos(struct strmbase_sink *iface) { struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface); - IFilterGraph *graph = filter->filter.filterInfo.pGraph; + IFilterGraph *graph = filter->filter.graph; IMediaEventSink *event_sink; HRESULT hr = S_OK;
diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index abb04a8384..ae0fadb391 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -130,7 +130,8 @@ struct strmbase_filter
FILTER_STATE state; IReferenceClock * pClock; - FILTER_INFO filterInfo; + WCHAR name[128]; + IFilterGraph *graph; CLSID clsid; LONG pin_version;