Commit d53fdd0e authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

qcap/audiorecord: Partially implement QueryAccept().

parent c752b561
...@@ -50,6 +50,17 @@ static HRESULT audio_record_source_query_interface(struct strmbase_pin *iface, R ...@@ -50,6 +50,17 @@ static HRESULT audio_record_source_query_interface(struct strmbase_pin *iface, R
return S_OK; 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 static const struct
{ {
unsigned int rate; unsigned int rate;
...@@ -129,6 +140,7 @@ static HRESULT WINAPI audio_record_source_DecideBufferSize(struct strmbase_sourc ...@@ -129,6 +140,7 @@ static HRESULT WINAPI audio_record_source_DecideBufferSize(struct strmbase_sourc
static const struct strmbase_source_ops source_ops = static const struct strmbase_source_ops source_ops =
{ {
.base.pin_get_media_type = audio_record_source_get_media_type, .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, .base.pin_query_interface = audio_record_source_query_interface,
.pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection, .pfnAttemptConnection = BaseOutputPinImpl_AttemptConnection,
.pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator,
......
...@@ -443,18 +443,18 @@ static void test_media_types(IBaseFilter *filter) ...@@ -443,18 +443,18 @@ static void test_media_types(IBaseFilter *filter)
init_pcm_mt(&mt, &format, 1, 44100, 8); init_pcm_mt(&mt, &format, 1, 44100, 8);
mt.majortype = MEDIATYPE_Stream; mt.majortype = MEDIATYPE_Stream;
hr = IPin_QueryAccept(pin, &mt); 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; mt.majortype = GUID_NULL;
hr = IPin_QueryAccept(pin, &mt); 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); init_pcm_mt(&mt, &format, 1, 44100, 8);
mt.formattype = FORMAT_None; mt.formattype = FORMAT_None;
hr = IPin_QueryAccept(pin, &mt); 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; mt.formattype = GUID_NULL;
hr = IPin_QueryAccept(pin, &mt); 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); init_pcm_mt(&mt, &format, 1, 44100, 8);
format.wFormatTag = 0xdead; format.wFormatTag = 0xdead;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment