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>
This commit is contained in:
parent
eea01d8e8b
commit
6f71e2c48d
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue