IBasicVideo 接口是 DirectShow 多媒体框架中的接口之一,用于处理视频相关的基本设置。它提供了一些方法,允许应用程序对视频进行控制,如视频窗口的大小和位置等。

以下是 IBasicVideo 接口的定义:
// Control.h 头文件可能包含如下定义
#include <Control.h>

// IBasicVideo 接口的 GUID
DEFINE_GUID(IID_IBasicVideo, 0x56a868b5, 0x0ad4, 0x11ce, 0xb03a, 0x0020af0ba770);

// IBasicVideo 接口的定义
DECLARE_INTERFACE_(IBasicVideo, IDispatch)
{
    STDMETHOD(GetTypeInfoCount)(UINT *pctinfo) PURE;
    STDMETHOD(GetTypeInfo)(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) PURE;
    STDMETHOD(GetIDsOfNames)(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) PURE;
    STDMETHOD(Invoke)(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) PURE;

    STDMETHOD(get_AvgTimePerFrame)(REFTIME *pAvgTimePerFrame) PURE;
    STDMETHOD(get_BitRate)(long *pBitRate) PURE;
    STDMETHOD(get_BitErrorRate)(long *pBitErrorRate) PURE;
    STDMETHOD(get_VideoWidth)(long *pVideoWidth) PURE;
    STDMETHOD(get_VideoHeight)(long *pVideoHeight) PURE;
    STDMETHOD(put_SourceLeft)(long SourceLeft) PURE;
    STDMETHOD(get_SourceLeft)(long *pSourceLeft) PURE;
    STDMETHOD(put_SourceWidth)(long SourceWidth) PURE;
    STDMETHOD(get_SourceWidth)(long *pSourceWidth) PURE;
    STDMETHOD(put_SourceTop)(long SourceTop) PURE;
    STDMETHOD(get_SourceTop)(long *pSourceTop) PURE;
    STDMETHOD(put_SourceHeight)(long SourceHeight) PURE;
    STDMETHOD(get_SourceHeight)(long *pSourceHeight) PURE;
    STDMETHOD(put_DestinationLeft)(long DestinationLeft) PURE;
    STDMETHOD(get_DestinationLeft)(long *pDestinationLeft) PURE;
    STDMETHOD(put_DestinationWidth)(long DestinationWidth) PURE;
    STDMETHOD(get_DestinationWidth)(long *pDestinationWidth) PURE;
    STDMETHOD(put_DestinationTop)(long DestinationTop) PURE;
    STDMETHOD(get_DestinationTop)(long *pDestinationTop) PURE;
    STDMETHOD(put_DestinationHeight)(long DestinationHeight) PURE;
    STDMETHOD(get_DestinationHeight)(long *pDestinationHeight) PURE;
    STDMETHOD(SetSourcePosition)(long Left, long Top, long Width, long Height) PURE;
    STDMETHOD(GetSourcePosition)(long *pLeft, long *pTop, long *pWidth, long *pHeight) PURE;
    STDMETHOD(SetDefaultSourcePosition)() PURE;
    STDMETHOD(SetDestinationPosition)(long Left, long Top, long Width, long Height) PURE;
    STDMETHOD(GetDestinationPosition)(long *pLeft, long *pTop, long *pWidth, long *pHeight) PURE;
    STDMETHOD(SetDefaultDestinationPosition)() PURE;
    STDMETHOD(GetVideoSize)(long *pWidth, long *pHeight) PURE;
    STDMETHOD(GetVideoPaletteEntries)(long StartIndex, long Entries, long *pRetrieved, long *pPalette) PURE;
    STDMETHOD(GetCurrentImage)(long *pBufferSize, long *pDIBImage) PURE;
    STDMETHOD(IsUsingDefaultSource)() PURE;
    STDMETHOD(IsUsingDefaultDestination)() PURE;
};

这个接口提供了一系列方法,允许应用程序获取和设置视频相关的属性,包括视频的大小、源和目标位置等。

如果你正在使用 DirectShow 框架,并且需要对视频进行控制,可以使用 IBasicVideo 接口。请注意,这些接口和头文件是特定于 Windows 平台的多媒体编程,通常在使用 DirectShow 进行音视频处理的场景中才会用到。


转载请注明出处:http://www.zyzy.cn/article/detail/25100/Win32 API/Control.h/IBasicVideo