Module: wine Branch: master Commit: b9a5b7a3b7c4b7e0ac78b6c36a74cb1cd90a4bc2 URL: https://source.winehq.org/git/wine.git/?a=commit;h=b9a5b7a3b7c4b7e0ac78b6c36...
Author: Zebediah Figura z.figura12@gmail.com Date: Mon Feb 3 14:15:49 2020 -0600
quartz/tests: Use BaseOutputPinImpl_AttemptConnection().
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/quartz/tests/videorenderer.c | 23 +++++------------------ dlls/quartz/tests/vmr7.c | 23 +++++------------------ dlls/quartz/tests/vmr9.c | 24 +++++------------------- 3 files changed, 15 insertions(+), 55 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index f75cf2919a..4e26a18f83 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -522,31 +522,18 @@ static HRESULT testsource_query_accept(struct strmbase_pin *iface, const AM_MEDI return S_OK; }
-static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface, - IPin *peer, const AM_MEDIA_TYPE *mt) +static HRESULT WINAPI testsource_DecideAllocator(struct strmbase_source *iface, + IMemInputPin *peer, IMemAllocator **allocator) { - HRESULT hr; - - iface->pin.peer = peer; - IPin_AddRef(peer); - CopyMediaType(&iface->pin.mt, mt); - - if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt))) - { - ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); - IPin_Release(peer); - iface->pin.peer = NULL; - FreeMediaType(&iface->pin.mt); - } - - return hr; + return S_OK; }
static const struct strmbase_source_ops testsource_ops = { .base.pin_query_accept = testsource_query_accept, .base.pin_get_media_type = strmbase_pin_get_media_type, - .pfnAttemptConnection = testsource_AttemptConnection, + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideAllocator = testsource_DecideAllocator, };
static void testfilter_init(struct testfilter *filter) diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 8a17bdcd19..bb793741e9 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -872,31 +872,18 @@ static HRESULT testsource_query_accept(struct strmbase_pin *iface, const AM_MEDI return S_OK; }
-static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface, - IPin *peer, const AM_MEDIA_TYPE *mt) +static HRESULT WINAPI testsource_DecideAllocator(struct strmbase_source *iface, + IMemInputPin *peer, IMemAllocator **allocator) { - HRESULT hr; - - iface->pin.peer = peer; - IPin_AddRef(peer); - CopyMediaType(&iface->pin.mt, mt); - - if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt))) - { - ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); - IPin_Release(peer); - iface->pin.peer = NULL; - FreeMediaType(&iface->pin.mt); - } - - return hr; + return S_OK; }
static const struct strmbase_source_ops testsource_ops = { .base.pin_query_accept = testsource_query_accept, .base.pin_get_media_type = strmbase_pin_get_media_type, - .pfnAttemptConnection = testsource_AttemptConnection, + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideAllocator = testsource_DecideAllocator, };
static void testfilter_init(struct testfilter *filter) diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index ed3f7cd38b..a800aaeb70 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -876,32 +876,18 @@ static HRESULT testsource_query_accept(struct strmbase_pin *iface, const AM_MEDI return S_OK; }
-static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface, - IPin *peer, const AM_MEDIA_TYPE *mt) +static HRESULT WINAPI testsource_DecideAllocator(struct strmbase_source *iface, + IMemInputPin *peer, IMemAllocator **allocator) { - HRESULT hr; - - iface->pin.peer = peer; - IPin_AddRef(peer); - CopyMediaType(&iface->pin.mt, mt); - - if (FAILED(hr = IPin_ReceiveConnection(peer, &iface->pin.IPin_iface, mt))) - { - 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); - } - - return hr; + return S_OK; }
static const struct strmbase_source_ops testsource_ops = { .base.pin_query_accept = testsource_query_accept, .base.pin_get_media_type = strmbase_pin_get_media_type, - .pfnAttemptConnection = testsource_AttemptConnection, + .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, + .pfnDecideAllocator = testsource_DecideAllocator, };
static void testfilter_init(struct testfilter *filter)