From 8a7960c4f9528232390615a43ec5ef41cb650948 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Wed, 27 Apr 2005 11:07:55 +0000 Subject: [PATCH] Added the video input device category. --- dlls/devenum/Makefile.in | 2 +- dlls/devenum/createdevenum.c | 42 ++++++++++++++++++++++++++++++++++ dlls/devenum/devenum_private.h | 1 + 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/dlls/devenum/Makefile.in b/dlls/devenum/Makefile.in index 8653126df62..f03b776fdc2 100644 --- a/dlls/devenum/Makefile.in +++ b/dlls/devenum/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = devenum.dll -IMPORTS = ole32 oleaut32 winmm user32 advapi32 kernel32 +IMPORTS = ole32 oleaut32 avicap32 winmm user32 advapi32 kernel32 EXTRALIBS = -lstrmiids -luuid C_SRCS = \ diff --git a/dlls/devenum/createdevenum.c b/dlls/devenum/createdevenum.c index 898a2008bcd..3022eef1359 100644 --- a/dlls/devenum/createdevenum.c +++ b/dlls/devenum/createdevenum.c @@ -27,6 +27,7 @@ #define NONAMELESSUNION #include "devenum_private.h" +#include "vfw.h" #include "wine/debug.h" #include "mmddk.h" @@ -117,6 +118,7 @@ HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator( if (IsEqualGUID(clsidDeviceClass, &CLSID_AudioRendererCategory) || IsEqualGUID(clsidDeviceClass, &CLSID_AudioInputDeviceCategory) || + IsEqualGUID(clsidDeviceClass, &CLSID_VideoInputDeviceCategory) || IsEqualGUID(clsidDeviceClass, &CLSID_MidiRendererCategory)) { hbasekey = HKEY_CURRENT_USER; @@ -142,6 +144,7 @@ HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator( { if (IsEqualGUID(clsidDeviceClass, &CLSID_AudioRendererCategory) || IsEqualGUID(clsidDeviceClass, &CLSID_AudioInputDeviceCategory) || + IsEqualGUID(clsidDeviceClass, &CLSID_VideoInputDeviceCategory) || IsEqualGUID(clsidDeviceClass, &CLSID_MidiRendererCategory)) { HRESULT hr = DEVENUM_CreateSpecialCategories(); @@ -413,6 +416,45 @@ static HRESULT DEVENUM_CreateSpecialCategories() CoTaskMemFree(pTypes); } } + res = DEVENUM_CreateAMCategoryKey(&CLSID_VideoInputDeviceCategory); + if (SUCCEEDED(res)) + for (i = 0; i < 10; i++) + { + WCHAR szDeviceName[80], szDeviceVersion[80]; + + if (capGetDriverDescriptionW ((WORD) i, + szDeviceName, sizeof(szDeviceName)/sizeof(WCHAR), + szDeviceVersion, sizeof(szDeviceVersion)/sizeof(WCHAR))) + { + IMoniker * pMoniker = NULL; + + rfp2.nMediaTypes = 1; + pTypes = CoTaskMemAlloc(rfp2.nMediaTypes * sizeof(REGPINTYPES)); + if (!pTypes) { + IFilterMapper2_Release(pMapper); + return E_OUTOFMEMORY; + } + + pTypes[0].clsMajorType = &MEDIATYPE_Video; + pTypes[0].clsMinorType = &MEDIASUBTYPE_RGB24; + + rfp2.lpMediaType = pTypes; + + res = IFilterMapper2_RegisterFilter(pMapper, + &CLSID_VfwCapture, + szDeviceName, + &pMoniker, + &CLSID_VideoInputDeviceCategory, + szDeviceName, + &rf2); + + /* FIXME: do additional stuff with IMoniker here, depending on what RegisterFilter does */ + if (pMoniker) IMoniker_Release(pMoniker); + + if (i == iDefaultDevice) FIXME("Default device\n"); + CoTaskMemFree(pTypes); + } + } } if (pMapper) diff --git a/dlls/devenum/devenum_private.h b/dlls/devenum/devenum_private.h index b48b3cbb94c..673f3c588d7 100644 --- a/dlls/devenum/devenum_private.h +++ b/dlls/devenum/devenum_private.h @@ -26,6 +26,7 @@ #include "windef.h" #include "winbase.h" +#include "wingdi.h" #include "winuser.h" #include "winreg.h" #include "winerror.h"