From: Zebediah Figura z.figura12@gmail.com
Native does not implement QueryVendorInfo(); we have no reason to do so ourselves.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qedit/samplegrabber.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c index 517c7fe77bb..b53d4d8c7e9 100644 --- a/dlls/qedit/samplegrabber.c +++ b/dlls/qedit/samplegrabber.c @@ -33,7 +33,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(qedit);
-static const WCHAR vendor_name[] = { 'W', 'i', 'n', 'e', 0 }; static const WCHAR pin_in_name[] = { 'I', 'n', 0 }; static const WCHAR pin_out_name[] = { 'O', 'u', 't', 0 };
@@ -420,19 +419,6 @@ SampleGrabber_IBaseFilter_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *grap return S_OK; }
-/* IBaseFilter */ -static HRESULT WINAPI -SampleGrabber_IBaseFilter_QueryVendorInfo(IBaseFilter *iface, LPWSTR *vendor) -{ - TRACE("(%p)\n", vendor); - if (!vendor) - return E_POINTER; - *vendor = CoTaskMemAlloc(sizeof(vendor_name)); - CopyMemory(*vendor, vendor_name, sizeof(vendor_name)); - return S_OK; -} - - /* SampleGrabber implementation of ISampleGrabber interface */
/* IUnknown */ @@ -1061,7 +1047,7 @@ static const IBaseFilterVtbl IBaseFilter_VTable = BaseFilterImpl_FindPin, BaseFilterImpl_QueryFilterInfo, SampleGrabber_IBaseFilter_JoinFilterGraph, - SampleGrabber_IBaseFilter_QueryVendorInfo, + BaseFilterImpl_QueryVendorInfo, };
static const ISampleGrabberVtbl ISampleGrabber_VTable =
From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 107 ++++++++++---------------------- dlls/quartz/tests/filtergraph.c | 5 ++ 2 files changed, 39 insertions(+), 73 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 9606a4961d3..45da4f25a8b 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -3058,90 +3058,51 @@ static ULONG WINAPI BasicAudio_Release(IBasicAudio *iface) return IUnknown_Release(This->outer_unk); }
-/*** IDispatch methods ***/ -static HRESULT WINAPI BasicAudio_GetTypeInfoCount(IBasicAudio *iface, UINT *pctinfo) +static HRESULT WINAPI BasicAudio_GetTypeInfoCount(IBasicAudio *iface, UINT *count) { - IFilterGraphImpl *This = impl_from_IBasicAudio(iface); - IBasicAudio* pBasicAudio; + TRACE("iface %p, count %p.\n", iface, count); + *count = 1; + return S_OK; +} + +static HRESULT WINAPI BasicAudio_GetTypeInfo(IBasicAudio *iface, UINT index, + LCID lcid, ITypeInfo **typeinfo) +{ + TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo); + return strmbase_get_typeinfo(IBasicAudio_tid, typeinfo); +} + +static HRESULT WINAPI BasicAudio_GetIDsOfNames(IBasicAudio *iface, REFIID iid, + LPOLESTR *names, UINT count, LCID lcid, DISPID *ids) +{ + ITypeInfo *typeinfo; HRESULT hr;
- TRACE("(%p/%p)->(%p)\n", This, iface, pctinfo); - - EnterCriticalSection(&This->cs); - - hr = GetTargetInterface(This, &IID_IBasicAudio, (LPVOID*)&pBasicAudio); - - if (hr == S_OK) - hr = IBasicAudio_GetTypeInfoCount(pBasicAudio, pctinfo); - - LeaveCriticalSection(&This->cs); + TRACE("iface %p, iid %s, names %p, count %u, lcid %#x, ids %p.\n", + iface, debugstr_guid(iid), names, count, lcid, ids);
+ if (SUCCEEDED(hr = strmbase_get_typeinfo(IBasicAudio_tid, &typeinfo))) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, ids); + ITypeInfo_Release(typeinfo); + } return hr; }
-static HRESULT WINAPI BasicAudio_GetTypeInfo(IBasicAudio *iface, UINT iTInfo, LCID lcid, - ITypeInfo **ppTInfo) +static HRESULT WINAPI BasicAudio_Invoke(IBasicAudio *iface, DISPID id, REFIID iid, LCID lcid, + WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg) { - IFilterGraphImpl *This = impl_from_IBasicAudio(iface); - IBasicAudio* pBasicAudio; + ITypeInfo *typeinfo; HRESULT hr;
- TRACE("(%p/%p)->(%d, %d, %p)\n", This, iface, iTInfo, lcid, ppTInfo); - - EnterCriticalSection(&This->cs); - - hr = GetTargetInterface(This, &IID_IBasicAudio, (LPVOID*)&pBasicAudio); - - if (hr == S_OK) - hr = IBasicAudio_GetTypeInfo(pBasicAudio, iTInfo, lcid, ppTInfo); - - LeaveCriticalSection(&This->cs); - - return hr; -} - -static HRESULT WINAPI BasicAudio_GetIDsOfNames(IBasicAudio *iface, REFIID riid, LPOLESTR *rgszNames, - UINT cNames, LCID lcid, DISPID *rgDispId) -{ - IFilterGraphImpl *This = impl_from_IBasicAudio(iface); - IBasicAudio* pBasicAudio; - HRESULT hr; - - TRACE("(%p/%p)->(%s, %p, %d, %d, %p)\n", This, iface, debugstr_guid(riid), rgszNames, cNames, - lcid, rgDispId); - - EnterCriticalSection(&This->cs); - - hr = GetTargetInterface(This, &IID_IBasicAudio, (LPVOID*)&pBasicAudio); - - if (hr == S_OK) - hr = IBasicAudio_GetIDsOfNames(pBasicAudio, riid, rgszNames, cNames, lcid, rgDispId); - - LeaveCriticalSection(&This->cs); - - return hr; -} - -static HRESULT WINAPI BasicAudio_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, - LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, - UINT *puArgErr) -{ - IFilterGraphImpl *This = impl_from_IBasicAudio(iface); - IBasicAudio* pBasicAudio; - HRESULT hr; - - TRACE("(%p/%p)->(%d, %s, %d, %04x, %p, %p, %p, %p)\n", This, iface, dispIdMember, - debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr); - - EnterCriticalSection(&This->cs); - - hr = GetTargetInterface(This, &IID_IBasicAudio, (LPVOID*)&pBasicAudio); - - if (hr == S_OK) - hr = IBasicAudio_Invoke(pBasicAudio, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr); - - LeaveCriticalSection(&This->cs); + TRACE("iface %p, id %d, iid %s, lcid %#x, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.\n", + iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg);
+ if (SUCCEEDED(hr = strmbase_get_typeinfo(IBasicAudio_tid, &typeinfo))) + { + hr = ITypeInfo_Invoke(typeinfo, iface, id, flags, params, result, excepinfo, error_arg); + ITypeInfo_Release(typeinfo); + } return hr; }
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index e6f2afa9701..adad45aac71 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -2495,6 +2495,7 @@ static void test_control_delegation(void) IBaseFilter *renderer; IVideoWindow *window; IBasicVideo *video; + ULONG count; HRESULT hr; LONG val;
@@ -2503,6 +2504,10 @@ static void test_control_delegation(void) hr = IFilterGraph2_QueryInterface(graph, &IID_IBasicAudio, (void **)&audio); ok(hr == S_OK, "got %#x\n", hr);
+ hr = IBasicAudio_GetTypeInfoCount(audio, &count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 1, "Got count %u.\n", count); + hr = IBasicAudio_put_Volume(audio, -10); ok(hr == E_NOTIMPL, "got %#x\n", hr); hr = IBasicAudio_get_Volume(audio, &val);
From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 108 ++++++++++---------------------- dlls/quartz/tests/filtergraph.c | 5 ++ 2 files changed, 39 insertions(+), 74 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 45da4f25a8b..046a0a1f190 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -4066,94 +4066,54 @@ static ULONG WINAPI VideoWindow_Release(IVideoWindow *iface) return IUnknown_Release(This->outer_unk); }
-/*** IDispatch methods ***/ -static HRESULT WINAPI VideoWindow_GetTypeInfoCount(IVideoWindow *iface, UINT *pctinfo) +HRESULT WINAPI VideoWindow_GetTypeInfoCount(IVideoWindow *iface, UINT *count) { - IFilterGraphImpl *This = impl_from_IVideoWindow(iface); - IVideoWindow *pVideoWindow; + TRACE("iface %p, count %p.\n", iface, count); + *count = 1; + return S_OK; +} + +HRESULT WINAPI VideoWindow_GetTypeInfo(IVideoWindow *iface, UINT index, + LCID lcid, ITypeInfo **typeinfo) +{ + TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo); + return strmbase_get_typeinfo(IVideoWindow_tid, typeinfo); +} + +HRESULT WINAPI VideoWindow_GetIDsOfNames(IVideoWindow *iface, REFIID iid, + LPOLESTR *names, UINT count, LCID lcid, DISPID *ids) +{ + ITypeInfo *typeinfo; HRESULT hr;
- TRACE("(%p/%p)->(%p)\n", This, iface, pctinfo); - - EnterCriticalSection(&This->cs); - - hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow); - - if (hr == S_OK) - hr = IVideoWindow_GetTypeInfoCount(pVideoWindow, pctinfo); - - LeaveCriticalSection(&This->cs); + TRACE("iface %p, iid %s, names %p, count %u, lcid %#x, ids %p.\n", + iface, debugstr_guid(iid), names, count, lcid, ids);
+ if (SUCCEEDED(hr = strmbase_get_typeinfo(IVideoWindow_tid, &typeinfo))) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, ids); + ITypeInfo_Release(typeinfo); + } return hr; }
-static HRESULT WINAPI VideoWindow_GetTypeInfo(IVideoWindow *iface, UINT iTInfo, LCID lcid, - ITypeInfo **ppTInfo) +static HRESULT WINAPI VideoWindow_Invoke(IVideoWindow *iface, DISPID id, REFIID iid, LCID lcid, + WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg) { - IFilterGraphImpl *This = impl_from_IVideoWindow(iface); - IVideoWindow *pVideoWindow; + ITypeInfo *typeinfo; HRESULT hr;
- TRACE("(%p/%p)->(%d, %d, %p)\n", This, iface, iTInfo, lcid, ppTInfo); - - EnterCriticalSection(&This->cs); - - hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow); - - if (hr == S_OK) - hr = IVideoWindow_GetTypeInfo(pVideoWindow, iTInfo, lcid, ppTInfo); - - LeaveCriticalSection(&This->cs); + TRACE("iface %p, id %d, iid %s, lcid %#x, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.\n", + iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg);
+ if (SUCCEEDED(hr = strmbase_get_typeinfo(IVideoWindow_tid, &typeinfo))) + { + hr = ITypeInfo_Invoke(typeinfo, iface, id, flags, params, result, excepinfo, error_arg); + ITypeInfo_Release(typeinfo); + } return hr; }
-static HRESULT WINAPI VideoWindow_GetIDsOfNames(IVideoWindow *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) -{ - IFilterGraphImpl *This = impl_from_IVideoWindow(iface); - IVideoWindow *pVideoWindow; - HRESULT hr; - - TRACE("(%p/%p)->(%s, %p, %d, %d, %p)\n", This, iface, debugstr_guid(riid), rgszNames, cNames, - lcid, rgDispId); - - EnterCriticalSection(&This->cs); - - hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow); - - if (hr == S_OK) - hr = IVideoWindow_GetIDsOfNames(pVideoWindow, riid, rgszNames, cNames, lcid, rgDispId); - - LeaveCriticalSection(&This->cs); - - return hr; -} - -static HRESULT WINAPI VideoWindow_Invoke(IVideoWindow *iface, DISPID dispIdMember, REFIID riid, - LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, - UINT*puArgErr) -{ - IFilterGraphImpl *This = impl_from_IVideoWindow(iface); - IVideoWindow *pVideoWindow; - HRESULT hr; - - TRACE("(%p/%p)->(%d, %s, %d, %04x, %p, %p, %p, %p)\n", This, iface, dispIdMember, - debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr); - - EnterCriticalSection(&This->cs); - - hr = GetTargetInterface(This, &IID_IVideoWindow, (LPVOID*)&pVideoWindow); - - if (hr == S_OK) - hr = IVideoWindow_Invoke(pVideoWindow, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr); - - LeaveCriticalSection(&This->cs); - - return hr; -} - - /*** IVideoWindow methods ***/ static HRESULT WINAPI VideoWindow_put_Caption(IVideoWindow *iface, BSTR strCaption) { diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index adad45aac71..976617ea892 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -2572,9 +2572,14 @@ static void test_control_delegation(void) /* Unlike IBasicAudio, these return E_NOINTERFACE. */ hr = IBasicVideo_get_BitRate(video, &val); ok(hr == E_NOINTERFACE, "got %#x\n", hr); + hr = IVideoWindow_SetWindowForeground(window, OAFALSE); ok(hr == E_NOINTERFACE, "got %#x\n", hr);
+ hr = IVideoWindow_GetTypeInfoCount(window, &count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 1, "Got count %u.\n", count); + hr = CoCreateInstance(&CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (void **)&renderer); ok(hr == S_OK, "got %#x\n", hr);
From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 107 ++++++++++---------------------- dlls/quartz/tests/filtergraph.c | 27 ++++++-- 2 files changed, 55 insertions(+), 79 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 046a0a1f190..c9710f12d1c 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -3234,90 +3234,51 @@ static ULONG WINAPI BasicVideo_Release(IBasicVideo2 *iface) return IUnknown_Release(This->outer_unk); }
-/*** IDispatch methods ***/ -static HRESULT WINAPI BasicVideo_GetTypeInfoCount(IBasicVideo2 *iface, UINT *pctinfo) +static HRESULT WINAPI BasicVideo_GetTypeInfoCount(IBasicVideo2 *iface, UINT *count) { - IFilterGraphImpl *This = impl_from_IBasicVideo2(iface); - IBasicVideo *pBasicVideo; + TRACE("iface %p, count %p.\n", iface, count); + *count = 1; + return S_OK; +} + +static HRESULT WINAPI BasicVideo_GetTypeInfo(IBasicVideo2 *iface, UINT index, + LCID lcid, ITypeInfo **typeinfo) +{ + TRACE("iface %p, index %u, lcid %#x, typeinfo %p.\n", iface, index, lcid, typeinfo); + return strmbase_get_typeinfo(IBasicVideo_tid, typeinfo); +} + +static HRESULT WINAPI BasicVideo_GetIDsOfNames(IBasicVideo2 *iface, REFIID iid, + LPOLESTR *names, UINT count, LCID lcid, DISPID *ids) +{ + ITypeInfo *typeinfo; HRESULT hr;
- TRACE("(%p/%p)->(%p)\n", This, iface, pctinfo); - - EnterCriticalSection(&This->cs); - - hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo); - - if (hr == S_OK) - hr = IBasicVideo_GetTypeInfoCount(pBasicVideo, pctinfo); - - LeaveCriticalSection(&This->cs); + TRACE("iface %p, iid %s, names %p, count %u, lcid %#x, ids %p.\n", + iface, debugstr_guid(iid), names, count, lcid, ids);
+ if (SUCCEEDED(hr = strmbase_get_typeinfo(IBasicVideo_tid, &typeinfo))) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, names, count, ids); + ITypeInfo_Release(typeinfo); + } return hr; }
-static HRESULT WINAPI BasicVideo_GetTypeInfo(IBasicVideo2 *iface, UINT iTInfo, LCID lcid, - ITypeInfo **ppTInfo) +static HRESULT WINAPI BasicVideo_Invoke(IBasicVideo2 *iface, DISPID id, REFIID iid, LCID lcid, + WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg) { - IFilterGraphImpl *This = impl_from_IBasicVideo2(iface); - IBasicVideo *pBasicVideo; + ITypeInfo *typeinfo; HRESULT hr;
- TRACE("(%p/%p)->(%d, %d, %p)\n", This, iface, iTInfo, lcid, ppTInfo); - - EnterCriticalSection(&This->cs); - - hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo); - - if (hr == S_OK) - hr = IBasicVideo_GetTypeInfo(pBasicVideo, iTInfo, lcid, ppTInfo); - - LeaveCriticalSection(&This->cs); - - return hr; -} - -static HRESULT WINAPI BasicVideo_GetIDsOfNames(IBasicVideo2 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) -{ - IFilterGraphImpl *This = impl_from_IBasicVideo2(iface); - IBasicVideo *pBasicVideo; - HRESULT hr; - - TRACE("(%p/%p)->(%s, %p, %d, %d, %p)\n", This, iface, debugstr_guid(riid), rgszNames, cNames, - lcid, rgDispId); - - EnterCriticalSection(&This->cs); - - hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo); - - if (hr == S_OK) - hr = IBasicVideo_GetIDsOfNames(pBasicVideo, riid, rgszNames, cNames, lcid, rgDispId); - - LeaveCriticalSection(&This->cs); - - return hr; -} - -static HRESULT WINAPI BasicVideo_Invoke(IBasicVideo2 *iface, DISPID dispIdMember, REFIID riid, - LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, - UINT *puArgErr) -{ - IFilterGraphImpl *This = impl_from_IBasicVideo2(iface); - IBasicVideo *pBasicVideo; - HRESULT hr; - - TRACE("(%p/%p)->(%d, %s, %d, %04x, %p, %p, %p, %p)\n", This, iface, dispIdMember, - debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr); - - EnterCriticalSection(&This->cs); - - hr = GetTargetInterface(This, &IID_IBasicVideo, (LPVOID*)&pBasicVideo); - - if (hr == S_OK) - hr = IBasicVideo_Invoke(pBasicVideo, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr); - - LeaveCriticalSection(&This->cs); + TRACE("iface %p, id %d, iid %s, lcid %#x, flags %#x, params %p, result %p, excepinfo %p, error_arg %p.\n", + iface, id, debugstr_guid(iid), lcid, flags, params, result, excepinfo, error_arg);
+ if (SUCCEEDED(hr = strmbase_get_typeinfo(IBasicVideo_tid, &typeinfo))) + { + hr = ITypeInfo_Invoke(typeinfo, iface, id, flags, params, result, excepinfo, error_arg); + ITypeInfo_Release(typeinfo); + } return hr; }
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 976617ea892..d89c9e25341 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -2494,7 +2494,9 @@ static void test_control_delegation(void) IBasicAudio *audio, *filter_audio; IBaseFilter *renderer; IVideoWindow *window; - IBasicVideo *video; + IBasicVideo2 *video; + ITypeInfo *typeinfo; + TYPEATTR *typeattr; ULONG count; HRESULT hr; LONG val; @@ -2564,15 +2566,28 @@ static void test_control_delegation(void)
/* IBasicVideo and IVideoWindow */
- hr = IFilterGraph2_QueryInterface(graph, &IID_IBasicVideo, (void **)&video); + hr = IFilterGraph2_QueryInterface(graph, &IID_IBasicVideo2, (void **)&video); ok(hr == S_OK, "got %#x\n", hr); hr = IFilterGraph2_QueryInterface(graph, &IID_IVideoWindow, (void **)&window); ok(hr == S_OK, "got %#x\n", hr);
/* Unlike IBasicAudio, these return E_NOINTERFACE. */ - hr = IBasicVideo_get_BitRate(video, &val); + hr = IBasicVideo2_get_BitRate(video, &val); ok(hr == E_NOINTERFACE, "got %#x\n", hr);
+ hr = IBasicVideo2_GetTypeInfoCount(video, &count); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(count == 1, "Got count %u.\n", count); + + hr = IBasicVideo2_GetTypeInfo(video, 0, 0, &typeinfo); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = ITypeInfo_GetTypeAttr(typeinfo, &typeattr); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(typeattr->typekind == TKIND_DISPATCH, "Got kind %u.\n", typeattr->typekind); + ok(IsEqualGUID(&typeattr->guid, &IID_IBasicVideo), "Got IID %s.\n", wine_dbgstr_guid(&typeattr->guid)); + ITypeInfo_ReleaseTypeAttr(typeinfo, typeattr); + ITypeInfo_Release(typeinfo); + hr = IVideoWindow_SetWindowForeground(window, OAFALSE); ok(hr == E_NOINTERFACE, "got %#x\n", hr);
@@ -2586,7 +2601,7 @@ static void test_control_delegation(void) hr = IFilterGraph2_AddFilter(graph, renderer, NULL); ok(hr == S_OK, "got %#x\n", hr);
- hr = IBasicVideo_get_BitRate(video, &val); + hr = IBasicVideo2_get_BitRate(video, &val); ok(hr == VFW_E_NOT_CONNECTED, "got %#x\n", hr); hr = IVideoWindow_SetWindowForeground(window, OAFALSE); ok(hr == VFW_E_NOT_CONNECTED, "got %#x\n", hr); @@ -2594,13 +2609,13 @@ static void test_control_delegation(void) hr = IFilterGraph2_RemoveFilter(graph, renderer); ok(hr == S_OK, "got %#x\n", hr);
- hr = IBasicVideo_get_BitRate(video, &val); + hr = IBasicVideo2_get_BitRate(video, &val); ok(hr == E_NOINTERFACE, "got %#x\n", hr); hr = IVideoWindow_SetWindowForeground(window, OAFALSE); ok(hr == E_NOINTERFACE, "got %#x\n", hr);
IBaseFilter_Release(renderer); - IBasicVideo_Release(video); + IBasicVideo2_Release(video); IVideoWindow_Release(window); IFilterGraph2_Release(graph); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=53511
Your paranoid android.
=== w2008s64 (32 bit report) ===
quartz: filtergraph.c:779: Test failed: wait failed
=== w1064v1507 (64 bit report) ===
quartz: filtergraph.c:779: Test failed: wait failed
From: Zebediah Figura z.figura12@gmail.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/qcap/avico.c | 13 ++++--------- dlls/qcap/avimux.c | 15 ++++----------- dlls/qcap/smartteefilter.c | 15 +++++---------- dlls/qcap/vfwcapture.c | 1 - dlls/qedit/samplegrabber.c | 13 ++++--------- dlls/quartz/filesource.c | 10 ++++------ dlls/quartz/parser.c | 8 +++----- dlls/strmbase/enumpins.c | 22 +++++++--------------- dlls/strmbase/filter.c | 8 ++------ dlls/strmbase/renderer.c | 1 - dlls/strmbase/transform.c | 1 - dlls/winegstreamer/gstdemux.c | 16 +++++----------- dlls/wineqtdecoder/qtsplitter.c | 12 ------------ 13 files changed, 38 insertions(+), 97 deletions(-)
diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 684a3324920..d257051b1ca 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -180,18 +180,13 @@ static const IBaseFilterVtbl AVICompressorVtbl = {
static IPin *avi_compressor_get_pin(BaseFilter *iface, unsigned int index) { - AVICompressor *This = impl_from_BaseFilter(iface); - IPin *ret; + AVICompressor *filter = impl_from_BaseFilter(iface);
if (index == 0) - ret = &This->in->pin.IPin_iface; + return &filter->in->pin.IPin_iface; else if (index == 1) - ret = &This->out->pin.IPin_iface; - else - return NULL; - - IPin_AddRef(ret); - return ret; + return &filter->out->pin.IPin_iface; + return NULL; }
static void avi_compressor_destroy(BaseFilter *iface) diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index de56a20b6f3..d289d2b9fed 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -118,19 +118,12 @@ static inline AviMux* impl_from_BaseFilter(BaseFilter *filter)
static IPin *avi_mux_get_pin(BaseFilter *iface, unsigned int index) { - AviMux *This = impl_from_BaseFilter(iface); + AviMux *filter = impl_from_BaseFilter(iface);
if (!index) - { - IPin_AddRef(&This->out->pin.pin.IPin_iface); - return &This->out->pin.pin.IPin_iface; - } - else if (index <= This->input_pin_no) - { - IPin_AddRef(&This->in[index - 1]->pin.pin.IPin_iface); - return &This->in[index - 1]->pin.pin.IPin_iface; - } - + return &filter->out->pin.pin.IPin_iface; + else if (index <= filter->input_pin_no) + return &filter->in[index - 1]->pin.pin.IPin_iface; return NULL; }
diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index 4095d95f947..02503ecb789 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -120,20 +120,15 @@ static const IBaseFilterVtbl SmartTeeFilterVtbl = {
static IPin *smart_tee_get_pin(BaseFilter *iface, unsigned int index) { - SmartTeeFilter *This = impl_from_BaseFilter(iface); - IPin *ret; + SmartTeeFilter *filter = impl_from_BaseFilter(iface);
if (index == 0) - ret = &This->input->pin.IPin_iface; + return &filter->input->pin.IPin_iface; else if (index == 1) - ret = &This->capture->pin.IPin_iface; + return &filter->capture->pin.IPin_iface; else if (index == 2) - ret = &This->preview->pin.IPin_iface; - else - return NULL; - - IPin_AddRef(ret); - return ret; + return &filter->preview->pin.IPin_iface; + return NULL; }
static void smart_tee_destroy(BaseFilter *iface) diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index d9d937a4a50..0bf8c45d9c0 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -104,7 +104,6 @@ static IPin *vfw_capture_get_pin(BaseFilter *iface, unsigned int index) if (index >= 1) return NULL;
- IPin_AddRef(This->pOutputPin); return This->pOutputPin; }
diff --git a/dlls/qedit/samplegrabber.c b/dlls/qedit/samplegrabber.c index b53d4d8c7e9..9836d9e3740 100644 --- a/dlls/qedit/samplegrabber.c +++ b/dlls/qedit/samplegrabber.c @@ -275,18 +275,13 @@ static void SampleGrabber_cleanup(SG_Impl *This)
static IPin *sample_grabber_get_pin(BaseFilter *iface, unsigned int index) { - SG_Impl *This = impl_from_BaseFilter(iface); - IPin *pin; + SG_Impl *filter = impl_from_BaseFilter(iface);
if (index == 0) - pin = &This->pin_in.IPin_iface; + return &filter->pin_in.IPin_iface; else if (index == 1) - pin = &This->pin_out.IPin_iface; - else - return NULL; - - IPin_AddRef(pin); - return pin; + return &filter->pin_out.IPin_iface; + return NULL; }
static void sample_grabber_destroy(BaseFilter *iface) diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index b2fc4015816..34601da6b47 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -394,13 +394,11 @@ HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID *
static IPin *async_reader_get_pin(BaseFilter *iface, unsigned int index) { - AsyncReader *This = impl_from_BaseFilter(iface); + AsyncReader *filter = impl_from_BaseFilter(iface);
- if (index >= 1 || !This->pOutputPin) - return NULL; - - IPin_AddRef(This->pOutputPin); - return This->pOutputPin; + if (!index && filter->pOutputPin) + return filter->pOutputPin; + return NULL; }
static void async_reader_destroy(BaseFilter *iface) diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 3320dece4b5..2666eb75aad 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -66,11 +66,9 @@ IPin *parser_get_pin(BaseFilter *iface, unsigned int index) { ParserImpl *filter = impl_from_BaseFilter(iface);
- if (index > filter->cStreams) - return NULL; - - IPin_AddRef(filter->ppPins[index]); - return filter->ppPins[index]; + if (index <= filter->cStreams) + return filter->ppPins[index]; + return NULL; }
HRESULT Parser_Create(ParserImpl *pParser, const IBaseFilterVtbl *vtbl, IUnknown *outer, diff --git a/dlls/strmbase/enumpins.c b/dlls/strmbase/enumpins.c index 198c8397a31..6e3357f5605 100644 --- a/dlls/strmbase/enumpins.c +++ b/dlls/strmbase/enumpins.c @@ -60,10 +60,7 @@ HRESULT enum_pins_create(BaseFilter *base, IEnumPins **out) object->Version = base->pin_version;
while ((pin = base->pFuncsTable->filter_get_pin(base, object->count))) - { - IPin_Release(pin); ++object->count; - }
TRACE("Created enumerator %p.\n", object); *out = &object->IEnumPins_iface; @@ -122,7 +119,7 @@ static ULONG WINAPI IEnumPinsImpl_Release(IEnumPins * iface) static HRESULT WINAPI IEnumPinsImpl_Next(IEnumPins * iface, ULONG cPins, IPin ** ppPins, ULONG * pcFetched) { IEnumPinsImpl *This = impl_from_IEnumPins(iface); - ULONG i = 0; + ULONG i;
TRACE("(%p)->(%u, %p, %p)\n", iface, cPins, ppPins, pcFetched);
@@ -138,16 +135,14 @@ static HRESULT WINAPI IEnumPinsImpl_Next(IEnumPins * iface, ULONG cPins, IPin ** if (This->Version != This->base->pin_version) return VFW_E_ENUM_OUT_OF_SYNC;
- while (i < cPins) + for (i = 0; i < cPins; ++i) { - IPin *pin; - pin = This->base->pFuncsTable->filter_get_pin(This->base, This->uIndex + i); + IPin *pin = This->base->pFuncsTable->filter_get_pin(This->base, This->uIndex + i);
- if (!pin) - break; - else - ppPins[i] = pin; - ++i; + if (!pin) + break; + + IPin_AddRef(ppPins[i] = pin); }
if (pcFetched) @@ -186,10 +181,7 @@ static HRESULT WINAPI IEnumPinsImpl_Reset(IEnumPins *iface) { enum_pins->count = 0; while ((pin = enum_pins->base->pFuncsTable->filter_get_pin(enum_pins->base, enum_pins->count))) - { - IPin_Release(pin); ++enum_pins->count; - } }
enum_pins->Version = enum_pins->base->pin_version; diff --git a/dlls/strmbase/filter.c b/dlls/strmbase/filter.c index b61d3ffa99f..5f57731b7a1 100644 --- a/dlls/strmbase/filter.c +++ b/dlls/strmbase/filter.c @@ -194,19 +194,15 @@ HRESULT WINAPI BaseFilterImpl_FindPin(IBaseFilter *iface, const WCHAR *id, IPin { hr = IPin_QueryPinInfo(pin, &info); if (FAILED(hr)) - { - IPin_Release(pin); return hr; - } + if (info.pFilter) IBaseFilter_Release(info.pFilter);
if (!lstrcmpW(id, info.achName)) { - *ret = pin; + IPin_AddRef(*ret = pin); return S_OK; } - - IPin_Release(pin); }
return VFW_E_NOT_FOUND; diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 1017c8c5747..b1b318f54f2 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -190,7 +190,6 @@ static IPin *renderer_get_pin(BaseFilter *iface, unsigned int index) if (index >= 1) return NULL;
- IPin_AddRef(&This->pInputPin->pin.IPin_iface); return &This->pInputPin->pin.IPin_iface; }
diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index a7c47b509f8..fe54ebe861f 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -135,7 +135,6 @@ static IPin *transform_get_pin(BaseFilter *iface, unsigned int index) if (index >= 2) return NULL;
- IPin_AddRef(filter->ppPins[index]); return filter->ppPins[index]; }
diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 8649c8af736..2ec540a3e42 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1198,19 +1198,13 @@ static inline GSTOutPin *impl_from_IMediaSeeking( IMediaSeeking *iface )
static IPin *gstdemux_get_pin(BaseFilter *base, unsigned int index) { - GSTImpl *This = impl_from_IBaseFilter(&base->IBaseFilter_iface); - IPin *pin; - - if (index > This->cStreams) - return NULL; + GSTImpl *filter = impl_from_IBaseFilter(&base->IBaseFilter_iface);
if (!index) - pin = &This->pInputPin.pin.IPin_iface; - else - pin = &This->ppPins[index - 1]->pin.pin.IPin_iface; - - IPin_AddRef(pin); - return pin; + return &filter->pInputPin.pin.IPin_iface; + else if (index <= filter->cStreams) + return &filter->ppPins[index - 1]->pin.pin.IPin_iface; + return NULL; }
static void gstdemux_destroy(BaseFilter *iface) diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index 6c1105ce4b5..3dd530fac3e 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -207,28 +207,16 @@ static IPin *qt_splitter_get_pin(BaseFilter *base, unsigned int index) QTSplitter *filter = impl_from_BaseFilter(base);
if (index == 0) - { - IPin_AddRef(&filter->pInputPin.pin.IPin_iface); return &filter->pInputPin.pin.IPin_iface; - } else if (index == 1) { if (filter->pVideo_Pin) - { - IPin_AddRef(&filter->pVideo_Pin->pin.pin.IPin_iface); return &filter->pVideo_Pin->pin.pin.IPin_iface; - } else if (filter->pAudio_Pin) - { - IPin_AddRef(&filter->pAudio_Pin->pin.pin.IPin_iface); return &filter->pAudio_Pin->pin.pin.IPin_iface; - } } else if (index == 2 && filter->pVideo_Pin && filter->pAudio_Pin) - { - IPin_AddRef(&filter->pAudio_Pin->pin.pin.IPin_iface); return &filter->pAudio_Pin->pin.pin.IPin_iface; - }
return NULL; }