[PATCH v4 3/5] quartz/tests: Use BaseOutputPinImpl_AttemptConnection().
Zebediah Figura
z.figura12 at gmail.com
Mon Feb 3 14:10:57 CST 2020
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
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 f75cf2919a0..4e26a18f833 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 8a17bdcd19f..bb793741e9d 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 ed3f7cd38bb..a800aaeb705 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)
--
2.25.0
More information about the wine-devel
mailing list