strmbase/renderer: Use base sink connection methods.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
67a6af77b5
commit
7f57286d73
|
@ -1392,7 +1392,7 @@ static void test_connect_pin(void)
|
|||
hr = IFilterGraph2_Disconnect(graph, pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
hr = IFilterGraph2_Disconnect(graph, pin);
|
||||
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(source.source.pin.peer == pin, "Got peer %p.\n", peer);
|
||||
IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface);
|
||||
|
||||
|
|
|
@ -901,7 +901,8 @@ static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface
|
|||
|
||||
if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt)))
|
||||
{
|
||||
ok(hr == VFW_E_TYPE_NOT_ACCEPTED || hr == E_FAIL, "Got hr %#x.\n", hr);
|
||||
todo_wine_if (((VIDEOINFOHEADER *)mt->pbFormat)->bmiHeader.biBitCount == 24)
|
||||
ok(hr == VFW_E_TYPE_NOT_ACCEPTED || hr == E_FAIL, "Got hr %#x.\n", hr);
|
||||
IPin_Release(peer);
|
||||
iface->pin.peer = NULL;
|
||||
FreeMediaType(&iface->pin.mt);
|
||||
|
@ -1315,13 +1316,17 @@ static void test_connect_pin(void)
|
|||
skip("Got E_FAIL when connecting.\n");
|
||||
goto out;
|
||||
}
|
||||
ok(hr == S_OK, "Got hr %#x for subtype %s and bpp %u.\n", hr,
|
||||
wine_dbgstr_guid(subtype_tests[i]), bpp_tests[j]);
|
||||
todo_wine_if (bpp_tests[j] == 24)
|
||||
ok(hr == S_OK, "Got hr %#x for subtype %s and bpp %u.\n", hr,
|
||||
wine_dbgstr_guid(subtype_tests[i]), bpp_tests[j]);
|
||||
|
||||
hr = IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
hr = IFilterGraph2_Disconnect(graph, pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
if (hr == S_OK)
|
||||
{
|
||||
hr = IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
hr = IFilterGraph2_Disconnect(graph, pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1391,7 +1396,7 @@ static void test_connect_pin(void)
|
|||
hr = IFilterGraph2_Disconnect(graph, pin);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
hr = IFilterGraph2_Disconnect(graph, pin);
|
||||
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
|
||||
ok(source.source.pin.peer == pin, "Got peer %p.\n", source.source.pin.peer);
|
||||
IFilterGraph2_Disconnect(graph, &source.source.pin.IPin_iface);
|
||||
|
||||
|
|
|
@ -356,7 +356,7 @@ static HRESULT VMR9_maybe_init(struct quartz_vmr *This, BOOL force)
|
|||
HRESULT hr;
|
||||
|
||||
TRACE("my mode: %u, my window: %p, my last window: %p\n", This->mode, This->baseControlWindow.baseWindow.hWnd, This->hWndClippingWindow);
|
||||
if (This->num_surfaces || !This->renderer.sink.pin.peer)
|
||||
if (This->num_surfaces)
|
||||
return S_OK;
|
||||
|
||||
if (This->mode == VMR9Mode_Windowless && !This->hWndClippingWindow)
|
||||
|
@ -410,7 +410,8 @@ static void vmr_start_stream(struct strmbase_renderer *iface)
|
|||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
VMR9_maybe_init(This, TRUE);
|
||||
if (This->renderer.sink.pin.peer)
|
||||
VMR9_maybe_init(This, TRUE);
|
||||
IVMRImagePresenter9_StartPresenting(This->presenter, This->cookie);
|
||||
SetWindowPos(This->baseControlWindow.baseWindow.hWnd, NULL,
|
||||
This->source_rect.left,
|
||||
|
@ -1760,7 +1761,8 @@ static HRESULT WINAPI VMR9WindowlessControl_SetVideoClippingWindow(IVMRWindowles
|
|||
|
||||
EnterCriticalSection(&This->renderer.filter.csFilter);
|
||||
This->hWndClippingWindow = hwnd;
|
||||
VMR9_maybe_init(This, FALSE);
|
||||
if (This->renderer.sink.pin.peer)
|
||||
VMR9_maybe_init(This, FALSE);
|
||||
if (!hwnd)
|
||||
IVMRSurfaceAllocatorEx9_TerminateDevice(This->allocator, This->cookie);
|
||||
LeaveCriticalSection(&This->renderer.filter.csFilter);
|
||||
|
|
|
@ -40,46 +40,6 @@ static inline struct strmbase_renderer *impl_from_IPin(IPin *iface)
|
|||
return CONTAINING_RECORD(iface, struct strmbase_renderer, sink.pin.IPin_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI BaseRenderer_InputPin_ReceiveConnection(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
|
||||
{
|
||||
struct strmbase_renderer *filter = impl_from_IPin(iface);
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, peer %p, mt %p.\n", iface, peer, mt);
|
||||
strmbase_dump_media_type(mt);
|
||||
|
||||
EnterCriticalSection(&filter->filter.csFilter);
|
||||
hr = BaseInputPinImpl_ReceiveConnection(iface, peer, mt);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
if (filter->pFuncsTable->renderer_connect)
|
||||
hr = filter->pFuncsTable->renderer_connect(filter, mt);
|
||||
}
|
||||
LeaveCriticalSection(&filter->filter.csFilter);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI BaseRenderer_InputPin_Disconnect(IPin * iface)
|
||||
{
|
||||
struct strmbase_renderer *filter = impl_from_IPin(iface);
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p.\n", iface);
|
||||
|
||||
EnterCriticalSection(&filter->filter.csFilter);
|
||||
hr = BaseInputPinImpl_Disconnect(iface);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
if (filter->pFuncsTable->pfnBreakConnect)
|
||||
hr = filter->pFuncsTable->pfnBreakConnect(filter);
|
||||
}
|
||||
BaseRendererImpl_ClearPendingSample(filter);
|
||||
LeaveCriticalSection(&filter->filter.csFilter);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface)
|
||||
{
|
||||
struct strmbase_renderer *filter = impl_from_IPin(iface);
|
||||
|
@ -157,8 +117,8 @@ static const IPinVtbl BaseRenderer_InputPin_Vtbl =
|
|||
BasePinImpl_AddRef,
|
||||
BasePinImpl_Release,
|
||||
BaseInputPinImpl_Connect,
|
||||
BaseRenderer_InputPin_ReceiveConnection,
|
||||
BaseRenderer_InputPin_Disconnect,
|
||||
BaseInputPinImpl_ReceiveConnection,
|
||||
BaseInputPinImpl_Disconnect,
|
||||
BasePinImpl_ConnectedTo,
|
||||
BasePinImpl_ConnectionMediaType,
|
||||
BasePinImpl_QueryPinInfo,
|
||||
|
@ -312,12 +272,31 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp
|
|||
return BaseRendererImpl_Receive(filter, sample);
|
||||
}
|
||||
|
||||
static HRESULT sink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
|
||||
{
|
||||
struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface);
|
||||
|
||||
if (filter->pFuncsTable->renderer_connect)
|
||||
return filter->pFuncsTable->renderer_connect(filter, mt);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static void sink_disconnect(struct strmbase_sink *iface)
|
||||
{
|
||||
struct strmbase_renderer *filter = impl_from_IPin(&iface->pin.IPin_iface);
|
||||
|
||||
if (filter->pFuncsTable->pfnBreakConnect)
|
||||
filter->pFuncsTable->pfnBreakConnect(filter);
|
||||
}
|
||||
|
||||
static const struct strmbase_sink_ops sink_ops =
|
||||
{
|
||||
.base.pin_query_accept = sink_query_accept,
|
||||
.base.pin_query_interface = sink_query_interface,
|
||||
.base.pin_get_media_type = strmbase_pin_get_media_type,
|
||||
.pfnReceive = BaseRenderer_Receive,
|
||||
.sink_connect = sink_connect,
|
||||
.sink_disconnect = sink_disconnect,
|
||||
};
|
||||
|
||||
void strmbase_renderer_cleanup(struct strmbase_renderer *filter)
|
||||
|
|
Loading…
Reference in New Issue