📄 vmrender.idl
字号:
///////////////////////////////////////////////////////////////////////////////
//
// Public Interfaces for the Video Mixing Renderer DShow filter
//
// Copyright (c) 1999 - 2002, Microsoft Corporation. All rights reserved.
///////////////////////////////////////////////////////////////////////////////
cpp_quote("#if 0")
// This is temporary work around to persuade
// MIDL to allow forward declarations.
typedef DWORD* LPDIRECTDRAW7;
typedef DWORD* LPDIRECTDRAWSURFACE7;
typedef DWORD* LPDDPIXELFORMAT;
typedef DWORD* LPBITMAPINFOHEADER;
typedef struct {DWORD dw1; DWORD dw2;} DDCOLORKEY;
typedef DDCOLORKEY* LPDDCOLORKEY;
cpp_quote ("#endif")
cpp_quote("#include <ddraw.h>")
// public interfaces supported by the VMR
interface IVMRSurface;
interface IVMRSurfaceAllocator;
interface IVMRSurfaceAllocatorNotify;
interface IVMRImagePresenter;
interface IVMRImagePresenterConfig;
interface IVMRWindowlessControl;
interface IVMRMixerControl;
interface IVMRMixerBitmap;
interface IVMRFilterConfig;
interface IVMRAspectRatioControl;
interface IVMRDeinterlaceControl;
interface IVMRMonitorConfig;
interface IVMRImageCompositor;
interface IVMRVideoStreamControl;
///////////////////////////////////////////////////////////////////////////////
//
// Allocator Presenter interfaces
//
///////////////////////////////////////////////////////////////////////////////
//=====================================================================
//
// IVMRImagePresenter
//
//=====================================================================
typedef enum {
VMRSample_SyncPoint = 0x00000001,
VMRSample_Preroll = 0x00000002,
VMRSample_Discontinuity = 0x00000004,
VMRSample_TimeValid = 0x00000008,
} VMRPresentationFlags;
typedef struct tagVMRPRESENTATIONINFO {
DWORD dwFlags;
LPDIRECTDRAWSURFACE7 lpSurf;
REFERENCE_TIME rtStart;
REFERENCE_TIME rtEnd;
SIZE szAspectRatio;
RECT rcSrc;
RECT rcDst;
DWORD dwTypeSpecificFlags;
DWORD dwInterlaceFlags;
} VMRPRESENTATIONINFO;
[
local,
object,
local,
uuid(CE704FE7-E71E-41fb-BAA2-C4403E1182F5),
helpstring("IVMRImagePresenter Interface"),
pointer_default(unique)
]
interface IVMRImagePresenter : IUnknown
{
HRESULT StartPresenting(
[in] DWORD_PTR dwUserID
);
HRESULT StopPresenting(
[in] DWORD_PTR dwUserID
);
HRESULT PresentImage(
[in] DWORD_PTR dwUserID,
[in] VMRPRESENTATIONINFO* lpPresInfo
);
};
//=====================================================================
//
// IVMRSurfaceAllocator
//
//=====================================================================
typedef enum {
AMAP_PIXELFORMAT_VALID = 0x01,
AMAP_3D_TARGET = 0x02,
AMAP_ALLOW_SYSMEM = 0x04,
AMAP_FORCE_SYSMEM = 0x08,
AMAP_DIRECTED_FLIP = 0x10,
AMAP_DXVA_TARGET = 0x20
} VMRSurfaceAllocationFlags;
typedef struct tagVMRALLOCATIONINFO {
DWORD dwFlags;
LPBITMAPINFOHEADER lpHdr;
LPDDPIXELFORMAT lpPixFmt;
SIZE szAspectRatio;
DWORD dwMinBuffers;
DWORD dwMaxBuffers;
DWORD dwInterlaceFlags;
SIZE szNativeSize;
} VMRALLOCATIONINFO;
[
local,
object,
local,
uuid(31ce832e-4484-458b-8cca-f4d7e3db0b52),
helpstring("IVMRSurfaceAllocator Interface"),
pointer_default(unique)
]
interface IVMRSurfaceAllocator : IUnknown
{
HRESULT AllocateSurface(
[in] DWORD_PTR dwUserID,
[in] VMRALLOCATIONINFO* lpAllocInfo,
[in] [out] DWORD* lpdwActualBuffers,
[out] LPDIRECTDRAWSURFACE7 *lplpSurface
);
HRESULT FreeSurface(
[in] DWORD_PTR dwID
);
HRESULT PrepareSurface(
[in] DWORD_PTR dwUserID,
[in] LPDIRECTDRAWSURFACE7 lpSurface,
[in] DWORD dwSurfaceFlags
);
HRESULT AdviseNotify(
[in] IVMRSurfaceAllocatorNotify* lpIVMRSurfAllocNotify
);
};
//=====================================================================
//
// IVMRSurfaceAllocatorNotify
//
//=====================================================================
[
local,
object,
local,
uuid(aada05a8-5a4e-4729-af0b-cea27aed51e2),
helpstring("IVMRSurfaceAllocatorNotify Interface"),
pointer_default(unique)
]
interface IVMRSurfaceAllocatorNotify : IUnknown
{
HRESULT AdviseSurfaceAllocator(
[in] DWORD_PTR dwUserID,
[in] IVMRSurfaceAllocator* lpIVRMSurfaceAllocator
);
HRESULT SetDDrawDevice(
[in] LPDIRECTDRAW7 lpDDrawDevice,
[in] HMONITOR hMonitor
);
HRESULT ChangeDDrawDevice(
[in] LPDIRECTDRAW7 lpDDrawDevice,
[in] HMONITOR hMonitor
);
HRESULT RestoreDDrawSurfaces();
HRESULT NotifyEvent(
[in] LONG EventCode,
[in] LONG_PTR Param1,
[in] LONG_PTR Param2
);
HRESULT SetBorderColor(
[in] COLORREF clrBorder
);
};
///////////////////////////////////////////////////////////////////////////////
//
// Application control and configuration interfaces
//
///////////////////////////////////////////////////////////////////////////////
//=====================================================================
//
// IVMRWindowlessControl
//
//=====================================================================
typedef enum {
VMR_ARMODE_NONE,
VMR_ARMODE_LETTER_BOX
} VMR_ASPECT_RATIO_MODE;
[
local,
object,
local,
uuid(0eb1088c-4dcd-46f0-878f-39dae86a51b7),
helpstring("IVMRWindowlessControl Interface"),
pointer_default(unique)
]
interface IVMRWindowlessControl : IUnknown
{
//
//////////////////////////////////////////////////////////
// Video size and position information
//////////////////////////////////////////////////////////
//
HRESULT GetNativeVideoSize(
[out] LONG* lpWidth,
[out] LONG* lpHeight,
[out] LONG* lpARWidth,
[out] LONG* lpARHeight
);
HRESULT GetMinIdealVideoSize(
[out] LONG* lpWidth,
[out] LONG* lpHeight
);
HRESULT GetMaxIdealVideoSize(
[out] LONG* lpWidth,
[out] LONG* lpHeight
);
HRESULT SetVideoPosition(
[in] const LPRECT lpSRCRect,
[in] const LPRECT lpDSTRect
);
HRESULT GetVideoPosition(
[out] LPRECT lpSRCRect,
[out] LPRECT lpDSTRect
);
HRESULT GetAspectRatioMode(
[out] DWORD* lpAspectRatioMode
);
HRESULT SetAspectRatioMode(
[in] DWORD AspectRatioMode
);
//
//////////////////////////////////////////////////////////
// Display and clipping management
//////////////////////////////////////////////////////////
//
HRESULT SetVideoClippingWindow(
[in] HWND hwnd
);
HRESULT RepaintVideo(
[in] HWND hwnd,
[in] HDC hdc
);
HRESULT DisplayModeChanged();
//
//////////////////////////////////////////////////////////
// GetCurrentImage
//
// Returns the current image being displayed. This images
// is returned in the form of packed Windows DIB.
//
// GetCurrentImage can be called at any time, also
// the caller is responsible for free the returned memory
// by calling CoTaskMemFree.
//
// Excessive use of this function will degrade video
// playback performed.
//////////////////////////////////////////////////////////
//
HRESULT GetCurrentImage(
[out] BYTE** lpDib
);
//
//////////////////////////////////////////////////////////
// Border Color control
//
// The border color is color used to fill any area of the
// the destination rectangle that does not contain video.
// It is typically used in two instances. When the video
// straddles two monitors and when the VMR is trying
// to maintain the aspect ratio of the movies by letter
// boxing the video to fit within the specified destination
// rectangle. See SetAspectRatioMode above.
//////////////////////////////////////////////////////////
//
HRESULT SetBorderColor(
[in] COLORREF Clr
);
HRESULT GetBorderColor(
[out] COLORREF* lpClr
);
//
//////////////////////////////////////////////////////////
// Color key control only meaningful when the VMR is using
// and overlay
//////////////////////////////////////////////////////////
//
HRESULT SetColorKey(
[in] COLORREF Clr
);
HRESULT GetColorKey(
[out] COLORREF* lpClr
);
};
//=====================================================================
//
// IVMRMixerControl
//
//=====================================================================
typedef enum {
MixerPref_NoDecimation = 0x00000001, // No decimation - full size
MixerPref_DecimateOutput = 0x00000002, // decimate output by 2 in x & y
MixerPref_DecimateMask = 0x0000000F,
MixerPref_BiLinearFiltering = 0x00000010, // use bi-linear filtering
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -