Added the video input device category.
This commit is contained in:
parent
6b4c02e57f
commit
8a7960c4f9
|
@ -3,7 +3,7 @@ TOPOBJDIR = ../..
|
||||||
SRCDIR = @srcdir@
|
SRCDIR = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
MODULE = devenum.dll
|
MODULE = devenum.dll
|
||||||
IMPORTS = ole32 oleaut32 winmm user32 advapi32 kernel32
|
IMPORTS = ole32 oleaut32 avicap32 winmm user32 advapi32 kernel32
|
||||||
EXTRALIBS = -lstrmiids -luuid
|
EXTRALIBS = -lstrmiids -luuid
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#define NONAMELESSUNION
|
#define NONAMELESSUNION
|
||||||
|
|
||||||
#include "devenum_private.h"
|
#include "devenum_private.h"
|
||||||
|
#include "vfw.h"
|
||||||
|
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#include "mmddk.h"
|
#include "mmddk.h"
|
||||||
|
@ -117,6 +118,7 @@ HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator(
|
||||||
|
|
||||||
if (IsEqualGUID(clsidDeviceClass, &CLSID_AudioRendererCategory) ||
|
if (IsEqualGUID(clsidDeviceClass, &CLSID_AudioRendererCategory) ||
|
||||||
IsEqualGUID(clsidDeviceClass, &CLSID_AudioInputDeviceCategory) ||
|
IsEqualGUID(clsidDeviceClass, &CLSID_AudioInputDeviceCategory) ||
|
||||||
|
IsEqualGUID(clsidDeviceClass, &CLSID_VideoInputDeviceCategory) ||
|
||||||
IsEqualGUID(clsidDeviceClass, &CLSID_MidiRendererCategory))
|
IsEqualGUID(clsidDeviceClass, &CLSID_MidiRendererCategory))
|
||||||
{
|
{
|
||||||
hbasekey = HKEY_CURRENT_USER;
|
hbasekey = HKEY_CURRENT_USER;
|
||||||
|
@ -142,6 +144,7 @@ HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator(
|
||||||
{
|
{
|
||||||
if (IsEqualGUID(clsidDeviceClass, &CLSID_AudioRendererCategory) ||
|
if (IsEqualGUID(clsidDeviceClass, &CLSID_AudioRendererCategory) ||
|
||||||
IsEqualGUID(clsidDeviceClass, &CLSID_AudioInputDeviceCategory) ||
|
IsEqualGUID(clsidDeviceClass, &CLSID_AudioInputDeviceCategory) ||
|
||||||
|
IsEqualGUID(clsidDeviceClass, &CLSID_VideoInputDeviceCategory) ||
|
||||||
IsEqualGUID(clsidDeviceClass, &CLSID_MidiRendererCategory))
|
IsEqualGUID(clsidDeviceClass, &CLSID_MidiRendererCategory))
|
||||||
{
|
{
|
||||||
HRESULT hr = DEVENUM_CreateSpecialCategories();
|
HRESULT hr = DEVENUM_CreateSpecialCategories();
|
||||||
|
@ -413,6 +416,45 @@ static HRESULT DEVENUM_CreateSpecialCategories()
|
||||||
CoTaskMemFree(pTypes);
|
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)
|
if (pMapper)
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
|
#include "wingdi.h"
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "winreg.h"
|
#include "winreg.h"
|
||||||
#include "winerror.h"
|
#include "winerror.h"
|
||||||
|
|
Loading…
Reference in New Issue