Commit 412e7a83 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

videoInput is now integrated into highgui and built from sources

parent e20d570e
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
#define NONAMELESSUNION 1
#endif
#if defined(NONAMELESSSTRUCT) && \
!defined(NONAMELESSUNION)
#define NONAMELESSUNION 1
#endif
#if defined(NONAMELESSUNION) && \
!defined(NONAMELESSSTRUCT)
#define NONAMELESSSTRUCT 1
#endif
#ifndef __ANONYMOUS_DEFINED
#define __ANONYMOUS_DEFINED
#if defined(__GNUC__) || defined(__GNUG__)
#define _ANONYMOUS_UNION __extension__
#define _ANONYMOUS_STRUCT __extension__
#else
#define _ANONYMOUS_UNION
#define _ANONYMOUS_STRUCT
#endif
#ifndef NONAMELESSUNION
#define _UNION_NAME(x)
#define _STRUCT_NAME(x)
#else /* NONAMELESSUNION */
#define _UNION_NAME(x) x
#define _STRUCT_NAME(x) x
#endif
#endif /* __ANONYMOUS_DEFINED */
#ifndef DUMMYUNIONNAME
# ifdef NONAMELESSUNION
# define DUMMYUNIONNAME u
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
# define DUMMYUNIONNAME2 u2
# define DUMMYUNIONNAME3 u3
# define DUMMYUNIONNAME4 u4
# define DUMMYUNIONNAME5 u5
# define DUMMYUNIONNAME6 u6
# define DUMMYUNIONNAME7 u7
# define DUMMYUNIONNAME8 u8
# define DUMMYUNIONNAME9 u9
# else /* NONAMELESSUNION */
# define DUMMYUNIONNAME
# define DUMMYUNIONNAME1 /* Wine uses this variant */
# define DUMMYUNIONNAME2
# define DUMMYUNIONNAME3
# define DUMMYUNIONNAME4
# define DUMMYUNIONNAME5
# define DUMMYUNIONNAME6
# define DUMMYUNIONNAME7
# define DUMMYUNIONNAME8
# define DUMMYUNIONNAME9
# endif
#endif /* DUMMYUNIONNAME */
#if !defined(DUMMYUNIONNAME1) /* MinGW does not define this one */
# ifdef NONAMELESSUNION
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
# else
# define DUMMYUNIONNAME1 /* Wine uses this variant */
# endif
#endif /* DUMMYUNIONNAME1 */
#ifndef DUMMYSTRUCTNAME
# ifdef NONAMELESSUNION
# define DUMMYSTRUCTNAME s
# define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */
# define DUMMYSTRUCTNAME2 s2
# define DUMMYSTRUCTNAME3 s3
# define DUMMYSTRUCTNAME4 s4
# define DUMMYSTRUCTNAME5 s5
# else
# define DUMMYSTRUCTNAME
# define DUMMYSTRUCTNAME1 /* Wine uses this variant */
# define DUMMYSTRUCTNAME2
# define DUMMYSTRUCTNAME3
# define DUMMYSTRUCTNAME4
# define DUMMYSTRUCTNAME5
# endif
#endif /* DUMMYSTRUCTNAME */
/* These are for compatibility with the Wine source tree */
#ifndef WINELIB_NAME_AW
# ifdef __MINGW_NAME_AW
# define WINELIB_NAME_AW __MINGW_NAME_AW
# else
# ifdef UNICODE
# define WINELIB_NAME_AW(func) func##W
# else
# define WINELIB_NAME_AW(func) func##A
# endif
# endif
#endif /* WINELIB_NAME_AW */
#ifndef DECL_WINELIB_TYPE_AW
# ifdef __MINGW_TYPEDEF_AW
# define DECL_WINELIB_TYPE_AW __MINGW_TYPEDEF_AW
# else
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
# endif
#endif /* DECL_WINELIB_TYPE_AW */
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#if !defined(_INC_CRT_UNICODE_MACROS)
/* _INC_CRT_UNICODE_MACROS defined based on UNICODE flag */
#if defined(UNICODE)
# define _INC_CRT_UNICODE_MACROS 1
# define __MINGW_NAME_AW(func) func##W
# define __MINGW_NAME_AW_EXT(func,ext) func##W##ext
# define __MINGW_NAME_UAW(func) func##_W
# define __MINGW_NAME_UAW_EXT(func,ext) func##_W_##ext
# define __MINGW_STRING_AW(str) L##str /* same as TEXT() from winnt.h */
# define __MINGW_PROCNAMEEXT_AW "W"
#else
# define _INC_CRT_UNICODE_MACROS 2
# define __MINGW_NAME_AW(func) func##A
# define __MINGW_NAME_AW_EXT(func,ext) func##A##ext
# define __MINGW_NAME_UAW(func) func##_A
# define __MINGW_NAME_UAW_EXT(func,ext) func##_A_##ext
# define __MINGW_STRING_AW(str) str /* same as TEXT() from winnt.h */
# define __MINGW_PROCNAMEEXT_AW "A"
#endif
#define __MINGW_TYPEDEF_AW(type) \
typedef __MINGW_NAME_AW(type) type;
#define __MINGW_TYPEDEF_UAW(type) \
typedef __MINGW_NAME_UAW(type) type;
#endif /* !defined(_INC_CRT_UNICODE_MACROS) */
/*** Autogenerated by WIDL from amvideo.idl - Do not edit ***/
#include <rpc.h>
#include <rpcndr.h>
#ifndef __WIDL_AMVIDEO_H
#define __WIDL_AMVIDEO_H
/* Forward declarations */
#ifndef __IDirectDrawVideo_FWD_DEFINED__
#define __IDirectDrawVideo_FWD_DEFINED__
typedef interface IDirectDrawVideo IDirectDrawVideo;
#endif
#ifndef __IQualProp_FWD_DEFINED__
#define __IQualProp_FWD_DEFINED__
typedef interface IQualProp IQualProp;
#endif
#ifndef __IFullScreenVideo_FWD_DEFINED__
#define __IFullScreenVideo_FWD_DEFINED__
typedef interface IFullScreenVideo IFullScreenVideo;
#endif
#ifndef __IFullScreenVideoEx_FWD_DEFINED__
#define __IFullScreenVideoEx_FWD_DEFINED__
typedef interface IFullScreenVideoEx IFullScreenVideoEx;
#endif
#ifndef __IBaseVideoMixer_FWD_DEFINED__
#define __IBaseVideoMixer_FWD_DEFINED__
typedef interface IBaseVideoMixer IBaseVideoMixer;
#endif
/* Headers for imported files */
#include <objidl.h>
#ifdef __cplusplus
extern "C" {
#endif
#if 0
typedef void *LPDIRECTDRAW;
typedef void DDSURFACEDESC;
typedef void DDCAPS;
typedef DWORD RGBQUAD;
typedef LONGLONG REFERENCE_TIME;
typedef struct __WIDL_amvideo_generated_name_00000000 {
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER;
typedef struct __WIDL_amvideo_generated_name_00000000 *PBITMAPINFOHEADER;
typedef struct __WIDL_amvideo_generated_name_00000000 *LPBITMAPINFOHEADER;
#endif
#include <dshow/ddraw.h>
#define AMDDS_NONE 0x00
#define AMDDS_DCIPS 0x01
#define AMDDS_PS 0x02
#define AMDDS_RGBOVR 0x04
#define AMDDS_YUVOVR 0x08
#define AMDDS_RGBOFF 0x10
#define AMDDS_YUVOFF 0x20
#define AMDDS_RGBFLP 0x40
#define AMDDS_YUVFLP 0x80
#define AMDDS_ALL 0xFF
#define AMDDS_DEFAULT AMDDS_ALL
#define AMDDS_YUV (AMDDS_YUVOFF | AMDDS_YUVOVR | AMDDS_YUVFLP)
#define AMDDS_RGB (AMDDS_RGBOFF | AMDDS_RGBOVR | AMDDS_RGBFLP)
#define AMDSS_PRIMARY (AMDDS_DCIPS | AMDDS_PS)
/*****************************************************************************
* IDirectDrawVideo interface
*/
#ifndef __IDirectDrawVideo_INTERFACE_DEFINED__
#define __IDirectDrawVideo_INTERFACE_DEFINED__
#if defined(__cplusplus) && !defined(CINTERFACE)
interface IDirectDrawVideo : public IUnknown
{
virtual HRESULT STDMETHODCALLTYPE GetSwitches(
DWORD *pSwitches) = 0;
virtual HRESULT STDMETHODCALLTYPE SetSwitches(
DWORD Switches) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCaps(
DDCAPS *pCaps) = 0;
virtual HRESULT STDMETHODCALLTYPE GetEmulatedCaps(
DDCAPS *pCaps) = 0;
virtual HRESULT STDMETHODCALLTYPE GetSurfaceDesc(
DDSURFACEDESC *pSurfaceDesc) = 0;
virtual HRESULT STDMETHODCALLTYPE GetFourCCCodes(
DWORD *pCount,
DWORD *pCodes) = 0;
virtual HRESULT STDMETHODCALLTYPE SetDirectDraw(
LPDIRECTDRAW pDirectDraw) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDirectDraw(
LPDIRECTDRAW *ppDirectDraw) = 0;
virtual HRESULT STDMETHODCALLTYPE GetSurfaceType(
DWORD *pSurfaceType) = 0;
virtual HRESULT STDMETHODCALLTYPE SetDefault(
) = 0;
virtual HRESULT STDMETHODCALLTYPE UseScanLine(
LONG UseScanLine) = 0;
virtual HRESULT STDMETHODCALLTYPE CanUseScanLine(
LONG *UseScanLine) = 0;
virtual HRESULT STDMETHODCALLTYPE UseOverlayStretch(
LONG UseOverlayStretch) = 0;
virtual HRESULT STDMETHODCALLTYPE CanUseOverlayStretch(
LONG *UseOverlayStretch) = 0;
virtual HRESULT STDMETHODCALLTYPE UseWhenFullScreen(
LONG UseWhenFullScreen) = 0;
virtual HRESULT STDMETHODCALLTYPE WillUseFullScreen(
LONG *UseWhenFullScreen) = 0;
};
#else
typedef struct IDirectDrawVideoVtbl {
BEGIN_INTERFACE
/*** IUnknown methods ***/
HRESULT (STDMETHODCALLTYPE *QueryInterface)(
IDirectDrawVideo* This,
REFIID riid,
void **ppvObject);
ULONG (STDMETHODCALLTYPE *AddRef)(
IDirectDrawVideo* This);
ULONG (STDMETHODCALLTYPE *Release)(
IDirectDrawVideo* This);
/*** IDirectDrawVideo methods ***/
HRESULT (STDMETHODCALLTYPE *GetSwitches)(
IDirectDrawVideo* This,
DWORD *pSwitches);
HRESULT (STDMETHODCALLTYPE *SetSwitches)(
IDirectDrawVideo* This,
DWORD Switches);
HRESULT (STDMETHODCALLTYPE *GetCaps)(
IDirectDrawVideo* This,
DDCAPS *pCaps);
HRESULT (STDMETHODCALLTYPE *GetEmulatedCaps)(
IDirectDrawVideo* This,
DDCAPS *pCaps);
HRESULT (STDMETHODCALLTYPE *GetSurfaceDesc)(
IDirectDrawVideo* This,
DDSURFACEDESC *pSurfaceDesc);
HRESULT (STDMETHODCALLTYPE *GetFourCCCodes)(
IDirectDrawVideo* This,
DWORD *pCount,
DWORD *pCodes);
HRESULT (STDMETHODCALLTYPE *SetDirectDraw)(
IDirectDrawVideo* This,
LPDIRECTDRAW pDirectDraw);
HRESULT (STDMETHODCALLTYPE *GetDirectDraw)(
IDirectDrawVideo* This,
LPDIRECTDRAW *ppDirectDraw);
HRESULT (STDMETHODCALLTYPE *GetSurfaceType)(
IDirectDrawVideo* This,
DWORD *pSurfaceType);
HRESULT (STDMETHODCALLTYPE *SetDefault)(
IDirectDrawVideo* This);
HRESULT (STDMETHODCALLTYPE *UseScanLine)(
IDirectDrawVideo* This,
LONG UseScanLine);
HRESULT (STDMETHODCALLTYPE *CanUseScanLine)(
IDirectDrawVideo* This,
LONG *UseScanLine);
HRESULT (STDMETHODCALLTYPE *UseOverlayStretch)(
IDirectDrawVideo* This,
LONG UseOverlayStretch);
HRESULT (STDMETHODCALLTYPE *CanUseOverlayStretch)(
IDirectDrawVideo* This,
LONG *UseOverlayStretch);
HRESULT (STDMETHODCALLTYPE *UseWhenFullScreen)(
IDirectDrawVideo* This,
LONG UseWhenFullScreen);
HRESULT (STDMETHODCALLTYPE *WillUseFullScreen)(
IDirectDrawVideo* This,
LONG *UseWhenFullScreen);
END_INTERFACE
} IDirectDrawVideoVtbl;
interface IDirectDrawVideo {
CONST_VTBL IDirectDrawVideoVtbl* lpVtbl;
};
#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IDirectDrawVideo_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IDirectDrawVideo_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IDirectDrawVideo_Release(This) (This)->lpVtbl->Release(This)
/*** IDirectDrawVideo methods ***/
#define IDirectDrawVideo_GetSwitches(This,pSwitches) (This)->lpVtbl->GetSwitches(This,pSwitches)
#define IDirectDrawVideo_SetSwitches(This,Switches) (This)->lpVtbl->SetSwitches(This,Switches)
#define IDirectDrawVideo_GetCaps(This,pCaps) (This)->lpVtbl->GetCaps(This,pCaps)
#define IDirectDrawVideo_GetEmulatedCaps(This,pCaps) (This)->lpVtbl->GetEmulatedCaps(This,pCaps)
#define IDirectDrawVideo_GetSurfaceDesc(This,pSurfaceDesc) (This)->lpVtbl->GetSurfaceDesc(This,pSurfaceDesc)
#define IDirectDrawVideo_GetFourCCCodes(This,pCount,pCodes) (This)->lpVtbl->GetFourCCCodes(This,pCount,pCodes)
#define IDirectDrawVideo_SetDirectDraw(This,pDirectDraw) (This)->lpVtbl->SetDirectDraw(This,pDirectDraw)
#define IDirectDrawVideo_GetDirectDraw(This,ppDirectDraw) (This)->lpVtbl->GetDirectDraw(This,ppDirectDraw)
#define IDirectDrawVideo_GetSurfaceType(This,pSurfaceType) (This)->lpVtbl->GetSurfaceType(This,pSurfaceType)
#define IDirectDrawVideo_SetDefault(This) (This)->lpVtbl->SetDefault(This)
#define IDirectDrawVideo_UseScanLine(This,UseScanLine) (This)->lpVtbl->UseScanLine(This,UseScanLine)
#define IDirectDrawVideo_CanUseScanLine(This,UseScanLine) (This)->lpVtbl->CanUseScanLine(This,UseScanLine)
#define IDirectDrawVideo_UseOverlayStretch(This,UseOverlayStretch) (This)->lpVtbl->UseOverlayStretch(This,UseOverlayStretch)
#define IDirectDrawVideo_CanUseOverlayStretch(This,UseOverlayStretch) (This)->lpVtbl->CanUseOverlayStretch(This,UseOverlayStretch)
#define IDirectDrawVideo_UseWhenFullScreen(This,UseWhenFullScreen) (This)->lpVtbl->UseWhenFullScreen(This,UseWhenFullScreen)
#define IDirectDrawVideo_WillUseFullScreen(This,UseWhenFullScreen) (This)->lpVtbl->WillUseFullScreen(This,UseWhenFullScreen)
#endif
#endif
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_GetSwitches_Proxy(
IDirectDrawVideo* This,
DWORD *pSwitches);
void __RPC_STUB IDirectDrawVideo_GetSwitches_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_SetSwitches_Proxy(
IDirectDrawVideo* This,
DWORD Switches);
void __RPC_STUB IDirectDrawVideo_SetSwitches_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_GetCaps_Proxy(
IDirectDrawVideo* This,
DDCAPS *pCaps);
void __RPC_STUB IDirectDrawVideo_GetCaps_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_GetEmulatedCaps_Proxy(
IDirectDrawVideo* This,
DDCAPS *pCaps);
void __RPC_STUB IDirectDrawVideo_GetEmulatedCaps_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_GetSurfaceDesc_Proxy(
IDirectDrawVideo* This,
DDSURFACEDESC *pSurfaceDesc);
void __RPC_STUB IDirectDrawVideo_GetSurfaceDesc_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_GetFourCCCodes_Proxy(
IDirectDrawVideo* This,
DWORD *pCount,
DWORD *pCodes);
void __RPC_STUB IDirectDrawVideo_GetFourCCCodes_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_SetDirectDraw_Proxy(
IDirectDrawVideo* This,
LPDIRECTDRAW pDirectDraw);
void __RPC_STUB IDirectDrawVideo_SetDirectDraw_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_GetDirectDraw_Proxy(
IDirectDrawVideo* This,
LPDIRECTDRAW *ppDirectDraw);
void __RPC_STUB IDirectDrawVideo_GetDirectDraw_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_GetSurfaceType_Proxy(
IDirectDrawVideo* This,
DWORD *pSurfaceType);
void __RPC_STUB IDirectDrawVideo_GetSurfaceType_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_SetDefault_Proxy(
IDirectDrawVideo* This);
void __RPC_STUB IDirectDrawVideo_SetDefault_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_UseScanLine_Proxy(
IDirectDrawVideo* This,
LONG UseScanLine);
void __RPC_STUB IDirectDrawVideo_UseScanLine_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_CanUseScanLine_Proxy(
IDirectDrawVideo* This,
LONG *UseScanLine);
void __RPC_STUB IDirectDrawVideo_CanUseScanLine_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_UseOverlayStretch_Proxy(
IDirectDrawVideo* This,
LONG UseOverlayStretch);
void __RPC_STUB IDirectDrawVideo_UseOverlayStretch_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_CanUseOverlayStretch_Proxy(
IDirectDrawVideo* This,
LONG *UseOverlayStretch);
void __RPC_STUB IDirectDrawVideo_CanUseOverlayStretch_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_UseWhenFullScreen_Proxy(
IDirectDrawVideo* This,
LONG UseWhenFullScreen);
void __RPC_STUB IDirectDrawVideo_UseWhenFullScreen_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IDirectDrawVideo_WillUseFullScreen_Proxy(
IDirectDrawVideo* This,
LONG *UseWhenFullScreen);
void __RPC_STUB IDirectDrawVideo_WillUseFullScreen_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
#endif /* __IDirectDrawVideo_INTERFACE_DEFINED__ */
/*****************************************************************************
* IQualProp interface
*/
#ifndef __IQualProp_INTERFACE_DEFINED__
#define __IQualProp_INTERFACE_DEFINED__
#if defined(__cplusplus) && !defined(CINTERFACE)
interface IQualProp : public IUnknown
{
virtual HRESULT STDMETHODCALLTYPE get_FramesDroppedInRenderer(
int *pcFrames) = 0;
virtual HRESULT STDMETHODCALLTYPE get_FramesDrawn(
int *pcFramesDrawn) = 0;
virtual HRESULT STDMETHODCALLTYPE get_AvgFrameRate(
int *piAvgFrameRate) = 0;
virtual HRESULT STDMETHODCALLTYPE get_Jitter(
int *iJitter) = 0;
virtual HRESULT STDMETHODCALLTYPE get_AvgSyncOffset(
int *piAvg) = 0;
virtual HRESULT STDMETHODCALLTYPE get_DevSyncOffset(
int *piDev) = 0;
};
#else
typedef struct IQualPropVtbl {
BEGIN_INTERFACE
/*** IUnknown methods ***/
HRESULT (STDMETHODCALLTYPE *QueryInterface)(
IQualProp* This,
REFIID riid,
void **ppvObject);
ULONG (STDMETHODCALLTYPE *AddRef)(
IQualProp* This);
ULONG (STDMETHODCALLTYPE *Release)(
IQualProp* This);
/*** IQualProp methods ***/
HRESULT (STDMETHODCALLTYPE *get_FramesDroppedInRenderer)(
IQualProp* This,
int *pcFrames);
HRESULT (STDMETHODCALLTYPE *get_FramesDrawn)(
IQualProp* This,
int *pcFramesDrawn);
HRESULT (STDMETHODCALLTYPE *get_AvgFrameRate)(
IQualProp* This,
int *piAvgFrameRate);
HRESULT (STDMETHODCALLTYPE *get_Jitter)(
IQualProp* This,
int *iJitter);
HRESULT (STDMETHODCALLTYPE *get_AvgSyncOffset)(
IQualProp* This,
int *piAvg);
HRESULT (STDMETHODCALLTYPE *get_DevSyncOffset)(
IQualProp* This,
int *piDev);
END_INTERFACE
} IQualPropVtbl;
interface IQualProp {
CONST_VTBL IQualPropVtbl* lpVtbl;
};
#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IQualProp_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IQualProp_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IQualProp_Release(This) (This)->lpVtbl->Release(This)
/*** IQualProp methods ***/
#define IQualProp_get_FramesDroppedInRenderer(This,pcFrames) (This)->lpVtbl->get_FramesDroppedInRenderer(This,pcFrames)
#define IQualProp_get_FramesDrawn(This,pcFramesDrawn) (This)->lpVtbl->get_FramesDrawn(This,pcFramesDrawn)
#define IQualProp_get_AvgFrameRate(This,piAvgFrameRate) (This)->lpVtbl->get_AvgFrameRate(This,piAvgFrameRate)
#define IQualProp_get_Jitter(This,iJitter) (This)->lpVtbl->get_Jitter(This,iJitter)
#define IQualProp_get_AvgSyncOffset(This,piAvg) (This)->lpVtbl->get_AvgSyncOffset(This,piAvg)
#define IQualProp_get_DevSyncOffset(This,piDev) (This)->lpVtbl->get_DevSyncOffset(This,piDev)
#endif
#endif
HRESULT STDMETHODCALLTYPE IQualProp_get_FramesDroppedInRenderer_Proxy(
IQualProp* This,
int *pcFrames);
void __RPC_STUB IQualProp_get_FramesDroppedInRenderer_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IQualProp_get_FramesDrawn_Proxy(
IQualProp* This,
int *pcFramesDrawn);
void __RPC_STUB IQualProp_get_FramesDrawn_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IQualProp_get_AvgFrameRate_Proxy(
IQualProp* This,
int *piAvgFrameRate);
void __RPC_STUB IQualProp_get_AvgFrameRate_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IQualProp_get_Jitter_Proxy(
IQualProp* This,
int *iJitter);
void __RPC_STUB IQualProp_get_Jitter_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IQualProp_get_AvgSyncOffset_Proxy(
IQualProp* This,
int *piAvg);
void __RPC_STUB IQualProp_get_AvgSyncOffset_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IQualProp_get_DevSyncOffset_Proxy(
IQualProp* This,
int *piDev);
void __RPC_STUB IQualProp_get_DevSyncOffset_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
#endif /* __IQualProp_INTERFACE_DEFINED__ */
/*****************************************************************************
* IFullScreenVideo interface
*/
#ifndef __IFullScreenVideo_INTERFACE_DEFINED__
#define __IFullScreenVideo_INTERFACE_DEFINED__
#if defined(__cplusplus) && !defined(CINTERFACE)
interface IFullScreenVideo : public IUnknown
{
virtual HRESULT STDMETHODCALLTYPE CountModes(
LONG *pModes) = 0;
virtual HRESULT STDMETHODCALLTYPE GetModeInfo(
LONG Mode,
LONG *pWidth,
LONG *pHeight,
LONG *pDepth) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentMode(
LONG *pMode) = 0;
virtual HRESULT STDMETHODCALLTYPE IsModeAvailable(
LONG Mode) = 0;
virtual HRESULT STDMETHODCALLTYPE IsModeEnabled(
LONG Mode) = 0;
virtual HRESULT STDMETHODCALLTYPE SetEnabled(
LONG Mode,
LONG bEnabled) = 0;
virtual HRESULT STDMETHODCALLTYPE GetClipFactor(
LONG *pClipFactor) = 0;
virtual HRESULT STDMETHODCALLTYPE SetClipFactor(
LONG ClipFactor) = 0;
virtual HRESULT STDMETHODCALLTYPE SetMessageDrain(
HWND hwnd) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMessageDrain(
HWND *hwnd) = 0;
virtual HRESULT STDMETHODCALLTYPE SetMonitor(
LONG Monitor) = 0;
virtual HRESULT STDMETHODCALLTYPE GetMonitor(
LONG *Monitor) = 0;
virtual HRESULT STDMETHODCALLTYPE HideOnDeactivate(
LONG Hide) = 0;
virtual HRESULT STDMETHODCALLTYPE IsHideOnDeactivate(
) = 0;
virtual HRESULT STDMETHODCALLTYPE SetCaption(
BSTR strCaption) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCaption(
BSTR *pstrCaption) = 0;
virtual HRESULT STDMETHODCALLTYPE SetDefault(
) = 0;
};
#else
typedef struct IFullScreenVideoVtbl {
BEGIN_INTERFACE
/*** IUnknown methods ***/
HRESULT (STDMETHODCALLTYPE *QueryInterface)(
IFullScreenVideo* This,
REFIID riid,
void **ppvObject);
ULONG (STDMETHODCALLTYPE *AddRef)(
IFullScreenVideo* This);
ULONG (STDMETHODCALLTYPE *Release)(
IFullScreenVideo* This);
/*** IFullScreenVideo methods ***/
HRESULT (STDMETHODCALLTYPE *CountModes)(
IFullScreenVideo* This,
LONG *pModes);
HRESULT (STDMETHODCALLTYPE *GetModeInfo)(
IFullScreenVideo* This,
LONG Mode,
LONG *pWidth,
LONG *pHeight,
LONG *pDepth);
HRESULT (STDMETHODCALLTYPE *GetCurrentMode)(
IFullScreenVideo* This,
LONG *pMode);
HRESULT (STDMETHODCALLTYPE *IsModeAvailable)(
IFullScreenVideo* This,
LONG Mode);
HRESULT (STDMETHODCALLTYPE *IsModeEnabled)(
IFullScreenVideo* This,
LONG Mode);
HRESULT (STDMETHODCALLTYPE *SetEnabled)(
IFullScreenVideo* This,
LONG Mode,
LONG bEnabled);
HRESULT (STDMETHODCALLTYPE *GetClipFactor)(
IFullScreenVideo* This,
LONG *pClipFactor);
HRESULT (STDMETHODCALLTYPE *SetClipFactor)(
IFullScreenVideo* This,
LONG ClipFactor);
HRESULT (STDMETHODCALLTYPE *SetMessageDrain)(
IFullScreenVideo* This,
HWND hwnd);
HRESULT (STDMETHODCALLTYPE *GetMessageDrain)(
IFullScreenVideo* This,
HWND *hwnd);
HRESULT (STDMETHODCALLTYPE *SetMonitor)(
IFullScreenVideo* This,
LONG Monitor);
HRESULT (STDMETHODCALLTYPE *GetMonitor)(
IFullScreenVideo* This,
LONG *Monitor);
HRESULT (STDMETHODCALLTYPE *HideOnDeactivate)(
IFullScreenVideo* This,
LONG Hide);
HRESULT (STDMETHODCALLTYPE *IsHideOnDeactivate)(
IFullScreenVideo* This);
HRESULT (STDMETHODCALLTYPE *SetCaption)(
IFullScreenVideo* This,
BSTR strCaption);
HRESULT (STDMETHODCALLTYPE *GetCaption)(
IFullScreenVideo* This,
BSTR *pstrCaption);
HRESULT (STDMETHODCALLTYPE *SetDefault)(
IFullScreenVideo* This);
END_INTERFACE
} IFullScreenVideoVtbl;
interface IFullScreenVideo {
CONST_VTBL IFullScreenVideoVtbl* lpVtbl;
};
#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IFullScreenVideo_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IFullScreenVideo_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IFullScreenVideo_Release(This) (This)->lpVtbl->Release(This)
/*** IFullScreenVideo methods ***/
#define IFullScreenVideo_CountModes(This,pModes) (This)->lpVtbl->CountModes(This,pModes)
#define IFullScreenVideo_GetModeInfo(This,Mode,pWidth,pHeight,pDepth) (This)->lpVtbl->GetModeInfo(This,Mode,pWidth,pHeight,pDepth)
#define IFullScreenVideo_GetCurrentMode(This,pMode) (This)->lpVtbl->GetCurrentMode(This,pMode)
#define IFullScreenVideo_IsModeAvailable(This,Mode) (This)->lpVtbl->IsModeAvailable(This,Mode)
#define IFullScreenVideo_IsModeEnabled(This,Mode) (This)->lpVtbl->IsModeEnabled(This,Mode)
#define IFullScreenVideo_SetEnabled(This,Mode,bEnabled) (This)->lpVtbl->SetEnabled(This,Mode,bEnabled)
#define IFullScreenVideo_GetClipFactor(This,pClipFactor) (This)->lpVtbl->GetClipFactor(This,pClipFactor)
#define IFullScreenVideo_SetClipFactor(This,ClipFactor) (This)->lpVtbl->SetClipFactor(This,ClipFactor)
#define IFullScreenVideo_SetMessageDrain(This,hwnd) (This)->lpVtbl->SetMessageDrain(This,hwnd)
#define IFullScreenVideo_GetMessageDrain(This,hwnd) (This)->lpVtbl->GetMessageDrain(This,hwnd)
#define IFullScreenVideo_SetMonitor(This,Monitor) (This)->lpVtbl->SetMonitor(This,Monitor)
#define IFullScreenVideo_GetMonitor(This,Monitor) (This)->lpVtbl->GetMonitor(This,Monitor)
#define IFullScreenVideo_HideOnDeactivate(This,Hide) (This)->lpVtbl->HideOnDeactivate(This,Hide)
#define IFullScreenVideo_IsHideOnDeactivate(This) (This)->lpVtbl->IsHideOnDeactivate(This)
#define IFullScreenVideo_SetCaption(This,strCaption) (This)->lpVtbl->SetCaption(This,strCaption)
#define IFullScreenVideo_GetCaption(This,pstrCaption) (This)->lpVtbl->GetCaption(This,pstrCaption)
#define IFullScreenVideo_SetDefault(This) (This)->lpVtbl->SetDefault(This)
#endif
#endif
HRESULT STDMETHODCALLTYPE IFullScreenVideo_CountModes_Proxy(
IFullScreenVideo* This,
LONG *pModes);
void __RPC_STUB IFullScreenVideo_CountModes_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_GetModeInfo_Proxy(
IFullScreenVideo* This,
LONG Mode,
LONG *pWidth,
LONG *pHeight,
LONG *pDepth);
void __RPC_STUB IFullScreenVideo_GetModeInfo_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_GetCurrentMode_Proxy(
IFullScreenVideo* This,
LONG *pMode);
void __RPC_STUB IFullScreenVideo_GetCurrentMode_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_IsModeAvailable_Proxy(
IFullScreenVideo* This,
LONG Mode);
void __RPC_STUB IFullScreenVideo_IsModeAvailable_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_IsModeEnabled_Proxy(
IFullScreenVideo* This,
LONG Mode);
void __RPC_STUB IFullScreenVideo_IsModeEnabled_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_SetEnabled_Proxy(
IFullScreenVideo* This,
LONG Mode,
LONG bEnabled);
void __RPC_STUB IFullScreenVideo_SetEnabled_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_GetClipFactor_Proxy(
IFullScreenVideo* This,
LONG *pClipFactor);
void __RPC_STUB IFullScreenVideo_GetClipFactor_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_SetClipFactor_Proxy(
IFullScreenVideo* This,
LONG ClipFactor);
void __RPC_STUB IFullScreenVideo_SetClipFactor_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_SetMessageDrain_Proxy(
IFullScreenVideo* This,
HWND hwnd);
void __RPC_STUB IFullScreenVideo_SetMessageDrain_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_GetMessageDrain_Proxy(
IFullScreenVideo* This,
HWND *hwnd);
void __RPC_STUB IFullScreenVideo_GetMessageDrain_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_SetMonitor_Proxy(
IFullScreenVideo* This,
LONG Monitor);
void __RPC_STUB IFullScreenVideo_SetMonitor_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_GetMonitor_Proxy(
IFullScreenVideo* This,
LONG *Monitor);
void __RPC_STUB IFullScreenVideo_GetMonitor_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_HideOnDeactivate_Proxy(
IFullScreenVideo* This,
LONG Hide);
void __RPC_STUB IFullScreenVideo_HideOnDeactivate_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_IsHideOnDeactivate_Proxy(
IFullScreenVideo* This);
void __RPC_STUB IFullScreenVideo_IsHideOnDeactivate_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_SetCaption_Proxy(
IFullScreenVideo* This,
BSTR strCaption);
void __RPC_STUB IFullScreenVideo_SetCaption_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_GetCaption_Proxy(
IFullScreenVideo* This,
BSTR *pstrCaption);
void __RPC_STUB IFullScreenVideo_GetCaption_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideo_SetDefault_Proxy(
IFullScreenVideo* This);
void __RPC_STUB IFullScreenVideo_SetDefault_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
#endif /* __IFullScreenVideo_INTERFACE_DEFINED__ */
/*****************************************************************************
* IFullScreenVideoEx interface
*/
#ifndef __IFullScreenVideoEx_INTERFACE_DEFINED__
#define __IFullScreenVideoEx_INTERFACE_DEFINED__
#if defined(__cplusplus) && !defined(CINTERFACE)
interface IFullScreenVideoEx : public IFullScreenVideo
{
virtual HRESULT STDMETHODCALLTYPE SetAcceleratorTable(
HWND hwnd,
HACCEL hAccel) = 0;
virtual HRESULT STDMETHODCALLTYPE GetAcceleratorTable(
HWND *phwnd,
HACCEL *phAccel) = 0;
virtual HRESULT STDMETHODCALLTYPE KeepPixelAspectRatio(
LONG KeepAspect) = 0;
virtual HRESULT STDMETHODCALLTYPE IsKeepPixelAspectRatio(
LONG *pKeepAspect) = 0;
};
#else
typedef struct IFullScreenVideoExVtbl {
BEGIN_INTERFACE
/*** IUnknown methods ***/
HRESULT (STDMETHODCALLTYPE *QueryInterface)(
IFullScreenVideoEx* This,
REFIID riid,
void **ppvObject);
ULONG (STDMETHODCALLTYPE *AddRef)(
IFullScreenVideoEx* This);
ULONG (STDMETHODCALLTYPE *Release)(
IFullScreenVideoEx* This);
/*** IFullScreenVideo methods ***/
HRESULT (STDMETHODCALLTYPE *CountModes)(
IFullScreenVideoEx* This,
LONG *pModes);
HRESULT (STDMETHODCALLTYPE *GetModeInfo)(
IFullScreenVideoEx* This,
LONG Mode,
LONG *pWidth,
LONG *pHeight,
LONG *pDepth);
HRESULT (STDMETHODCALLTYPE *GetCurrentMode)(
IFullScreenVideoEx* This,
LONG *pMode);
HRESULT (STDMETHODCALLTYPE *IsModeAvailable)(
IFullScreenVideoEx* This,
LONG Mode);
HRESULT (STDMETHODCALLTYPE *IsModeEnabled)(
IFullScreenVideoEx* This,
LONG Mode);
HRESULT (STDMETHODCALLTYPE *SetEnabled)(
IFullScreenVideoEx* This,
LONG Mode,
LONG bEnabled);
HRESULT (STDMETHODCALLTYPE *GetClipFactor)(
IFullScreenVideoEx* This,
LONG *pClipFactor);
HRESULT (STDMETHODCALLTYPE *SetClipFactor)(
IFullScreenVideoEx* This,
LONG ClipFactor);
HRESULT (STDMETHODCALLTYPE *SetMessageDrain)(
IFullScreenVideoEx* This,
HWND hwnd);
HRESULT (STDMETHODCALLTYPE *GetMessageDrain)(
IFullScreenVideoEx* This,
HWND *hwnd);
HRESULT (STDMETHODCALLTYPE *SetMonitor)(
IFullScreenVideoEx* This,
LONG Monitor);
HRESULT (STDMETHODCALLTYPE *GetMonitor)(
IFullScreenVideoEx* This,
LONG *Monitor);
HRESULT (STDMETHODCALLTYPE *HideOnDeactivate)(
IFullScreenVideoEx* This,
LONG Hide);
HRESULT (STDMETHODCALLTYPE *IsHideOnDeactivate)(
IFullScreenVideoEx* This);
HRESULT (STDMETHODCALLTYPE *SetCaption)(
IFullScreenVideoEx* This,
BSTR strCaption);
HRESULT (STDMETHODCALLTYPE *GetCaption)(
IFullScreenVideoEx* This,
BSTR *pstrCaption);
HRESULT (STDMETHODCALLTYPE *SetDefault)(
IFullScreenVideoEx* This);
/*** IFullScreenVideoEx methods ***/
HRESULT (STDMETHODCALLTYPE *SetAcceleratorTable)(
IFullScreenVideoEx* This,
HWND hwnd,
HACCEL hAccel);
HRESULT (STDMETHODCALLTYPE *GetAcceleratorTable)(
IFullScreenVideoEx* This,
HWND *phwnd,
HACCEL *phAccel);
HRESULT (STDMETHODCALLTYPE *KeepPixelAspectRatio)(
IFullScreenVideoEx* This,
LONG KeepAspect);
HRESULT (STDMETHODCALLTYPE *IsKeepPixelAspectRatio)(
IFullScreenVideoEx* This,
LONG *pKeepAspect);
END_INTERFACE
} IFullScreenVideoExVtbl;
interface IFullScreenVideoEx {
CONST_VTBL IFullScreenVideoExVtbl* lpVtbl;
};
#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IFullScreenVideoEx_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IFullScreenVideoEx_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IFullScreenVideoEx_Release(This) (This)->lpVtbl->Release(This)
/*** IFullScreenVideo methods ***/
#define IFullScreenVideoEx_CountModes(This,pModes) (This)->lpVtbl->CountModes(This,pModes)
#define IFullScreenVideoEx_GetModeInfo(This,Mode,pWidth,pHeight,pDepth) (This)->lpVtbl->GetModeInfo(This,Mode,pWidth,pHeight,pDepth)
#define IFullScreenVideoEx_GetCurrentMode(This,pMode) (This)->lpVtbl->GetCurrentMode(This,pMode)
#define IFullScreenVideoEx_IsModeAvailable(This,Mode) (This)->lpVtbl->IsModeAvailable(This,Mode)
#define IFullScreenVideoEx_IsModeEnabled(This,Mode) (This)->lpVtbl->IsModeEnabled(This,Mode)
#define IFullScreenVideoEx_SetEnabled(This,Mode,bEnabled) (This)->lpVtbl->SetEnabled(This,Mode,bEnabled)
#define IFullScreenVideoEx_GetClipFactor(This,pClipFactor) (This)->lpVtbl->GetClipFactor(This,pClipFactor)
#define IFullScreenVideoEx_SetClipFactor(This,ClipFactor) (This)->lpVtbl->SetClipFactor(This,ClipFactor)
#define IFullScreenVideoEx_SetMessageDrain(This,hwnd) (This)->lpVtbl->SetMessageDrain(This,hwnd)
#define IFullScreenVideoEx_GetMessageDrain(This,hwnd) (This)->lpVtbl->GetMessageDrain(This,hwnd)
#define IFullScreenVideoEx_SetMonitor(This,Monitor) (This)->lpVtbl->SetMonitor(This,Monitor)
#define IFullScreenVideoEx_GetMonitor(This,Monitor) (This)->lpVtbl->GetMonitor(This,Monitor)
#define IFullScreenVideoEx_HideOnDeactivate(This,Hide) (This)->lpVtbl->HideOnDeactivate(This,Hide)
#define IFullScreenVideoEx_IsHideOnDeactivate(This) (This)->lpVtbl->IsHideOnDeactivate(This)
#define IFullScreenVideoEx_SetCaption(This,strCaption) (This)->lpVtbl->SetCaption(This,strCaption)
#define IFullScreenVideoEx_GetCaption(This,pstrCaption) (This)->lpVtbl->GetCaption(This,pstrCaption)
#define IFullScreenVideoEx_SetDefault(This) (This)->lpVtbl->SetDefault(This)
/*** IFullScreenVideoEx methods ***/
#define IFullScreenVideoEx_SetAcceleratorTable(This,hwnd,hAccel) (This)->lpVtbl->SetAcceleratorTable(This,hwnd,hAccel)
#define IFullScreenVideoEx_GetAcceleratorTable(This,phwnd,phAccel) (This)->lpVtbl->GetAcceleratorTable(This,phwnd,phAccel)
#define IFullScreenVideoEx_KeepPixelAspectRatio(This,KeepAspect) (This)->lpVtbl->KeepPixelAspectRatio(This,KeepAspect)
#define IFullScreenVideoEx_IsKeepPixelAspectRatio(This,pKeepAspect) (This)->lpVtbl->IsKeepPixelAspectRatio(This,pKeepAspect)
#endif
#endif
HRESULT STDMETHODCALLTYPE IFullScreenVideoEx_SetAcceleratorTable_Proxy(
IFullScreenVideoEx* This,
HWND hwnd,
HACCEL hAccel);
void __RPC_STUB IFullScreenVideoEx_SetAcceleratorTable_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideoEx_GetAcceleratorTable_Proxy(
IFullScreenVideoEx* This,
HWND *phwnd,
HACCEL *phAccel);
void __RPC_STUB IFullScreenVideoEx_GetAcceleratorTable_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideoEx_KeepPixelAspectRatio_Proxy(
IFullScreenVideoEx* This,
LONG KeepAspect);
void __RPC_STUB IFullScreenVideoEx_KeepPixelAspectRatio_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IFullScreenVideoEx_IsKeepPixelAspectRatio_Proxy(
IFullScreenVideoEx* This,
LONG *pKeepAspect);
void __RPC_STUB IFullScreenVideoEx_IsKeepPixelAspectRatio_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
#endif /* __IFullScreenVideoEx_INTERFACE_DEFINED__ */
/*****************************************************************************
* IBaseVideoMixer interface
*/
#ifndef __IBaseVideoMixer_INTERFACE_DEFINED__
#define __IBaseVideoMixer_INTERFACE_DEFINED__
#if defined(__cplusplus) && !defined(CINTERFACE)
interface IBaseVideoMixer : public IUnknown
{
virtual HRESULT STDMETHODCALLTYPE SetLeadPin(
int iPin) = 0;
virtual HRESULT STDMETHODCALLTYPE GetLeadPin(
int *piPin) = 0;
virtual HRESULT STDMETHODCALLTYPE GetInputPinCount(
int *piPinCount) = 0;
virtual HRESULT STDMETHODCALLTYPE IsUsingClock(
int *pbValue) = 0;
virtual HRESULT STDMETHODCALLTYPE SetUsingClock(
int bValue) = 0;
virtual HRESULT STDMETHODCALLTYPE GetClockPeriod(
int *pbValue) = 0;
virtual HRESULT STDMETHODCALLTYPE SetClockPeriod(
int bValue) = 0;
};
#else
typedef struct IBaseVideoMixerVtbl {
BEGIN_INTERFACE
/*** IUnknown methods ***/
HRESULT (STDMETHODCALLTYPE *QueryInterface)(
IBaseVideoMixer* This,
REFIID riid,
void **ppvObject);
ULONG (STDMETHODCALLTYPE *AddRef)(
IBaseVideoMixer* This);
ULONG (STDMETHODCALLTYPE *Release)(
IBaseVideoMixer* This);
/*** IBaseVideoMixer methods ***/
HRESULT (STDMETHODCALLTYPE *SetLeadPin)(
IBaseVideoMixer* This,
int iPin);
HRESULT (STDMETHODCALLTYPE *GetLeadPin)(
IBaseVideoMixer* This,
int *piPin);
HRESULT (STDMETHODCALLTYPE *GetInputPinCount)(
IBaseVideoMixer* This,
int *piPinCount);
HRESULT (STDMETHODCALLTYPE *IsUsingClock)(
IBaseVideoMixer* This,
int *pbValue);
HRESULT (STDMETHODCALLTYPE *SetUsingClock)(
IBaseVideoMixer* This,
int bValue);
HRESULT (STDMETHODCALLTYPE *GetClockPeriod)(
IBaseVideoMixer* This,
int *pbValue);
HRESULT (STDMETHODCALLTYPE *SetClockPeriod)(
IBaseVideoMixer* This,
int bValue);
END_INTERFACE
} IBaseVideoMixerVtbl;
interface IBaseVideoMixer {
CONST_VTBL IBaseVideoMixerVtbl* lpVtbl;
};
#ifdef COBJMACROS
/*** IUnknown methods ***/
#define IBaseVideoMixer_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
#define IBaseVideoMixer_AddRef(This) (This)->lpVtbl->AddRef(This)
#define IBaseVideoMixer_Release(This) (This)->lpVtbl->Release(This)
/*** IBaseVideoMixer methods ***/
#define IBaseVideoMixer_SetLeadPin(This,iPin) (This)->lpVtbl->SetLeadPin(This,iPin)
#define IBaseVideoMixer_GetLeadPin(This,piPin) (This)->lpVtbl->GetLeadPin(This,piPin)
#define IBaseVideoMixer_GetInputPinCount(This,piPinCount) (This)->lpVtbl->GetInputPinCount(This,piPinCount)
#define IBaseVideoMixer_IsUsingClock(This,pbValue) (This)->lpVtbl->IsUsingClock(This,pbValue)
#define IBaseVideoMixer_SetUsingClock(This,bValue) (This)->lpVtbl->SetUsingClock(This,bValue)
#define IBaseVideoMixer_GetClockPeriod(This,pbValue) (This)->lpVtbl->GetClockPeriod(This,pbValue)
#define IBaseVideoMixer_SetClockPeriod(This,bValue) (This)->lpVtbl->SetClockPeriod(This,bValue)
#endif
#endif
HRESULT STDMETHODCALLTYPE IBaseVideoMixer_SetLeadPin_Proxy(
IBaseVideoMixer* This,
int iPin);
void __RPC_STUB IBaseVideoMixer_SetLeadPin_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IBaseVideoMixer_GetLeadPin_Proxy(
IBaseVideoMixer* This,
int *piPin);
void __RPC_STUB IBaseVideoMixer_GetLeadPin_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IBaseVideoMixer_GetInputPinCount_Proxy(
IBaseVideoMixer* This,
int *piPinCount);
void __RPC_STUB IBaseVideoMixer_GetInputPinCount_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IBaseVideoMixer_IsUsingClock_Proxy(
IBaseVideoMixer* This,
int *pbValue);
void __RPC_STUB IBaseVideoMixer_IsUsingClock_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IBaseVideoMixer_SetUsingClock_Proxy(
IBaseVideoMixer* This,
int bValue);
void __RPC_STUB IBaseVideoMixer_SetUsingClock_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IBaseVideoMixer_GetClockPeriod_Proxy(
IBaseVideoMixer* This,
int *pbValue);
void __RPC_STUB IBaseVideoMixer_GetClockPeriod_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT STDMETHODCALLTYPE IBaseVideoMixer_SetClockPeriod_Proxy(
IBaseVideoMixer* This,
int bValue);
void __RPC_STUB IBaseVideoMixer_SetClockPeriod_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
#endif /* __IBaseVideoMixer_INTERFACE_DEFINED__ */
#define iPALETTE_COLORS 256
#define iEGA_COLORS 16
#define iMASK_COLORS 3
#define iTRUECOLOR 16
#define iRED 0
#define iGREEN 1
#define iBLUE 2
#define iPALETTE 8
#define iMAXBITS 8
typedef struct tag_TRUECOLORINFO {
DWORD dwBitMasks[3];
RGBQUAD bmiColors[256];
} TRUECOLORINFO;
typedef struct tagVIDEOINFOHEADER {
RECT rcSource;
RECT rcTarget;
DWORD dwBitRate;
DWORD dwBitErrorRate;
REFERENCE_TIME AvgTimePerFrame;
BITMAPINFOHEADER bmiHeader;
} VIDEOINFOHEADER;
typedef struct tagVIDEOINFO {
RECT rcSource;
RECT rcTarget;
DWORD dwBitRate;
DWORD dwBitErrorRate;
REFERENCE_TIME AvgTimePerFrame;
BITMAPINFOHEADER bmiHeader;
union {
RGBQUAD bmiColors[256];
DWORD dwBitMasks[3];
TRUECOLORINFO TrueColorInfo;
} DUMMYUNIONNAME;
} VIDEOINFO;
typedef struct tagMPEG1VIDEOINFO {
VIDEOINFOHEADER hdr;
DWORD dwStartTimeCode;
DWORD cbSequenceHeader;
BYTE bSequenceHeader[1];
} MPEG1VIDEOINFO;
#define MAX_SIZE_MPEG1_SEQUENCE_INFO 140
#define MPEG1_SEQUENCE_INFO(pv) ((const BYTE *)(pv)->bSequenceHeader)
typedef struct tagAnalogVideoInfo {
RECT rcSource;
RECT rcTarget;
DWORD dwActiveWidth;
DWORD dwActiveHeight;
REFERENCE_TIME AvgTimePerFrame;
} ANALOGVIDEOINFO;
typedef enum __WIDL_amvideo_generated_name_00000001 {
AM_PROPERTY_FRAMESTEP_STEP = 0x1,
AM_PROPERTY_FRAMESTEP_CANCEL = 0x2,
AM_PROPERTY_FRAMESTEP_CANSTEP = 0x3,
AM_PROPERTY_FRAMESTEP_CANSTEPMULTIPLE = 0x4
} AM_PROPERTY_FRAMESTEP;
typedef struct _AM_FRAMESTEP_STEP {
DWORD dwFramesToStep;
} AM_FRAMESTEP_STEP;
/* Begin additional prototypes for all interfaces */
ULONG __RPC_USER HWND_UserSize (ULONG *, ULONG, HWND *);
unsigned char * __RPC_USER HWND_UserMarshal (ULONG *, unsigned char *, HWND *);
unsigned char * __RPC_USER HWND_UserUnmarshal(ULONG *, unsigned char *, HWND *);
void __RPC_USER HWND_UserFree (ULONG *, HWND *);
ULONG __RPC_USER BSTR_UserSize (ULONG *, ULONG, BSTR *);
unsigned char * __RPC_USER BSTR_UserMarshal (ULONG *, unsigned char *, BSTR *);
unsigned char * __RPC_USER BSTR_UserUnmarshal(ULONG *, unsigned char *, BSTR *);
void __RPC_USER BSTR_UserFree (ULONG *, BSTR *);
/* End additional prototypes */
#ifdef __cplusplus
}
#endif
#endif /* __WIDL_AMVIDEO_H */
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
* Copyright (C) 2002 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __DSHOW_INCLUDED__
#define __DSHOW_INCLUDED__
#define AM_NOVTABLE
#ifndef __WINESRC__
# include <windows.h>
# include <windowsx.h>
#else
# include <windef.h>
# include <wingdi.h>
# include <objbase.h>
#endif
#include <olectl.h>
#include <dshow/ddraw.h>
#include <mmsystem.h>
/* FIXME: #include <strsafe.h>*/
#ifndef NUMELMS
#define NUMELMS(array) (sizeof(array)/sizeof((array)[0]))
#endif
#include <dshow/strmif.h>
#include <dshow/amvideo.h>
#ifdef DSHOW_USE_AMAUDIO
/* FIXME: #include <amaudio.h>*/
#endif
#include <dshow/control.h>
#include <evcode.h>
#include <dshow/uuids.h>
#include <errors.h>
/* FIXME: #include <edevdefs.h> */
#include <audevcod.h>
/* FIXME: #include <dvdevcod.h> */
#ifndef OATRUE
#define OATRUE (-1)
#endif
#ifndef OAFALSE
#define OAFALSE (0)
#endif
#endif /* __DSHOW_INCLUDED__ */
#include <dshow/_mingw_unicode.h>
#undef INTERFACE
/*
* Copyright (C) the Wine project
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __DSOUND_INCLUDED__
#define __DSOUND_INCLUDED__
#ifndef DIRECTSOUND_VERSION
#define DIRECTSOUND_VERSION 0x0900
#endif
#define COM_NO_WINDOWS_H
#include <objbase.h>
#include <float.h>
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */
#ifndef DX_SHARED_DEFINES
typedef float D3DVALUE, *LPD3DVALUE;
#ifndef D3DCOLOR_DEFINED
typedef DWORD D3DCOLOR, *LPD3DCOLOR;
#define D3DCOLOR_DEFINED
#endif
#ifndef D3DVECTOR_DEFINED
typedef struct _D3DVECTOR {
float x;
float y;
float z;
} D3DVECTOR;
#define D3DVECTOR_DEFINED
#endif
#ifndef LPD3DVECTOR_DEFINED
typedef D3DVECTOR *LPD3DVECTOR;
#define LPD3DVECTOR_DEFINED
#endif
#define DX_SHARED_DEFINES
#endif /* DX_SHARED_DEFINES */
/*****************************************************************************
* Predeclare the interfaces
*/
DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
DEFINE_GUID(CLSID_DirectSound8, 0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b);
DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x08, 0x00, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
DEFINE_GUID(CLSID_DirectSoundCapture8, 0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1);
DEFINE_GUID(CLSID_DirectSoundFullDuplex,0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d);
DEFINE_GUID(IID_IDirectSound, 0x279AFA83,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
typedef struct IDirectSound *LPDIRECTSOUND,**LPLPDIRECTSOUND;
DEFINE_GUID(IID_IDirectSound8, 0xC50A7E93,0xF395,0x4834,0x9E,0xF6,0x7F,0xA9,0x9D,0xE5,0x09,0x66);
typedef struct IDirectSound8 *LPDIRECTSOUND8,**LPLPDIRECTSOUND8;
DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER,**LPLPDIRECTSOUNDBUFFER;
DEFINE_GUID(IID_IDirectSoundBuffer8, 0x6825A449,0x7524,0x4D82,0x92,0x0F,0x50,0xE3,0x6A,0xB3,0xAB,0x1E);
typedef struct IDirectSoundBuffer8 *LPDIRECTSOUNDBUFFER8,**LPLPDIRECTSOUNDBUFFER8;
DEFINE_GUID(IID_IDirectSoundNotify, 0xB0210783,0x89cd,0x11d0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY,**LPLPDIRECTSOUNDNOTIFY;
#define IID_IDirectSoundNotify8 IID_IDirectSoundNotify
DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER,**LPLPDIRECTSOUND3DLISTENER;
DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86,0x4981,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60);
typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER,**LPLPDIRECTSOUND3DBUFFER;
DEFINE_GUID(IID_IDirectSoundCapture, 0xB0210781,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE,**LPLPDIRECTSOUNDCAPTURE;
#define IID_IDirectSoundCapture8 IID_IDirectSoundCapture
typedef struct IDirectSoundCapture IDirectSoundCapture8,*LPDIRECTSOUNDCAPTURE8,**LPLPDIRECTSOUNDCAPTURE8;
DEFINE_GUID(IID_IDirectSoundCaptureBuffer,0xB0210782,0x89CD,0x11D0,0xAF,0x08,0x00,0xA0,0xC9,0x25,0xCD,0x16);
typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER,**LPLPDIRECTSOUNDCAPTUREBUFFER;
DEFINE_GUID(IID_IDirectSoundCaptureBuffer8,0x00990DF4,0x0DBB,0x4872,0x83,0x3E,0x6D,0x30,0x3E,0x80,0xAE,0xB6);
typedef struct IDirectSoundCaptureBuffer8 *LPDIRECTSOUNDCAPTUREBUFFER8,**LPLPDIRECTSOUNDCAPTUREBUFFER8;
DEFINE_GUID(IID_IDirectSoundFullDuplex, 0xEDCB4C7A,0xDAAB,0x4216,0xA4,0x2E,0x6C,0x50,0x59,0x6D,0xDC,0x1D);
typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX,**LPLPDIRECTSOUNDFULLDUPLEX;
#define IID_IDirectSoundFullDuplex8 IID_IDirectSoundFullDuplex
DEFINE_GUID(DSDEVID_DefaultPlayback, 0xDEF00000,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
DEFINE_GUID(DSDEVID_DefaultCapture, 0xDEF00001,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
DEFINE_GUID(DSDEVID_DefaultVoicePlayback,0xDEF00002,0x9C6D,0x47Ed,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xDEF00003,0x9C6D,0x47ED,0xAA,0xF1,0x4D,0xDA,0x8F,0x2B,0x5C,0x03);
DEFINE_GUID(DSDEVID_WinePlayback, 0x40316A1D,0x605B,0xD611,0x87,0xC6,0x00,0x80,0xAD,0x00,0x02,0xFE);
#define _FACDS 0x878
#define MAKE_DSHRESULT(code) MAKE_HRESULT(1,_FACDS,code)
#define DS_OK 0
#define DS_NO_VIRTUALIZATION MAKE_HRESULT(0, _FACDS, 10)
#define DS_INCOMPLETE MAKE_HRESULT(0, _FACDS, 20)
#define DSERR_ALLOCATED MAKE_DSHRESULT(10)
#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30)
#define DSERR_INVALIDPARAM E_INVALIDARG
#define DSERR_INVALIDCALL MAKE_DSHRESULT(50)
#define DSERR_GENERIC E_FAIL
#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70)
#define DSERR_OUTOFMEMORY E_OUTOFMEMORY
#define DSERR_BADFORMAT MAKE_DSHRESULT(100)
#define DSERR_UNSUPPORTED E_NOTIMPL
#define DSERR_NODRIVER MAKE_DSHRESULT(120)
#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130)
#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION
#define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160)
#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170)
#define DSERR_NOINTERFACE E_NOINTERFACE
#define DSERR_ACCESSDENIED E_ACCESSDENIED
#define DSERR_BUFFERTOOSMALL MAKE_DSHRESULT(180)
#define DSERR_DS8_REQUIRED MAKE_DSHRESULT(190)
#define DSERR_SENDLOOP MAKE_DSHRESULT(200)
#define DSERR_BADSENDBUFFERGUID MAKE_DSHRESULT(210)
#define DSERR_FXUNAVAILABLE MAKE_DSHRESULT(220)
#define DSERR_OBJECTNOTFOUND MAKE_DSHRESULT(4449)
#define DSCAPS_PRIMARYMONO 0x00000001
#define DSCAPS_PRIMARYSTEREO 0x00000002
#define DSCAPS_PRIMARY8BIT 0x00000004
#define DSCAPS_PRIMARY16BIT 0x00000008
#define DSCAPS_CONTINUOUSRATE 0x00000010
#define DSCAPS_EMULDRIVER 0x00000020
#define DSCAPS_CERTIFIED 0x00000040
#define DSCAPS_SECONDARYMONO 0x00000100
#define DSCAPS_SECONDARYSTEREO 0x00000200
#define DSCAPS_SECONDARY8BIT 0x00000400
#define DSCAPS_SECONDARY16BIT 0x00000800
#define DSSCL_NORMAL 1
#define DSSCL_PRIORITY 2
#define DSSCL_EXCLUSIVE 3
#define DSSCL_WRITEPRIMARY 4
typedef struct _DSCAPS
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwMinSecondarySampleRate;
DWORD dwMaxSecondarySampleRate;
DWORD dwPrimaryBuffers;
DWORD dwMaxHwMixingAllBuffers;
DWORD dwMaxHwMixingStaticBuffers;
DWORD dwMaxHwMixingStreamingBuffers;
DWORD dwFreeHwMixingAllBuffers;
DWORD dwFreeHwMixingStaticBuffers;
DWORD dwFreeHwMixingStreamingBuffers;
DWORD dwMaxHw3DAllBuffers;
DWORD dwMaxHw3DStaticBuffers;
DWORD dwMaxHw3DStreamingBuffers;
DWORD dwFreeHw3DAllBuffers;
DWORD dwFreeHw3DStaticBuffers;
DWORD dwFreeHw3DStreamingBuffers;
DWORD dwTotalHwMemBytes;
DWORD dwFreeHwMemBytes;
DWORD dwMaxContigFreeHwMemBytes;
DWORD dwUnlockTransferRateHwBuffers;
DWORD dwPlayCpuOverheadSwBuffers;
DWORD dwReserved1;
DWORD dwReserved2;
} DSCAPS,*LPDSCAPS;
typedef const DSCAPS *LPCDSCAPS;
#define DSBPLAY_LOOPING 0x00000001
#define DSBPLAY_LOCHARDWARE 0x00000002
#define DSBPLAY_LOCSOFTWARE 0x00000004
#define DSBPLAY_TERMINATEBY_TIME 0x00000008
#define DSBPLAY_TERMINATEBY_DISTANCE 0x000000010
#define DSBPLAY_TERMINATEBY_PRIORITY 0x000000020
#define DSBSTATUS_PLAYING 0x00000001
#define DSBSTATUS_BUFFERLOST 0x00000002
#define DSBSTATUS_LOOPING 0x00000004
#define DSBSTATUS_LOCHARDWARE 0x00000008
#define DSBSTATUS_LOCSOFTWARE 0x00000010
#define DSBSTATUS_TERMINATED 0x00000020
#define DSBLOCK_FROMWRITECURSOR 0x00000001
#define DSBLOCK_ENTIREBUFFER 0x00000002
#define DSBCAPS_PRIMARYBUFFER 0x00000001
#define DSBCAPS_STATIC 0x00000002
#define DSBCAPS_LOCHARDWARE 0x00000004
#define DSBCAPS_LOCSOFTWARE 0x00000008
#define DSBCAPS_CTRL3D 0x00000010
#define DSBCAPS_CTRLFREQUENCY 0x00000020
#define DSBCAPS_CTRLPAN 0x00000040
#define DSBCAPS_CTRLVOLUME 0x00000080
#define DSBCAPS_CTRLDEFAULT 0x000000E0 /* Pan + volume + frequency. */
#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100
#define DSBCAPS_CTRLFX 0x00000200
#define DSBCAPS_CTRLALL 0x000001F0 /* All control capabilities */
#define DSBCAPS_STICKYFOCUS 0x00004000
#define DSBCAPS_GLOBALFOCUS 0x00008000
#define DSBCAPS_GETCURRENTPOSITION2 0x00010000 /* More accurate play cursor under emulation*/
#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
#define DSBCAPS_LOCDEFER 0x00040000
#define DSBSIZE_MIN 4
#define DSBSIZE_MAX 0xFFFFFFF
#define DSBPAN_LEFT -10000
#define DSBPAN_CENTER 0
#define DSBPAN_RIGHT 10000
#define DSBVOLUME_MAX 0
#define DSBVOLUME_MIN -10000
#define DSBFREQUENCY_MIN 100
#define DSBFREQUENCY_MAX 200000
#define DSBFREQUENCY_ORIGINAL 0
#define DSBNOTIFICATIONS_MAX 100000U
typedef struct _DSBCAPS
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwBufferBytes;
DWORD dwUnlockTransferRate;
DWORD dwPlayCpuOverhead;
} DSBCAPS,*LPDSBCAPS;
typedef const DSBCAPS *LPCDSBCAPS;
#define DSSCL_NORMAL 1
#define DSSCL_PRIORITY 2
#define DSSCL_EXCLUSIVE 3
#define DSSCL_WRITEPRIMARY 4
typedef struct _DSEFFECTDESC
{
DWORD dwSize;
DWORD dwFlags;
GUID guidDSFXClass;
DWORD_PTR dwReserved1;
DWORD_PTR dwReserved2;
} DSEFFECTDESC,*LPDSEFFECTDESC;
typedef const DSEFFECTDESC *LPCDSEFFECTDESC;
#define DSFX_LOCHARDWARE 0x00000001
#define DSFX_LOCSOFTWARE 0x00000002
enum
{
DSFXR_PRESENT,
DSFXR_LOCHARDWARE,
DSFXR_LOCSOFTWARE,
DSFXR_UNALLOCATED,
DSFXR_FAILED,
DSFXR_UNKNOWN,
DSFXR_SENDLOOP
};
typedef struct _DSBUFFERDESC1
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwBufferBytes;
DWORD dwReserved;
LPWAVEFORMATEX lpwfxFormat;
} DSBUFFERDESC1,*LPDSBUFFERDESC1;
typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1;
typedef struct _DSBUFFERDESC
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwBufferBytes;
DWORD dwReserved;
LPWAVEFORMATEX lpwfxFormat;
GUID guid3DAlgorithm;
} DSBUFFERDESC,*LPDSBUFFERDESC;
typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
typedef struct _DSBPOSITIONNOTIFY
{
DWORD dwOffset;
HANDLE hEventNotify;
} DSBPOSITIONNOTIFY,*LPDSBPOSITIONNOTIFY;
typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
#define DSSPEAKER_HEADPHONE 1
#define DSSPEAKER_MONO 2
#define DSSPEAKER_QUAD 3
#define DSSPEAKER_STEREO 4
#define DSSPEAKER_SURROUND 5
#define DSSPEAKER_5POINT1 6
#define DSSPEAKER_7POINT1 7
#define DSSPEAKER_GEOMETRY_MIN 0x00000005 /* 5 degrees */
#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A /* 10 degrees */
#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 /* 20 degrees */
#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 /* 180 degrees */
#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
#define DSSPEAKER_CONFIG(a) ((BYTE)(a))
#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
#define DS_CERTIFIED 0x00000000
#define DS_UNCERTIFIED 0x00000001
typedef struct _DSCEFFECTDESC
{
DWORD dwSize;
DWORD dwFlags;
GUID guidDSCFXClass;
GUID guidDSCFXInstance;
DWORD dwReserved1;
DWORD dwReserved2;
} DSCEFFECTDESC, *LPDSCEFFECTDESC;
typedef const DSCEFFECTDESC *LPCDSCEFFECTDESC;
#define DSCFX_LOCHARDWARE 0x00000001
#define DSCFX_LOCSOFTWARE 0x00000002
#define DSCFXR_LOCHARDWARE 0x00000010
#define DSCFXR_LOCSOFTWARE 0x00000020
typedef struct _DSCBUFFERDESC1
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwBufferBytes;
DWORD dwReserved;
LPWAVEFORMATEX lpwfxFormat;
} DSCBUFFERDESC1, *LPDSCBUFFERDESC1;
typedef struct _DSCBUFFERDESC
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwBufferBytes;
DWORD dwReserved;
LPWAVEFORMATEX lpwfxFormat;
DWORD dwFXCount;
LPDSCEFFECTDESC lpDSCFXDesc;
} DSCBUFFERDESC, *LPDSCBUFFERDESC;
typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
typedef struct _DSCCAPS
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwFormats;
DWORD dwChannels;
} DSCCAPS, *LPDSCCAPS;
typedef const DSCCAPS *LPCDSCCAPS;
typedef struct _DSCBCAPS
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwBufferBytes;
DWORD dwReserved;
} DSCBCAPS, *LPDSCBCAPS;
typedef const DSCBCAPS *LPCDSCBCAPS;
#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER
#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED
#define DSCCAPS_MULTIPLECAPTURE 0x00000001
#define DSCBCAPS_WAVEMAPPED 0x80000000
#define DSCBCAPS_CTRLFX 0x00000200
#define DSCBLOCK_ENTIREBUFFER 0x00000001
#define DSCBSTART_LOOPING 0x00000001
#define DSCBPN_OFFSET_STOP 0xffffffff
#define DSCBSTATUS_CAPTURING 0x00000001
#define DSCBSTATUS_LOOPING 0x00000002
#ifndef __LPCGUID_DEFINED__
#define __LPCGUID_DEFINED__
typedef const GUID *LPCGUID;
#endif
typedef WINBOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID,LPCWSTR,LPCWSTR,LPVOID);
typedef WINBOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID,LPCSTR,LPCSTR,LPVOID);
__MINGW_TYPEDEF_AW(LPDSENUMCALLBACK)
extern HRESULT WINAPI DirectSoundCreate(LPCGUID lpGUID,LPDIRECTSOUND *ppDS,LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
#define DirectSoundEnumerate __MINGW_NAME_AW(DirectSoundEnumerate)
extern HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID lpGUID, LPDIRECTSOUNDCAPTURE *ppDSC, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
#define DirectSoundCaptureEnumerate __MINGW_NAME_AW(DirectSoundCaptureEnumerate)
extern HRESULT WINAPI DirectSoundCreate8(LPCGUID lpGUID,LPDIRECTSOUND8 *ppDS8,LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DirectSoundCaptureCreate8(LPCGUID lpGUID, LPDIRECTSOUNDCAPTURE8 *ppDSC8, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DirectSoundFullDuplexCreate(LPCGUID pcGuidCaptureDevice, LPCGUID pcGuidRenderDevice,
LPCDSCBUFFERDESC pcDSCBufferDesc, LPCDSBUFFERDESC pcDSBufferDesc, HWND hWnd, DWORD dwLevel,
LPDIRECTSOUNDFULLDUPLEX *ppDSFD, LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8, LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, LPUNKNOWN pUnkOuter);
#define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate
extern HRESULT WINAPI GetDeviceID(LPCGUID lpGuidSrc, LPGUID lpGuidDest);
/*****************************************************************************
* IDirectSound interface
*/
#define INTERFACE IDirectSound
DECLARE_INTERFACE_(IDirectSound,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectSound methods ***/
STDMETHOD(CreateSoundBuffer)(THIS_ LPCDSBUFFERDESC lpcDSBufferDesc, LPLPDIRECTSOUNDBUFFER lplpDirectSoundBuffer, IUnknown *pUnkOuter) PURE;
STDMETHOD(GetCaps)(THIS_ LPDSCAPS lpDSCaps) PURE;
STDMETHOD(DuplicateSoundBuffer)(THIS_ LPDIRECTSOUNDBUFFER lpDsbOriginal, LPLPDIRECTSOUNDBUFFER lplpDsbDuplicate) PURE;
STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwLevel) PURE;
STDMETHOD(Compact)(THIS) PURE;
STDMETHOD(GetSpeakerConfig)(THIS_ LPDWORD lpdwSpeakerConfig) PURE;
STDMETHOD(SetSpeakerConfig)(THIS_ DWORD dwSpeakerConfig) PURE;
STDMETHOD(Initialize)(THIS_ LPCGUID lpcGuid) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirectSound_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSound_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSound_Release(p) (p)->lpVtbl->Release(p)
/*** IDirectSound methods ***/
#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p)
#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a)
#define IDirectSound_SetSpeakerConfig(p,a) (p)->lpVtbl->SetSpeakerConfig(p,a)
#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
#else
/*** IUnknown methods ***/
#define IDirectSound_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSound_AddRef(p) (p)->AddRef()
#define IDirectSound_Release(p) (p)->Release()
/*** IDirectSound methods ***/
#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c)
#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
#define IDirectSound_Compact(p) (p)->Compact()
#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a)
#define IDirectSound_SetSpeakerConfig(p,a) (p)->SetSpeakerConfig(a)
#define IDirectSound_Initialize(p,a) (p)->Initialize(a)
#endif
/*****************************************************************************
* IDirectSound8 interface
*/
#define INTERFACE IDirectSound8
DECLARE_INTERFACE_(IDirectSound8,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectSound8 methods ***/
STDMETHOD(CreateSoundBuffer)(THIS_ LPCDSBUFFERDESC lpcDSBufferDesc, LPLPDIRECTSOUNDBUFFER lplpDirectSoundBuffer, IUnknown *pUnkOuter) PURE;
STDMETHOD(GetCaps)(THIS_ LPDSCAPS lpDSCaps) PURE;
STDMETHOD(DuplicateSoundBuffer)(THIS_ LPDIRECTSOUNDBUFFER lpDsbOriginal, LPLPDIRECTSOUNDBUFFER lplpDsbDuplicate) PURE;
STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwLevel) PURE;
STDMETHOD(Compact)(THIS) PURE;
STDMETHOD(GetSpeakerConfig)(THIS_ LPDWORD lpdwSpeakerConfig) PURE;
STDMETHOD(SetSpeakerConfig)(THIS_ DWORD dwSpeakerConfig) PURE;
STDMETHOD(Initialize)(THIS_ LPCGUID lpcGuid) PURE;
STDMETHOD(VerifyCertification)(THIS_ LPDWORD pdwCertified) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirectSound8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSound8_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSound8_Release(p) (p)->lpVtbl->Release(p)
/*** IDirectSound methods ***/
#define IDirectSound8_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
#define IDirectSound8_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectSound8_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
#define IDirectSound8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
#define IDirectSound8_Compact(p) (p)->lpVtbl->Compact(p)
#define IDirectSound8_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a)
#define IDirectSound8_SetSpeakerConfig(p,a) (p)->lpVtbl->SetSpeakerConfig(p,a)
#define IDirectSound8_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
/*** IDirectSound8 methods ***/
#define IDirectSound8_VerifyCertification(p,a) (p)->lpVtbl->VerifyCertification(p,a)
#else
/*** IUnknown methods ***/
#define IDirectSound8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSound8_AddRef(p) (p)->AddRef()
#define IDirectSound8_Release(p) (p)->Release()
/*** IDirectSound methods ***/
#define IDirectSound8_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c)
#define IDirectSound8_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectSound8_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
#define IDirectSound8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
#define IDirectSound8_Compact(p) (p)->Compact()
#define IDirectSound8_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a)
#define IDirectSound8_SetSpeakerConfig(p,a) (p)->SetSpeakerConfig(a)
#define IDirectSound8_Initialize(p,a) (p)->Initialize(a)
/*** IDirectSound8 methods ***/
#define IDirectSound8_VerifyCertification(p,a) (p)->VerifyCertification(a)
#endif
/*****************************************************************************
* IDirectSoundBuffer interface
*/
#define INTERFACE IDirectSoundBuffer
DECLARE_INTERFACE_(IDirectSoundBuffer,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectSoundBuffer methods ***/
STDMETHOD(GetCaps)(THIS_ LPDSBCAPS lpDSBufferCaps) PURE;
STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor) PURE;
STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
STDMETHOD(GetVolume)(THIS_ LPLONG lplVolume) PURE;
STDMETHOD(GetPan)(THIS_ LPLONG lplpan) PURE;
STDMETHOD(GetFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
STDMETHOD(Initialize)(THIS_ LPDIRECTSOUND lpDirectSound, LPCDSBUFFERDESC lpcDSBufferDesc) PURE;
STDMETHOD(Lock)(THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
STDMETHOD(Play)(THIS_ DWORD dwReserved1, DWORD dwReserved2, DWORD dwFlags) PURE;
STDMETHOD(SetCurrentPosition)(THIS_ DWORD dwNewPosition) PURE;
STDMETHOD(SetFormat)(THIS_ LPCWAVEFORMATEX lpcfxFormat) PURE;
STDMETHOD(SetVolume)(THIS_ LONG lVolume) PURE;
STDMETHOD(SetPan)(THIS_ LONG lPan) PURE;
STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE;
STDMETHOD(Stop)(THIS) PURE;
STDMETHOD(Unlock)(THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioPtr2) PURE;
STDMETHOD(Restore)(THIS) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSoundBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSoundBuffer_Release(p) (p)->lpVtbl->Release(p)
/*** IDirectSoundBuffer methods ***/
#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a)
#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a)
#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a)
#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a)
#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a)
#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a)
#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p)
#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p)
#else
/*** IUnknown methods ***/
#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSoundBuffer_AddRef(p) (p)->AddRef()
#define IDirectSoundBuffer_Release(p) (p)->Release()
/*** IDirectSoundBuffer methods ***/
#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a)
#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a)
#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a)
#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a)
#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c)
#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a)
#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a)
#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a)
#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a)
#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a)
#define IDirectSoundBuffer_Stop(p) (p)->Stop()
#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
#define IDirectSoundBuffer_Restore(p) (p)->Restore()
#endif
/*****************************************************************************
* IDirectSoundBuffer8 interface
*/
#define INTERFACE IDirectSoundBuffer8
DECLARE_INTERFACE_(IDirectSoundBuffer8,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectSoundBuffer8 methods ***/
STDMETHOD(GetCaps)(THIS_ LPDSBCAPS lpDSBufferCaps) PURE;
STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCurrentPlayCursor, LPDWORD lpdwCurrentWriteCursor) PURE;
STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
STDMETHOD(GetVolume)(THIS_ LPLONG lplVolume) PURE;
STDMETHOD(GetPan)(THIS_ LPLONG lplpan) PURE;
STDMETHOD(GetFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
STDMETHOD(Initialize)(THIS_ LPDIRECTSOUND lpDirectSound, LPCDSBUFFERDESC lpcDSBufferDesc) PURE;
STDMETHOD(Lock)(THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
STDMETHOD(Play)(THIS_ DWORD dwReserved1, DWORD dwReserved2, DWORD dwFlags) PURE;
STDMETHOD(SetCurrentPosition)(THIS_ DWORD dwNewPosition) PURE;
STDMETHOD(SetFormat)(THIS_ LPCWAVEFORMATEX lpcfxFormat) PURE;
STDMETHOD(SetVolume)(THIS_ LONG lVolume) PURE;
STDMETHOD(SetPan)(THIS_ LONG lPan) PURE;
STDMETHOD(SetFrequency)(THIS_ DWORD dwFrequency) PURE;
STDMETHOD(Stop)(THIS) PURE;
STDMETHOD(Unlock)(THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioPtr2) PURE;
STDMETHOD(Restore)(THIS) PURE;
STDMETHOD(SetFX)(THIS_ DWORD dwEffectsCount, LPDSEFFECTDESC pDSFXDesc, LPDWORD pdwResultCodes) PURE;
STDMETHOD(AcquireResources)(THIS_ DWORD dwFlags, DWORD dwEffectsCount, LPDWORD pdwResultCodes) PURE;
STDMETHOD(GetObjectInPath)(THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirectSoundBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSoundBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSoundBuffer8_Release(p) (p)->lpVtbl->Release(p)
/*** IDirectSoundBuffer methods ***/
#define IDirectSoundBuffer8_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectSoundBuffer8_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
#define IDirectSoundBuffer8_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
#define IDirectSoundBuffer8_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a)
#define IDirectSoundBuffer8_GetPan(p,a) (p)->lpVtbl->GetPan(p,a)
#define IDirectSoundBuffer8_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a)
#define IDirectSoundBuffer8_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
#define IDirectSoundBuffer8_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
#define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
#define IDirectSoundBuffer8_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
#define IDirectSoundBuffer8_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a)
#define IDirectSoundBuffer8_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
#define IDirectSoundBuffer8_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a)
#define IDirectSoundBuffer8_SetPan(p,a) (p)->lpVtbl->SetPan(p,a)
#define IDirectSoundBuffer8_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
#define IDirectSoundBuffer8_Stop(p) (p)->lpVtbl->Stop(p)
#define IDirectSoundBuffer8_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
#define IDirectSoundBuffer8_Restore(p) (p)->lpVtbl->Restore(p)
/*** IDirectSoundBuffer8 methods ***/
#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->lpVtbl->SetFX(p,a,b,c)
#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->lpVtbl->AcquireResources(p,a,b,c)
#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
#else
/*** IUnknown methods ***/
#define IDirectSoundBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSoundBuffer8_AddRef(p) (p)->AddRef()
#define IDirectSoundBuffer8_Release(p) (p)->Release()
/*** IDirectSoundBuffer methods ***/
#define IDirectSoundBuffer8_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectSoundBuffer8_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
#define IDirectSoundBuffer8_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
#define IDirectSoundBuffer8_GetVolume(p,a) (p)->GetVolume(a)
#define IDirectSoundBuffer8_GetPan(p,a) (p)->GetPan(a)
#define IDirectSoundBuffer8_GetFrequency(p,a) (p)->GetFrequency(a)
#define IDirectSoundBuffer8_GetStatus(p,a) (p)->GetStatus(a)
#define IDirectSoundBuffer8_Initialize(p,a,b) (p)->Initialize(a,b)
#define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
#define IDirectSoundBuffer8_Play(p,a,b,c) (p)->Play(a,b,c)
#define IDirectSoundBuffer8_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a)
#define IDirectSoundBuffer8_SetFormat(p,a) (p)->SetFormat(a)
#define IDirectSoundBuffer8_SetVolume(p,a) (p)->SetVolume(a)
#define IDirectSoundBuffer8_SetPan(p,a) (p)->SetPan(a)
#define IDirectSoundBuffer8_SetFrequency(p,a) (p)->SetFrequency(a)
#define IDirectSoundBuffer8_Stop(p) (p)->Stop()
#define IDirectSoundBuffer8_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
#define IDirectSoundBuffer8_Restore(p) (p)->Restore()
/*** IDirectSoundBuffer8 methods ***/
#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->SetFX(a,b,c)
#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->AcquireResources(a,b,c)
#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d)
#endif
/*****************************************************************************
* IDirectSoundCapture interface
*/
#define INTERFACE IDirectSoundCapture
DECLARE_INTERFACE_(IDirectSoundCapture,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectSoundCapture methods ***/
STDMETHOD(CreateCaptureBuffer)(THIS_ LPCDSCBUFFERDESC lpcDSCBufferDesc,LPDIRECTSOUNDCAPTUREBUFFER *lplpDSCaptureBuffer, LPUNKNOWN pUnk) PURE;
STDMETHOD(GetCaps)(THIS_ LPDSCCAPS lpDSCCaps) PURE;
STDMETHOD(Initialize)(THIS_ LPCGUID lpcGUID) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSoundCapture_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSoundCapture_Release(p) (p)->lpVtbl->Release(p)
/*** IDirectSoundCapture methods ***/
#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
#else
/*** IUnknown methods ***/
#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSoundCapture_AddRef(p) (p)->AddRef()
#define IDirectSoundCapture_Release(p) (p)->Release()
/*** IDirectSoundCapture methods ***/
#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c)
#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a)
#endif
/*****************************************************************************
* IDirectSoundCaptureBuffer interface
*/
#define INTERFACE IDirectSoundCaptureBuffer
DECLARE_INTERFACE_(IDirectSoundCaptureBuffer,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectSoundCaptureBuffer methods ***/
STDMETHOD(GetCaps)(THIS_ LPDSCBCAPS lpDSCBCaps) PURE;
STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCapturePosition,LPDWORD lpdwReadPosition) PURE;
STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
STDMETHOD(Initialize)(THIS_ LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc) PURE;
STDMETHOD(Lock)(THIS_ DWORD dwReadCusor, DWORD dwReadBytes, LPVOID *lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID *lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE;
STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE;
STDMETHOD(Stop)(THIS) PURE;
STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSoundCaptureBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSoundCaptureBuffer_Release(p) (p)->lpVtbl->Release(p)
/*** IDirectSoundCaptureBuffer methods ***/
#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a)
#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p)
#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
#else
/*** IUnknown methods ***/
#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSoundCaptureBuffer_AddRef(p) (p)->AddRef()
#define IDirectSoundCaptureBuffer_Release(p) (p)->Release()
/*** IDirectSoundCaptureBuffer methods ***/
#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a)
#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a)
#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop()
#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
#endif
/*****************************************************************************
* IDirectSoundCaptureBuffer8 interface
*/
#define INTERFACE IDirectSoundCaptureBuffer8
DECLARE_INTERFACE_(IDirectSoundCaptureBuffer8,IDirectSoundCaptureBuffer)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectSoundCaptureBuffer methods ***/
STDMETHOD(GetCaps)(THIS_ LPDSCBCAPS lpDSCBCaps) PURE;
STDMETHOD(GetCurrentPosition)(THIS_ LPDWORD lpdwCapturePosition,LPDWORD lpdwReadPosition) PURE;
STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX lpwfxFormat, DWORD dwSizeAllocated, LPDWORD lpdwSizeWritten) PURE;
STDMETHOD(GetStatus)(THIS_ LPDWORD lpdwStatus) PURE;
STDMETHOD(Initialize)(THIS_ LPDIRECTSOUNDCAPTURE lpDSC, LPCDSCBUFFERDESC lpcDSCBDesc) PURE;
STDMETHOD(Lock)(THIS_ DWORD dwReadCusor, DWORD dwReadBytes, LPVOID *lplpvAudioPtr1, LPDWORD lpdwAudioBytes1, LPVOID *lplpvAudioPtr2, LPDWORD lpdwAudioBytes2, DWORD dwFlags) PURE;
STDMETHOD(Start)(THIS_ DWORD dwFlags) PURE;
STDMETHOD(Stop)(THIS) PURE;
STDMETHOD(Unlock)(THIS_ LPVOID lpvAudioPtr1, DWORD dwAudioBytes1, LPVOID lpvAudioPtr2, DWORD dwAudioBytes2) PURE;
/*** IDirectSoundCaptureBuffer8 methods ***/
STDMETHOD(GetObjectInPath)(THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
STDMETHOD(GetFXStatus)(THIS_ DWORD dwFXCount, LPDWORD pdwFXStatus) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSoundCaptureBuffer8_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSoundCaptureBuffer8_Release(p) (p)->lpVtbl->Release(p)
/*** IDirectSoundCaptureBuffer methods ***/
#define IDirectSoundCaptureBuffer8_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
#define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
#define IDirectSoundCaptureBuffer8_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
#define IDirectSoundCaptureBuffer8_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
#define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
#define IDirectSoundCaptureBuffer8_Start(p,a) (p)->lpVtbl->Start(p,a)
#define IDirectSoundCaptureBuffer8_Stop(p) (p)->lpVtbl->Stop(p)
#define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
/*** IDirectSoundCaptureBuffer8 methods ***/
#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->lpVtbl->GetFXStatus(p,a,b)
#else
/*** IUnknown methods ***/
#define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSoundCaptureBuffer8_AddRef(p) (p)->AddRef()
#define IDirectSoundCaptureBuffer8_Release(p) (p)->Release()
/*** IDirectSoundCaptureBuffer methods ***/
#define IDirectSoundCaptureBuffer8_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
#define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
#define IDirectSoundCaptureBuffer8_GetStatus(p,a) (p)->GetStatus(a)
#define IDirectSoundCaptureBuffer8_Initialize(p,a,b) (p)->Initialize(a,b)
#define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
#define IDirectSoundCaptureBuffer8_Start(p,a) (p)->Start(a)
#define IDirectSoundCaptureBuffer8_Stop(p) (p)->Stop()
#define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
/*** IDirectSoundCaptureBuffer8 methods ***/
#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d)
#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->GetFXStatus(a,b)
#endif
/*****************************************************************************
* IDirectSoundNotify interface
*/
#define WINE_NOBUFFER 0x80000000
#define DSBPN_OFFSETSTOP -1
#define INTERFACE IDirectSoundNotify
DECLARE_INTERFACE_(IDirectSoundNotify,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectSoundNotify methods ***/
STDMETHOD(SetNotificationPositions)(THIS_ DWORD cPositionNotifies, LPCDSBPOSITIONNOTIFY lpcPositionNotifies) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSoundNotify_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSoundNotify_Release(p) (p)->lpVtbl->Release(p)
/*** IDirectSoundNotify methods ***/
#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
#else
/*** IUnknown methods ***/
#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSoundNotify_AddRef(p) (p)->AddRef()
#define IDirectSoundNotify_Release(p) (p)->Release()
/*** IDirectSoundNotify methods ***/
#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b)
#endif
/*****************************************************************************
* IDirectSound3DListener interface
*/
#define DS3DMODE_NORMAL 0x00000000
#define DS3DMODE_HEADRELATIVE 0x00000001
#define DS3DMODE_DISABLE 0x00000002
#define DS3D_IMMEDIATE 0x00000000
#define DS3D_DEFERRED 0x00000001
#define DS3D_MINDISTANCEFACTOR FLT_MIN
#define DS3D_MAXDISTANCEFACTOR FLT_MAX
#define DS3D_DEFAULTDISTANCEFACTOR 1.0f
#define DS3D_MINROLLOFFFACTOR 0.0f
#define DS3D_MAXROLLOFFFACTOR 10.0f
#define DS3D_DEFAULTROLLOFFFACTOR 1.0f
#define DS3D_MINDOPPLERFACTOR 0.0f
#define DS3D_MAXDOPPLERFACTOR 10.0f
#define DS3D_DEFAULTDOPPLERFACTOR 1.0f
#define DS3D_DEFAULTMINDISTANCE 1.0f
#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f
#define DS3D_MINCONEANGLE 0
#define DS3D_MAXCONEANGLE 360
#define DS3D_DEFAULTCONEANGLE 360
#define DS3D_DEFAULTCONEOUTSIDEVOLUME DSBVOLUME_MAX
typedef struct _DS3DLISTENER {
DWORD dwSize;
D3DVECTOR vPosition;
D3DVECTOR vVelocity;
D3DVECTOR vOrientFront;
D3DVECTOR vOrientTop;
D3DVALUE flDistanceFactor;
D3DVALUE flRolloffFactor;
D3DVALUE flDopplerFactor;
} DS3DLISTENER, *LPDS3DLISTENER;
typedef const DS3DLISTENER *LPCDS3DLISTENER;
#define INTERFACE IDirectSound3DListener
DECLARE_INTERFACE_(IDirectSound3DListener,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectSound3DListener methods ***/
STDMETHOD(GetAllParameters)(THIS_ LPDS3DLISTENER lpListener) PURE;
STDMETHOD(GetDistanceFactor)(THIS_ LPD3DVALUE lpflDistanceFactor) PURE;
STDMETHOD(GetDopplerFactor)(THIS_ LPD3DVALUE lpflDopplerFactor) PURE;
STDMETHOD(GetOrientation)(THIS_ LPD3DVECTOR lpvOrientFront, LPD3DVECTOR lpvOrientTop) PURE;
STDMETHOD(GetPosition)(THIS_ LPD3DVECTOR lpvPosition) PURE;
STDMETHOD(GetRolloffFactor)(THIS_ LPD3DVALUE lpflRolloffFactor) PURE;
STDMETHOD(GetVelocity)(THIS_ LPD3DVECTOR lpvVelocity) PURE;
STDMETHOD(SetAllParameters)(THIS_ LPCDS3DLISTENER lpcListener, DWORD dwApply) PURE;
STDMETHOD(SetDistanceFactor)(THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE;
STDMETHOD(SetDopplerFactor)(THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE;
STDMETHOD(SetOrientation)(THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront, D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE;
STDMETHOD(SetPosition)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
STDMETHOD(SetRolloffFactor)(THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE;
STDMETHOD(SetVelocity)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
STDMETHOD(CommitDeferredSettings)(THIS) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSound3DListener_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSound3DListener_Release(p) (p)->lpVtbl->Release(p)
/*** IDirectSound3DListener methods ***/
#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a)
#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a)
#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b)
#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a)
#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b)
#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b)
#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b)
#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p)
#else
/*** IUnknown methods ***/
#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSound3DListener_AddRef(p) (p)->AddRef()
#define IDirectSound3DListener_Release(p) (p)->Release()
/*** IDirectSound3DListener methods ***/
#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a)
#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a)
#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a)
#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b)
#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a)
#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a)
#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a)
#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b)
#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b)
#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g)
#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b)
#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings()
#endif
/*****************************************************************************
* IDirectSound3DBuffer interface
*/
typedef struct _DS3DBUFFER {
DWORD dwSize;
D3DVECTOR vPosition;
D3DVECTOR vVelocity;
DWORD dwInsideConeAngle;
DWORD dwOutsideConeAngle;
D3DVECTOR vConeOrientation;
LONG lConeOutsideVolume;
D3DVALUE flMinDistance;
D3DVALUE flMaxDistance;
DWORD dwMode;
} DS3DBUFFER, *LPDS3DBUFFER;
typedef const DS3DBUFFER *LPCDS3DBUFFER;
#define INTERFACE IDirectSound3DBuffer
DECLARE_INTERFACE_(IDirectSound3DBuffer,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectSound3DBuffer methods ***/
STDMETHOD(GetAllParameters)(THIS_ LPDS3DBUFFER lpDs3dBuffer) PURE;
STDMETHOD(GetConeAngles)(THIS_ LPDWORD lpdwInsideConeAngle, LPDWORD lpdwOutsideConeAngle) PURE;
STDMETHOD(GetConeOrientation)(THIS_ LPD3DVECTOR lpvOrientation) PURE;
STDMETHOD(GetConeOutsideVolume)(THIS_ LPLONG lplConeOutsideVolume) PURE;
STDMETHOD(GetMaxDistance)(THIS_ LPD3DVALUE lpflMaxDistance) PURE;
STDMETHOD(GetMinDistance)(THIS_ LPD3DVALUE lpflMinDistance) PURE;
STDMETHOD(GetMode)(THIS_ LPDWORD lpwdMode) PURE;
STDMETHOD(GetPosition)(THIS_ LPD3DVECTOR lpvPosition) PURE;
STDMETHOD(GetVelocity)(THIS_ LPD3DVECTOR lpvVelocity) PURE;
STDMETHOD(SetAllParameters)(THIS_ LPCDS3DBUFFER lpcDs3dBuffer, DWORD dwApply) PURE;
STDMETHOD(SetConeAngles)(THIS_ DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) PURE;
STDMETHOD(SetConeOrientation)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
STDMETHOD(SetConeOutsideVolume)(THIS_ LONG lConeOutsideVolume, DWORD dwApply) PURE;
STDMETHOD(SetMaxDistance)(THIS_ D3DVALUE flMaxDistance, DWORD dwApply) PURE;
STDMETHOD(SetMinDistance)(THIS_ D3DVALUE flMinDistance, DWORD dwApply) PURE;
STDMETHOD(SetMode)(THIS_ DWORD dwMode, DWORD dwApply) PURE;
STDMETHOD(SetPosition)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
STDMETHOD(SetVelocity)(THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSound3DBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSound3DBuffer_Release(p) (p)->lpVtbl->Release(p)
/*** IDirectSound3DBuffer methods ***/
#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b)
#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a)
#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a)
#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a)
#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a)
#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a)
#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c)
#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->lpVtbl->SetConeOutsideVolume(p,a,b)
#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b)
#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b)
#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b)
#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
#else
/*** IUnknown methods ***/
#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSound3DBuffer_AddRef(p) (p)->AddRef()
#define IDirectSound3DBuffer_Release(p) (p)->Release()
/*** IDirectSound3DBuffer methods ***/
#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a)
#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b)
#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a)
#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a)
#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a)
#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a)
#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a)
#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a)
#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a)
#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c)
#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->SetConeOutsideVolume(a,b)
#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b)
#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b)
#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b)
#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
#endif
/*****************************************************************************
* IKsPropertySet interface
*/
#ifndef _IKsPropertySet_
#define _IKsPropertySet_
typedef struct IKsPropertySet *LPKSPROPERTYSET;
DEFINE_GUID(IID_IKsPropertySet,0x31EFAC30,0x515C,0x11D0,0xA9,0xAA,0x00,0xAA,0x00,0x61,0xBE,0x93);
#define KSPROPERTY_SUPPORT_GET 1
#define KSPROPERTY_SUPPORT_SET 2
#define INTERFACE IKsPropertySet
DECLARE_INTERFACE_(IKsPropertySet,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IKsPropertySet methods ***/
STDMETHOD(Get)(THIS_ REFGUID rgid,ULONG x1,LPVOID p1,ULONG x2,LPVOID p2,ULONG x3,ULONG *px4) PURE;
STDMETHOD(Set)(THIS_ REFGUID rgid,ULONG x1,LPVOID p1,ULONG x2,LPVOID p2,ULONG x3) PURE;
STDMETHOD(QuerySupport)(THIS_ REFGUID rgid,ULONG x1,ULONG *px2) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IKsPropertySet_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IKsPropertySet_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IKsPropertySet_Release(p) (p)->lpVtbl->Release(p)
/*** IKsPropertySet methods ***/
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f)
#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c)
#else
/*** IUnknown methods ***/
#define IKsPropertySet_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IKsPropertySet_AddRef(p) (p)->AddRef()
#define IKsPropertySet_Release(p) (p)->Release()
/*** IKsPropertySet methods ***/
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g)
#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f)
#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c)
#endif
#endif /* _IKsPropertySet_ */
/*****************************************************************************
* IDirectSoundFullDuplex interface
*/
#define INTERFACE IDirectSoundFullDuplex
DECLARE_INTERFACE_(IDirectSoundFullDuplex,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectSoundFullDuplex methods ***/
STDMETHOD(Initialize)(THIS_ LPCGUID pCaptureGuid,LPCGUID pRendererGuid,LPCDSCBUFFERDESC lpDscBufferDesc,LPCDSBUFFERDESC lpDsBufferDesc,HWND hWnd,DWORD dwLevel,LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8,LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IDirectSoundFullDuplex_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSoundFullDuplex_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSoundFullDuplex_Release(p) (p)->lpVtbl->Release(p)
/*** IDirectSoundFullDuplex methods ***/
#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Initialize(p,a,b,c,d,e,f,g,h)
#else
/*** IUnknown methods ***/
#define IDirectSoundFullDuplex_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSoundFullDuplex_AddRef(p) (p)->AddRef()
#define IDirectSoundFullDuplex_Release(p) (p)->Release()
/*** IDirectSoundFullDuplex methods ***/
#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->Initialize(a,b,c,d,e,f,g,h)
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */
#endif /* __DSOUND_INCLUDED__ */
/*
* Copyright (C) 2008 Maarten Lankhorst
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __DVDMEDIA_H__
#define __DVDMEDIA_H__
#define AMCONTROL_USED 0x00000001
#define AMCONTROL_PAD_TO_4x3 0x00000002
#define AMCONTROL_PAD_TO_16x9 0x00000004
enum AM_MPEG2Level {
AM_MPEG2Level_Low = 1,
AM_MPEG2Level_Main,
AM_MPEG2Level_High1440,
AM_MPEG2Level_High
};
enum AM_MPEG2Profile {
AM_MPEG2Profile_Simple = 1,
AM_MPEG2Profile_Main,
AM_MPEG2Profile_SNRScalable,
AM_MPEG2Profile_SpatiallyScalable,
AM_MPEG2Profile_High
};
typedef enum {
AM_RATE_ChangeRate = 1,
AM_RATE_FullDataRateMax = 2,
AM_RATE_ReverseDecode = 3,
AM_RATE_DecoderPosition = 4,
AM_RATE_DecoderVersion = 5
} AM_PROPERTY_DVD_RATE_CHANGE;
typedef struct tagVIDEOINFOHEADER2 {
RECT rcSource;
RECT rcTarget;
DWORD dwBitRate;
DWORD dwBitErrorRate;
REFERENCE_TIME AvgTimePerFrame;
DWORD dwInterlaceFlags;
DWORD dwCopyProtectFlags;
DWORD dwPictAspectRatioX;
DWORD dwPictAspectRatioY;
union {
DWORD dwControlFlags;
DWORD dwReserved1;
} DUMMYUNIONNAME;
DWORD dwReserved2;
BITMAPINFOHEADER bmiHeader;
} VIDEOINFOHEADER2;
typedef struct tagMPEG2VIDEOINFO {
VIDEOINFOHEADER2 hdr;
DWORD dwStartTimeCode;
DWORD cbSequenceHeader;
DWORD dwProfile;
DWORD dwLevel;
DWORD dwFlags;
DWORD dwSequenceHeader[1];
} MPEG2VIDEOINFO;
#endif /* __DVDMEDIA_H__ */
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PACK,
0x36523B13,0x8EE5,0x11d1,0x8C,0xA3,0x00,0x60,0xB0,0x57,0x66,0x4A)
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PES,
0xe06d8020,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_WMDRM_TRANSPORT,
0x18BEC4EA,0x4676,0x450e,0xB4,0x78,0x0C,0xD8,0x4C,0x54,0xB3,0x27)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_VIDEO,
0xe06d8026,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(FORMAT_MPEG2_VIDEO,
0xe06d80e3,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(FORMAT_VIDEOINFO2,
0xf72a76A0L,0xeb0a,0x11d0,0xac,0xe4,0x0,0x0,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PROGRAM,
0xe06d8022,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT,
0xe06d8023,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_AUDIO,
0xe06d802b,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3,
0xe06d802c,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_SUBPICTURE,
0xe06d802d,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_LPCM_AUDIO,
0xe06d8032,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIATYPE_DVD_ENCRYPTED_PACK,
0xed0b916a,0x044d,0x11d1,0xaa,0x78,0x00,0xc0,0x04f,0xc3,0x1d,0x60)
OUR_GUID_ENTRY(MEDIATYPE_DVD_NAVIGATION,
0xe06d802e,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PCI,
0xe06d802f,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_DSI,
0xe06d8030,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PROVIDER,
0xe06d8031,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(FORMAT_MPEG2Video,
0xe06d80e3,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(FORMAT_DolbyAC3,
0xe06d80e4,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(FORMAT_MPEG2Audio,
0xe06d80e5,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(FORMAT_DVD_LPCMAudio,
0xe06d80e6,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(AM_KSPROPSETID_AC3,
0xBFABE720,0x6E1F,0x11D0,0xBC,0xF2,0x44,0x45,0x53,0x54,0x00,0x00)
OUR_GUID_ENTRY(AM_KSPROPSETID_DvdSubPic,
0xac390460,0x43af,0x11d0,0xbd,0x6a,0x00,0x35,0x05,0xc1,0x03,0xa9)
OUR_GUID_ENTRY(AM_KSPROPSETID_CopyProt,
0x0E8A0A40,0x6AEF,0x11D0,0x9E,0xD0,0x00,0xA0,0x24,0xCA,0x19,0xB3)
OUR_GUID_ENTRY(AM_KSPROPSETID_TSRateChange,
0xa503c5c0,0x1d1d,0x11d1,0xad,0x80,0x44,0x45,0x53,0x54,0x0,0x0)
OUR_GUID_ENTRY(AM_KSPROPSETID_MPEG4_MediaType_Attributes,
0xff6c4bfa,0x7a9,0x4c7b,0xa2,0x37,0x67,0x2f,0x9d,0x68,0x6,0x5f)
OUR_GUID_ENTRY(AM_KSCATEGORY_CAPTURE,
0x65E8773DL,0x8F56,0x11D0,0xA3,0xB9,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(AM_KSCATEGORY_RENDER,
0x65E8773EL,0x8F56,0x11D0,0xA3,0xB9,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(AM_KSCATEGORY_DATACOMPRESSOR,
0x1E84C900L,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
OUR_GUID_ENTRY(AM_KSCATEGORY_AUDIO,
0x6994AD04L,0x93EF,0x11D0,0xA3,0xCC,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(AM_KSCATEGORY_VIDEO,
0x6994AD05L,0x93EF,0x11D0,0xA3,0xCC,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(AM_KSCATEGORY_TVTUNER,
0xa799a800L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
OUR_GUID_ENTRY(AM_KSCATEGORY_CROSSBAR,
0xa799a801L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
OUR_GUID_ENTRY(AM_KSCATEGORY_TVAUDIO,
0xa799a802L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC,
0x07dad660L,0x22f1,0x11d1,0xa9,0xf4,0x00,0xc0,0x4f,0xbb,0xde,0x8f)
OUR_GUID_ENTRY(AM_KSCATEGORY_SPLITTER,
0x0A4252A0L,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
OUR_GUID_ENTRY(IID_IKsInterfaceHandler,
0xD3ABC7E0L,0x9A61,0x11D0,0xA4,0x0D,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(IID_IKsDataTypeHandler,
0x5FFBAA02L,0x49A3,0x11D0,0x9F,0x36,0x00,0xAA,0x00,0xA2,0x16,0xA1)
OUR_GUID_ENTRY(IID_IKsPin,
0xb61178d1L,0xa2d9,0x11cf,0x9e,0x53,0x00,0xaa,0x00,0xa2,0x16,0xa1)
OUR_GUID_ENTRY(IID_IKsControl,
0x28F54685L,0x06FD,0x11D2,0xB2,0x7A,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(IID_IKsPinFactory,
0xCD5EBE6BL,0x8B6E,0x11D1,0x8A,0xE0,0x00,0xA0,0xC9,0x22,0x31,0x96)
OUR_GUID_ENTRY(AM_INTERFACESETID_Standard,
0x1A8766A0L,0x62CE,0x11CF,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
#if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1)
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_SECTIONS,
0x455f176c,0x4b06,0x47ce,0x9a,0xef,0x8c,0xae,0xf7,0x3d,0xf7,0xb5)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_VERSIONED_TABLES,
0x1ed988b0,0x3ffc,0x4523,0x87,0x25,0x34,0x7b,0xee,0xc1,0xa8,0xa0)
OUR_GUID_ENTRY(MEDIASUBTYPE_ATSC_SI,
0xb3c7397c,0xd303,0x414d,0xb3,0x3c,0x4e,0xd2,0xc9,0xd2,0x97,0x33)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVB_SI,
0xe9dd31a3,0x221d,0x4adb,0x85,0x32,0x9a,0xf3,0x9,0xc1,0xa4,0x8)
OUR_GUID_ENTRY(MEDIASUBTYPE_ISDB_SI,
0xe89ad298,0x3601,0x4b06,0xaa,0xec,0x9d,0xde,0xed,0xcc,0x5b,0xd0)
OUR_GUID_ENTRY(MEDIASUBTYPE_TIF_SI,
0xec232eb2,0xcb96,0x4191,0xb2,0x26,0xe,0xa1,0x29,0xf3,0x82,0x50)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2DATA,
0xc892e55b,0x252d,0x42b5,0xa3,0x16,0xd9,0x97,0xe7,0xa5,0xd9,0x95)
#endif
/* ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) ||
(NTDDI_VERSION >= NTDDI_WS03SP1) */
#if (NTDDI_VERSION >= NTDDI_WINXP)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT_STRIDE,
0x138aa9a4,0x1ee2,0x4c5b,0x98,0x8e,0x19,0xab,0xfd,0xbc,0x8a,0x11)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_UDCR_TRANSPORT,
0x18BEC4EA,0x4676,0x450e,0xB4,0x78,0x0C,0xD8,0x4C,0x54,0xB3,0x27)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PBDA_TRANSPORT_RAW,
0x0d7aed42,0xcb9a,0x11db,0x97,0x5,0x0,0x50,0x56,0xc0,0x0,0x8)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PBDA_TRANSPORT_PROCESSED,
0xaf748dd4,0xd80,0x11db,0x97,0x5,0x0,0x50,0x56,0xc0,0x0,0x8)
OUR_GUID_ENTRY(MEDIASUBTYPE_DTS,
0xe06d8033,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(MEDIASUBTYPE_SDDS,
0xe06d8034,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
OUR_GUID_ENTRY(AM_KSPROPSETID_DVD_RateChange,
0x3577eb09,0x9582,0x477f,0xb2,0x9c,0xb0,0xc4,0x52,0xa4,0xff,0x9a)
OUR_GUID_ENTRY(AM_KSPROPSETID_DvdKaraoke,
0xae4720ae,0xaa71,0x42d8,0xb8,0x2a,0xff,0xfd,0xf5,0x8b,0x76,0xfd)
OUR_GUID_ENTRY(AM_KSPROPSETID_FrameStep,
0xc830acbd,0xab07,0x492f,0x88,0x52,0x45,0xb6,0x98,0x7c,0x29,0x79)
#endif /* NTDDI_VERSION >= NTDDI_WINXP */
#if (NTDDI_VERSION >= NTDDI_WS03SP1)
OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC_MI,
0x9c24a977,0x951,0x451a,0x80,0x6,0xe,0x49,0xbd,0x28,0xcd,0x5f)
#endif /* NTDDI_VERSION >= NTDDI_WS03SP1 */
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef OUR_GUID_ENTRY
#define OUR_GUID_ENTRY(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8);
#endif
#define MEDIATYPE_NULL GUID_NULL
#define MEDIASUBTYPE_NULL GUID_NULL
OUR_GUID_ENTRY(MEDIASUBTYPE_None,0xe436eb8e,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIATYPE_Video,0x73646976,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_Audio,0x73647561,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_Text,0x73747874,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_Midi,0x7364696D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_Stream,0xe436eb83,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIATYPE_Interleaved,0x73766169,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_File,0x656c6966,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_ScriptCommand,0x73636d64,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_AUXLine21Data,0x670aea80,0x3a82,0x11d0,0xb7,0x9b,0x0,0xaa,0x0,0x37,0x67,0xa7)
OUR_GUID_ENTRY(MEDIATYPE_VBI,0xf72a76e1,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(MEDIATYPE_Timecode,0x482dee3,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIATYPE_LMRT,0x74726c6d,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIATYPE_URL_STREAM,0x736c7275,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_CLPL,0x4C504C43,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_YUYV,0x56595559,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IYUV,0x56555949,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_YVU9,0x39555659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_Y411,0x31313459,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_Y41P,0x50313459,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_YUY2,0x32595559,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_YVYU,0x55595659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_UYVY,0x59565955,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_Y211,0x31313259,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_CLJR,0x524a4c43,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IF09,0x39304649,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_CPLA,0x414c5043,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_MJPG,0x47504A4D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_TVMJ,0x4A4D5654,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_WAKE,0x454B4157,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_CFCC,0x43434643,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IJPG,0x47504A49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_Plum,0x6D756C50,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVCS,0x53435644,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_DVSD,0x44535644,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_MDVF,0x4656444D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB1,0xe436eb78,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB4,0xe436eb79,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB8,0xe436eb7a,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB565,0xe436eb7b,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB555,0xe436eb7c,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB24,0xe436eb7d,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32,0xe436eb7e,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555,0x297c55af,0xe209,0x4cb3,0xb7,0x57,0xc7,0x6d,0x6b,0x9c,0x88,0xa8)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444,0x6e6415e6,0x5c24,0x425f,0x93,0xcd,0x80,0x10,0x2b,0x3d,0x1c,0xca)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32,0x773c9ac0,0x3274,0x11d0,0xb7,0x24,0x0,0xaa,0x0,0x6c,0x1a,0x1)
OUR_GUID_ENTRY(MEDIASUBTYPE_A2R10G10B10,0x2f8bb76d,0xb644,0x4550,0xac,0xf3,0xd3,0x0c,0xaa,0x65,0xd5,0xc5)
OUR_GUID_ENTRY(MEDIASUBTYPE_A2B10G10R10,0x576f7893,0xbdf6,0x48c4,0x87,0x5f,0xae,0x7b,0x81,0x83,0x45,0x67)
OUR_GUID_ENTRY(MEDIASUBTYPE_AYUV,0x56555941,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_AI44,0x34344941,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IA44,0x34344149,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32_D3D_DX7_RT,0x32335237,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB16_D3D_DX7_RT,0x36315237,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32_D3D_DX7_RT,0x38384137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444_D3D_DX7_RT,0x34344137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555_D3D_DX7_RT,0x35314137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32_D3D_DX9_RT,0x32335239,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB16_D3D_DX9_RT,0x36315239,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32_D3D_DX9_RT,0x38384139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444_D3D_DX9_RT,0x34344139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555_D3D_DX9_RT,0x35314139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
#define MEDIASUBTYPE_HASALPHA(mt) (((mt).subtype==MEDIASUBTYPE_ARGB4444) || ((mt).subtype==MEDIASUBTYPE_ARGB32) || ((mt).subtype==MEDIASUBTYPE_AYUV) || ((mt).subtype==MEDIASUBTYPE_AI44) || ((mt).subtype==MEDIASUBTYPE_IA44) || ((mt).subtype==MEDIASUBTYPE_ARGB1555) || ((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT))
#define MEDIASUBTYPE_HASALPHA7(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT))
#define MEDIASUBTYPE_D3D_DX7_RT(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_RGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_RGB16_D3D_DX7_RT))
#define MEDIASUBTYPE_HASALPHA9(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT))
#define MEDIASUBTYPE_D3D_DX9_RT(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_RGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_RGB16_D3D_DX9_RT))
OUR_GUID_ENTRY(MEDIASUBTYPE_YV12,0x32315659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_NV12,0x3231564E,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC1,0x31434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC2,0x32434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC3,0x33434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC4,0x34434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_S340,0x30343353,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_S342,0x32343353,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_Overlay,0xe436eb7f,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Packet,0xe436eb80,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Payload,0xe436eb81,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1AudioPayload,0x00000050,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71)
OUR_GUID_ENTRY(MEDIATYPE_MPEG1SystemStream,0xe436eb82,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1System,0xe436eb84,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1VideoCD,0xe436eb85,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Video,0xe436eb86,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Audio,0xe436eb87,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_Avi,0xe436eb88,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_Asf,0x3db80f90,0x9412,0x11d1,0xad,0xed,0x0,0x0,0xf8,0x75,0x4b,0x99)
OUR_GUID_ENTRY(MEDIASUBTYPE_QTMovie,0xe436eb89,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_QTRpza,0x617a7072,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_QTSmc,0x20636d73,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_QTRle,0x20656c72,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_QTJpeg,0x6765706a,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_PCMAudio_Obsolete,0xe436eb8a,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_PCM,0x00000001,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_WAVE,0xe436eb8b,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_AU,0xe436eb8c,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_AIFF,0xe436eb8d,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(MEDIASUBTYPE_dvsd,0x64737664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_dvhd,0x64687664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_dvsl,0x6c737664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_dv25,0x35327664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_dv50,0x30357664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_dvh1,0x31687664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_BytePair,0x6e8d4a22,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_GOPPacket,0x6e8d4a23,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_VBIRawData,0x6e8d4a24,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
OUR_GUID_ENTRY(MEDIASUBTYPE_TELETEXT,0xf72a76e3,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(MEDIASUBTYPE_WSS,0x2791D576,0x8E7A,0x466F,0x9E,0x90,0x5D,0x3F,0x30,0x83,0x73,0x8B)
OUR_GUID_ENTRY(MEDIASUBTYPE_VPS,0xa1b3f620,0x9792,0x4d8d,0x81,0xa4,0x86,0xaf,0x25,0x77,0x20,0x90)
OUR_GUID_ENTRY(MEDIASUBTYPE_DRM_Audio,0x00000009,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_IEEE_FLOAT,0x00000003,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3_SPDIF,0x00000092,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_RAW_SPORT,0x00000240,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_SPDIF_TAG_241h,0x00000241,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
OUR_GUID_ENTRY(MEDIASUBTYPE_DssVideo,0xa0af4f81,0xe163,0x11d0,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(MEDIASUBTYPE_DssAudio,0xa0af4f82,0xe163,0x11d0,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(MEDIASUBTYPE_VPVideo,0x5a9b6a40,0x1a22,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(MEDIASUBTYPE_VPVBI,0x5a9b6a41,0x1a22,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder,0xBF87B6E0,0x8C27,0x11d0,0xB3,0xF0,0x0,0xAA,0x00,0x37,0x61,0xC5)
OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder2,0xBF87B6E1,0x8C27,0x11d0,0xB3,0xF0,0x0,0xAA,0x00,0x37,0x61,0xC5)
OUR_GUID_ENTRY(CLSID_ProtoFilterGraph,0xe436ebb0,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_SystemClock,0xe436ebb1,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_FilterMapper,0xe436ebb2,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_FilterGraph,0xe436ebb3,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_FilterGraphNoThread,0xe436ebb8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_MPEG1Doc,0xe4bbd160,0x4269,0x11ce,0x83,0x8d,0x0,0xaa,0x0,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_FileSource,0x701722e0,0x8ae3,0x11ce,0xa8,0x5c,0x00,0xaa,0x00,0x2f,0xea,0xb5)
OUR_GUID_ENTRY(CLSID_MPEG1PacketPlayer,0x26c25940,0x4ca9,0x11ce,0xa8,0x28,0x0,0xaa,0x0,0x2f,0xea,0xb5)
OUR_GUID_ENTRY(CLSID_MPEG1Splitter,0x336475d0,0x942a,0x11ce,0xa8,0x70,0x00,0xaa,0x00,0x2f,0xea,0xb5)
OUR_GUID_ENTRY(CLSID_CMpegVideoCodec,0xfeb50740,0x7bef,0x11ce,0x9b,0xd9,0x0,0x0,0xe2,0x2,0x59,0x9c)
OUR_GUID_ENTRY(CLSID_CMpegAudioCodec,0x4a2286e0,0x7bef,0x11ce,0x9b,0xd9,0x0,0x0,0xe2,0x2,0x59,0x9c)
OUR_GUID_ENTRY(CLSID_TextRender,0xe30629d3,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
OUR_GUID_ENTRY(CLSID_InfTee,0xf8388a40,0xd5bb,0x11d0,0xbe,0x5a,0x0,0x80,0xc7,0x6,0x56,0x8e)
OUR_GUID_ENTRY(CLSID_AviSplitter,0x1b544c20,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
OUR_GUID_ENTRY(CLSID_AviReader,0x1b544c21,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
OUR_GUID_ENTRY(CLSID_VfwCapture,0x1b544c22,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
OUR_GUID_ENTRY(CLSID_CaptureProperties,0x1B544c22,0xFD0B,0x11ce,0x8C,0x63,0x00,0xAA,0x00,0x44,0xB5,0x1F)
OUR_GUID_ENTRY(CLSID_FGControl,0xe436ebb4,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_MOVReader,0x44584800,0xf8ee,0x11ce,0xb2,0xd4,0x00,0xdd,0x1,0x10,0x1b,0x85)
OUR_GUID_ENTRY(CLSID_QuickTimeParser,0xd51bd5a0,0x7548,0x11cf,0xa5,0x20,0x0,0x80,0xc7,0x7e,0xf5,0x8a)
OUR_GUID_ENTRY(CLSID_QTDec,0xfdfe9681,0x74a3,0x11d0,0xaf,0xa7,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_AVIDoc,0xd3588ab0,0x0781,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0xb,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_VideoRenderer,0x70e102b0,0x5556,0x11ce,0x97,0xc0,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_Colour,0x1643e180,0x90f5,0x11ce,0x97,0xd5,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_Dither,0x1da08500,0x9edc,0x11cf,0xbc,0x10,0x00,0xaa,0x00,0xac,0x74,0xf6)
OUR_GUID_ENTRY(CLSID_ModexRenderer,0x7167665,0x5011,0x11cf,0xbf,0x33,0x0,0xaa,0x0,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_AudioRender,0xe30629d1,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
OUR_GUID_ENTRY(CLSID_AudioProperties,0x05589faf,0xc356,0x11ce,0xbf,0x01,0x0,0xaa,0x0,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_DSoundRender,0x79376820,0x07D0,0x11CF,0xA2,0x4D,0x0,0x20,0xAF,0xD7,0x97,0x67)
OUR_GUID_ENTRY(CLSID_AudioRecord,0xe30629d2,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
OUR_GUID_ENTRY(CLSID_AudioInputMixerProperties,0x2ca8ca52,0x3c3f,0x11d2,0xb7,0x3d,0x0,0xc0,0x4f,0xb6,0xbd,0x3d)
OUR_GUID_ENTRY(CLSID_AVIDec,0xcf49d4e0,0x1115,0x11ce,0xb0,0x3a,0x0,0x20,0xaf,0xb,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_AVIDraw,0xa888df60,0x1e90,0x11cf,0xac,0x98,0x0,0xaa,0x0,0x4c,0xf,0xa9)
OUR_GUID_ENTRY(CLSID_ACMWrapper,0x6a08cf80,0x0e18,0x11cf,0xa2,0x4d,0x0,0x20,0xaf,0xd7,0x97,0x67)
OUR_GUID_ENTRY(CLSID_AsyncReader,0xe436ebb5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_URLReader,0xe436ebb6,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_PersistMonikerPID,0xe436ebb7,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
OUR_GUID_ENTRY(CLSID_AVICo,0xd76e2820,0x1563,0x11cf,0xac,0x98,0x0,0xaa,0x0,0x4c,0xf,0xa9)
OUR_GUID_ENTRY(CLSID_FileWriter,0x8596e5f0,0xda5,0x11d0,0xbd,0x21,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_AviDest,0xe2510970,0xf137,0x11ce,0x8b,0x67,0x0,0xaa,0x0,0xa3,0xf1,0xa6)
OUR_GUID_ENTRY(CLSID_AviMuxProptyPage,0xc647b5c0,0x157c,0x11d0,0xbd,0x23,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_AviMuxProptyPage1,0xa9ae910,0x85c0,0x11d0,0xbd,0x42,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_AVIMIDIRender,0x07b65360,0xc445,0x11ce,0xaf,0xde,0x00,0xaa,0x00,0x6c,0x14,0xf4)
OUR_GUID_ENTRY(CLSID_WMAsfReader,0x187463a0,0x5bb7,0x11d3,0xac,0xbe,0x0,0x80,0xc7,0x5e,0x24,0x6e)
OUR_GUID_ENTRY(CLSID_WMAsfWriter,0x7c23220e,0x55bb,0x11d3,0x8b,0x16,0x0,0xc0,0x4f,0xb6,0xbd,0x3d)
OUR_GUID_ENTRY(CLSID_MPEG2Demultiplexer,0xafb6c280,0x2c41,0x11d3,0x8a,0x60,0x00,0x00,0xf8,0x1e,0x0e,0x4a)
OUR_GUID_ENTRY(CLSID_MMSPLITTER,0x3ae86b20,0x7be8,0x11d1,0xab,0xe6,0x00,0xa0,0xc9,0x05,0xf3,0x75)
OUR_GUID_ENTRY(CLSID_StreamBufferSink,0x2db47ae5,0xcf39,0x43c2,0xb4,0xd6,0xc,0xd8,0xd9,0x9,0x46,0xf4)
OUR_GUID_ENTRY(CLSID_StreamBufferSource,0xc9f5fe02,0xf851,0x4eb5,0x99,0xee,0xad,0x60,0x2a,0xf1,0xe6,0x19)
OUR_GUID_ENTRY(CLSID_StreamBufferConfig,0xfa8a68b2,0xc864,0x4ba2,0xad,0x53,0xd3,0x87,0x6a,0x87,0x49,0x4b)
OUR_GUID_ENTRY(CLSID_Mpeg2VideoStreamAnalyzer,0x6cfad761,0x735d,0x4aa5,0x8a,0xfc,0xaf,0x91,0xa7,0xd6,0x1e,0xba)
OUR_GUID_ENTRY(CLSID_StreamBufferRecordingAttributes,0xccaa63ac,0x1057,0x4778,0xae,0x92,0x12,0x6,0xab,0x9a,0xce,0xe6)
OUR_GUID_ENTRY(CLSID_StreamBufferComposeRecording,0xd682c4ba,0xa90a,0x42fe,0xb9,0xe1,0x3,0x10,0x98,0x49,0xc4,0x23)
OUR_GUID_ENTRY(CLSID_DVVideoCodec,0xb1b77c00,0xc3e4,0x11cf,0xaf,0x79,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_DVVideoEnc,0x13aa3650,0xbb6f,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_DVSplitter,0x4eb31670,0x9fc6,0x11cf,0xaf,0x6e,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_DVMux,0x129d7e40,0xc10d,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_SeekingPassThru,0x60af76c,0x68dd,0x11d0,0x8f,0xc1,0x0,0xc0,0x4f,0xd9,0x18,0x9d)
OUR_GUID_ENTRY(CLSID_Line21Decoder,0x6e8d4a20,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
OUR_GUID_ENTRY(CLSID_Line21Decoder2,0xe4206432,0x01a1,0x4bee,0xb3,0xe1,0x37,0x02,0xc8,0xed,0xc5,0x74)
OUR_GUID_ENTRY(CLSID_OverlayMixer,0xcd8743a1,0x3736,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(CLSID_VBISurfaces,0x814b9800,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(CLSID_WSTDecoder,0x70bc06e0,0x5666,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
OUR_GUID_ENTRY(CLSID_MjpegDec,0x301056d0,0x6dff,0x11d2,0x9e,0xeb,0x0,0x60,0x8,0x3,0x9e,0x37)
OUR_GUID_ENTRY(CLSID_MJPGEnc,0xb80ab0a0,0x7416,0x11d2,0x9e,0xeb,0x0,0x60,0x8,0x3,0x9e,0x37)
OUR_GUID_ENTRY(CLSID_SystemDeviceEnum,0x62BE5D10,0x60EB,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
OUR_GUID_ENTRY(CLSID_CDeviceMoniker,0x4315D437,0x5B8C,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
OUR_GUID_ENTRY(CLSID_VideoInputDeviceCategory,0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
OUR_GUID_ENTRY(CLSID_CVidCapClassManager,0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
OUR_GUID_ENTRY(CLSID_LegacyAmFilterCategory,0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86)
OUR_GUID_ENTRY(CLSID_CQzFilterClassManager,0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86)
OUR_GUID_ENTRY(CLSID_VideoCompressorCategory,0x33d9a760,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_CIcmCoClassManager,0x33d9a760,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_AudioCompressorCategory,0x33d9a761,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_CAcmCoClassManager,0x33d9a761,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_AudioInputDeviceCategory,0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_CWaveinClassManager,0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_AudioRendererCategory,0xe0f158e1,0xcb04,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_CWaveOutClassManager,0xe0f158e1,0xcb04,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_MidiRendererCategory,0x4EfE2452,0x168A,0x11d1,0xBC,0x76,0x0,0xc0,0x4F,0xB9,0x45,0x3B)
OUR_GUID_ENTRY(CLSID_CMidiOutClassManager,0x4EfE2452,0x168A,0x11d1,0xBC,0x76,0x0,0xc0,0x4F,0xB9,0x45,0x3B)
OUR_GUID_ENTRY(CLSID_TransmitCategory,0xcc7bfb41,0xf175,0x11d1,0xa3,0x92,0x0,0xe0,0x29,0x1f,0x39,0x59)
OUR_GUID_ENTRY(CLSID_DeviceControlCategory,0xcc7bfb46,0xf175,0x11d1,0xa3,0x92,0x0,0xe0,0x29,0x1f,0x39,0x59)
OUR_GUID_ENTRY(CLSID_ActiveMovieCategories,0xda4e3da0,0xd07d,0x11d0,0xbd,0x50,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_DVDHWDecodersCategory,0x2721AE20,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
OUR_GUID_ENTRY(CLSID_MediaEncoderCategory,0x7D22E920,0x5CA9,0x4787,0x8C,0x2B,0xA6,0x77,0x9B,0xD1,0x17,0x81)
OUR_GUID_ENTRY(CLSID_MediaMultiplexerCategory,0x236C9559,0xADCE,0x4736,0xBF,0x72,0xBA,0xB3,0x4E,0x39,0x21,0x96)
OUR_GUID_ENTRY(CLSID_FilterMapper2,0xcda42200,0xbd88,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_MemoryAllocator,0x1e651cc0,0xb199,0x11d0,0x82,0x12,0x00,0xc0,0x4f,0xc3,0x2c,0x45)
OUR_GUID_ENTRY(CLSID_MediaPropertyBag,0xcdbd8d00,0xc193,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
OUR_GUID_ENTRY(CLSID_DvdGraphBuilder,0xFCC152B7,0xF372,0x11d0,0x8E,0x00,0x00,0xC0,0x4F,0xD7,0xC0,0x8B)
OUR_GUID_ENTRY(CLSID_DVDNavigator,0x9b8c4620,0x2c1a,0x11d0,0x84,0x93,0x0,0xa0,0x24,0x38,0xad,0x48)
OUR_GUID_ENTRY(CLSID_DVDState,0xf963c5cf,0xa659,0x4a93,0x96,0x38,0xca,0xf3,0xcd,0x27,0x7d,0x13)
OUR_GUID_ENTRY(CLSID_SmartTee,0xcc58e280,0x8aa1,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
OUR_GUID_ENTRY(FORMAT_None,0x0F6417D6,0xc318,0x11d0,0xa4,0x3f,0x00,0xa0,0xc9,0x22,0x31,0x96)
OUR_GUID_ENTRY(FORMAT_VideoInfo,0x05589f80,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(FORMAT_VideoInfo2,0xf72a76A0,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(FORMAT_WaveFormatEx,0x05589f81,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(FORMAT_MPEGVideo,0x05589f82,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(FORMAT_MPEGStreams,0x05589f83,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(FORMAT_DvInfo,0x05589f84,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_DirectDrawProperties,0x944d4c00,0xdd52,0x11ce,0xbf,0x0e,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(CLSID_PerformanceProperties,0x59ce6880,0xacf8,0x11cf,0xb5,0x6e,0x00,0x80,0xc7,0xc4,0xb6,0x8a)
OUR_GUID_ENTRY(CLSID_QualityProperties,0x418afb70,0xf8b8,0x11ce,0xaa,0xc6,0x00,0x20,0xaf,0x0b,0x99,0xa3)
OUR_GUID_ENTRY(IID_IBaseVideoMixer,0x61ded640,0xe912,0x11ce,0xa0,0x99,0x00,0xaa,0x00,0x47,0x9a,0x58)
OUR_GUID_ENTRY(IID_IDirectDrawVideo,0x36d39eb0,0xdd75,0x11ce,0xbf,0x0e,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(IID_IQualProp,0x1bd0ecb0,0xf8e2,0x11ce,0xaa,0xc6,0x00,0x20,0xaf,0x0b,0x99,0xa3)
OUR_GUID_ENTRY(CLSID_VPObject,0xce292861,0xfc88,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(IID_IVPObject,0xce292862,0xfc88,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(IID_IVPControl,0x25df12c1,0x3de0,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(CLSID_VPVBIObject,0x814b9801,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(IID_IVPVBIObject,0x814b9802,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(IID_IVPConfig,0xbc29a660,0x30e3,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(IID_IVPNotify,0xc76794a1,0xd6c5,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(IID_IVPNotify2,0xebf47183,0x8764,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(IID_IVPVBIConfig,0xec529b00,0x1a1f,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(IID_IVPVBINotify,0xec529b01,0x1a1f,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
OUR_GUID_ENTRY(IID_IMixerPinConfig,0x593cdde1,0x759,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
OUR_GUID_ENTRY(IID_IMixerPinConfig2,0xebf47182,0x8764,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
#ifndef __DDRAW_INCLUDED__
OUR_GUID_ENTRY(CLSID_DirectDraw,0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35)
OUR_GUID_ENTRY(CLSID_DirectDrawClipper,0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56)
OUR_GUID_ENTRY(IID_IDirectDraw,0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
OUR_GUID_ENTRY(IID_IDirectDraw2,0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56)
OUR_GUID_ENTRY(IID_IDirectDrawSurface,0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
OUR_GUID_ENTRY(IID_IDirectDrawSurface2,0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27)
OUR_GUID_ENTRY(IID_IDirectDrawSurface3,0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB)
OUR_GUID_ENTRY(IID_IDirectDrawSurface4,0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B)
OUR_GUID_ENTRY(IID_IDirectDrawSurface7,0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b)
OUR_GUID_ENTRY(IID_IDirectDrawPalette,0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
OUR_GUID_ENTRY(IID_IDirectDrawClipper,0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
OUR_GUID_ENTRY(IID_IDirectDrawColorControl,0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
#endif
#ifndef __DVP_INCLUDED__
OUR_GUID_ENTRY(IID_IDDVideoPortContainer,0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
#endif
#ifndef __DDKM_INCLUDED__
OUR_GUID_ENTRY(IID_IDirectDrawKernel,0x8D56C120,0x6A08,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
OUR_GUID_ENTRY(IID_IDirectDrawSurfaceKernel,0x60755DA0,0x6A40,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
#endif
OUR_GUID_ENTRY(CLSID_ModexProperties,0x0618aa30,0x6bc4,0x11cf,0xbf,0x36,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(IID_IFullScreenVideo,0xdd1d7110,0x7836,0x11cf,0xbf,0x47,0x00,0xaa,0x00,0x55,0x59,0x5a)
OUR_GUID_ENTRY(IID_IFullScreenVideoEx,0x53479470,0xf1dd,0x11cf,0xbc,0x42,0x00,0xaa,0x00,0xac,0x74,0xf6)
OUR_GUID_ENTRY(CLSID_DVDecPropertiesPage,0x101193c0,0xbfe,0x11d0,0xaf,0x91,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_DVEncPropertiesPage,0x4150f050,0xbb6f,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(CLSID_DVMuxPropertyPage,0x4db880e0,0xc10d,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
OUR_GUID_ENTRY(IID_IAMDirectSound,0x546f4260,0xd53e,0x11cf,0xb3,0xf0,0x0,0xaa,0x0,0x37,0x61,0xc5)
OUR_GUID_ENTRY(IID_IMpegAudioDecoder,0xb45dd570,0x3c77,0x11d1,0xab,0xe1,0x00,0xa0,0xc9,0x05,0xf3,0x75)
OUR_GUID_ENTRY(IID_IAMLine21Decoder,0x6e8d4a21,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
OUR_GUID_ENTRY(IID_IAMWstDecoder,0xc056de21,0x75c2,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
OUR_GUID_ENTRY(CLSID_WstDecoderPropertyPage,0x4e27f80,0x91e4,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
OUR_GUID_ENTRY(FORMAT_AnalogVideo,0x482dde0,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIATYPE_AnalogVideo,0x482dde1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_NTSC_M,0x482dde2,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_B,0x482dde5,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_D,0x482dde6,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_G,0x482dde7,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_H,0x482dde8,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_I,0x482dde9,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_M,0x482ddea,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N,0x482ddeb,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N_COMBO,0x482ddec,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_B,0x482ddf0,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_D,0x482ddf1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_G,0x482ddf2,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_H,0x482ddf3,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K,0x482ddf4,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K1,0x482ddf5,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_L,0x482ddf6,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(MEDIATYPE_AnalogAudio,0x482dee1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
#include "dshow/ksuuids.h"
OUR_GUID_ENTRY(TIME_FORMAT_NONE,0L,0,0,0,0,0,0,0,0,0,0)
OUR_GUID_ENTRY(TIME_FORMAT_FRAME,0x7b785570,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
OUR_GUID_ENTRY(TIME_FORMAT_BYTE,0x7b785571,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
OUR_GUID_ENTRY(TIME_FORMAT_SAMPLE,0x7b785572,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
OUR_GUID_ENTRY(TIME_FORMAT_FIELD,0x7b785573,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
OUR_GUID_ENTRY(TIME_FORMAT_MEDIA_TIME,0x7b785574,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
OUR_GUID_ENTRY(AMPROPSETID_Pin,0x9b00f101,0x1567,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
OUR_GUID_ENTRY(PIN_CATEGORY_CAPTURE,0xfb6c4281,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_PREVIEW,0xfb6c4282,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_ANALOGVIDEOIN,0xfb6c4283,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_VBI,0xfb6c4284,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT,0xfb6c4285,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_NABTS,0xfb6c4286,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_EDS,0xfb6c4287,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_TELETEXT,0xfb6c4288,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_CC,0xfb6c4289,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_STILL,0xfb6c428a,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_TIMECODE,0xfb6c428b,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT_VBI,0xfb6c428c,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
OUR_GUID_ENTRY(LOOK_UPSTREAM_ONLY,0xac798be0,0x98e3,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
OUR_GUID_ENTRY(LOOK_DOWNSTREAM_ONLY,0xac798be1,0x98e3,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
OUR_GUID_ENTRY(CLSID_TVTunerFilterPropertyPage,0x266eee41,0x6c63,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
OUR_GUID_ENTRY(CLSID_CrossbarFilterPropertyPage,0x71f96461,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
OUR_GUID_ENTRY(CLSID_TVAudioFilterPropertyPage,0x71f96463,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
OUR_GUID_ENTRY(CLSID_VideoProcAmpPropertyPage,0x71f96464,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
OUR_GUID_ENTRY(CLSID_CameraControlPropertyPage,0x71f96465,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
OUR_GUID_ENTRY(CLSID_AnalogVideoDecoderPropertyPage,0x71f96466,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
OUR_GUID_ENTRY(CLSID_VideoStreamConfigPropertyPage,0x71f96467,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
OUR_GUID_ENTRY(CLSID_AudioRendererAdvancedProperties,0x37e92a92,0xd9aa,0x11d2,0xbf,0x84,0x8e,0xf2,0xb1,0x55,0x5a,0xed)
OUR_GUID_ENTRY(CLSID_VideoMixingRenderer,0xB87BEB7B,0x8D29,0x423f,0xAE,0x4D,0x65,0x82,0xC1,0x01,0x75,0xAC)
OUR_GUID_ENTRY(CLSID_VideoRendererDefault,0x6BC1CFFA,0x8FC1,0x4261,0xAC,0x22,0xCF,0xB4,0xCC,0x38,0xDB,0x50)
OUR_GUID_ENTRY(CLSID_AllocPresenter,0x99d54f63,0x1a69,0x41ae,0xaa,0x4d,0xc9,0x76,0xeb,0x3f,0x07,0x13)
OUR_GUID_ENTRY(CLSID_AllocPresenterDDXclMode,0x4444ac9e,0x242e,0x471b,0xa3,0xc7,0x45,0xdc,0xd4,0x63,0x52,0xbc)
OUR_GUID_ENTRY(CLSID_VideoPortManager,0x6f26a6cd,0x967b,0x47fd,0x87,0x4a,0x7a,0xed,0x2c,0x9d,0x25,0xa2)
OUR_GUID_ENTRY(CLSID_VideoMixingRenderer9,0x51b4abf3,0x748f,0x4e3b,0xa2,0x76,0xc8,0x28,0x33,0x0e,0x92,0x6a)
OUR_GUID_ENTRY(CLSID_ATSCNetworkProvider,0x0dad2fdd,0x5fd7,0x11d3,0x8f,0x50,0x00,0xc0,0x4f,0x79,0x71,0xe2)
OUR_GUID_ENTRY(CLSID_ATSCNetworkPropertyPage,0xe3444d16,0x5ac4,0x4386,0x88,0xdf,0x13,0xfd,0x23,0x0e,0x1d,0xda)
OUR_GUID_ENTRY(CLSID_DVBSNetworkProvider,0xfa4b375a,0x45b4,0x4d45,0x84,0x40,0x26,0x39,0x57,0xb1,0x16,0x23)
OUR_GUID_ENTRY(CLSID_DVBTNetworkProvider,0x216c62df,0x6d7f,0x4e9a,0x85,0x71,0x5,0xf1,0x4e,0xdb,0x76,0x6a)
OUR_GUID_ENTRY(CLSID_DVBCNetworkProvider,0xdc0c0fe7,0x485,0x4266,0xb9,0x3f,0x68,0xfb,0xf8,0xe,0xd8,0x34)
OUR_GUID_ENTRY(CLSID_DShowTVEFilter,0x05500280,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
OUR_GUID_ENTRY(CLSID_TVEFilterTuneProperties,0x05500281,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
OUR_GUID_ENTRY(CLSID_TVEFilterCCProperties,0x05500282,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
OUR_GUID_ENTRY(CLSID_TVEFilterStatsProperties,0x05500283,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
OUR_GUID_ENTRY(CLSID_IVideoEncoderProxy,0xb43c4eec,0x8c32,0x4791,0x91,0x2,0x50,0x8a,0xda,0x5e,0xe8,0xe7)
OUR_GUID_ENTRY(CLSID_ICodecAPIProxy,0x7ff0997a,0x1999,0x4286,0xa7,0x3c,0x62,0x2b,0x88,0x14,0xe7,0xeb)
OUR_GUID_ENTRY(CLSID_IVideoEncoderCodecAPIProxy,0xb05dabd9,0x56e5,0x4fdc,0xaf,0xa4,0x8a,0x47,0xe9,0x1f,0x1c,0x9c)
#ifndef __ENCODER_API_GUIDS__
#define __ENCODER_API_GUIDS__
OUR_GUID_ENTRY(ENCAPIPARAM_BITRATE,0x49cc4c43,0xca83,0x4ad4,0xa9,0xaf,0xf3,0x69,0x6a,0xf6,0x66,0xdf)
OUR_GUID_ENTRY(ENCAPIPARAM_PEAK_BITRATE,0x703f16a9,0x3d48,0x44a1,0xb0,0x77,0x1,0x8d,0xff,0x91,0x5d,0x19)
OUR_GUID_ENTRY(ENCAPIPARAM_BITRATE_MODE,0xee5fb25c,0xc713,0x40d1,0x9d,0x58,0xc0,0xd7,0x24,0x1e,0x25,0xf)
OUR_GUID_ENTRY(CODECAPI_CHANGELISTS,0x62b12acf,0xf6b0,0x47d9,0x94,0x56,0x96,0xf2,0x2c,0x4e,0x0b,0x9d)
OUR_GUID_ENTRY(CODECAPI_VIDEO_ENCODER,0x7112e8e1,0x3d03,0x47ef,0x8e,0x60,0x03,0xf1,0xcf,0x53,0x73,0x01)
OUR_GUID_ENTRY(CODECAPI_AUDIO_ENCODER,0xb9d19a3e,0xf897,0x429c,0xbc,0x46,0x81,0x38,0xb7,0x27,0x2b,0x2d)
OUR_GUID_ENTRY(CODECAPI_SETALLDEFAULTS,0x6c5e6a7c,0xacf8,0x4f55,0xa9,0x99,0x1a,0x62,0x81,0x09,0x05,0x1b)
OUR_GUID_ENTRY(CODECAPI_ALLSETTINGS,0x6a577e92,0x83e1,0x4113,0xad,0xc2,0x4f,0xce,0xc3,0x2f,0x83,0xa1)
OUR_GUID_ENTRY(CODECAPI_SUPPORTSEVENTS,0x0581af97,0x7693,0x4dbd,0x9d,0xca,0x3f,0x9e,0xbd,0x65,0x85,0xa1)
OUR_GUID_ENTRY(CODECAPI_CURRENTCHANGELIST,0x1cb14e83,0x7d72,0x4657,0x83,0xfd,0x47,0xa2,0xc5,0xb9,0xd1,0x3d)
#endif
#undef OUR_GUID_ENTRY
#ifndef _VIDEOINPUT
#define _VIDEOINPUT
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//THE SOFTWARE.
//////////////////////////////////////////////////////////
//Written by Theodore Watson - theo.watson@gmail.com //
//Do whatever you want with this code but if you find //
//a bug or make an improvement I would love to know! //
// //
//Warning This code is experimental //
//use at your own risk :) //
//////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/* Shoutouts
Thanks to:
Dillip Kumar Kara for crossbar code.
Zachary Lieberman for getting me into this stuff
and for being so generous with time and code.
The guys at Potion Design for helping me with VC++
Josh Fisher for being a serious C++ nerd :)
Golan Levin for helping me debug the strangest
and slowest bug in the world!
And all the people using this library who send in
bugs, suggestions and improvements who keep me working on
the next version - yeah thanks a lot ;)
*/
/////////////////////////////////////////////////////////
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <wchar.h>
//this is for TryEnterCriticalSection
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x400
#endif
#include <windows.h>
//Example Usage
/*
//create a videoInput object
videoInput VI;
//Prints out a list of available devices and returns num of devices found
int numDevices = VI.listDevices();
int device1 = 0; //this could be any deviceID that shows up in listDevices
int device2 = 1; //this could be any deviceID that shows up in listDevices
//if you want to capture at a different frame rate (default is 30)
//specify it here, you are not guaranteed to get this fps though.
//VI.setIdealFramerate(dev, 60);
//setup the first device - there are a number of options:
VI.setupDevice(device1); //setup the first device with the default settings
//VI.setupDevice(device1, VI_COMPOSITE); //or setup device with specific connection type
//VI.setupDevice(device1, 320, 240); //or setup device with specified video size
//VI.setupDevice(device1, 320, 240, VI_COMPOSITE); //or setup device with video size and connection type
//VI.setFormat(device1, VI_NTSC_M); //if your card doesn't remember what format it should be
//call this with the appropriate format listed above
//NOTE: must be called after setupDevice!
//optionally setup a second (or third, fourth ...) device - same options as above
VI.setupDevice(device2);
//As requested width and height can not always be accomodated
//make sure to check the size once the device is setup
int width = VI.getWidth(device1);
int height = VI.getHeight(device1);
int size = VI.getSize(device1);
unsigned char * yourBuffer1 = new unsigned char[size];
unsigned char * yourBuffer2 = new unsigned char[size];
//to get the data from the device first check if the data is new
if(VI.isFrameNew(device1)){
VI.getPixels(device1, yourBuffer1, false, false); //fills pixels as a BGR (for openCV) unsigned char array - no flipping
VI.getPixels(device1, yourBuffer2, true, true); //fills pixels as a RGB (for openGL) unsigned char array - flipping!
}
//same applies to device2 etc
//to get a settings dialog for the device
VI.showSettingsWindow(device1);
//Shut down devices properly
VI.stopDevice(device1);
VI.stopDevice(device2);
*/
////////////////////////////////////// VARS AND DEFS //////////////////////////////////
//STUFF YOU CAN CHANGE
//change for verbose debug info
static bool verbose = true;
//if you need VI to use multi threaded com
//#define VI_COM_MULTI_THREADED
//STUFF YOU DON'T CHANGE
//videoInput defines
#define VI_VERSION 0.1995
#define VI_MAX_CAMERAS 20
#define VI_NUM_TYPES 18 //DON'T TOUCH
#define VI_NUM_FORMATS 18 //DON'T TOUCH
//defines for setPhyCon - tuner is not as well supported as composite and s-video
#define VI_COMPOSITE 0
#define VI_S_VIDEO 1
#define VI_TUNER 2
#define VI_USB 3
#define VI_1394 4
//defines for formats
#define VI_NTSC_M 0
#define VI_PAL_B 1
#define VI_PAL_D 2
#define VI_PAL_G 3
#define VI_PAL_H 4
#define VI_PAL_I 5
#define VI_PAL_M 6
#define VI_PAL_N 7
#define VI_PAL_NC 8
#define VI_SECAM_B 9
#define VI_SECAM_D 10
#define VI_SECAM_G 11
#define VI_SECAM_H 12
#define VI_SECAM_K 13
#define VI_SECAM_K1 14
#define VI_SECAM_L 15
#define VI_NTSC_M_J 16
#define VI_NTSC_433 17
//allows us to directShow classes here with the includes in the cpp
struct ICaptureGraphBuilder2;
struct IGraphBuilder;
struct IBaseFilter;
struct IAMCrossbar;
struct IMediaControl;
struct ISampleGrabber;
struct IMediaEventEx;
struct IAMStreamConfig;
struct _AMMediaType;
class SampleGrabberCallback;
typedef _AMMediaType AM_MEDIA_TYPE;
//keeps track of how many instances of VI are being used
//don't touch
static int comInitCount = 0;
//////////////////////////////////////// VIDEO DEVICE ///////////////////////////////////
class videoDevice{
public:
videoDevice();
void setSize(int w, int h);
void NukeDownstream(IBaseFilter *pBF);
void destroyGraph();
~videoDevice();
int videoSize;
int width;
int height;
int tryWidth;
int tryHeight;
ICaptureGraphBuilder2 *pCaptureGraph; // Capture graph builder object
IGraphBuilder *pGraph; // Graph builder object
IMediaControl *pControl; // Media control object
IBaseFilter *pVideoInputFilter; // Video Capture filter
IBaseFilter *pGrabberF;
IBaseFilter * pDestFilter;
IAMStreamConfig *streamConf;
ISampleGrabber * pGrabber; // Grabs frame
AM_MEDIA_TYPE * pAmMediaType;
IMediaEventEx * pMediaEvent;
GUID videoType;
long formatType;
SampleGrabberCallback * sgCallback;
bool tryDiffSize;
bool useCrossbar;
bool readyToCapture;
bool sizeSet;
bool setupStarted;
bool specificFormat;
bool autoReconnect;
int nFramesForReconnect;
unsigned long nFramesRunning;
int connection;
int storeConn;
int myID;
long requestedFrameTime; //ie fps
char nDeviceName[255];
WCHAR wDeviceName[255];
unsigned char * pixels;
char * pBuffer;
};
////////////////////////////////////// VIDEO INPUT /////////////////////////////////////
class videoInput{
public:
videoInput();
~videoInput();
//turns off console messages - default is to print messages
static void setVerbose(bool _verbose);
//Functions in rough order they should be used.
static int listDevices(bool silent = false);
//needs to be called after listDevices - otherwise returns NULL
static char * getDeviceName(int deviceID);
//choose to use callback based capture - or single threaded
void setUseCallback(bool useCallback);
//call before setupDevice
//directshow will try and get the closest possible framerate to what is requested
void setIdealFramerate(int deviceID, int idealFramerate);
//some devices will stop delivering frames after a while - this method gives you the option to try and reconnect
//to a device if videoInput detects that a device has stopped delivering frames.
//you MUST CALL isFrameNew every app loop for this to have any effect
void setAutoReconnectOnFreeze(int deviceNumber, bool doReconnect, int numMissedFramesBeforeReconnect);
//Choose one of these four to setup your device
bool setupDevice(int deviceID);
bool setupDevice(int deviceID, int w, int h);
//These two are only for capture cards
//USB and Firewire cameras souldn't specify connection
bool setupDevice(int deviceID, int connection);
bool setupDevice(int deviceID, int w, int h, int connection);
//If you need to you can set your NTSC/PAL/SECAM
//preference here. if it is available it will be used.
//see #defines above for available formats - eg VI_NTSC_M or VI_PAL_B
//should be called after setupDevice
//can be called multiple times
bool setFormat(int deviceNumber, int format);
//Tells you when a new frame has arrived - you should call this if you have specified setAutoReconnectOnFreeze to true
bool isFrameNew(int deviceID);
bool isDeviceSetup(int deviceID);
//Returns the pixels - flipRedAndBlue toggles RGB/BGR flipping - and you can flip the image too
unsigned char * getPixels(int deviceID, bool flipRedAndBlue = true, bool flipImage = false);
//Or pass in a buffer for getPixels to fill returns true if successful.
bool getPixels(int id, unsigned char * pixels, bool flipRedAndBlue = true, bool flipImage = false);
//Launches a pop up settings window
//For some reason in GLUT you have to call it twice each time.
void showSettingsWindow(int deviceID);
//Manual control over settings thanks.....
//These are experimental for now.
bool setVideoSettingFilter(int deviceID, long Property, long lValue, long Flags = NULL, bool useDefaultValue = false);
bool setVideoSettingFilterPct(int deviceID, long Property, float pctValue, long Flags = NULL);
bool getVideoSettingFilter(int deviceID, long Property, long &min, long &max, long &SteppingDelta, long &currentValue, long &flags, long &defaultValue);
bool setVideoSettingCamera(int deviceID, long Property, long lValue, long Flags = NULL, bool useDefaultValue = false);
bool setVideoSettingCameraPct(int deviceID, long Property, float pctValue, long Flags = NULL);
bool getVideoSettingCamera(int deviceID, long Property, long &min, long &max, long &SteppingDelta, long &currentValue, long &flags, long &defaultValue);
//bool setVideoSettingCam(int deviceID, long Property, long lValue, long Flags = NULL, bool useDefaultValue = false);
//get width, height and number of pixels
int getWidth(int deviceID);
int getHeight(int deviceID);
int getSize(int deviceID);
//completely stops and frees a device
void stopDevice(int deviceID);
//as above but then sets it up with same settings
bool restartDevice(int deviceID);
//number of devices available
int devicesFound;
long propBrightness;
long propContrast;
long propHue;
long propSaturation;
long propSharpness;
long propGamma;
long propColorEnable;
long propWhiteBalance;
long propBacklightCompensation;
long propGain;
long propPan;
long propTilt;
long propRoll;
long propZoom;
long propExposure;
long propIris;
long propFocus;
private:
void setPhyCon(int deviceID, int conn);
void setAttemptCaptureSize(int deviceID, int w, int h);
bool setup(int deviceID);
void processPixels(unsigned char * src, unsigned char * dst, int width, int height, bool bRGB, bool bFlip);
int start(int deviceID, videoDevice * VD);
int getDeviceCount();
void getMediaSubtypeAsString(GUID type, char * typeAsString);
HRESULT getDevice(IBaseFilter **pSrcFilter, int deviceID, WCHAR * wDeviceName, char * nDeviceName);
static HRESULT ShowFilterPropertyPages(IBaseFilter *pFilter);
HRESULT SaveGraphFile(IGraphBuilder *pGraph, WCHAR *wszPath);
HRESULT routeCrossbar(ICaptureGraphBuilder2 **ppBuild, IBaseFilter **pVidInFilter, int conType, GUID captureMode);
//don't touch
static bool comInit();
static bool comUnInit();
int connection;
int callbackSetCount;
bool bCallback;
GUID CAPTURE_MODE;
//Extra video subtypes
GUID MEDIASUBTYPE_Y800;
GUID MEDIASUBTYPE_Y8;
GUID MEDIASUBTYPE_GREY;
videoDevice * VDList[VI_MAX_CAMERAS];
GUID mediaSubtypes[VI_NUM_TYPES];
long formatTypes[VI_NUM_FORMATS];
static void __cdecl basicThread(void * objPtr);
static char deviceNames[VI_MAX_CAMERAS][255];
};
#endif
......@@ -365,20 +365,6 @@ set(WITH_IPP OFF CACHE BOOL "Include Intel IPP support")
set(WITH_EIGEN ON CACHE BOOL "Include Eigen2/Eigen3 support")
set(WITH_CUDA ON CACHE BOOL "Include NVidia Cuda Runtime support")
if(WIN32)
set(MINGW_DWARF2 0)
if (MINGW)
if(${CMAKE_OPENCV_GCC_INFO_FULL} MATCHES "--with-dwarf2")
set(MINGW_DWARF2 1)
endif()
endif()
if (MINGW_DWARF2)
set(WITH_VIDEOINPUT OFF CACHE BOOL "Enable VideoInput support")
else()
set(WITH_VIDEOINPUT ON CACHE BOOL "Enable VideoInput support")
endif()
endif()
set(WITH_OPENNI OFF CACHE BOOL "Include OpenNI support")
# ===================================================
......@@ -833,17 +819,6 @@ if(WITH_CUDA)
endif()
############################### VideoInput ################################
if (WIN32 AND WITH_VIDEOINPUT)
if(CMAKE_CXX_COMPILER MATCHES "dw2")
else()
if(NOT MINGW64)
set(HAVE_VIDEOINPUT 1)
endif()
endif()
endif()
############################### OpenNI ################################
set(HAVE_OPENNI FALSE)
set(HAVE_OPENNI_PRIME_SENSOR_MODULE FALSE)
......@@ -869,34 +844,18 @@ endif()
################## Extra HighGUI libs on Windows ###################
if(WIN32)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} comctl32 gdi32 ole32)
set(HAVE_VIDEOINPUT 1)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} comctl32 gdi32 ole32 strmiids)
if (MSVC)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} vfw32)
if (NOT BUILD_SHARED_LIBS)
if (MSVC64)
if(HAVE_VIDEOINPUT)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} ${OpenCV_SOURCE_DIR}/3rdparty/lib/videoInput64.lib strmiids)
endif()
elseif (MSVC)
if(HAVE_VIDEOINPUT)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} ${OpenCV_SOURCE_DIR}/3rdparty/lib/videoInput.lib strmiids)
endif()
endif()
endif()
endif()
if(MINGW)
if(MINGW64)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} msvfw32 avifil32 avicap32 winmm)
if(HAVE_VIDEOINPUT)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} videoInput64 strmiids)
endif()
else()
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} vfw32 winmm)
if(HAVE_VIDEOINPUT)
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} videoInput strmiids)
endif()
endif()
endif()
endif()
......@@ -1253,15 +1212,6 @@ if(WIN32)
# Install the OpenCVConfig.cmake file which has the right paths pointing to the install directory
install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/")
# if videoInput support is enabled (which is by default on WIN32) copy the static library required to the installation path
# DESTINATION could also be "${CMAKE_INSTALL_PREFIX}/lib") to simplify dev environment setup of client applications
IF(HAVE_VIDEOINPUT)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/lib/videoInput.lib" "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/lib/videoInput64.lib"
DESTINATION "${CMAKE_INSTALL_PREFIX}/3rdparty/lib")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/include/videoInput.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/3rdparty/include")
ENDIF()
# Add the OpenCV configuration header to the install path
# Useful for instance if a client application checks against the features OpenCV has been compiled with
install(FILES "${CMAKE_BINARY_DIR}/cvconfig.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
......@@ -1526,12 +1476,7 @@ endif()
if(WIN32)
message(STATUS "")
message(STATUS " Video I/O: ")
if(HAVE_VIDEOINPUT)
message(STATUS " VideoInput: YES")
else()
message(STATUS " VideoInput: NO")
endif()
message(STATUS " Video I/O: DirectShow")
endif()
message(STATUS "")
......
......@@ -41,9 +41,2838 @@
#include "precomp.hpp"
#if defined HAVE_VIDEOINPUT && (_MSC_VER >= 1400 || defined __GNUC__)
#if defined WIN32 || defined _WIN32
#include "videoInput.h"
/*
DirectShow-based Video Capturing module is based on
videoInput library by Theodore Watson:
http://muonics.net/school/spring05/videoInput/
Below is the original copyright
*/
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//THE SOFTWARE.
//////////////////////////////////////////////////////////
//Written by Theodore Watson - theo.watson@gmail.com //
//Do whatever you want with this code but if you find //
//a bug or make an improvement I would love to know! //
// //
//Warning This code is experimental //
//use at your own risk :) //
//////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/* Shoutouts
Thanks to:
Dillip Kumar Kara for crossbar code.
Zachary Lieberman for getting me into this stuff
and for being so generous with time and code.
The guys at Potion Design for helping me with VC++
Josh Fisher for being a serious C++ nerd :)
Golan Levin for helping me debug the strangest
and slowest bug in the world!
And all the people using this library who send in
bugs, suggestions and improvements who keep me working on
the next version - yeah thanks a lot ;)
*/
/////////////////////////////////////////////////////////
#if _MSC_VER >= 1400
#pragma warning(disable: 4995)
#endif
#include <tchar.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <wchar.h>
#include <vector>
//Include Directshow stuff here so we don't worry about needing all the h files.
#ifdef _MSC_VER
#include "DShow.h"
#include "strmif.h"
#include "Aviriff.h"
#include "dvdmedia.h"
#include "bdaiface.h"
#else
#include "dshow/dshow.h"
#include "dshow/dvdmedia.h"
#include "bdatypes.h"
interface IEnumPIDMap : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Next(
/* [in] */ ULONG cRequest,
/* [size_is][out][in] */ PID_MAP *pPIDMap,
/* [out] */ ULONG *pcReceived) = 0;
virtual HRESULT STDMETHODCALLTYPE Skip(
/* [in] */ ULONG cRecords) = 0;
virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Clone(
/* [out] */ IEnumPIDMap **ppIEnumPIDMap) = 0;
};
interface IMPEG2PIDMap : public IUnknown
{
virtual HRESULT STDMETHODCALLTYPE MapPID(
/* [in] */ ULONG culPID,
/* [in] */ ULONG *pulPID,
/* [in] */ MEDIA_SAMPLE_CONTENT MediaSampleContent) = 0;
virtual HRESULT STDMETHODCALLTYPE UnmapPID(
/* [in] */ ULONG culPID,
/* [in] */ ULONG *pulPID) = 0;
virtual HRESULT STDMETHODCALLTYPE EnumPIDMap(
/* [out] */ IEnumPIDMap **pIEnumPIDMap) = 0;
};
#endif
//for threading
#include <process.h>
//this is for TryEnterCriticalSection
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x400
#endif
#include <windows.h>
/*
MEDIASUBTYPE_I420 : TGUID ='{30323449-0000-0010-8000-00AA00389B71}';
MEDIASUBTYPE_Y800 : TGUID ='{30303859-0000-0010-8000-00AA00389B71}';
MEDIASUBTYPE_Y8 : TGUID ='{20203859-0000-0010-8000-00AA00389B71}';
MEDIASUBTYPE_Y160 : TGUID ='{30363159-0000-0010-8000-00AA00389B71}';
MEDIASUBTYPE_YV16 : TGUID ='{32315659-0000-0010-8000-00AA00389B71}';
MEDIASUBTYPE_Y422 : TGUID ='{32323459-0000-0010-8000-00AA00389B71}';
MEDIASUBTYPE_GREY : TGUID ='{59455247-0000-0010-8000-00AA00389B71}';
*/
#ifdef _MSC_VER
#include <initguid.h>
#endif
DEFINE_GUID(IID_ISampleGrabber, 0x6b652fff, 0x11fe, 0x4fce, 0x92,0xad, 0x02,0x66,0xb5,0xd7,0xc7,0x8f);
DEFINE_GUID(CLSID_SampleGrabber, 0xc1f400a0, 0x3f08, 0x11d3, 0x9f, 0x0b,
0x00, 0x60, 0x08, 0x03, 0x9e, 0x37);
DEFINE_GUID(CLSID_NullRenderer, 0xc1f400a4, 0x3f08, 0x11d3, 0x9f, 0x0b,
0x00, 0x60, 0x08, 0x03, 0x9e, 0x37);
DEFINE_GUID(IID_IMPEG2PIDMap,0xafb6c2a1,0x2c41,0x11d3,0x8a,0x60,0x00,0x00,0xf8,0x1e,0x0e,0x4a);
#include <initguid.h>
DEFINE_GUID(MEDIASUBTYPE_GREY, 0x59455247, 0x0000, 0x0010, 0x80, 0x00,
0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
DEFINE_GUID(MEDIASUBTYPE_Y8, 0x20203859, 0x0000, 0x0010, 0x80, 0x00,
0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
DEFINE_GUID(MEDIASUBTYPE_Y800, 0x30303859, 0x0000, 0x0010, 0x80, 0x00,
0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
interface ISampleGrabberCB : public IUnknown
{
virtual HRESULT STDMETHODCALLTYPE SampleCB(
double SampleTime,
IMediaSample *pSample) = 0;
virtual HRESULT STDMETHODCALLTYPE BufferCB(
double SampleTime,
BYTE *pBuffer,
LONG BufferLen) = 0;
};
interface ISampleGrabber : public IUnknown
{
virtual HRESULT STDMETHODCALLTYPE SetOneShot(
BOOL OneShot) = 0;
virtual HRESULT STDMETHODCALLTYPE SetMediaType(
const AM_MEDIA_TYPE *pType) = 0;
virtual HRESULT STDMETHODCALLTYPE GetConnectedMediaType(
AM_MEDIA_TYPE *pType) = 0;
virtual HRESULT STDMETHODCALLTYPE SetBufferSamples(
BOOL BufferThem) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentBuffer(
LONG *pBufferSize,
LONG *pBuffer) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentSample(
IMediaSample **ppSample) = 0;
virtual HRESULT STDMETHODCALLTYPE SetCallback(
ISampleGrabberCB *pCallback,
LONG WhichMethodToCallback) = 0;
};
#ifndef HEADER
#define HEADER(p) (&(((VIDEOINFOHEADER*)(p))->bmiHeader))
#endif
//Example Usage
/*
//create a videoInput object
videoInput VI;
//Prints out a list of available devices and returns num of devices found
int numDevices = VI.listDevices();
int device1 = 0; //this could be any deviceID that shows up in listDevices
int device2 = 1; //this could be any deviceID that shows up in listDevices
//if you want to capture at a different frame rate (default is 30)
//specify it here, you are not guaranteed to get this fps though.
//VI.setIdealFramerate(dev, 60);
//setup the first device - there are a number of options:
VI.setupDevice(device1); //setup the first device with the default settings
//VI.setupDevice(device1, VI_COMPOSITE); //or setup device with specific connection type
//VI.setupDevice(device1, 320, 240); //or setup device with specified video size
//VI.setupDevice(device1, 320, 240, VI_COMPOSITE); //or setup device with video size and connection type
//VI.setFormat(device1, VI_NTSC_M); //if your card doesn't remember what format it should be
//call this with the appropriate format listed above
//NOTE: must be called after setupDevice!
//optionally setup a second (or third, fourth ...) device - same options as above
VI.setupDevice(device2);
//As requested width and height can not always be accomodated
//make sure to check the size once the device is setup
int width = VI.getWidth(device1);
int height = VI.getHeight(device1);
int size = VI.getSize(device1);
unsigned char * yourBuffer1 = new unsigned char[size];
unsigned char * yourBuffer2 = new unsigned char[size];
//to get the data from the device first check if the data is new
if(VI.isFrameNew(device1)){
VI.getPixels(device1, yourBuffer1, false, false); //fills pixels as a BGR (for openCV) unsigned char array - no flipping
VI.getPixels(device1, yourBuffer2, true, true); //fills pixels as a RGB (for openGL) unsigned char array - flipping!
}
//same applies to device2 etc
//to get a settings dialog for the device
VI.showSettingsWindow(device1);
//Shut down devices properly
VI.stopDevice(device1);
VI.stopDevice(device2);
*/
////////////////////////////////////// VARS AND DEFS //////////////////////////////////
//STUFF YOU CAN CHANGE
//change for verbose debug info
static bool verbose = true;
//if you need VI to use multi threaded com
//#define VI_COM_MULTI_THREADED
//STUFF YOU DON'T CHANGE
//videoInput defines
#define VI_VERSION 0.1995
#define VI_MAX_CAMERAS 20
#define VI_NUM_TYPES 18 //DON'T TOUCH
#define VI_NUM_FORMATS 18 //DON'T TOUCH
//defines for setPhyCon - tuner is not as well supported as composite and s-video
#define VI_COMPOSITE 0
#define VI_S_VIDEO 1
#define VI_TUNER 2
#define VI_USB 3
#define VI_1394 4
//defines for formats
#define VI_NTSC_M 0
#define VI_PAL_B 1
#define VI_PAL_D 2
#define VI_PAL_G 3
#define VI_PAL_H 4
#define VI_PAL_I 5
#define VI_PAL_M 6
#define VI_PAL_N 7
#define VI_PAL_NC 8
#define VI_SECAM_B 9
#define VI_SECAM_D 10
#define VI_SECAM_G 11
#define VI_SECAM_H 12
#define VI_SECAM_K 13
#define VI_SECAM_K1 14
#define VI_SECAM_L 15
#define VI_NTSC_M_J 16
#define VI_NTSC_433 17
//allows us to directShow classes here with the includes in the cpp
struct ICaptureGraphBuilder2;
struct IGraphBuilder;
struct IBaseFilter;
struct IAMCrossbar;
struct IMediaControl;
struct ISampleGrabber;
struct IMediaEventEx;
struct IAMStreamConfig;
struct _AMMediaType;
class SampleGrabberCallback;
typedef _AMMediaType AM_MEDIA_TYPE;
//keeps track of how many instances of VI are being used
//don't touch
static int comInitCount = 0;
//////////////////////////////////////// VIDEO DEVICE ///////////////////////////////////
class videoDevice{
public:
videoDevice();
void setSize(int w, int h);
void NukeDownstream(IBaseFilter *pBF);
void destroyGraph();
~videoDevice();
int videoSize;
int width;
int height;
int tryWidth;
int tryHeight;
ICaptureGraphBuilder2 *pCaptureGraph; // Capture graph builder object
IGraphBuilder *pGraph; // Graph builder object
IMediaControl *pControl; // Media control object
IBaseFilter *pVideoInputFilter; // Video Capture filter
IBaseFilter *pGrabberF;
IBaseFilter * pDestFilter;
IAMStreamConfig *streamConf;
ISampleGrabber * pGrabber; // Grabs frame
AM_MEDIA_TYPE * pAmMediaType;
IMediaEventEx * pMediaEvent;
GUID videoType;
long formatType;
SampleGrabberCallback * sgCallback;
bool tryDiffSize;
bool useCrossbar;
bool readyToCapture;
bool sizeSet;
bool setupStarted;
bool specificFormat;
bool autoReconnect;
int nFramesForReconnect;
unsigned long nFramesRunning;
int connection;
int storeConn;
int myID;
long requestedFrameTime; //ie fps
char nDeviceName[255];
WCHAR wDeviceName[255];
unsigned char * pixels;
char * pBuffer;
};
////////////////////////////////////// VIDEO INPUT /////////////////////////////////////
class videoInput{
public:
videoInput();
~videoInput();
//turns off console messages - default is to print messages
static void setVerbose(bool _verbose);
//Functions in rough order they should be used.
static int listDevices(bool silent = false);
//needs to be called after listDevices - otherwise returns NULL
static char * getDeviceName(int deviceID);
//choose to use callback based capture - or single threaded
void setUseCallback(bool useCallback);
//call before setupDevice
//directshow will try and get the closest possible framerate to what is requested
void setIdealFramerate(int deviceID, int idealFramerate);
//some devices will stop delivering frames after a while - this method gives you the option to try and reconnect
//to a device if videoInput detects that a device has stopped delivering frames.
//you MUST CALL isFrameNew every app loop for this to have any effect
void setAutoReconnectOnFreeze(int deviceNumber, bool doReconnect, int numMissedFramesBeforeReconnect);
//Choose one of these four to setup your device
bool setupDevice(int deviceID);
bool setupDevice(int deviceID, int w, int h);
//These two are only for capture cards
//USB and Firewire cameras souldn't specify connection
bool setupDevice(int deviceID, int connection);
bool setupDevice(int deviceID, int w, int h, int connection);
//If you need to you can set your NTSC/PAL/SECAM
//preference here. if it is available it will be used.
//see #defines above for available formats - eg VI_NTSC_M or VI_PAL_B
//should be called after setupDevice
//can be called multiple times
bool setFormat(int deviceNumber, int format);
//Tells you when a new frame has arrived - you should call this if you have specified setAutoReconnectOnFreeze to true
bool isFrameNew(int deviceID);
bool isDeviceSetup(int deviceID);
//Returns the pixels - flipRedAndBlue toggles RGB/BGR flipping - and you can flip the image too
unsigned char * getPixels(int deviceID, bool flipRedAndBlue = true, bool flipImage = false);
//Or pass in a buffer for getPixels to fill returns true if successful.
bool getPixels(int id, unsigned char * pixels, bool flipRedAndBlue = true, bool flipImage = false);
//Launches a pop up settings window
//For some reason in GLUT you have to call it twice each time.
void showSettingsWindow(int deviceID);
//Manual control over settings thanks.....
//These are experimental for now.
bool setVideoSettingFilter(int deviceID, long Property, long lValue, long Flags = NULL, bool useDefaultValue = false);
bool setVideoSettingFilterPct(int deviceID, long Property, float pctValue, long Flags = NULL);
bool getVideoSettingFilter(int deviceID, long Property, long &min, long &max, long &SteppingDelta, long &currentValue, long &flags, long &defaultValue);
bool setVideoSettingCamera(int deviceID, long Property, long lValue, long Flags = NULL, bool useDefaultValue = false);
bool setVideoSettingCameraPct(int deviceID, long Property, float pctValue, long Flags = NULL);
bool getVideoSettingCamera(int deviceID, long Property, long &min, long &max, long &SteppingDelta, long &currentValue, long &flags, long &defaultValue);
//bool setVideoSettingCam(int deviceID, long Property, long lValue, long Flags = NULL, bool useDefaultValue = false);
//get width, height and number of pixels
int getWidth(int deviceID);
int getHeight(int deviceID);
int getSize(int deviceID);
//completely stops and frees a device
void stopDevice(int deviceID);
//as above but then sets it up with same settings
bool restartDevice(int deviceID);
//number of devices available
int devicesFound;
long propBrightness;
long propContrast;
long propHue;
long propSaturation;
long propSharpness;
long propGamma;
long propColorEnable;
long propWhiteBalance;
long propBacklightCompensation;
long propGain;
long propPan;
long propTilt;
long propRoll;
long propZoom;
long propExposure;
long propIris;
long propFocus;
private:
void setPhyCon(int deviceID, int conn);
void setAttemptCaptureSize(int deviceID, int w, int h);
bool setup(int deviceID);
void processPixels(unsigned char * src, unsigned char * dst, int width, int height, bool bRGB, bool bFlip);
int start(int deviceID, videoDevice * VD);
int getDeviceCount();
void getMediaSubtypeAsString(GUID type, char * typeAsString);
HRESULT getDevice(IBaseFilter **pSrcFilter, int deviceID, WCHAR * wDeviceName, char * nDeviceName);
static HRESULT ShowFilterPropertyPages(IBaseFilter *pFilter);
HRESULT SaveGraphFile(IGraphBuilder *pGraph, WCHAR *wszPath);
HRESULT routeCrossbar(ICaptureGraphBuilder2 **ppBuild, IBaseFilter **pVidInFilter, int conType, GUID captureMode);
//don't touch
static bool comInit();
static bool comUnInit();
int connection;
int callbackSetCount;
bool bCallback;
GUID CAPTURE_MODE;
//Extra video subtypes
GUID MEDIASUBTYPE_Y800;
GUID MEDIASUBTYPE_Y8;
GUID MEDIASUBTYPE_GREY;
videoDevice * VDList[VI_MAX_CAMERAS];
GUID mediaSubtypes[VI_NUM_TYPES];
long formatTypes[VI_NUM_FORMATS];
static void __cdecl basicThread(void * objPtr);
static char deviceNames[VI_MAX_CAMERAS][255];
};
/////////////////////////// HANDY FUNCTIONS /////////////////////////////
void MyFreeMediaType(AM_MEDIA_TYPE& mt){
if (mt.cbFormat != 0)
{
CoTaskMemFree((PVOID)mt.pbFormat);
mt.cbFormat = 0;
mt.pbFormat = NULL;
}
if (mt.pUnk != NULL)
{
// Unecessary because pUnk should not be used, but safest.
mt.pUnk->Release();
mt.pUnk = NULL;
}
}
void MyDeleteMediaType(AM_MEDIA_TYPE *pmt)
{
if (pmt != NULL)
{
MyFreeMediaType(*pmt);
CoTaskMemFree(pmt);
}
}
////////////////////////////// CALLBACK ////////////////////////////////
//Callback class
class SampleGrabberCallback : public ISampleGrabberCB{
public:
//------------------------------------------------
SampleGrabberCallback(){
InitializeCriticalSection(&critSection);
freezeCheck = 0;
bufferSetup = false;
newFrame = false;
latestBufferLength = 0;
hEvent = CreateEvent(NULL, true, false, NULL);
}
//------------------------------------------------
~SampleGrabberCallback(){
ptrBuffer = NULL;
DeleteCriticalSection(&critSection);
CloseHandle(hEvent);
if(bufferSetup){
delete pixels;
}
}
//------------------------------------------------
bool setupBuffer(int numBytesIn){
if(bufferSetup){
return false;
}else{
numBytes = numBytesIn;
pixels = new unsigned char[numBytes];
bufferSetup = true;
newFrame = false;
latestBufferLength = 0;
}
return true;
}
//------------------------------------------------
STDMETHODIMP_(ULONG) AddRef() { return 1; }
STDMETHODIMP_(ULONG) Release() { return 2; }
//------------------------------------------------
STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject){
*ppvObject = static_cast<ISampleGrabberCB*>(this);
return S_OK;
}
//This method is meant to have less overhead
//------------------------------------------------
STDMETHODIMP SampleCB(double Time, IMediaSample *pSample){
if(WaitForSingleObject(hEvent, 0) == WAIT_OBJECT_0) return S_OK;
HRESULT hr = pSample->GetPointer(&ptrBuffer);
if(hr == S_OK){
latestBufferLength = pSample->GetActualDataLength();
if(latestBufferLength == numBytes){
EnterCriticalSection(&critSection);
memcpy(pixels, ptrBuffer, latestBufferLength);
newFrame = true;
freezeCheck = 1;
LeaveCriticalSection(&critSection);
SetEvent(hEvent);
}else{
printf("ERROR: SampleCB() - buffer sizes do not match\n");
}
}
return S_OK;
}
//This method is meant to have more overhead
STDMETHODIMP BufferCB(double Time, BYTE *pBuffer, long BufferLen){
return E_NOTIMPL;
}
int freezeCheck;
int latestBufferLength;
int numBytes;
bool newFrame;
bool bufferSetup;
unsigned char * pixels;
unsigned char * ptrBuffer;
CRITICAL_SECTION critSection;
HANDLE hEvent;
};
////////////////////////////// VIDEO DEVICE ////////////////////////////////
// ----------------------------------------------------------------------
// Should this class also be the callback?
//
// ----------------------------------------------------------------------
videoDevice::videoDevice(){
pCaptureGraph = NULL; // Capture graph builder object
pGraph = NULL; // Graph builder object
pControl = NULL; // Media control object
pVideoInputFilter = NULL; // Video Capture filter
pGrabber = NULL; // Grabs frame
pDestFilter = NULL; // Null Renderer Filter
pGrabberF = NULL; // Grabber Filter
pMediaEvent = NULL;
streamConf = NULL;
pAmMediaType = NULL;
//This is our callback class that processes the frame.
sgCallback = new SampleGrabberCallback();
sgCallback->newFrame = false;
//Default values for capture type
videoType = MEDIASUBTYPE_RGB24;
connection = PhysConn_Video_Composite;
storeConn = 0;
videoSize = 0;
width = 0;
height = 0;
tryWidth = 0;
tryHeight = 0;
nFramesForReconnect= 10000;
nFramesRunning = 0;
myID = -1;
tryDiffSize = false;
useCrossbar = false;
readyToCapture = false;
sizeSet = false;
setupStarted = false;
specificFormat = false;
autoReconnect = false;
requestedFrameTime = -1;
memset(wDeviceName, 0, sizeof(WCHAR) * 255);
memset(nDeviceName, 0, sizeof(char) * 255);
}
// ----------------------------------------------------------------------
// The only place we are doing new
//
// ----------------------------------------------------------------------
void videoDevice::setSize(int w, int h){
if(sizeSet){
if(verbose)printf("SETUP: Error device size should not be set more than once \n");
}
else
{
width = w;
height = h;
videoSize = w*h*3;
sizeSet = true;
pixels = new unsigned char[videoSize];
pBuffer = new char[videoSize];
memset(pixels, 0 , videoSize);
sgCallback->setupBuffer(videoSize);
}
}
// ----------------------------------------------------------------------
// Borrowed from the SDK, use it to take apart the graph from
// the capture device downstream to the null renderer
// ----------------------------------------------------------------------
void videoDevice::NukeDownstream(IBaseFilter *pBF){
IPin *pP, *pTo;
ULONG u;
IEnumPins *pins = NULL;
PIN_INFO pininfo;
HRESULT hr = pBF->EnumPins(&pins);
pins->Reset();
while (hr == NOERROR)
{
hr = pins->Next(1, &pP, &u);
if (hr == S_OK && pP)
{
pP->ConnectedTo(&pTo);
if (pTo)
{
hr = pTo->QueryPinInfo(&pininfo);
if (hr == NOERROR)
{
if (pininfo.dir == PINDIR_INPUT)
{
NukeDownstream(pininfo.pFilter);
pGraph->Disconnect(pTo);
pGraph->Disconnect(pP);
pGraph->RemoveFilter(pininfo.pFilter);
}
pininfo.pFilter->Release();
pininfo.pFilter = NULL;
}
pTo->Release();
}
pP->Release();
}
}
if (pins) pins->Release();
}
// ----------------------------------------------------------------------
// Also from SDK
// ----------------------------------------------------------------------
void videoDevice::destroyGraph(){
HRESULT hr = NULL;
//int FuncRetval=0;
//int NumFilters=0;
int i = 0;
while (hr == NOERROR)
{
IEnumFilters * pEnum = 0;
ULONG cFetched;
// We must get the enumerator again every time because removing a filter from the graph
// invalidates the enumerator. We always get only the first filter from each enumerator.
hr = pGraph->EnumFilters(&pEnum);
if (FAILED(hr)) { if(verbose)printf("SETUP: pGraph->EnumFilters() failed. \n"); return; }
IBaseFilter * pFilter = NULL;
if (pEnum->Next(1, &pFilter, &cFetched) == S_OK)
{
FILTER_INFO FilterInfo={0};
hr = pFilter->QueryFilterInfo(&FilterInfo);
FilterInfo.pGraph->Release();
int count = 0;
char buffer[255];
memset(buffer, 0, 255 * sizeof(char));
while( FilterInfo.achName[count] != 0x00 )
{
buffer[count] = FilterInfo.achName[count];
count++;
}
if(verbose)printf("SETUP: removing filter %s...\n", buffer);
hr = pGraph->RemoveFilter(pFilter);
if (FAILED(hr)) { if(verbose)printf("SETUP: pGraph->RemoveFilter() failed. \n"); return; }
if(verbose)printf("SETUP: filter removed %s \n",buffer);
pFilter->Release();
pFilter = NULL;
}
else break;
pEnum->Release();
pEnum = NULL;
i++;
}
return;
}
// ----------------------------------------------------------------------
// Our deconstructor, attempts to tear down graph and release filters etc
// Does checking to make sure it only is freeing if it needs to
// Probably could be a lot cleaner! :)
// ----------------------------------------------------------------------
videoDevice::~videoDevice(){
if(setupStarted){ if(verbose)printf("\nSETUP: Disconnecting device %i\n", myID); }
else{
if(sgCallback){
sgCallback->Release();
delete sgCallback;
}
return;
}
HRESULT HR = NULL;
//Stop the callback and free it
if( (sgCallback) && (pGrabber) )
{
pGrabber->SetCallback(NULL, 1);
if(verbose)printf("SETUP: freeing Grabber Callback\n");
sgCallback->Release();
//delete our pixels
if(sizeSet){
delete[] pixels;
delete[] pBuffer;
}
delete sgCallback;
}
//Check to see if the graph is running, if so stop it.
if( (pControl) )
{
HR = pControl->Pause();
if (FAILED(HR)) if(verbose)printf("ERROR - Could not pause pControl\n");
HR = pControl->Stop();
if (FAILED(HR)) if(verbose)printf("ERROR - Could not stop pControl\n");
}
//Disconnect filters from capture device
if( (pVideoInputFilter) )NukeDownstream(pVideoInputFilter);
//Release and zero pointers to our filters etc
if( (pDestFilter) ){ if(verbose)printf("SETUP: freeing Renderer \n");
(pDestFilter)->Release();
(pDestFilter) = 0;
}
if( (pVideoInputFilter) ){ if(verbose)printf("SETUP: freeing Capture Source \n");
(pVideoInputFilter)->Release();
(pVideoInputFilter) = 0;
}
if( (pGrabberF) ){ if(verbose)printf("SETUP: freeing Grabber Filter \n");
(pGrabberF)->Release();
(pGrabberF) = 0;
}
if( (pGrabber) ){ if(verbose)printf("SETUP: freeing Grabber \n");
(pGrabber)->Release();
(pGrabber) = 0;
}
if( (pControl) ){ if(verbose)printf("SETUP: freeing Control \n");
(pControl)->Release();
(pControl) = 0;
}
if( (pMediaEvent) ){ if(verbose)printf("SETUP: freeing Media Event \n");
(pMediaEvent)->Release();
(pMediaEvent) = 0;
}
if( (streamConf) ){ if(verbose)printf("SETUP: freeing Stream \n");
(streamConf)->Release();
(streamConf) = 0;
}
if( (pAmMediaType) ){ if(verbose)printf("SETUP: freeing Media Type \n");
MyDeleteMediaType(pAmMediaType);
}
if((pMediaEvent)){
if(verbose)printf("SETUP: freeing Media Event \n");
(pMediaEvent)->Release();
(pMediaEvent) = 0;
}
//Destroy the graph
if( (pGraph) )destroyGraph();
//Release and zero our capture graph and our main graph
if( (pCaptureGraph) ){ if(verbose)printf("SETUP: freeing Capture Graph \n");
(pCaptureGraph)->Release();
(pCaptureGraph) = 0;
}
if( (pGraph) ){ if(verbose)printf("SETUP: freeing Main Graph \n");
(pGraph)->Release();
(pGraph) = 0;
}
//delete our pointers
delete pDestFilter;
delete pVideoInputFilter;
delete pGrabberF;
delete pGrabber;
delete pControl;
delete streamConf;
delete pMediaEvent;
delete pCaptureGraph;
delete pGraph;
if(verbose)printf("SETUP: Device %i disconnected and freed\n\n",myID);
}
////////////////////////////// VIDEO INPUT ////////////////////////////////
//////////////////////////// PUBLIC METHODS ///////////////////////////////
// ----------------------------------------------------------------------
// Constructor - creates instances of videoDevice and adds the various
// media subtypes to check.
// ----------------------------------------------------------------------
videoInput::videoInput(){
//start com
comInit();
devicesFound = 0;
callbackSetCount = 0;
bCallback = true;
//setup a max no of device objects
for(int i=0; i<VI_MAX_CAMERAS; i++) VDList[i] = new videoDevice();
if(verbose)printf("\n***** VIDEOINPUT LIBRARY - %2.04f - TFW07 *****\n\n",VI_VERSION);
//added for the pixelink firewire camera
//MEDIASUBTYPE_Y800 = (GUID)FOURCCMap(FCC('Y800'));
//MEDIASUBTYPE_Y8 = (GUID)FOURCCMap(FCC('Y8'));
//MEDIASUBTYPE_GREY = (GUID)FOURCCMap(FCC('GREY'));
//The video types we support
//in order of preference
mediaSubtypes[0] = MEDIASUBTYPE_RGB24;
mediaSubtypes[1] = MEDIASUBTYPE_RGB32;
mediaSubtypes[2] = MEDIASUBTYPE_RGB555;
mediaSubtypes[3] = MEDIASUBTYPE_RGB565;
mediaSubtypes[4] = MEDIASUBTYPE_YUY2;
mediaSubtypes[5] = MEDIASUBTYPE_YVYU;
mediaSubtypes[6] = MEDIASUBTYPE_YUYV;
mediaSubtypes[7] = MEDIASUBTYPE_IYUV;
mediaSubtypes[8] = MEDIASUBTYPE_UYVY;
mediaSubtypes[9] = MEDIASUBTYPE_YV12;
mediaSubtypes[10] = MEDIASUBTYPE_YVU9;
mediaSubtypes[11] = MEDIASUBTYPE_Y411;
mediaSubtypes[12] = MEDIASUBTYPE_Y41P;
mediaSubtypes[13] = MEDIASUBTYPE_Y211;
mediaSubtypes[14] = MEDIASUBTYPE_AYUV;
//non standard
mediaSubtypes[15] = MEDIASUBTYPE_Y800;
mediaSubtypes[16] = MEDIASUBTYPE_Y8;
mediaSubtypes[17] = MEDIASUBTYPE_GREY;
//The video formats we support
formatTypes[VI_NTSC_M] = AnalogVideo_NTSC_M;
formatTypes[VI_NTSC_M_J] = AnalogVideo_NTSC_M_J;
formatTypes[VI_NTSC_433] = AnalogVideo_NTSC_433;
formatTypes[VI_PAL_B] = AnalogVideo_PAL_B;
formatTypes[VI_PAL_D] = AnalogVideo_PAL_D;
formatTypes[VI_PAL_G] = AnalogVideo_PAL_G;
formatTypes[VI_PAL_H] = AnalogVideo_PAL_H;
formatTypes[VI_PAL_I] = AnalogVideo_PAL_I;
formatTypes[VI_PAL_M] = AnalogVideo_PAL_M;
formatTypes[VI_PAL_N] = AnalogVideo_PAL_N;
formatTypes[VI_PAL_NC] = AnalogVideo_PAL_N_COMBO;
formatTypes[VI_SECAM_B] = AnalogVideo_SECAM_B;
formatTypes[VI_SECAM_D] = AnalogVideo_SECAM_D;
formatTypes[VI_SECAM_G] = AnalogVideo_SECAM_G;
formatTypes[VI_SECAM_H] = AnalogVideo_SECAM_H;
formatTypes[VI_SECAM_K] = AnalogVideo_SECAM_K;
formatTypes[VI_SECAM_K1] = AnalogVideo_SECAM_K1;
formatTypes[VI_SECAM_L] = AnalogVideo_SECAM_L;
propBrightness = VideoProcAmp_Brightness;
propContrast = VideoProcAmp_Contrast;
propHue = VideoProcAmp_Hue;
propSaturation = VideoProcAmp_Saturation;
propSharpness = VideoProcAmp_Sharpness;
propGamma = VideoProcAmp_Gamma;
propColorEnable = VideoProcAmp_ColorEnable;
propWhiteBalance = VideoProcAmp_WhiteBalance;
propBacklightCompensation = VideoProcAmp_BacklightCompensation;
propGain = VideoProcAmp_Gain;
propPan = CameraControl_Pan;
propTilt = CameraControl_Tilt;
propRoll = CameraControl_Roll;
propZoom = CameraControl_Zoom;
propExposure = CameraControl_Exposure;
propIris = CameraControl_Iris;
propFocus = CameraControl_Focus;
}
// ----------------------------------------------------------------------
// static - set whether messages get printed to console or not
//
// ----------------------------------------------------------------------
void videoInput::setVerbose(bool _verbose){
verbose = _verbose;
}
// ----------------------------------------------------------------------
// change to use callback or regular capture
// callback tells you when a new frame has arrived
// but non-callback won't - but is single threaded
// ----------------------------------------------------------------------
void videoInput::setUseCallback(bool useCallback){
if(callbackSetCount == 0){
bCallback = useCallback;
callbackSetCount = 1;
}else{
printf("ERROR: setUseCallback can only be called before setup\n");
}
}
// ----------------------------------------------------------------------
// Set the requested framerate - no guarantee you will get this
//
// ----------------------------------------------------------------------
void videoInput::setIdealFramerate(int deviceNumber, int idealFramerate){
if(deviceNumber >= VI_MAX_CAMERAS || VDList[deviceNumber]->readyToCapture) return;
if( idealFramerate > 0 ){
VDList[deviceNumber]->requestedFrameTime = (unsigned long)(10000000 / idealFramerate);
}
}
// ----------------------------------------------------------------------
// Set the requested framerate - no guarantee you will get this
//
// ----------------------------------------------------------------------
void videoInput::setAutoReconnectOnFreeze(int deviceNumber, bool doReconnect, int numMissedFramesBeforeReconnect){
if(deviceNumber >= VI_MAX_CAMERAS) return;
VDList[deviceNumber]->autoReconnect = doReconnect;
VDList[deviceNumber]->nFramesForReconnect = numMissedFramesBeforeReconnect;
}
// ----------------------------------------------------------------------
// Setup a device with the default settings
//
// ----------------------------------------------------------------------
bool videoInput::setupDevice(int deviceNumber){
if(deviceNumber >= VI_MAX_CAMERAS || VDList[deviceNumber]->readyToCapture) return false;
if(setup(deviceNumber))return true;
return false;
}
// ----------------------------------------------------------------------
// Setup a device with the default size but specify input type
//
// ----------------------------------------------------------------------
bool videoInput::setupDevice(int deviceNumber, int connection){
if(deviceNumber >= VI_MAX_CAMERAS || VDList[deviceNumber]->readyToCapture) return false;
setPhyCon(deviceNumber, connection);
if(setup(deviceNumber))return true;
return false;
}
// ----------------------------------------------------------------------
// Setup a device with the default connection but specify size
//
// ----------------------------------------------------------------------
bool videoInput::setupDevice(int deviceNumber, int w, int h){
if(deviceNumber >= VI_MAX_CAMERAS || VDList[deviceNumber]->readyToCapture) return false;
setAttemptCaptureSize(deviceNumber,w,h);
if(setup(deviceNumber))return true;
return false;
}
// ----------------------------------------------------------------------
// Setup a device with specific size and connection
//
// ----------------------------------------------------------------------
bool videoInput::setupDevice(int deviceNumber, int w, int h, int connection){
if(deviceNumber >= VI_MAX_CAMERAS || VDList[deviceNumber]->readyToCapture) return false;
setAttemptCaptureSize(deviceNumber,w,h);
setPhyCon(deviceNumber, connection);
if(setup(deviceNumber))return true;
return false;
}
// ----------------------------------------------------------------------
// Setup the default video format of the device
// Must be called after setup!
// See #define formats in header file (eg VI_NTSC_M )
//
// ----------------------------------------------------------------------
bool videoInput::setFormat(int deviceNumber, int format){
if(deviceNumber >= VI_MAX_CAMERAS || !VDList[deviceNumber]->readyToCapture) return false;
bool returnVal = false;
if(format >= 0 && format < VI_NUM_FORMATS){
VDList[deviceNumber]->formatType = formatTypes[format];
VDList[deviceNumber]->specificFormat = true;
if(VDList[deviceNumber]->specificFormat){
HRESULT hr = getDevice(&VDList[deviceNumber]->pVideoInputFilter, deviceNumber, VDList[deviceNumber]->wDeviceName, VDList[deviceNumber]->nDeviceName);
if(hr != S_OK){
return false;
}
IAMAnalogVideoDecoder *pVideoDec = NULL;
hr = VDList[deviceNumber]->pCaptureGraph->FindInterface(NULL, &MEDIATYPE_Video, VDList[deviceNumber]->pVideoInputFilter, IID_IAMAnalogVideoDecoder, (void **)&pVideoDec);
//in case the settings window some how freed them first
if(VDList[deviceNumber]->pVideoInputFilter)VDList[deviceNumber]->pVideoInputFilter->Release();
if(VDList[deviceNumber]->pVideoInputFilter)VDList[deviceNumber]->pVideoInputFilter = NULL;
if(FAILED(hr)){
printf("SETUP: couldn't set requested format\n");
}else{
long lValue = 0;
hr = pVideoDec->get_AvailableTVFormats(&lValue);
if( SUCCEEDED(hr) && (lValue & VDList[deviceNumber]->formatType) )
{
hr = pVideoDec->put_TVFormat(VDList[deviceNumber]->formatType);
if( FAILED(hr) ){
printf("SETUP: couldn't set requested format\n");
}else{
returnVal = true;
}
}
pVideoDec->Release();
pVideoDec = NULL;
}
}
}
return returnVal;
}
// ----------------------------------------------------------------------
// Our static function for returning device names - thanks Peter!
// Must call listDevices first.
//
// ----------------------------------------------------------------------
char videoInput::deviceNames[VI_MAX_CAMERAS][255]={{0}};
char * videoInput::getDeviceName(int deviceID){
if( deviceID >= VI_MAX_CAMERAS ){
return NULL;
}
return deviceNames[deviceID];
}
// ----------------------------------------------------------------------
// Our static function for finding num devices available etc
//
// ----------------------------------------------------------------------
int videoInput::listDevices(bool silent){
//COM Library Intialization
comInit();
if(!silent)printf("\nVIDEOINPUT SPY MODE!\n\n");
ICreateDevEnum *pDevEnum = NULL;
IEnumMoniker *pEnum = NULL;
int deviceCounter = 0;
HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL,
CLSCTX_INPROC_SERVER, IID_ICreateDevEnum,
reinterpret_cast<void**>(&pDevEnum));
if (SUCCEEDED(hr))
{
// Create an enumerator for the video capture category.
hr = pDevEnum->CreateClassEnumerator(
CLSID_VideoInputDeviceCategory,
&pEnum, 0);
if(hr == S_OK){
if(!silent)printf("SETUP: Looking For Capture Devices\n");
IMoniker *pMoniker = NULL;
while (pEnum->Next(1, &pMoniker, NULL) == S_OK){
IPropertyBag *pPropBag;
hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
(void**)(&pPropBag));
if (FAILED(hr)){
pMoniker->Release();
continue; // Skip this one, maybe the next one will work.
}
// Find the description or friendly name.
VARIANT varName;
VariantInit(&varName);
hr = pPropBag->Read(L"Description", &varName, 0);
if (FAILED(hr)) hr = pPropBag->Read(L"FriendlyName", &varName, 0);
if (SUCCEEDED(hr)){
hr = pPropBag->Read(L"FriendlyName", &varName, 0);
int count = 0;
int maxLen = sizeof(deviceNames[0])/sizeof(deviceNames[0][0]) - 2;
while( varName.bstrVal[count] != 0x00 && count < maxLen) {
deviceNames[deviceCounter][count] = varName.bstrVal[count];
count++;
}
deviceNames[deviceCounter][count] = 0;
if(!silent)printf("SETUP: %i) %s \n",deviceCounter, deviceNames[deviceCounter]);
}
pPropBag->Release();
pPropBag = NULL;
pMoniker->Release();
pMoniker = NULL;
deviceCounter++;
}
pDevEnum->Release();
pDevEnum = NULL;
pEnum->Release();
pEnum = NULL;
}
if(!silent)printf("SETUP: %i Device(s) found\n\n", deviceCounter);
}
comUnInit();
return deviceCounter;
}
// ----------------------------------------------------------------------
//
//
// ----------------------------------------------------------------------
int videoInput::getWidth(int id){
if(isDeviceSetup(id))
{
return VDList[id] ->width;
}
return 0;
}
// ----------------------------------------------------------------------
//
//
// ----------------------------------------------------------------------
int videoInput::getHeight(int id){
if(isDeviceSetup(id))
{
return VDList[id] ->height;
}
return 0;
}
// ----------------------------------------------------------------------
//
//
// ----------------------------------------------------------------------
int videoInput::getSize(int id){
if(isDeviceSetup(id))
{
return VDList[id] ->videoSize;
}
return 0;
}
// ----------------------------------------------------------------------
// Uses a supplied buffer
// ----------------------------------------------------------------------
bool videoInput::getPixels(int id, unsigned char * dstBuffer, bool flipRedAndBlue, bool flipImage){
bool success = false;
if(isDeviceSetup(id)){
if(bCallback){
//callback capture
DWORD result = WaitForSingleObject(VDList[id]->sgCallback->hEvent, 1000);
if( result != WAIT_OBJECT_0) return false;
//double paranoia - mutexing with both event and critical section
EnterCriticalSection(&VDList[id]->sgCallback->critSection);
unsigned char * src = VDList[id]->sgCallback->pixels;
unsigned char * dst = dstBuffer;
int height = VDList[id]->height;
int width = VDList[id]->width;
processPixels(src, dst, width, height, flipRedAndBlue, flipImage);
VDList[id]->sgCallback->newFrame = false;
LeaveCriticalSection(&VDList[id]->sgCallback->critSection);
ResetEvent(VDList[id]->sgCallback->hEvent);
success = true;
}
else{
//regular capture method
long bufferSize = VDList[id]->videoSize;
HRESULT hr = VDList[id]->pGrabber->GetCurrentBuffer(&bufferSize, (long *)VDList[id]->pBuffer);
if(hr==S_OK){
int numBytes = VDList[id]->videoSize;
if (numBytes == bufferSize){
unsigned char * src = (unsigned char * )VDList[id]->pBuffer;
unsigned char * dst = dstBuffer;
int height = VDList[id]->height;
int width = VDList[id]->width;
processPixels(src, dst, width, height, flipRedAndBlue, flipImage);
success = true;
}else{
if(verbose)printf("ERROR: GetPixels() - bufferSizes do not match!\n");
}
}else{
if(verbose)printf("ERROR: GetPixels() - Unable to grab frame for device %i\n", id);
}
}
}
return success;
}
// ----------------------------------------------------------------------
// Returns a buffer
// ----------------------------------------------------------------------
unsigned char * videoInput::getPixels(int id, bool flipRedAndBlue, bool flipImage){
if(isDeviceSetup(id)){
getPixels(id, VDList[id]->pixels, flipRedAndBlue, flipImage);
}
return VDList[id]->pixels;
}
// ----------------------------------------------------------------------
//
//
// ----------------------------------------------------------------------
bool videoInput::isFrameNew(int id){
if(!isDeviceSetup(id)) return false;
if(!bCallback)return true;
bool result = false;
bool freeze = false;
//again super paranoia!
EnterCriticalSection(&VDList[id]->sgCallback->critSection);
result = VDList[id]->sgCallback->newFrame;
//we need to give it some time at the begining to start up so lets check after 400 frames
if(VDList[id]->nFramesRunning > 400 && VDList[id]->sgCallback->freezeCheck > VDList[id]->nFramesForReconnect ){
freeze = true;
}
//we increment the freezeCheck var here - the callback resets it to 1
//so as long as the callback is running this var should never get too high.
//if the callback is not running then this number will get high and trigger the freeze action below
VDList[id]->sgCallback->freezeCheck++;
LeaveCriticalSection(&VDList[id]->sgCallback->critSection);
VDList[id]->nFramesRunning++;
if(freeze && VDList[id]->autoReconnect){
if(verbose)printf("ERROR: Device seems frozen - attempting to reconnect\n");
if( !restartDevice(VDList[id]->myID) ){
if(verbose)printf("ERROR: Unable to reconnect to device\n");
}else{
if(verbose)printf("SUCCESS: Able to reconnect to device\n");
}
}
return result;
}
// ----------------------------------------------------------------------
//
//
// ----------------------------------------------------------------------
bool videoInput::isDeviceSetup(int id){
if(id<devicesFound && VDList[id]->readyToCapture)return true;
else return false;
}
// ----------------------------------------------------------------------
// Gives us a little pop up window to adjust settings
// We do this in a seperate thread now!
// ----------------------------------------------------------------------
void __cdecl videoInput::basicThread(void * objPtr){
//get a reference to the video device
//not a copy as we need to free the filter
videoDevice * vd = *( (videoDevice **)(objPtr) );
ShowFilterPropertyPages(vd->pVideoInputFilter);
//now we free the filter and make sure it set to NULL
if(vd->pVideoInputFilter)vd->pVideoInputFilter->Release();
if(vd->pVideoInputFilter)vd->pVideoInputFilter = NULL;
return;
}
void videoInput::showSettingsWindow(int id){
if(isDeviceSetup(id)){
HANDLE myTempThread;
//we reconnect to the device as we have freed our reference to it
//why have we freed our reference? because there seemed to be an issue
//with some mpeg devices if we didn't
HRESULT hr = getDevice(&VDList[id]->pVideoInputFilter, id, VDList[id]->wDeviceName, VDList[id]->nDeviceName);
if(hr == S_OK){
myTempThread = (HANDLE)_beginthread(basicThread, 0, (void *)&VDList[id]);
}
}
}
// Set a video signal setting using IAMVideoProcAmp
bool videoInput::getVideoSettingFilter(int deviceID, long Property, long &min, long &max, long &SteppingDelta, long &currentValue, long &flags, long &defaultValue){
if( !isDeviceSetup(deviceID) )return false;
HRESULT hr;
//bool isSuccessful = false;
videoDevice * VD = VDList[deviceID];
hr = getDevice(&VD->pVideoInputFilter, deviceID, VD->wDeviceName, VD->nDeviceName);
if (FAILED(hr)){
printf("setVideoSetting - getDevice Error\n");
return false;
}
IAMVideoProcAmp *pAMVideoProcAmp = NULL;
hr = VD->pVideoInputFilter->QueryInterface(IID_IAMVideoProcAmp, (void**)&pAMVideoProcAmp);
if(FAILED(hr)){
printf("setVideoSetting - QueryInterface Error\n");
if(VD->pVideoInputFilter)VD->pVideoInputFilter->Release();
if(VD->pVideoInputFilter)VD->pVideoInputFilter = NULL;
return false;
}
if (verbose) printf("Setting video setting %ld.\n", Property);
pAMVideoProcAmp->GetRange(Property, &min, &max, &SteppingDelta, &defaultValue, &flags);
if (verbose) printf("Range for video setting %ld: Min:%ld Max:%ld SteppingDelta:%ld Default:%ld Flags:%ld\n", Property, min, max, SteppingDelta, defaultValue, flags);
pAMVideoProcAmp->Get(Property, &currentValue, &flags);
if(pAMVideoProcAmp)pAMVideoProcAmp->Release();
if(VD->pVideoInputFilter)VD->pVideoInputFilter->Release();
if(VD->pVideoInputFilter)VD->pVideoInputFilter = NULL;
return true;
}
// Set a video signal setting using IAMVideoProcAmp
bool videoInput::setVideoSettingFilterPct(int deviceID, long Property, float pctValue, long Flags){
if( !isDeviceSetup(deviceID) )return false;
long min, max, currentValue, flags, defaultValue, stepAmnt;
if( !getVideoSettingFilter(deviceID, Property, min, max, stepAmnt, currentValue, flags, defaultValue) )return false;
if(pctValue > 1.0)pctValue = 1.0;
else if(pctValue < 0)pctValue = 0.0;
float range = (float)max - (float)min;
if(range <= 0)return false;
if(stepAmnt == 0) return false;
long value = (long)( (float)min + range * pctValue );
long rasterValue = value;
//if the range is the stepAmnt then it is just a switch
//so we either set the value to low or high
if( range == stepAmnt ){
if( pctValue < 0.5)rasterValue = min;
else rasterValue = max;
}else{
//we need to rasterize the value to the stepping amnt
long mod = value % stepAmnt;
float halfStep = (float)stepAmnt * 0.5f;
if( mod < halfStep ) rasterValue -= mod;
else rasterValue += stepAmnt - mod;
printf("RASTER - pctValue is %f - value is %i - step is %i - mod is %i - rasterValue is %i\n", pctValue, value, stepAmnt, mod, rasterValue);
}
return setVideoSettingFilter(deviceID, Property, rasterValue, Flags, false);
}
// Set a video signal setting using IAMVideoProcAmp
bool videoInput::setVideoSettingFilter(int deviceID, long Property, long lValue, long Flags, bool useDefaultValue){
if( !isDeviceSetup(deviceID) )return false;
HRESULT hr;
//bool isSuccessful = false;
videoDevice * VD = VDList[deviceID];
hr = getDevice(&VD->pVideoInputFilter, deviceID, VD->wDeviceName, VD->nDeviceName);
if (FAILED(hr)){
printf("setVideoSetting - getDevice Error\n");
return false;
}
IAMVideoProcAmp *pAMVideoProcAmp = NULL;
hr = VD->pVideoInputFilter->QueryInterface(IID_IAMVideoProcAmp, (void**)&pAMVideoProcAmp);
if(FAILED(hr)){
printf("setVideoSetting - QueryInterface Error\n");
if(VD->pVideoInputFilter)VD->pVideoInputFilter->Release();
if(VD->pVideoInputFilter)VD->pVideoInputFilter = NULL;
return false;
}
if (verbose) printf("Setting video setting %ld.\n", Property);
long CurrVal, Min, Max, SteppingDelta, Default, CapsFlags, AvailableCapsFlags = 0;
pAMVideoProcAmp->GetRange(Property, &Min, &Max, &SteppingDelta, &Default, &AvailableCapsFlags);
if (verbose) printf("Range for video setting %ld: Min:%ld Max:%ld SteppingDelta:%ld Default:%ld Flags:%ld\n", Property, Min, Max, SteppingDelta, Default, AvailableCapsFlags);
pAMVideoProcAmp->Get(Property, &CurrVal, &CapsFlags);
if (verbose) printf("Current value: %ld Flags %ld (%s)\n", CurrVal, CapsFlags, (CapsFlags == 1 ? "Auto" : (CapsFlags == 2 ? "Manual" : "Unknown")));
if (useDefaultValue) {
pAMVideoProcAmp->Set(Property, Default, VideoProcAmp_Flags_Auto);
}
else{
// Perhaps add a check that lValue and Flags are within the range aquired from GetRange above
pAMVideoProcAmp->Set(Property, lValue, Flags);
}
if(pAMVideoProcAmp)pAMVideoProcAmp->Release();
if(VD->pVideoInputFilter)VD->pVideoInputFilter->Release();
if(VD->pVideoInputFilter)VD->pVideoInputFilter = NULL;
return true;
}
bool videoInput::setVideoSettingCameraPct(int deviceID, long Property, float pctValue, long Flags){
if( !isDeviceSetup(deviceID) )return false;
long min, max, currentValue, flags, defaultValue, stepAmnt;
if( !getVideoSettingCamera(deviceID, Property, min, max, stepAmnt, currentValue, flags, defaultValue) )return false;
if(pctValue > 1.0)pctValue = 1.0;
else if(pctValue < 0)pctValue = 0.0;
float range = (float)max - (float)min;
if(range <= 0)return false;
if(stepAmnt == 0) return false;
long value = (long)( (float)min + range * pctValue );
long rasterValue = value;
//if the range is the stepAmnt then it is just a switch
//so we either set the value to low or high
if( range == stepAmnt ){
if( pctValue < 0.5)rasterValue = min;
else rasterValue = max;
}else{
//we need to rasterize the value to the stepping amnt
long mod = value % stepAmnt;
float halfStep = (float)stepAmnt * 0.5f;
if( mod < halfStep ) rasterValue -= mod;
else rasterValue += stepAmnt - mod;
printf("RASTER - pctValue is %f - value is %i - step is %i - mod is %i - rasterValue is %i\n", pctValue, value, stepAmnt, mod, rasterValue);
}
return setVideoSettingCamera(deviceID, Property, rasterValue, Flags, false);
}
bool videoInput::setVideoSettingCamera(int deviceID, long Property, long lValue, long Flags, bool useDefaultValue){
IAMCameraControl *pIAMCameraControl;
if(isDeviceSetup(deviceID))
{
HRESULT hr;
hr = getDevice(&VDList[deviceID]->pVideoInputFilter, deviceID, VDList[deviceID]->wDeviceName, VDList[deviceID]->nDeviceName);
if (verbose) printf("Setting video setting %ld.\n", Property);
hr = VDList[deviceID]->pVideoInputFilter->QueryInterface(IID_IAMCameraControl, (void**)&pIAMCameraControl);
if (FAILED(hr)) {
printf("Error\n");
return false;
}
else
{
long CurrVal, Min, Max, SteppingDelta, Default, CapsFlags, AvailableCapsFlags;
pIAMCameraControl->GetRange(Property, &Min, &Max, &SteppingDelta, &Default, &AvailableCapsFlags);
if (verbose) printf("Range for video setting %ld: Min:%ld Max:%ld SteppingDelta:%ld Default:%ld Flags:%ld\n", Property, Min, Max, SteppingDelta, Default, AvailableCapsFlags);
pIAMCameraControl->Get(Property, &CurrVal, &CapsFlags);
if (verbose) printf("Current value: %ld Flags %ld (%s)\n", CurrVal, CapsFlags, (CapsFlags == 1 ? "Auto" : (CapsFlags == 2 ? "Manual" : "Unknown")));
if (useDefaultValue) {
pIAMCameraControl->Set(Property, Default, CameraControl_Flags_Auto);
}
else
{
// Perhaps add a check that lValue and Flags are within the range aquired from GetRange above
pIAMCameraControl->Set(Property, lValue, Flags);
}
pIAMCameraControl->Release();
return true;
}
}
return false;
}
bool videoInput::getVideoSettingCamera(int deviceID, long Property, long &min, long &max, long &SteppingDelta, long &currentValue, long &flags, long &defaultValue){
if( !isDeviceSetup(deviceID) )return false;
HRESULT hr;
//bool isSuccessful = false;
videoDevice * VD = VDList[deviceID];
hr = getDevice(&VD->pVideoInputFilter, deviceID, VD->wDeviceName, VD->nDeviceName);
if (FAILED(hr)){
printf("setVideoSetting - getDevice Error\n");
return false;
}
IAMCameraControl *pIAMCameraControl = NULL;
hr = VD->pVideoInputFilter->QueryInterface(IID_IAMCameraControl, (void**)&pIAMCameraControl);
if(FAILED(hr)){
printf("setVideoSetting - QueryInterface Error\n");
if(VD->pVideoInputFilter)VD->pVideoInputFilter->Release();
if(VD->pVideoInputFilter)VD->pVideoInputFilter = NULL;
return false;
}
if (verbose) printf("Setting video setting %ld.\n", Property);
pIAMCameraControl->GetRange(Property, &min, &max, &SteppingDelta, &defaultValue, &flags);
if (verbose) printf("Range for video setting %ld: Min:%ld Max:%ld SteppingDelta:%ld Default:%ld Flags:%ld\n", Property, min, max, SteppingDelta, defaultValue, flags);
pIAMCameraControl->Get(Property, &currentValue, &flags);
if(pIAMCameraControl)pIAMCameraControl->Release();
if(VD->pVideoInputFilter)VD->pVideoInputFilter->Release();
if(VD->pVideoInputFilter)VD->pVideoInputFilter = NULL;
return true;
}
// ----------------------------------------------------------------------
// Shutsdown the device, deletes the object and creates a new object
// so it is ready to be setup again
// ----------------------------------------------------------------------
void videoInput::stopDevice(int id){
if(id < VI_MAX_CAMERAS)
{
delete VDList[id];
VDList[id] = new videoDevice();
}
}
// ----------------------------------------------------------------------
// Restarts the device with the same settings it was using
//
// ----------------------------------------------------------------------
bool videoInput::restartDevice(int id){
if(isDeviceSetup(id))
{
int conn = VDList[id]->storeConn;
int tmpW = VDList[id]->width;
int tmpH = VDList[id]->height;
bool bFormat = VDList[id]->specificFormat;
long format = VDList[id]->formatType;
int nReconnect = VDList[id]->nFramesForReconnect;
bool bReconnect = VDList[id]->autoReconnect;
unsigned long avgFrameTime = VDList[id]->requestedFrameTime;
stopDevice(id);
//set our fps if needed
if( avgFrameTime != -1){
VDList[id]->requestedFrameTime = avgFrameTime;
}
if( setupDevice(id, tmpW, tmpH, conn) ){
//reapply the format - ntsc / pal etc
if( bFormat ){
setFormat(id, format);
}
if( bReconnect ){
setAutoReconnectOnFreeze(id, true, nReconnect);
}
return true;
}
}
return false;
}
// ----------------------------------------------------------------------
// Shuts down all devices, deletes objects and unitializes com if needed
//
// ----------------------------------------------------------------------
videoInput::~videoInput(){
for(int i = 0; i < VI_MAX_CAMERAS; i++)
{
delete VDList[i];
}
//Unitialize com
comUnInit();
}
////////////////////////////// VIDEO INPUT ////////////////////////////////
//////////////////////////// PRIVATE METHODS //////////////////////////////
// ----------------------------------------------------------------------
// We only should init com if it hasn't been done so by our apps thread
// Use a static counter to keep track of other times it has been inited
// (do we need to worry about multithreaded apps?)
// ----------------------------------------------------------------------
bool videoInput::comInit(){
HRESULT hr = NULL;
//no need for us to start com more than once
if(comInitCount == 0 ){
// Initialize the COM library.
//CoInitializeEx so videoInput can run in another thread
#ifdef VI_COM_MULTI_THREADED
hr = CoInitializeEx(NULL,COINIT_MULTITHREADED);
#else
hr = CoInitialize(NULL);
#endif
//this is the only case where there might be a problem
//if another library has started com as single threaded
//and we need it multi-threaded - send warning but don't fail
if( hr == RPC_E_CHANGED_MODE){
if(verbose)printf("SETUP - COM already setup - threaded VI might not be possible\n");
}
}
comInitCount++;
return true;
}
// ----------------------------------------------------------------------
// Same as above but to unitialize com, decreases counter and frees com
// if no one else is using it
// ----------------------------------------------------------------------
bool videoInput::comUnInit(){
if(comInitCount > 0)comInitCount--; //decrease the count of instances using com
if(comInitCount == 0){
CoUninitialize(); //if there are no instances left - uninitialize com
return true;
}
return false;
}
// ----------------------------------------------------------------------
// This is the size we ask for - we might not get it though :)
//
// ----------------------------------------------------------------------
void videoInput::setAttemptCaptureSize(int id, int w, int h){
VDList[id]->tryWidth = w;
VDList[id]->tryHeight = h;
VDList[id]->tryDiffSize = true;
}
// ----------------------------------------------------------------------
// Set the connection type
// (maybe move to private?)
// ----------------------------------------------------------------------
void videoInput::setPhyCon(int id, int conn){
switch(conn){
case 0:
VDList[id]->connection = PhysConn_Video_Composite;
break;
case 1:
VDList[id]->connection = PhysConn_Video_SVideo;
break;
case 2:
VDList[id]->connection = PhysConn_Video_Tuner;
break;
case 3:
VDList[id]->connection = PhysConn_Video_USB;
break;
case 4:
VDList[id]->connection = PhysConn_Video_1394;
break;
default:
return; //if it is not these types don't set crossbar
break;
}
VDList[id]->storeConn = conn;
VDList[id]->useCrossbar = true;
}
// ----------------------------------------------------------------------
// Check that we are not trying to setup a non-existant device
// Then start the graph building!
// ----------------------------------------------------------------------
bool videoInput::setup(int deviceNumber){
devicesFound = getDeviceCount();
if(deviceNumber>devicesFound-1)
{
if(verbose)printf("SETUP: device[%i] not found - you have %i devices available\n", deviceNumber, devicesFound);
if(devicesFound>=0) if(verbose)printf("SETUP: this means that the last device you can use is device[%i] \n", devicesFound-1);
return false;
}
if(VDList[deviceNumber]->readyToCapture)
{
if(verbose)printf("SETUP: can't setup, device %i is currently being used\n",VDList[deviceNumber]->myID);
return false;
}
HRESULT hr = start(deviceNumber, VDList[deviceNumber]);
if(hr == S_OK)return true;
else return false;
}
// ----------------------------------------------------------------------
// Does both vertical buffer flipping and bgr to rgb swapping
// You have any combination of those.
// ----------------------------------------------------------------------
void videoInput::processPixels(unsigned char * src, unsigned char * dst, int width, int height, bool bRGB, bool bFlip){
int widthInBytes = width * 3;
int numBytes = widthInBytes * height;
if(!bRGB){
//int x = 0;
//int y = 0;
if(bFlip){
for(int y = 0; y < height; y++){
memcpy(dst + (y * widthInBytes), src + ( (height -y -1) * widthInBytes), widthInBytes);
}
}else{
memcpy(dst, src, numBytes);
}
}else{
if(bFlip){
int x = 0;
int y = (height - 1) * widthInBytes;
src += y;
for(int i = 0; i < numBytes; i+=3){
if(x >= width){
x = 0;
src -= widthInBytes*2;
}
*dst = *(src+2);
dst++;
*dst = *(src+1);
dst++;
*dst = *src;
dst++;
src+=3;
x++;
}
}
else{
for(int i = 0; i < numBytes; i+=3){
*dst = *(src+2);
dst++;
*dst = *(src+1);
dst++;
*dst = *src;
dst++;
src+=3;
}
}
}
}
//------------------------------------------------------------------------------------------
void videoInput::getMediaSubtypeAsString(GUID type, char * typeAsString){
char tmpStr[8];
if( type == MEDIASUBTYPE_RGB24) sprintf(tmpStr, "RGB24");
else if(type == MEDIASUBTYPE_RGB32) sprintf(tmpStr, "RGB32");
else if(type == MEDIASUBTYPE_RGB555)sprintf(tmpStr, "RGB555");
else if(type == MEDIASUBTYPE_RGB565)sprintf(tmpStr, "RGB565");
else if(type == MEDIASUBTYPE_YUY2) sprintf(tmpStr, "YUY2");
else if(type == MEDIASUBTYPE_YVYU) sprintf(tmpStr, "YVYU");
else if(type == MEDIASUBTYPE_YUYV) sprintf(tmpStr, "YUYV");
else if(type == MEDIASUBTYPE_IYUV) sprintf(tmpStr, "IYUV");
else if(type == MEDIASUBTYPE_UYVY) sprintf(tmpStr, "UYVY");
else if(type == MEDIASUBTYPE_YV12) sprintf(tmpStr, "YV12");
else if(type == MEDIASUBTYPE_YVU9) sprintf(tmpStr, "YVU9");
else if(type == MEDIASUBTYPE_Y411) sprintf(tmpStr, "Y411");
else if(type == MEDIASUBTYPE_Y41P) sprintf(tmpStr, "Y41P");
else if(type == MEDIASUBTYPE_Y211) sprintf(tmpStr, "Y211");
else if(type == MEDIASUBTYPE_AYUV) sprintf(tmpStr, "AYUV");
else if(type == MEDIASUBTYPE_Y800) sprintf(tmpStr, "Y800");
else if(type == MEDIASUBTYPE_Y8) sprintf(tmpStr, "Y8");
else if(type == MEDIASUBTYPE_GREY) sprintf(tmpStr, "GREY");
else sprintf(tmpStr, "OTHER");
memcpy(typeAsString, tmpStr, sizeof(char)*8);
}
//-------------------------------------------------------------------------------------------
static void findClosestSizeAndSubtype(videoDevice * VD, int widthIn, int heightIn, int &widthOut, int &heightOut, GUID & mediatypeOut){
HRESULT hr;
//find perfect match or closest size
int nearW = 9999999;
int nearH = 9999999;
bool foundClosestMatch = true;
int iCount = 0;
int iSize = 0;
hr = VD->streamConf->GetNumberOfCapabilities(&iCount, &iSize);
if (iSize == sizeof(VIDEO_STREAM_CONFIG_CAPS))
{
//For each format type RGB24 YUV2 etc
for (int iFormat = 0; iFormat < iCount; iFormat++)
{
VIDEO_STREAM_CONFIG_CAPS scc;
AM_MEDIA_TYPE *pmtConfig;
hr = VD->streamConf->GetStreamCaps(iFormat, &pmtConfig, (BYTE*)&scc);
if (SUCCEEDED(hr)){
//his is how many diff sizes are available for the format
int stepX = scc.OutputGranularityX;
int stepY = scc.OutputGranularityY;
int tempW = 999999;
int tempH = 999999;
//Don't want to get stuck in a loop
if(stepX < 1 || stepY < 1) continue;
//if(verbose)printf("min is %i %i max is %i %i - res is %i %i \n", scc.MinOutputSize.cx, scc.MinOutputSize.cy, scc.MaxOutputSize.cx, scc.MaxOutputSize.cy, stepX, stepY);
//if(verbose)printf("min frame duration is %i max duration is %i\n", scc.MinFrameInterval, scc.MaxFrameInterval);
bool exactMatch = false;
bool exactMatchX = false;
bool exactMatchY = false;
for(int x = scc.MinOutputSize.cx; x <= scc.MaxOutputSize.cx; x+= stepX){
//If we find an exact match
if( widthIn == x ){
exactMatchX = true;
tempW = x;
}
//Otherwise lets find the closest match based on width
else if( abs(widthIn-x) < abs(widthIn-tempW) ){
tempW = x;
}
}
for(int y = scc.MinOutputSize.cy; y <= scc.MaxOutputSize.cy; y+= stepY){
//If we find an exact match
if( heightIn == y){
exactMatchY = true;
tempH = y;
}
//Otherwise lets find the closest match based on height
else if( abs(heightIn-y) < abs(heightIn-tempH) ){
tempH = y;
}
}
//see if we have an exact match!
if(exactMatchX && exactMatchY){
foundClosestMatch = false;
exactMatch = true;
widthOut = widthIn;
heightOut = heightIn;
mediatypeOut = pmtConfig->subtype;
}
//otherwise lets see if this filters closest size is the closest
//available. the closest size is determined by the sum difference
//of the widths and heights
else if( abs(widthIn - tempW) + abs(heightIn - tempH) < abs(widthIn - nearW) + abs(heightIn - nearH) )
{
nearW = tempW;
nearH = tempH;
widthOut = nearW;
heightOut = nearH;
mediatypeOut = pmtConfig->subtype;
}
MyDeleteMediaType(pmtConfig);
//If we have found an exact match no need to search anymore
if(exactMatch)break;
}
}
}
}
//---------------------------------------------------------------------------------------------------
static bool setSizeAndSubtype(videoDevice * VD, int attemptWidth, int attemptHeight, GUID mediatype){
VIDEOINFOHEADER *pVih = reinterpret_cast<VIDEOINFOHEADER*>(VD->pAmMediaType->pbFormat);
//store current size
//int tmpWidth = HEADER(pVih)->biWidth;
//int tmpHeight = HEADER(pVih)->biHeight;
AM_MEDIA_TYPE * tmpType = NULL;
HRESULT hr = VD->streamConf->GetFormat(&tmpType);
if(hr != S_OK)return false;
//set new size:
//width and height
HEADER(pVih)->biWidth = attemptWidth;
HEADER(pVih)->biHeight = attemptHeight;
VD->pAmMediaType->formattype = FORMAT_VideoInfo;
VD->pAmMediaType->majortype = MEDIATYPE_Video;
VD->pAmMediaType->subtype = mediatype;
//buffer size
VD->pAmMediaType->lSampleSize = attemptWidth*attemptHeight*3;
//set fps if requested
if( VD->requestedFrameTime != -1){
pVih->AvgTimePerFrame = VD->requestedFrameTime;
}
//okay lets try new size
hr = VD->streamConf->SetFormat(VD->pAmMediaType);
if(hr == S_OK){
if( tmpType != NULL )MyDeleteMediaType(tmpType);
return true;
}else{
VD->streamConf->SetFormat(tmpType);
if( tmpType != NULL )MyDeleteMediaType(tmpType);
}
return false;
}
// ----------------------------------------------------------------------
// Where all the work happens!
// Attempts to build a graph for the specified device
// ----------------------------------------------------------------------
int videoInput::start(int deviceID, videoDevice *VD){
HRESULT hr = NULL;
VD->myID = deviceID;
VD->setupStarted = true;
CAPTURE_MODE = PIN_CATEGORY_CAPTURE; //Don't worry - it ends up being preview (which is faster)
callbackSetCount = 1; //make sure callback method is not changed after setup called
if(verbose)printf("SETUP: Setting up device %i\n",deviceID);
// CREATE THE GRAPH BUILDER //
// Create the filter graph manager and query for interfaces.
hr = CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2, (void **)&VD->pCaptureGraph);
if (FAILED(hr)) // FAILED is a macro that tests the return value
{
if(verbose)printf("ERROR - Could not create the Filter Graph Manager\n");
return hr;
}
//FITLER GRAPH MANAGER//
// Create the Filter Graph Manager.
hr = CoCreateInstance(CLSID_FilterGraph, 0, CLSCTX_INPROC_SERVER,IID_IGraphBuilder, (void**)&VD->pGraph);
if (FAILED(hr))
{
if(verbose)printf("ERROR - Could not add the graph builder!\n");
stopDevice(deviceID);
return hr;
}
//SET THE FILTERGRAPH//
hr = VD->pCaptureGraph->SetFiltergraph(VD->pGraph);
if (FAILED(hr))
{
if(verbose)printf("ERROR - Could not set filtergraph\n");
stopDevice(deviceID);
return hr;
}
//MEDIA CONTROL (START/STOPS STREAM)//
// Using QueryInterface on the graph builder,
// Get the Media Control object.
hr = VD->pGraph->QueryInterface(IID_IMediaControl, (void **)&VD->pControl);
if (FAILED(hr))
{
if(verbose)printf("ERROR - Could not create the Media Control object\n");
stopDevice(deviceID);
return hr;
}
//FIND VIDEO DEVICE AND ADD TO GRAPH//
//gets the device specified by the second argument.
hr = getDevice(&VD->pVideoInputFilter, deviceID, VD->wDeviceName, VD->nDeviceName);
if (SUCCEEDED(hr)){
if(verbose)printf("SETUP: %s\n", VD->nDeviceName);
hr = VD->pGraph->AddFilter(VD->pVideoInputFilter, VD->wDeviceName);
}else{
if(verbose)printf("ERROR - Could not find specified video device\n");
stopDevice(deviceID);
return hr;
}
//LOOK FOR PREVIEW PIN IF THERE IS NONE THEN WE USE CAPTURE PIN AND THEN SMART TEE TO PREVIEW
IAMStreamConfig *streamConfTest = NULL;
hr = VD->pCaptureGraph->FindInterface(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, VD->pVideoInputFilter, IID_IAMStreamConfig, (void **)&streamConfTest);
if(FAILED(hr)){
if(verbose)printf("SETUP: Couldn't find preview pin using SmartTee\n");
}else{
CAPTURE_MODE = PIN_CATEGORY_PREVIEW;
streamConfTest->Release();
streamConfTest = NULL;
}
//CROSSBAR (SELECT PHYSICAL INPUT TYPE)//
//my own function that checks to see if the device can support a crossbar and if so it routes it.
//webcams tend not to have a crossbar so this function will also detect a webcams and not apply the crossbar
if(VD->useCrossbar)
{
if(verbose)printf("SETUP: Checking crossbar\n");
routeCrossbar(&VD->pCaptureGraph, &VD->pVideoInputFilter, VD->connection, CAPTURE_MODE);
}
//we do this because webcams don't have a preview mode
hr = VD->pCaptureGraph->FindInterface(&CAPTURE_MODE, &MEDIATYPE_Video, VD->pVideoInputFilter, IID_IAMStreamConfig, (void **)&VD->streamConf);
if(FAILED(hr)){
if(verbose)printf("ERROR: Couldn't config the stream!\n");
stopDevice(deviceID);
return hr;
}
//NOW LETS DEAL WITH GETTING THE RIGHT SIZE
hr = VD->streamConf->GetFormat(&VD->pAmMediaType);
if(FAILED(hr)){
if(verbose)printf("ERROR: Couldn't getFormat for pAmMediaType!\n");
stopDevice(deviceID);
return hr;
}
VIDEOINFOHEADER *pVih = reinterpret_cast<VIDEOINFOHEADER*>(VD->pAmMediaType->pbFormat);
int currentWidth = HEADER(pVih)->biWidth;
int currentHeight = HEADER(pVih)->biHeight;
bool customSize = VD->tryDiffSize;
bool foundSize = false;
if(customSize){
if(verbose) printf("SETUP: Default Format is set to %i by %i \n", currentWidth, currentHeight);
char guidStr[8];
for(int i = 0; i < VI_NUM_TYPES; i++){
getMediaSubtypeAsString(mediaSubtypes[i], guidStr);
if(verbose)printf("SETUP: trying format %s @ %i by %i\n", guidStr, VD->tryWidth, VD->tryHeight);
if( setSizeAndSubtype(VD, VD->tryWidth, VD->tryHeight, mediaSubtypes[i]) ){
VD->setSize(VD->tryWidth, VD->tryHeight);
foundSize = true;
break;
}
}
//if we didn't find the requested size - lets try and find the closest matching size
if( foundSize == false ){
if( verbose )printf("SETUP: couldn't find requested size - searching for closest matching size\n");
int closestWidth = -1;
int closestHeight = -1;
GUID newMediaSubtype;
findClosestSizeAndSubtype(VD, VD->tryWidth, VD->tryHeight, closestWidth, closestHeight, newMediaSubtype);
if( closestWidth != -1 && closestHeight != -1){
getMediaSubtypeAsString(newMediaSubtype, guidStr);
if(verbose)printf("SETUP: closest supported size is %s @ %i %i\n", guidStr, closestWidth, closestHeight);
if( setSizeAndSubtype(VD, closestWidth, closestHeight, newMediaSubtype) ){
VD->setSize(closestWidth, closestHeight);
foundSize = true;
}
}
}
}
//if we didn't specify a custom size or if we did but couldn't find it lets setup with the default settings
if(customSize == false || foundSize == false){
if( VD->requestedFrameTime != -1 ){
pVih->AvgTimePerFrame = VD->requestedFrameTime;
hr = VD->streamConf->SetFormat(VD->pAmMediaType);
}
VD->setSize(currentWidth, currentHeight);
}
//SAMPLE GRABBER (ALLOWS US TO GRAB THE BUFFER)//
// Create the Sample Grabber.
hr = CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER,IID_IBaseFilter, (void**)&VD->pGrabberF);
if (FAILED(hr)){
if(verbose)printf("Could not Create Sample Grabber - CoCreateInstance()\n");
stopDevice(deviceID);
return hr;
}
hr = VD->pGraph->AddFilter(VD->pGrabberF, L"Sample Grabber");
if (FAILED(hr)){
if(verbose)printf("Could not add Sample Grabber - AddFilter()\n");
stopDevice(deviceID);
return hr;
}
hr = VD->pGrabberF->QueryInterface(IID_ISampleGrabber, (void**)&VD->pGrabber);
if (FAILED(hr)){
if(verbose)printf("ERROR: Could not query SampleGrabber\n");
stopDevice(deviceID);
return hr;
}
//Set Params - One Shot should be false unless you want to capture just one buffer
hr = VD->pGrabber->SetOneShot(FALSE);
if(bCallback){
hr = VD->pGrabber->SetBufferSamples(FALSE);
}else{
hr = VD->pGrabber->SetBufferSamples(TRUE);
}
if(bCallback){
//Tell the grabber to use our callback function - 0 is for SampleCB and 1 for BufferCB
//We use SampleCB
hr = VD->pGrabber->SetCallback(VD->sgCallback, 0);
if (FAILED(hr)){
if(verbose)printf("ERROR: problem setting callback\n");
stopDevice(deviceID);
return hr;
}else{
if(verbose)printf("SETUP: Capture callback set\n");
}
}
//MEDIA CONVERSION
//Get video properties from the stream's mediatype and apply to the grabber (otherwise we don't get an RGB image)
//zero the media type - lets try this :) - maybe this works?
AM_MEDIA_TYPE mt;
ZeroMemory(&mt,sizeof(AM_MEDIA_TYPE));
mt.majortype = MEDIATYPE_Video;
mt.subtype = MEDIASUBTYPE_RGB24;
mt.formattype = FORMAT_VideoInfo;
//VD->pAmMediaType->subtype = VD->videoType;
hr = VD->pGrabber->SetMediaType(&mt);
//lets try freeing our stream conf here too
//this will fail if the device is already running
if(VD->streamConf){
VD->streamConf->Release();
VD->streamConf = NULL;
}else{
if(verbose)printf("ERROR: connecting device - prehaps it is already being used?\n");
stopDevice(deviceID);
return S_FALSE;
}
//NULL RENDERER//
//used to give the video stream somewhere to go to.
hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void**)(&VD->pDestFilter));
if (FAILED(hr)){
if(verbose)printf("ERROR: Could not create filter - NullRenderer\n");
stopDevice(deviceID);
return hr;
}
hr = VD->pGraph->AddFilter(VD->pDestFilter, L"NullRenderer");
if (FAILED(hr)){
if(verbose)printf("ERROR: Could not add filter - NullRenderer\n");
stopDevice(deviceID);
return hr;
}
//RENDER STREAM//
//This is where the stream gets put together.
hr = VD->pCaptureGraph->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, VD->pVideoInputFilter, VD->pGrabberF, VD->pDestFilter);
if (FAILED(hr)){
if(verbose)printf("ERROR: Could not connect pins - RenderStream()\n");
stopDevice(deviceID);
return hr;
}
//EXP - lets try setting the sync source to null - and make it run as fast as possible
{
IMediaFilter *pMediaFilter = 0;
hr = VD->pGraph->QueryInterface(IID_IMediaFilter, (void**)&pMediaFilter);
if (FAILED(hr)){
if(verbose)printf("ERROR: Could not get IID_IMediaFilter interface\n");
}else{
pMediaFilter->SetSyncSource(NULL);
pMediaFilter->Release();
}
}
//LETS RUN THE STREAM!
hr = VD->pControl->Run();
if (FAILED(hr)){
if(verbose)printf("ERROR: Could not start graph\n");
stopDevice(deviceID);
return hr;
}
//MAKE SURE THE DEVICE IS SENDING VIDEO BEFORE WE FINISH
if(!bCallback){
long bufferSize = VD->videoSize;
while( hr != S_OK){
hr = VD->pGrabber->GetCurrentBuffer(&bufferSize, (long *)VD->pBuffer);
Sleep(10);
}
}
if(verbose)printf("SETUP: Device is setup and ready to capture.\n\n");
VD->readyToCapture = true;
//Release filters - seen someone else do this
//looks like it solved the freezes
//if we release this then we don't have access to the settings
//we release our video input filter but then reconnect with it
//each time we need to use it
VD->pVideoInputFilter->Release();
VD->pVideoInputFilter = NULL;
VD->pGrabberF->Release();
VD->pGrabberF = NULL;
VD->pDestFilter->Release();
VD->pDestFilter = NULL;
return S_OK;
}
// ----------------------------------------------------------------------
// Returns number of good devices
//
// ----------------------------------------------------------------------
int videoInput::getDeviceCount(){
ICreateDevEnum *pDevEnum = NULL;
IEnumMoniker *pEnum = NULL;
int deviceCounter = 0;
HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL,
CLSCTX_INPROC_SERVER, IID_ICreateDevEnum,
reinterpret_cast<void**>(&pDevEnum));
if (SUCCEEDED(hr))
{
// Create an enumerator for the video capture category.
hr = pDevEnum->CreateClassEnumerator(
CLSID_VideoInputDeviceCategory,
&pEnum, 0);
if(hr == S_OK){
IMoniker *pMoniker = NULL;
while (pEnum->Next(1, &pMoniker, NULL) == S_OK){
IPropertyBag *pPropBag;
hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag,
(void**)(&pPropBag));
if (FAILED(hr)){
pMoniker->Release();
continue; // Skip this one, maybe the next one will work.
}
pPropBag->Release();
pPropBag = NULL;
pMoniker->Release();
pMoniker = NULL;
deviceCounter++;
}
pEnum->Release();
pEnum = NULL;
}
pDevEnum->Release();
pDevEnum = NULL;
}
return deviceCounter;
}
// ----------------------------------------------------------------------
// Do we need this?
//
// Enumerate all of the video input devices
// Return the filter with a matching friendly name
// ----------------------------------------------------------------------
HRESULT videoInput::getDevice(IBaseFilter** gottaFilter, int deviceId, WCHAR * wDeviceName, char * nDeviceName){
BOOL done = false;
int deviceCounter = 0;
// Create the System Device Enumerator.
ICreateDevEnum *pSysDevEnum = NULL;
HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, (void **)&pSysDevEnum);
if (FAILED(hr))
{
return hr;
}
// Obtain a class enumerator for the video input category.
IEnumMoniker *pEnumCat = NULL;
hr = pSysDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pEnumCat, 0);
if (hr == S_OK)
{
// Enumerate the monikers.
IMoniker *pMoniker = NULL;
ULONG cFetched;
while ((pEnumCat->Next(1, &pMoniker, &cFetched) == S_OK) && (!done))
{
if(deviceCounter == deviceId)
{
// Bind the first moniker to an object
IPropertyBag *pPropBag;
hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pPropBag);
if (SUCCEEDED(hr))
{
// To retrieve the filter's friendly name, do the following:
VARIANT varName;
VariantInit(&varName);
hr = pPropBag->Read(L"FriendlyName", &varName, 0);
if (SUCCEEDED(hr))
{
//copy the name to nDeviceName & wDeviceName
int count = 0;
while( varName.bstrVal[count] != 0x00 ) {
wDeviceName[count] = varName.bstrVal[count];
nDeviceName[count] = (char)varName.bstrVal[count];
count++;
}
// We found it, so send it back to the caller
hr = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter, (void**)gottaFilter);
done = true;
}
VariantClear(&varName);
pPropBag->Release();
pPropBag = NULL;
pMoniker->Release();
pMoniker = NULL;
}
}
deviceCounter++;
}
pEnumCat->Release();
pEnumCat = NULL;
}
pSysDevEnum->Release();
pSysDevEnum = NULL;
if (done) {
return hr; // found it, return native error
} else {
return VFW_E_NOT_FOUND; // didn't find it error
}
}
// ----------------------------------------------------------------------
// Show the property pages for a filter
// This is stolen from the DX9 SDK
// ----------------------------------------------------------------------
HRESULT videoInput::ShowFilterPropertyPages(IBaseFilter *pFilter){
ISpecifyPropertyPages *pProp;
HRESULT hr = pFilter->QueryInterface(IID_ISpecifyPropertyPages, (void **)&pProp);
if (SUCCEEDED(hr))
{
// Get the filter's name and IUnknown pointer.
FILTER_INFO FilterInfo;
hr = pFilter->QueryFilterInfo(&FilterInfo);
IUnknown *pFilterUnk;
pFilter->QueryInterface(IID_IUnknown, (void **)&pFilterUnk);
// Show the page.
CAUUID caGUID;
pProp->GetPages(&caGUID);
pProp->Release();
OleCreatePropertyFrame(
NULL, // Parent window
0, 0, // Reserved
FilterInfo.achName, // Caption for the dialog box
1, // Number of objects (just the filter)
&pFilterUnk, // Array of object pointers.
caGUID.cElems, // Number of property pages
caGUID.pElems, // Array of property page CLSIDs
0, // Locale identifier
0, NULL // Reserved
);
// Clean up.
if(pFilterUnk)pFilterUnk->Release();
if(FilterInfo.pGraph)FilterInfo.pGraph->Release();
CoTaskMemFree(caGUID.pElems);
}
return hr;
}
// ----------------------------------------------------------------------
// This code was also brazenly stolen from the DX9 SDK
// Pass it a file name in wszPath, and it will save the filter graph to that file.
// ----------------------------------------------------------------------
HRESULT videoInput::SaveGraphFile(IGraphBuilder *pGraph, WCHAR *wszPath) {
const WCHAR wszStreamName[] = L"ActiveMovieGraph";
HRESULT hr;
IStorage *pStorage = NULL;
// First, create a document file which will hold the GRF file
hr = StgCreateDocfile(
wszPath,
STGM_CREATE | STGM_TRANSACTED | STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
0, &pStorage);
if(FAILED(hr))
{
return hr;
}
// Next, create a stream to store.
IStream *pStream;
hr = pStorage->CreateStream(
wszStreamName,
STGM_WRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE,
0, 0, &pStream);
if (FAILED(hr))
{
pStorage->Release();
return hr;
}
// The IPersistStream converts a stream into a persistent object.
IPersistStream *pPersist = NULL;
pGraph->QueryInterface(IID_IPersistStream, reinterpret_cast<void**>(&pPersist));
hr = pPersist->Save(pStream, TRUE);
pStream->Release();
pPersist->Release();
if (SUCCEEDED(hr))
{
hr = pStorage->Commit(STGC_DEFAULT);
}
pStorage->Release();
return hr;
}
// ----------------------------------------------------------------------
// For changing the input types
//
// ----------------------------------------------------------------------
HRESULT videoInput::routeCrossbar(ICaptureGraphBuilder2 **ppBuild, IBaseFilter **pVidInFilter, int conType, GUID captureMode){
//create local ICaptureGraphBuilder2
ICaptureGraphBuilder2 *pBuild = NULL;
pBuild = *ppBuild;
//create local IBaseFilter
IBaseFilter *pVidFilter = NULL;
pVidFilter = * pVidInFilter;
// Search upstream for a crossbar.
IAMCrossbar *pXBar1 = NULL;
HRESULT hr = pBuild->FindInterface(&LOOK_UPSTREAM_ONLY, NULL, pVidFilter,
IID_IAMCrossbar, (void**)&pXBar1);
if (SUCCEEDED(hr))
{
bool foundDevice = false;
if(verbose)printf("SETUP: You are not a webcam! Setting Crossbar\n");
pXBar1->Release();
IAMCrossbar *Crossbar;
hr = pBuild->FindInterface(&captureMode, &MEDIATYPE_Interleaved, pVidFilter, IID_IAMCrossbar, (void **)&Crossbar);
if(hr != NOERROR){
hr = pBuild->FindInterface(&captureMode, &MEDIATYPE_Video, pVidFilter, IID_IAMCrossbar, (void **)&Crossbar);
}
LONG lInpin, lOutpin;
hr = Crossbar->get_PinCounts(&lOutpin , &lInpin);
BOOL IPin=TRUE; LONG pIndex=0 , pRIndex=0 , pType=0;
while( pIndex < lInpin)
{
hr = Crossbar->get_CrossbarPinInfo( IPin , pIndex , &pRIndex , &pType);
if( pType == conType){
if(verbose)printf("SETUP: Found Physical Interface");
switch(conType){
case PhysConn_Video_Composite:
if(verbose)printf(" - Composite\n");
break;
case PhysConn_Video_SVideo:
if(verbose)printf(" - S-Video\n");
break;
case PhysConn_Video_Tuner:
if(verbose)printf(" - Tuner\n");
break;
case PhysConn_Video_USB:
if(verbose)printf(" - USB\n");
break;
case PhysConn_Video_1394:
if(verbose)printf(" - Firewire\n");
break;
}
foundDevice = true;
break;
}
pIndex++;
}
if(foundDevice){
BOOL OPin=FALSE; LONG pOIndex=0 , pORIndex=0 , pOType=0;
while( pOIndex < lOutpin)
{
hr = Crossbar->get_CrossbarPinInfo( OPin , pOIndex , &pORIndex , &pOType);
if( pOType == PhysConn_Video_VideoDecoder)
break;
}
Crossbar->Route(pOIndex,pIndex);
}else{
if(verbose)printf("SETUP: Didn't find specified Physical Connection type. Using Defualt. \n");
}
//we only free the crossbar when we close or restart the device
//we were getting a crash otherwise
//if(Crossbar)Crossbar->Release();
//if(Crossbar)Crossbar = NULL;
if(pXBar1)pXBar1->Release();
if(pXBar1)pXBar1 = NULL;
}else{
if(verbose)printf("SETUP: You are a webcam or snazzy firewire cam! No Crossbar needed\n");
return hr;
}
return hr;
}
/********************* Capturing video from camera via VFW *********************/
......@@ -183,13 +3012,4 @@ CvCapture* cvCreateCameraCapture_DShow( int index )
return 0;
}
#ifdef _MSC_VER
#pragma comment(lib, "strmiids.lib")
#if defined _M_X64
#pragma comment(lib, "videoInput64.lib")
#else
#pragma comment(lib, "videoInput.lib")
#endif
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment