quartz/filtergraph: Check for AM_FILTER_MISC_FLAGS_IS_RENDERER or IMediaSeeking to count renderers.
Instead of using IPin_QueryInternalConnections(). Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d65586ea95
commit
783c2d66a4
|
@ -2084,8 +2084,34 @@ static HRESULT WINAPI MediaControl_Invoke(IMediaControl *iface, DISPID dispIdMem
|
||||||
|
|
||||||
typedef HRESULT(WINAPI *fnFoundFilter)(IBaseFilter *, DWORD_PTR data);
|
typedef HRESULT(WINAPI *fnFoundFilter)(IBaseFilter *, DWORD_PTR data);
|
||||||
|
|
||||||
|
static BOOL has_output_pins(IBaseFilter *filter)
|
||||||
|
{
|
||||||
|
IEnumPins *enumpins;
|
||||||
|
PIN_DIRECTION dir;
|
||||||
|
IPin *pin;
|
||||||
|
|
||||||
|
if (FAILED(IBaseFilter_EnumPins(filter, &enumpins)))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
while (IEnumPins_Next(enumpins, 1, &pin, NULL) == S_OK)
|
||||||
|
{
|
||||||
|
IPin_QueryDirection(pin, &dir);
|
||||||
|
IPin_Release(pin);
|
||||||
|
if (dir == PINDIR_OUTPUT)
|
||||||
|
{
|
||||||
|
IEnumPins_Release(enumpins);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumPins_Release(enumpins);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT ExploreGraph(IFilterGraphImpl* pGraph, IPin* pOutputPin, fnFoundFilter FoundFilter, DWORD_PTR data)
|
static HRESULT ExploreGraph(IFilterGraphImpl* pGraph, IPin* pOutputPin, fnFoundFilter FoundFilter, DWORD_PTR data)
|
||||||
{
|
{
|
||||||
|
IAMFilterMiscFlags *flags;
|
||||||
|
IMediaSeeking *seeking;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
IPin* pInputPin;
|
IPin* pInputPin;
|
||||||
IPin** ppPins;
|
IPin** ppPins;
|
||||||
|
@ -2108,13 +2134,7 @@ static HRESULT ExploreGraph(IFilterGraphImpl* pGraph, IPin* pOutputPin, fnFoundF
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
if (nb == 0)
|
if (nb)
|
||||||
{
|
|
||||||
TRACE("Reached a renderer\n");
|
|
||||||
/* Count renderers for end of stream notification */
|
|
||||||
pGraph->nRenderers++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
for(i = 0; i < nb; i++)
|
for(i = 0; i < nb; i++)
|
||||||
{
|
{
|
||||||
|
@ -2129,6 +2149,21 @@ static HRESULT ExploreGraph(IFilterGraphImpl* pGraph, IPin* pOutputPin, fnFoundF
|
||||||
}
|
}
|
||||||
TRACE("Doing stuff with filter %p\n", PinInfo.pFilter);
|
TRACE("Doing stuff with filter %p\n", PinInfo.pFilter);
|
||||||
|
|
||||||
|
if (SUCCEEDED(IBaseFilter_QueryInterface(PinInfo.pFilter,
|
||||||
|
&IID_IAMFilterMiscFlags, (void **)&flags)))
|
||||||
|
{
|
||||||
|
if (IAMFilterMiscFlags_GetMiscFlags(flags) & AM_FILTER_MISC_FLAGS_IS_RENDERER)
|
||||||
|
pGraph->nRenderers++;
|
||||||
|
IAMFilterMiscFlags_Release(flags);
|
||||||
|
}
|
||||||
|
else if (SUCCEEDED(IBaseFilter_QueryInterface(PinInfo.pFilter,
|
||||||
|
&IID_IMediaSeeking, (void **)&seeking)))
|
||||||
|
{
|
||||||
|
if (!has_output_pins(PinInfo.pFilter))
|
||||||
|
pGraph->nRenderers++;
|
||||||
|
IMediaSeeking_Release(seeking);
|
||||||
|
}
|
||||||
|
|
||||||
FoundFilter(PinInfo.pFilter, data);
|
FoundFilter(PinInfo.pFilter, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3080,10 +3080,8 @@ static void test_ec_complete(void)
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
hr = IMediaEvent_GetEvent(eventsrc, &code, ¶m1, ¶m2, 0);
|
hr = IMediaEvent_GetEvent(eventsrc, &code, ¶m1, ¶m2, 0);
|
||||||
todo_wine {
|
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
ok(code == EC_COMPLETE, "Got code %#x.\n", code);
|
ok(code == EC_COMPLETE, "Got code %#x.\n", code);
|
||||||
}
|
|
||||||
ok(param1 == S_OK, "Got param1 %#lx.\n", param1);
|
ok(param1 == S_OK, "Got param1 %#lx.\n", param1);
|
||||||
ok(!param2, "Got param2 %#lx.\n", param2);
|
ok(!param2, "Got param2 %#lx.\n", param2);
|
||||||
hr = IMediaEvent_FreeEventParams(eventsrc, code, param1, param2);
|
hr = IMediaEvent_FreeEventParams(eventsrc, code, param1, param2);
|
||||||
|
@ -3096,7 +3094,6 @@ todo_wine {
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
hr = IMediaEvent_GetEvent(eventsrc, &code, ¶m1, ¶m2, 50);
|
hr = IMediaEvent_GetEvent(eventsrc, &code, ¶m1, ¶m2, 50);
|
||||||
todo_wine
|
|
||||||
ok(hr == E_ABORT, "Got hr %#x.\n", hr);
|
ok(hr == E_ABORT, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
IMediaControl_Stop(control);
|
IMediaControl_Stop(control);
|
||||||
|
@ -3156,7 +3153,6 @@ todo_wine
|
||||||
IFilterGraph2_ConnectDirect(graph, &source_pins[0].IPin_iface, &filter1_pin.IPin_iface, NULL);
|
IFilterGraph2_ConnectDirect(graph, &source_pins[0].IPin_iface, &filter1_pin.IPin_iface, NULL);
|
||||||
|
|
||||||
hr = check_ec_complete(graph, &filter1.IBaseFilter_iface);
|
hr = check_ec_complete(graph, &filter1.IBaseFilter_iface);
|
||||||
todo_wine
|
|
||||||
ok(hr == E_ABORT, "Got hr %#x.\n", hr);
|
ok(hr == E_ABORT, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
IFilterGraph2_RemoveFilter(graph, &filter1.IBaseFilter_iface);
|
IFilterGraph2_RemoveFilter(graph, &filter1.IBaseFilter_iface);
|
||||||
|
@ -3185,7 +3181,6 @@ todo_wine
|
||||||
IFilterGraph2_ConnectDirect(graph, &source_pins[0].IPin_iface, &filter1_pin.IPin_iface, NULL);
|
IFilterGraph2_ConnectDirect(graph, &source_pins[0].IPin_iface, &filter1_pin.IPin_iface, NULL);
|
||||||
|
|
||||||
hr = check_ec_complete(graph, &filter1.IBaseFilter_iface);
|
hr = check_ec_complete(graph, &filter1.IBaseFilter_iface);
|
||||||
todo_wine
|
|
||||||
ok(hr == E_ABORT, "Got hr %#x.\n", hr);
|
ok(hr == E_ABORT, "Got hr %#x.\n", hr);
|
||||||
|
|
||||||
IMediaControl_Release(control);
|
IMediaControl_Release(control);
|
||||||
|
|
Loading…
Reference in New Issue