Module: wine Branch: master Commit: c41ba79df7014e8c2756a34315f61a0078b65897 URL: https://gitlab.winehq.org/wine/wine/-/commit/c41ba79df7014e8c2756a34315f61a0...
Author: Zebediah Figura zfigura@codeweavers.com Date: Thu May 4 15:50:19 2023 -0500
qcap/audiorecord: Stub IAMBufferNegotiation.
Needed by the Microsoft Silverlight configuration tool.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36230
---
dlls/qcap/audiorecord.c | 54 ++++++++++++++++++++++++++++++++++++++++++- dlls/qcap/tests/audiorecord.c | 1 + 2 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/dlls/qcap/audiorecord.c b/dlls/qcap/audiorecord.c index 0a17eb08057..291ca4452b3 100644 --- a/dlls/qcap/audiorecord.c +++ b/dlls/qcap/audiorecord.c @@ -29,6 +29,7 @@ struct audio_record IPersistPropertyBag IPersistPropertyBag_iface;
struct strmbase_source source; + IAMBufferNegotiation IAMBufferNegotiation_iface; IAMStreamConfig IAMStreamConfig_iface; IKsPropertySet IKsPropertySet_iface;
@@ -56,7 +57,9 @@ static HRESULT audio_record_source_query_interface(struct strmbase_pin *iface, R { struct audio_record *filter = impl_from_strmbase_filter(iface->filter);
- if (IsEqualGUID(iid, &IID_IAMStreamConfig)) + if (IsEqualGUID(iid, &IID_IAMBufferNegotiation)) + *out = &filter->IAMBufferNegotiation_iface; + else if (IsEqualGUID(iid, &IID_IAMStreamConfig)) *out = &filter->IAMStreamConfig_iface; else if (IsEqualGUID(iid, &IID_IKsPropertySet)) *out = &filter->IKsPropertySet_iface; @@ -327,6 +330,54 @@ static const IAMStreamConfigVtbl stream_config_vtbl = stream_config_GetStreamCaps, };
+static struct audio_record *impl_from_IAMBufferNegotiation(IAMBufferNegotiation *iface) +{ + return CONTAINING_RECORD(iface, struct audio_record, IAMBufferNegotiation_iface); +} + +static HRESULT WINAPI buffer_negotiation_QueryInterface(IAMBufferNegotiation *iface, REFIID iid, void **out) +{ + struct audio_record *filter = impl_from_IAMBufferNegotiation(iface); + return IPin_QueryInterface(&filter->source.pin.IPin_iface, iid, out); +} + +static ULONG WINAPI buffer_negotiation_AddRef(IAMBufferNegotiation *iface) +{ + struct audio_record *filter = impl_from_IAMBufferNegotiation(iface); + return IPin_AddRef(&filter->source.pin.IPin_iface); +} + +static ULONG WINAPI buffer_negotiation_Release(IAMBufferNegotiation *iface) +{ + struct audio_record *filter = impl_from_IAMBufferNegotiation(iface); + return IPin_Release(&filter->source.pin.IPin_iface); +} + +static HRESULT WINAPI buffer_negotiation_SuggestAllocatorProperties( + IAMBufferNegotiation *iface, const ALLOCATOR_PROPERTIES *props) +{ + FIXME("iface %p, props %p, stub!\n", iface, props); + TRACE("Requested %ld buffers, size %ld, alignment %ld, prefix %ld.\n", + props->cBuffers, props->cbBuffer, props->cbAlign, props->cbPrefix); + return E_NOTIMPL; +} + +static HRESULT WINAPI buffer_negotiation_GetAllocatorProperties( + IAMBufferNegotiation *iface, ALLOCATOR_PROPERTIES *props) +{ + FIXME("iface %p, props %p, stub!\n", iface, props); + return E_NOTIMPL; +} + +static const IAMBufferNegotiationVtbl buffer_negotiation_vtbl = +{ + buffer_negotiation_QueryInterface, + buffer_negotiation_AddRef, + buffer_negotiation_Release, + buffer_negotiation_SuggestAllocatorProperties, + buffer_negotiation_GetAllocatorProperties, +}; + static struct audio_record *impl_from_IKsPropertySet(IKsPropertySet *iface) { return CONTAINING_RECORD(iface, struct audio_record, IKsPropertySet_iface); @@ -741,6 +792,7 @@ HRESULT audio_record_create(IUnknown *outer, IUnknown **out) strmbase_filter_init(&object->filter, outer, &CLSID_AudioRecord, &filter_ops);
strmbase_source_init(&object->source, &object->filter, L"Capture", &source_ops); + object->IAMBufferNegotiation_iface.lpVtbl = &buffer_negotiation_vtbl; object->IAMStreamConfig_iface.lpVtbl = &stream_config_vtbl; object->IKsPropertySet_iface.lpVtbl = &property_set_vtbl;
diff --git a/dlls/qcap/tests/audiorecord.c b/dlls/qcap/tests/audiorecord.c index 3e2194436a9..a5669612351 100644 --- a/dlls/qcap/tests/audiorecord.c +++ b/dlls/qcap/tests/audiorecord.c @@ -100,6 +100,7 @@ static void test_interfaces(IBaseFilter *filter) hr = IBaseFilter_FindPin(filter, L"Capture", &pin); ok(hr == S_OK, "Got hr %#lx.\n", hr);
+ check_interface(pin, &IID_IAMBufferNegotiation, TRUE); check_interface(pin, &IID_IAMStreamConfig, TRUE); check_interface(pin, &IID_IKsPropertySet, TRUE); check_interface(pin, &IID_IPin, TRUE);