您的位置:首页 > 其它

DirectShow API 基础知识概论

2011-01-11 23:45 375 查看
在写代码之前,我认为列出API的常用接口的方法和属性,是很有必要的。

FilgraphManager对象

这是一个最基本的控制器控制对象,看方法就知道了

属性描述
FilterCollection当前所有过滤器集合.
RegFilterCollection注册表过滤器集合.
方法Description
AddSourceFilter加入一个源.
GetState获取过滤器状态.
Pause暂停.
RenderFile创建过滤器图标.
Run开始运行.
Stop停止.
StopWhenReady等待播放.
IBasicAudio接口

这个接口主要是用来处理音的.

属性描述
Balance设置或者获取音效平衡.
Volume设置或者获取音量.

IVideoWindow接口

这个接口主要处理和窗口相关的控制器.

方法描述
get_AutoShow 获取释放自动播放.
get_BackgroundPalette Queries whether the video window realizes its palette in the background.
get_BorderColor Retrieves the color that appears around the edges of the destination rectangle.
get_Caption Retrieves the video window caption.
get_FullScreenMode Queries whether the video renderer is in full-screen mode.
get_Height Retrieves the height of the video window.
get_Left Retrieves the video window's x-coordinate.
get_MessageDrain Retrieves the window that receives mouse and keyboard messages from the video window, if any.
get_Owner Retrieves the video window's parent window, if any.
get_Top Retrieves the video window's y-coordinate.
get_Visible Queries whether the video window is visible.
get_Width Retrieves the width of the video window.
get_WindowState Queries whether the video window is visible, hidden, minimized, or maximized.
get_WindowStyle Retrieves the window style on the video window.
get_WindowStyleEx Retrieves the extended window style on the video window.
GetMaxIdealImageSize Retrieves the maximum ideal size for the video image.
GetMinIdealImageSize Retrieves the minimum ideal size for the video image.
GetRestorePosition Retrieves the restored window position.
GetWindowPosition Retrieves the position of the video window.
HideCursor Hides the cursor.
IsCursorHidden Queries whether the cursor is hidden.
NotifyOwnerMessage Forwards a message to the video window.
put_AutoShow Specifies whether the video renderer automatically shows the video window when it receives video data.
put_BackgroundPalette Specifies whether the video window realizes its palette in the background.
put_BorderColor Sets the color that appears around the edges of the destination rectangle.
put_Caption Sets the video window caption.
put_FullScreenMode Enables or disables full-screen mode.
put_Height Sets the height of the video window.
put_Left Sets the video window's x-coordinate.
put_MessageDrain Specifies a window to receive mouse and keyboard messages from the video window.
put_Owner Specifies a parent window for the video window.
put_Top Sets the video window's y-coordinate.
put_Visible Shows or hides the video window.
put_Width Sets the width of the video window.
put_WindowState Shows, hides, minimizes, or maximizes the video window.
put_WindowStyle Sets the window style on the video window.
put_WindowStyleEx Sets the extended window style on the video window.
SetWindowForeground Places the video window at the top of the Z order.
SetWindowPosition Sets the position of the video window.
IMediaEvent 接口

此接口主要处理媒体事件.

方法描述
CancelDefaultHandling取消控制器对某事件的默认接口
FreeEventParams释放事件资源
GetEvent从事件列队获取下一事件.
GetEventHandle从列队获取可用事件句柄.
RestoreDefaultHandling保存控制器对某事件的接口为默认
WaitForCompletion等待控制器处理数据.
IMediaEventEx接口

继承的是IMediaEvent 接口。

方法描述
SetNotifyWindow注册一个窗口到进程事件信息.
SetNotifyFlags设置事件信息可用.
GetNotifyFlags获取事件信息可用.

IMediaPosition 接口



这个接口主要处理播放流的的时间对应的位置信息.

MethodDescription
get_DurationRetrieves the duration of the stream.
put_CurrentPositionSets the current position, relative to the total duration of the stream.
get_CurrentPositionRetrieves the current position, relative to the total duration of the stream.
get_StopTimeRetrieves the time at which the playback will stop, relative to the duration of the stream.
put_StopTimeSets the time at which the playback will stop, relative to the duration of the stream.
get_PrerollTimeRetrieves the amount of data that will be queued before the start position.
put_PrerollTimeSets the amount of data that will be queued before the start position.
put_RateSets the playback rate.
get_RateRetrieves the playback rate.
CanSeekForwardDetermines whether the filter graph can seek forward in the stream.
CanSeekBackwardDetermines whether the filter graph can seek backward in the stream.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: