Most video cameras are exposed through WDM on modern Windows, and not supported by the VFW capture filter. No known applications depend on the VFW capture filter, and any such applications would fail to work with modern video cameras.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- This supersedes patch 185155.
dlls/qcap/tests/qcap.c | 145 ----------------------------------------- 1 file changed, 145 deletions(-)
diff --git a/dlls/qcap/tests/qcap.c b/dlls/qcap/tests/qcap.c index 56eaf77513..d1b2cb810f 100644 --- a/dlls/qcap/tests/qcap.c +++ b/dlls/qcap/tests/qcap.c @@ -1643,150 +1643,6 @@ static void test_AviMux(char *arg) ok(ref == 0, "IStream was not destroyed (%d)\n", ref); }
-/* Outer IUnknown for COM aggregation tests */ -struct unk_impl { - IUnknown IUnknown_iface; - LONG ref; - IUnknown *inner_unk; -}; - -static inline struct unk_impl *impl_from_IUnknown(IUnknown *iface) -{ - return CONTAINING_RECORD(iface, struct unk_impl, IUnknown_iface); -} - -static HRESULT WINAPI unk_QueryInterface(IUnknown *iface, REFIID riid, void **ret_iface) -{ - struct unk_impl *This = impl_from_IUnknown(iface); - - return IUnknown_QueryInterface(This->inner_unk, riid, ret_iface); -} - -static ULONG WINAPI unk_AddRef(IUnknown *iface) -{ - struct unk_impl *This = impl_from_IUnknown(iface); - - return InterlockedIncrement(&This->ref); -} - -static ULONG WINAPI unk_Release(IUnknown *iface) -{ - struct unk_impl *This = impl_from_IUnknown(iface); - - return InterlockedDecrement(&This->ref); -} - -static const IUnknownVtbl unk_vtbl = -{ - unk_QueryInterface, - unk_AddRef, - unk_Release -}; - -static void test_COM_vfwcapture(void) -{ - struct unk_impl unk_obj = {{&unk_vtbl}, 19, NULL}; - IBaseFilter *bf; - IMediaFilter *mf; - IPersist *p; - IPersistPropertyBag *ppb; - IAMVfwCaptureDialogs *amvcd; - IAMFilterMiscFlags *amfmf; - ISpecifyPropertyPages *spp; - IUnknown *unk; - ULONG refcount; - HRESULT hr; - - /* COM aggregation */ - hr = CoCreateInstance(&CLSID_VfwCapture, &unk_obj.IUnknown_iface, CLSCTX_INPROC_SERVER, - &IID_IUnknown, (void**)&unk_obj.inner_unk); - if ((hr == REGDB_E_CLASSNOTREG) || (hr == CLASS_E_CLASSNOTAVAILABLE)) - { - win_skip("CLSID_VfwCapture not supported (0x%x)\n", hr); - return; - } - ok(hr == S_OK, "VfwCapture create failed: %08x\n", hr); - hr = IUnknown_QueryInterface(unk_obj.inner_unk, &IID_IBaseFilter, (void**)&bf); - ok(hr == S_OK, "QueryInterface for IID_IBaseFilter failed: %08x\n", hr); - refcount = IBaseFilter_AddRef(bf); - ok(refcount == unk_obj.ref, "VfwCapture just pretends to support COM aggregation\n"); - refcount = IBaseFilter_Release(bf); - ok(refcount == unk_obj.ref, "VfwCapture just pretends to support COM aggregation\n"); - refcount = IBaseFilter_Release(bf); - ok(refcount == 19, "Refcount should be back at 19 but is %u\n", refcount); - IUnknown_Release(unk_obj.inner_unk); - - /* Invalid RIID */ - hr = CoCreateInstance(&CLSID_VfwCapture, NULL, CLSCTX_INPROC_SERVER, &IID_IClassFactory, - (void**)&bf); - ok(hr == E_NOINTERFACE, "VfwCapture create failed: %08x, expected E_NOINTERFACE\n", hr); - - /* Same refcount for all VfwCapture interfaces */ - hr = CoCreateInstance(&CLSID_VfwCapture, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, - (void**)&bf); - ok(hr == S_OK, "VfwCapture create failed: %08x, expected S_OK\n", hr); - refcount = IBaseFilter_AddRef(bf); - ok(refcount == 2, "refcount == %u, expected 2\n", refcount); - - hr = IBaseFilter_QueryInterface(bf, &IID_IMediaFilter, (void**)&mf); - ok(hr == S_OK, "QueryInterface for IID_IMediaFilter failed: %08x\n", hr); - refcount = IMediaFilter_AddRef(mf); - ok(refcount == 4, "refcount == %u, expected 4\n", refcount); - refcount = IMediaFilter_Release(mf); - - hr = IBaseFilter_QueryInterface(bf, &IID_IPersist, (void**)&p); - ok(hr == S_OK, "QueryInterface for IID_IPersist failed: %08x\n", hr); - refcount = IPersist_AddRef(p); - ok(refcount == 5, "refcount == %u, expected 5\n", refcount); - refcount = IPersist_Release(p); - - hr = IBaseFilter_QueryInterface(bf, &IID_IPersistPropertyBag, (void**)&ppb); - ok(hr == S_OK, "QueryInterface for IID_IPersistPropertyBag failed: %08x\n", hr); - refcount = IPersistPropertyBag_AddRef(ppb); - ok(refcount == 6, "refcount == %u, expected 6\n", refcount); - refcount = IPersistPropertyBag_Release(ppb); - - hr = IBaseFilter_QueryInterface(bf, &IID_IAMVfwCaptureDialogs, (void**)&amvcd); - todo_wine ok(hr == S_OK, "QueryInterface for IID_IAMVfwCaptureDialogs failed: %08x\n", hr); - if (hr == S_OK) { - refcount = IAMVfwCaptureDialogs_AddRef(amvcd); - ok(refcount == 7, "refcount == %u, expected 7\n", refcount); - refcount = IAMVfwCaptureDialogs_Release(amvcd); - } - - hr = IBaseFilter_QueryInterface(bf, &IID_IAMFilterMiscFlags, (void**)&amfmf); - todo_wine ok(hr == S_OK, "QueryInterface for IID_IAMFilterMiscFlags failed: %08x\n", hr); - if (hr == S_OK) { - refcount = IAMFilterMiscFlags_AddRef(amfmf); - ok(refcount == 8, "refcount == %u, expected 8\n", refcount); - refcount = IAMFilterMiscFlags_Release(amfmf); - } - - hr = IBaseFilter_QueryInterface(bf, &IID_ISpecifyPropertyPages, (void**)&spp); - todo_wine ok(hr == S_OK, "QueryInterface for IID_ISpecifyPropertyPages failed: %08x\n", hr); - if (hr == S_OK) { - refcount = ISpecifyPropertyPages_AddRef(spp); - ok(refcount == 9, "refcount == %u, expected 9\n", refcount); - refcount = ISpecifyPropertyPages_Release(spp); - } - - hr = IBaseFilter_QueryInterface(bf, &IID_IUnknown, (void**)&unk); - ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr); - refcount = IUnknown_AddRef(unk); - todo_wine ok(refcount == 10, "refcount == %u, expected 10\n", refcount); - refcount = IUnknown_Release(unk); - - /* Unsupported interfaces */ - hr = IBaseFilter_QueryInterface(bf, &IID_IAMStreamConfig, (void**)&unk); - ok(hr == E_NOINTERFACE, "QueryInterface for IID_IAMStreamConfig failed: %08x\n", hr); - hr = IBaseFilter_QueryInterface(bf, &IID_IAMVideoProcAmp, (void**)&unk); - todo_wine ok(hr == E_NOINTERFACE, "QueryInterface for IID_IAMVideoProcAmp failed: %08x\n", hr); - hr = IBaseFilter_QueryInterface(bf, &IID_IOverlayNotify, (void**)&unk); - ok(hr == E_NOINTERFACE, "QueryInterface for IID_IOverlayNotify failed: %08x\n", hr); - - while (IBaseFilter_Release(bf)); -} - START_TEST(qcap) { if (SUCCEEDED(CoInitialize(NULL))) @@ -1797,7 +1653,6 @@ START_TEST(qcap) arg_c = winetest_get_mainargs(&arg_v);
test_AviMux(arg_c>2 ? arg_v[2] : NULL); - test_COM_vfwcapture();
CoUninitialize(); }
From: Jactry Zeng jzeng@codeweavers.com
Signed-off-by: Jactry Zeng jzeng@codeweavers.com Signed-off-by: Zebediah Figura z.figura12@gmail.com --- No changes from 185107.
This supersedes patches 185107 and 185156.
dlls/qcap/tests/videocapture.c | 19 +++++++++++++++- dlls/qcap/vfwcapture.c | 40 ++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-)
diff --git a/dlls/qcap/tests/videocapture.c b/dlls/qcap/tests/videocapture.c index cd613b00e7..5699b2e3cc 100644 --- a/dlls/qcap/tests/videocapture.c +++ b/dlls/qcap/tests/videocapture.c @@ -215,7 +215,7 @@ static void test_capture(IBaseFilter *filter)
IEnumPins_Release(enum_pins);
- todo_wine check_interface(filter, &IID_IAMFilterMiscFlags, TRUE); + check_interface(filter, &IID_IAMFilterMiscFlags, TRUE); todo_wine check_interface(filter, &IID_IAMVideoControl, TRUE); check_interface(filter, &IID_IAMVideoProcAmp, TRUE); check_interface(filter, &IID_IBaseFilter, TRUE); @@ -235,6 +235,22 @@ static void test_capture(IBaseFilter *filter) check_interface(filter, &IID_IOverlayNotify, FALSE); }
+static void test_misc_flags(IBaseFilter *filter) +{ + IAMFilterMiscFlags *misc_flags; + ULONG flags; + HRESULT hr; + + hr = IBaseFilter_QueryInterface(filter, &IID_IAMFilterMiscFlags, (void **)&misc_flags); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + flags = IAMFilterMiscFlags_GetMiscFlags(misc_flags); + ok(flags == AM_FILTER_MISC_FLAGS_IS_SOURCE + || broken(!flags) /* win7 */, "Got wrong flags: %#x.\n", flags); + + IAMFilterMiscFlags_Release(misc_flags); +} + START_TEST(videocapture) { ICreateDevEnum *dev_enum; @@ -272,6 +288,7 @@ START_TEST(videocapture) if (hr == S_OK) { test_capture(filter); + test_misc_flags(filter); ref = IBaseFilter_Release(filter); ok(!ref, "Got outstanding refcount %d.\n", ref); } diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index 7b759f0173..602ffc9a90 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -49,6 +49,7 @@ typedef struct VfwCapture struct strmbase_filter filter; IAMStreamConfig IAMStreamConfig_iface; IAMVideoProcAmp IAMVideoProcAmp_iface; + IAMFilterMiscFlags IAMFilterMiscFlags_iface; IPersistPropertyBag IPersistPropertyBag_iface; BOOL init; Capture *driver_info; @@ -72,6 +73,11 @@ static inline VfwCapture *impl_from_IAMVideoProcAmp(IAMVideoProcAmp *iface) return CONTAINING_RECORD(iface, VfwCapture, IAMVideoProcAmp_iface); }
+static inline VfwCapture *impl_from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface) +{ + return CONTAINING_RECORD(iface, VfwCapture, IAMFilterMiscFlags_iface); +} + static inline VfwCapture *impl_from_IPersistPropertyBag(IPersistPropertyBag *iface) { return CONTAINING_RECORD(iface, VfwCapture, IPersistPropertyBag_iface); @@ -117,6 +123,8 @@ static HRESULT vfw_capture_query_interface(struct strmbase_filter *iface, REFIID *out = &filter->IPersistPropertyBag_iface; else if (IsEqualGUID(iid, &IID_IAMVideoProcAmp)) *out = &filter->IAMVideoProcAmp_iface; + else if (IsEqualGUID(iid, &IID_IAMFilterMiscFlags)) + *out = &filter->IAMFilterMiscFlags_iface; else return E_NOINTERFACE;
@@ -574,6 +582,37 @@ static const struct strmbase_source_ops source_ops = .pfnDecideAllocator = BaseOutputPinImpl_DecideAllocator, };
+static HRESULT WINAPI misc_flags_QueryInterface(IAMFilterMiscFlags *iface, REFIID riid, void **ppv) +{ + VfwCapture *filter = impl_from_IAMFilterMiscFlags(iface); + return IUnknown_QueryInterface(filter->filter.outer_unk, riid, ppv); +} + +static ULONG WINAPI misc_flags_AddRef(IAMFilterMiscFlags *iface) +{ + VfwCapture *filter = impl_from_IAMFilterMiscFlags(iface); + return IUnknown_AddRef(filter->filter.outer_unk); +} + +static ULONG WINAPI misc_flags_Release(IAMFilterMiscFlags *iface) +{ + VfwCapture *filter = impl_from_IAMFilterMiscFlags(iface); + return IUnknown_Release(filter->filter.outer_unk); +} + +static ULONG WINAPI misc_flags_GetMiscFlags(IAMFilterMiscFlags *iface) +{ + return AM_FILTER_MISC_FLAGS_IS_SOURCE; +} + +static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_VTable = +{ + misc_flags_QueryInterface, + misc_flags_AddRef, + misc_flags_Release, + misc_flags_GetMiscFlags +}; + HRESULT vfw_capture_create(IUnknown *outer, IUnknown **out) { static const WCHAR source_name[] = {'O','u','t','p','u','t',0}; @@ -586,6 +625,7 @@ HRESULT vfw_capture_create(IUnknown *outer, IUnknown **out)
object->IAMStreamConfig_iface.lpVtbl = &IAMStreamConfig_VTable; object->IAMVideoProcAmp_iface.lpVtbl = &IAMVideoProcAmp_VTable; + object->IAMFilterMiscFlags_iface.lpVtbl = &IAMFilterMiscFlags_VTable; object->IPersistPropertyBag_iface.lpVtbl = &IPersistPropertyBag_VTable; object->init = FALSE;
From: Jactry Zeng jzeng@codeweavers.com
Signed-off-by: Jactry Zeng jzeng@codeweavers.com Signed-off-by: Zebediah Figura z.figura12@gmail.com --- No changes from 185108.
This supersedes patches 185108 and 185157.
dlls/qcap/tests/videocapture.c | 2 +- dlls/qcap/vfwcapture.c | 99 ++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-)
diff --git a/dlls/qcap/tests/videocapture.c b/dlls/qcap/tests/videocapture.c index 5699b2e3cc..80d4899410 100644 --- a/dlls/qcap/tests/videocapture.c +++ b/dlls/qcap/tests/videocapture.c @@ -216,7 +216,7 @@ static void test_capture(IBaseFilter *filter) IEnumPins_Release(enum_pins);
check_interface(filter, &IID_IAMFilterMiscFlags, TRUE); - todo_wine check_interface(filter, &IID_IAMVideoControl, TRUE); + check_interface(filter, &IID_IAMVideoControl, TRUE); check_interface(filter, &IID_IAMVideoProcAmp, TRUE); check_interface(filter, &IID_IBaseFilter, TRUE); todo_wine check_interface(filter, &IID_IKsPropertySet, TRUE); diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index 602ffc9a90..9430533ea1 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -48,6 +48,7 @@ typedef struct VfwCapture { struct strmbase_filter filter; IAMStreamConfig IAMStreamConfig_iface; + IAMVideoControl IAMVideoControl_iface; IAMVideoProcAmp IAMVideoProcAmp_iface; IAMFilterMiscFlags IAMFilterMiscFlags_iface; IPersistPropertyBag IPersistPropertyBag_iface; @@ -68,6 +69,11 @@ static inline VfwCapture *impl_from_IAMStreamConfig(IAMStreamConfig *iface) return CONTAINING_RECORD(iface, VfwCapture, IAMStreamConfig_iface); }
+static inline VfwCapture *impl_from_IAMVideoControl(IAMVideoControl *iface) +{ + return CONTAINING_RECORD(iface, VfwCapture, IAMVideoControl_iface); +} + static inline VfwCapture *impl_from_IAMVideoProcAmp(IAMVideoProcAmp *iface) { return CONTAINING_RECORD(iface, VfwCapture, IAMVideoProcAmp_iface); @@ -121,6 +127,8 @@ static HRESULT vfw_capture_query_interface(struct strmbase_filter *iface, REFIID
if (IsEqualGUID(iid, &IID_IPersistPropertyBag)) *out = &filter->IPersistPropertyBag_iface; + else if (IsEqualGUID(iid, &IID_IAMVideoControl)) + *out = &filter->IAMVideoControl_iface; else if (IsEqualGUID(iid, &IID_IAMVideoProcAmp)) *out = &filter->IAMVideoProcAmp_iface; else if (IsEqualGUID(iid, &IID_IAMFilterMiscFlags)) @@ -613,6 +621,96 @@ static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_VTable = misc_flags_GetMiscFlags };
+static HRESULT WINAPI video_control_QueryInterface(IAMVideoControl *iface, REFIID riid, void **ppv) +{ + VfwCapture *filter = impl_from_IAMVideoControl(iface); + return IUnknown_QueryInterface(filter->filter.outer_unk, riid, ppv); +} + +static ULONG WINAPI video_control_AddRef(IAMVideoControl *iface) +{ + VfwCapture *filter = impl_from_IAMVideoControl(iface); + return IUnknown_AddRef(filter->filter.outer_unk); +} + +static ULONG WINAPI video_control_Release(IAMVideoControl *iface) +{ + VfwCapture *filter = impl_from_IAMVideoControl(iface); + return IUnknown_Release(filter->filter.outer_unk); +} + +static HRESULT WINAPI video_control_GetCaps(IAMVideoControl *iface, IPin *pin, LONG *flags) +{ + VfwCapture *filter = impl_from_IAMVideoControl(iface); + + FIXME("filter %p, pin %p, flags %p: stub.\n", filter, pin, flags); + + return E_NOTIMPL; +} + +static HRESULT WINAPI video_control_SetMode(IAMVideoControl *iface, IPin *pin, LONG mode) +{ + VfwCapture *filter = impl_from_IAMVideoControl(iface); + + FIXME("filter %p, pin %p, mode %d: stub.\n", filter, pin, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI video_control_GetMode(IAMVideoControl *iface, IPin *pin, LONG *mode) +{ + VfwCapture *filter = impl_from_IAMVideoControl(iface); + + FIXME("filter %p, pin %p, mode %p: stub.\n", filter, pin, mode); + + return E_NOTIMPL; +} + +static HRESULT WINAPI video_control_GetCurrentActualFrameRate(IAMVideoControl *iface, IPin *pin, + LONGLONG *frame_rate) +{ + VfwCapture *filter = impl_from_IAMVideoControl(iface); + + FIXME("filter %p, pin %p, frame rate %p: stub.\n", filter, pin, frame_rate); + + return E_NOTIMPL; +} + +static HRESULT WINAPI video_control_GetMaxAvailableFrameRate(IAMVideoControl *iface, IPin *pin, + LONG index, SIZE dimensions, LONGLONG *frame_rate) +{ + VfwCapture *filter = impl_from_IAMVideoControl(iface); + + FIXME("filter %p, pin %p, index %d, dimensions (%dx%d), frame rate %p: stub.\n", + filter, pin, index, dimensions.cx, dimensions.cy, frame_rate); + + return E_NOTIMPL; +} + +static HRESULT WINAPI video_control_GetFrameRateList(IAMVideoControl *iface, IPin *pin, LONG index, + SIZE dimensions, LONG *list_size, LONGLONG **frame_rate) +{ + VfwCapture *filter = impl_from_IAMVideoControl(iface); + + FIXME("filter %p, pin %p, index %d, dimensions (%dx%d), list size %p, frame rate: %p: stub.\n", + filter, pin, index, dimensions.cx, dimensions.cy, list_size, frame_rate); + + return E_NOTIMPL; +} + +static const IAMVideoControlVtbl IAMVideoControl_VTable = +{ + video_control_QueryInterface, + video_control_AddRef, + video_control_Release, + video_control_GetCaps, + video_control_SetMode, + video_control_GetMode, + video_control_GetCurrentActualFrameRate, + video_control_GetMaxAvailableFrameRate, + video_control_GetFrameRateList +}; + HRESULT vfw_capture_create(IUnknown *outer, IUnknown **out) { static const WCHAR source_name[] = {'O','u','t','p','u','t',0}; @@ -624,6 +722,7 @@ HRESULT vfw_capture_create(IUnknown *outer, IUnknown **out) strmbase_filter_init(&object->filter, outer, &CLSID_VfwCapture, &filter_ops);
object->IAMStreamConfig_iface.lpVtbl = &IAMStreamConfig_VTable; + object->IAMVideoControl_iface.lpVtbl = &IAMVideoControl_VTable; object->IAMVideoProcAmp_iface.lpVtbl = &IAMVideoProcAmp_VTable; object->IAMFilterMiscFlags_iface.lpVtbl = &IAMFilterMiscFlags_VTable; object->IPersistPropertyBag_iface.lpVtbl = &IPersistPropertyBag_VTable;