Module: wine Branch: master Commit: d53fdd0eb0537d0481dcbc6a710e8e09e07294f5 URL: https://gitlab.winehq.org/wine/wine/-/commit/d53fdd0eb0537d0481dcbc6a710e8e0...
Author: Zebediah Figura zfigura@codeweavers.com Date: Thu May 4 15:16:36 2023 -0500
qcap/audiorecord: Partially implement QueryAccept().
---
dlls/qcap/audiorecord.c | 12 ++++++++++++ dlls/qcap/tests/audiorecord.c | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/dlls/qcap/audiorecord.c b/dlls/qcap/audiorecord.c index ffd8e059b7b..d97d7fef19a 100644 --- a/dlls/qcap/audiorecord.c +++ b/dlls/qcap/audiorecord.c @@ -50,6 +50,17 @@ static HRESULT audio_record_source_query_interface(struct strmbase_pin *iface, R return S_OK; }
+static HRESULT audio_record_source_query_accept(struct strmbase_pin *iface, const AM_MEDIA_TYPE *mt) +{ + if (!IsEqualGUID(&mt->majortype, &MEDIATYPE_Audio)) + return S_FALSE; + + if (!IsEqualGUID(&mt->formattype, &FORMAT_WaveFormatEx)) + return S_FALSE; + + return S_OK; +} + static const struct { unsigned int rate; @@ -129,6 +140,7 @@ static HRESULT WINAPI audio_record_source_DecideBufferSize(struct strmbase_sourc static const struct strmbase_source_ops source_ops = { .base.pin_get_media_type = audio_record_source_get_media_type, + .base.pin_query_accept = audio_record_source_query_accept, .base.pin_query_interface = audio_record_source_query_interface, .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, diff --git a/dlls/qcap/tests/audiorecord.c b/dlls/qcap/tests/audiorecord.c index c64a8a83b2e..0438b970ff1 100644 --- a/dlls/qcap/tests/audiorecord.c +++ b/dlls/qcap/tests/audiorecord.c @@ -443,18 +443,18 @@ static void test_media_types(IBaseFilter *filter) init_pcm_mt(&mt, &format, 1, 44100, 8); mt.majortype = MEDIATYPE_Stream; hr = IPin_QueryAccept(pin, &mt); - todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); mt.majortype = GUID_NULL; hr = IPin_QueryAccept(pin, &mt); - todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
init_pcm_mt(&mt, &format, 1, 44100, 8); mt.formattype = FORMAT_None; hr = IPin_QueryAccept(pin, &mt); - todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); mt.formattype = GUID_NULL; hr = IPin_QueryAccept(pin, &mt); - todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
init_pcm_mt(&mt, &format, 1, 44100, 8); format.wFormatTag = 0xdead;