关于接口

 

关于接口

IGraphBuilder接口à调用CoCreateInstance 得到的IGraphBuilder接口包含了大部分创建filter graph 的方法 。

IGraphBuilder::AddSourceFilter-àThis method adds a source filter to the filter graph for a specific file.

IGraphBuilder::Connect-àThis method connects the two pins, using intermediates if necessary.

IGraphBuilder::Render-àThis method builds a filter graph that renders the data from this output pin.

IGraphBuilder::RenderFile-àThis method builds a filter graph that renders the specified file. 此方法是创建一个能够播放指定文件的filter graph 。

IGraphBuilder::SetLogFile-àThis method sets the file into which actions taken in attempting to perform an operation are logged.

 

IMediaControl接口à控制数据流,它包含开启和停止graph的函数。

IMediaControl::AddSourceFilter-àThis method adds to the graph the source filter that can read the given file name, and returns an IDispatch interface pointer representing the filter.

IMediaControl::GetState-àThis method retrieves the state of the filter graph.

IMediaControl::PauseàThis method pauses all the filters in the filter graph.

IMediaControl::RenderFileàThis method adds and connects filters needed to play the specified file.

IMediaControl::RunàThis method switches the entire filter graph into a running state.

IMediaControl::StopàThis method switches all filters in the filter graph to a stopped state.

IMediaControl::StopWhenReadyàThis method waits for an operation such as Pause to complete, allowing filters to queue up data, then stops the filter graph.

 

IMediaEvent接口à包含从Filter Graph Manager 获取事件的函数。

IMediaEvent::CancelDefaultHandling-àThis method cancels any default handling by the filter graph of the specified event and ensures that it is passed to the application.

IMediaEvent::FreeEventParams-àThis method frees resources associated with the parameters of an event.

IMediaEvent::GetEvent-àThis method retrieves the next notification event.

IMediaEvent::GetEventHandle-àThis method retrieves a handle to a manual-reset event that will be signaled as long as there are event notifications to deliver.

IMediaEvent::RestoreDefaultHandling-àThis method reinstates the normal default handling by a filter graph for the specified event, if there is one.

IMediaEvent::WaitForCompletion-àThis method blocks execution of the application thread until the graph's operation finishes. (等待回放的结束)

小知识点:

return 0是正常退出,return 非零 是异常退出,这是返回给控制台的,不在你编的程序的控制范围内,是给操作系统识别的,对你的程序无影响

 

其它流媒体常用接口

IFilterGraph接口à滤波器图表接口

IFilterGraph::AddFilter-àThis method adds a filter to the graph and names it by using the pName parameter.

IFilterGraph::ConnectDirect-àThis method connects the two pins directly (without intervening filters).

IFilterGraph::Disconnect-àThis method disconnects this pin.

IFilterGraph::EnumFilters-àThis method provides an enumerator for all filters in the graph.

IFilterGraph::FindFilterByName-àThis method finds a filter that was added to the filter graph with a specific name.

IFilterGraph::Reconnect-àThis method disconnects this and the pin to which it connects and then reconnects it to the same pin. This allows the details of the connection, such as media type and allocator, to be renegotiated.

IFilterGraph::RemoveFilter-àThis method removes a filter from the graph.

IFilterGraph::SetDefaultSyncSource-àThis method sets the default source of synchronization.

 

IFilterGraph2接口à增强的IFilterGraph

IFilterGraph2::ReconnectEx-àThis method specifies a pin and a media type to reconnect with.

 

ICaptureGraphBuilder2接口à构造增强型的视频捕获滤波器图表管理器(Filter Graph Manager)

ICaptureGraphBuilder2::ControlStream-àThis method sets the start and stop times for one or more streams of captured data.

ICaptureGraphBuilder2::FindInterface-àThis method searches the graph for a specified interface, starting from a specified filter. You can restrict the search to a section of the graph upstream or downstream of the filter, or restrict it to a particular pin category or media type.

ICaptureGraphBuilder2::FindPin-àThis method retrieves a particular pin on a filter, or determines whether a given pin matches the specified criteria.

ICaptureGraphBuilder2::GetFiltergraph-àThis method retrieves the filter graph that the capture graph builder is using.

ICaptureGraphBuilder2::RenderStream-àThis method connects an output pin on a source filter to a sink filter, optionally through an intermediate filter.

ICaptureGraphBuilder2::SetFiltergraph-àThis method specifies a filter graph for the capture graph builder to use.

ICaptureGraphBuilder2::SetOutputFileName-àThis method creates the file writing section of the filter graph.

 

IMediaEventEX接口à播放事件接口扩展

IMediaEventEx::GetNotifyFlags-àThis method retrieves whether event notifications are on or off.

IMediaEventEx::SetNotifyFlags-àThis method turns event notifications on or off.

IMediaEventEx::SetNotifyWindow-àThis method registers a window that will handle messages in response to all events from an object.

 

IMediaPosition接口à播放的位置和速度控制接口(控制播放位置只能为设置时间控制方式)

IMediaPosition::CanSeekBackward-àThis method determines if the current position can be moved backward in the media stream.

IMediaPosition::CanSeekForward-àThis method determines if the current position can be moved forward in the media stream.

IMediaPosition::get_CurrentPosition-àThis method retrieves the current position in terms of the total length of the media stream.

IMediaPosition::get_Duration-àThis method retrieves the total duration of the media stream.

IMediaPosition::get_PrerollTime-àThis method retrieves the time prior to the start position that any nonrandom access device should start rolling.

IMediaPosition::get_Rate-àThis method retrieves the rate of playback relative to normal playback speed.

IMediaPosition::get_StopTime-àThis method retrieves the time at which the media stream stops.

IMediaPosition::put_CurrentPosition-àThis method sets the time that the media stream begins.

IMediaPosition::put_PrerollTime-àThis method sets the time prior to the start position that any nonrandom access device should start rolling.

IMediaPosition::put_Rate-àThis method sets the rate of playback relative to normal speed.

IMediaPosition::put_StopTime-àThis method sets the time at which the media stream will stop.

 

IMediaSeeking接口à另一个播放的位置和播放速度控制接口,在位置选择方面功能较强,设置播放格式,多种控制播放方式,常用的有:TIME_FORMAT_MEDIA_TIME 单位 100纳秒和TIME_FORMAT_FRAME按帧播放。

IMediaSeeking::CheckCapabilities-àThis method determines which capabilities exist on a media stream by applying seeking capability flags and checking the returned value.

IMediaSeeking::ConvertTimeFormat-àThis method converts a time from one format to another.

IMediaSeeking::GetAvailable-àThis method returns the range of times in which seeking is efficient.

IMediaSeeking::GetCapabilities-àThis method returns the seeking capabilities of the media stream.

IMediaSeeking::GetCurrentPosition-àThis method retrieves the current position in terms of the total length of the media stream.

IMediaSeeking::GetDuration-àThis method retrieves the length of time that the media stream will play.

IMediaSeeking::GetPositions-àThis method returns the current and stop position settings.

IMediaSeeking::GetPreroll-àThis method retrieves the preroll settings.

IMediaSeeking::GetRate-àThis method retrieves the current rate.

IMediaSeeking::GetStopPosition-àThis method retrieves the time at which the media stream stops.

IMediaSeeking::GetTimeFormat-àThis method retrieves the current time format, which determines the format of units used during seeking.

IMediaSeeking::IsFormatSupported-àThis method determines if a specified time format is supported.

IMediaSeeking::IsUsingTimeFormat-àThis method determines if the time format being used in the call is the same as the one currently in use by the interface.

IMediaSeeking::QueryPreferredFormat-àThis method retrieves the preferred time format to be used by the interface.

IMediaSeeking::SetPositions-àThis method sets current and stop positions and applies flags to both.

IMediaSeeking::SetRate-àThis method sets a new playback rate.

IMediaSeeking::SetTimeFormat-àThis method sets the time format, which determines the format of units used during seeking.

 

IBasicAudio接口à声音控制接口

IBasicAudio method

Description

put_Volume

Sets the volume (amplitude) of the audio signal.

get_Volume

Retrieves the volume (amplitude) of the audio signal.

put_Balance

Sets the balance for the audio signal.

get_Balance

Retrieves the balance for the audio signal.

 

IBasicVideo接口à图像控制接口(比特率,图像宽,高等信息)

IBasicVideo method

Description

get_AvgTimePerFrame

Retrieves the average time between successive frames in 100-nanosecond units.

get_BitRate

Retrieves an approximate bit rate for the video stream.

get_BitErrorRate

Retrieves an approximate bit error rate for the video stream.

get_VideoWidth

Retrieves the current video width.

get_VideoHeight

Retrieves the current video height.

put_SourceLeft

Sets the x-axis coordinate for the source video rectangle.

get_SourceLeft

Retrieves the x-axis coordinate for the source video rectangle.

put_SourceWidth

Sets the width of the source video rectangle.

get_SourceWidth

Retrieves the width of the source video rectangle.

put_SourceTop

Sets the y-axis coordinate for the source video rectangle.

get_SourceTop

Retrieves the y-axis coordinate for the source video rectangle.

put_SourceHeight

Sets the height of the source video rectangle.

get_SourceHeight

Retrieves the height of the source video rectangle.

put_DestinationLeft

Sets the x-axis coordinate for the destination video rectangle.

get_DestinationLeft

Retrieves the x-axis coordinate for the destination video rectangle.

put_DestinationWidth

Sets the width of the destination video rectangle.

get_DestinationWidth

Retrieves the width of the destination video rectangle.

put_DestinationTop

Sets the y-axis coordinate for the destination video rectangle.

get_DestinationTop

Retrieves the y-axis coordinate for the destination video rectangle.

put_DestinationHeight

Sets the height of the destination video rectangle.

get_DestinationHeight

Retrieves the height of the destination video rectangle.

SetSourcePosition

Sets the source video rectangle.

GetSourcePosition

Retrieves the source video rectangle.

SetDefaultSourcePosition

Informs the renderer to use the default source rectangle.

SetDestinationPosition

Sets the destination rectangle for the window.

GetDestinationPosition

Retrieves the destination video rectangle for the window.

SetDefaultDestinationPosition

Sets the default destination position for the window.

GetVideoSize

Retrieves the native video dimensions.

GetVideoPaletteEntries

Retrieves the color palette entries required by the video.

GetCurrentImage

Returns a copy of the current image that is waiting at the renderer.

IsUsingDefaultSource

Determines if the renderer is using the default source rectangle.

IsUsingDefaultDestination

Determines if the renderer is using the default destination rectangle.

 

IBasicFilter接口àDirectShow中的基本滤波器接口

IVideoWindow接口à显示窗口控制接口(有关播放窗口的一切控制,包括标题标题显示,窗口位置控制等)

IVideoWindow method

Description

put_Caption

Sets the text caption on the playback window.

get_Caption

Retrieves the text caption on the playback window.

put_WindowStyle

Sets the playback window style.

get_WindowStyle

Retrieves the playback window style.

put_WindowStyleEx

Sets the style of the control window.

get_WindowStyleEx

Retrieves the playback window's extended style bits.

put_AutoShow

Specifies if the window will be automatically shown on the first state change.

get_AutoShow

Returns if the window will be automatically shown on the first state change.

put_WindowState

Sets the current window state (such as visible or minimized).

get_WindowState

Retrieves the current window state (such as visible or minimized).

put_BackgroundPalette

Informs the renderer to realize its palette in the background.

get_BackgroundPalette

Returns whenever the renderer realizes its palette in the background.

put_Visible

Sets the visibility of the window.

get_Visible

Retrieves the visibility of the window.

put_Left

Sets the x-axis coordinate for the video window.

get_Left

Retrieves the x-axis coordinate for the video window.

put_Width

Sets the width of the video window.

get_Width

Retrieves the width of the video window.

put_Top

Sets the y-axis coordinates for the video window.

get_Top

Retrieves the y-axis coordinates for the video window.

put_Height

Sets the height of the video window.

get_Height

Retrieves the height of the video window.

put_Owner

Sets the owning parent window for the video playback window.

get_Owner

Retrieves the owning parent window for the video playback window.

put_MessageDrain

Specifies a window to which the video window will post messages.

get_MessageDrain

Retrieves the window set to receive messages from the video window.

get_BorderColor

Retrieves the border color for the video window.

put_BorderColor

Sets the border color for the video window.

get_FullScreenMode

Returns the full-screen rendering mode of the video renderer filter supporting this interface.

put_FullScreenMode

Sets the full-screen mode for the video renderer filter supporting this interface.

SetWindowForeground

Tells the renderer filter to become the foreground window.

NotifyOwnerMessage

Forwards messages that have been received by a parent window to a child window owned by a filter.

SetWindowPosition

Sets the video window position on the display.

GetWindowPosition

Retrieves the video window position.

GetMinIdealImageSize

Retrieves the ideal minimum image size for the video image playback (client) area.

GetMaxIdealImageSize

Retrieves the ideal maximum image size for the video image playback (client) area.

GetRestorePosition

Returns the normal restored window dimensions.

HideCursor

Hides the cursor.

IsCursorHidden

Determines if the cursor is hidden or showing.

 

ISampleGrabber接口à捕获图像窗口(可用于抓图控制)

Method

Description

SetOneShot

Specifies whether the filter should stop the graph after receiving one sample.

SetMediaType

Specifies the media type for the connection on the Sample Grabber's input pin.

GetConnectedMediaType

Retrieves the media type for the connection on the Sample Grabber's input pin.

SetBufferSamples

Specifies whether to copy sample data into a buffer as it goes through the filter.

GetCurrentBuffer

Retrieves a copy of the sample that the filter received most recently.

GetCurrentSample

Not currently implemented.

SetCallback

Specifies a callback method to call on incoming samples.

 

IVideoFrameStep接口à控制单帧播放的接口

IVideoWindow method

Description

put_Caption

Sets the text caption on the playback window.

get_Caption

Retrieves the text caption on the playback window.

put_WindowStyle

Sets the playback window style.

get_WindowStyle

Retrieves the playback window style.

put_WindowStyleEx

Sets the style of the control window.

get_WindowStyleEx

Retrieves the playback window's extended style bits.

put_AutoShow

Specifies if the window will be automatically shown on the first state change.

get_AutoShow

Returns if the window will be automatically shown on the first state change.

put_WindowState

Sets the current window state (such as visible or minimized).

get_WindowState

Retrieves the current window state (such as visible or minimized).

put_BackgroundPalette

Informs the renderer to realize its palette in the background.

get_BackgroundPalette

Returns whenever the renderer realizes its palette in the background.

put_Visible

Sets the visibility of the window.

get_Visible

Retrieves the visibility of the window.

put_Left

Sets the x-axis coordinate for the video window.

get_Left

Retrieves the x-axis coordinate for the video window.

put_Width

Sets the width of the video window.

get_Width

Retrieves the width of the video window.

put_Top

Sets the y-axis coordinates for the video window.

get_Top

Retrieves the y-axis coordinates for the video window.

put_Height

Sets the height of the video window.

get_Height

Retrieves the height of the video window.

put_Owner

Sets the owning parent window for the video playback window.

get_Owner

Retrieves the owning parent window for the video playback window.

put_MessageDrain

Specifies a window to which the video window will post messages.

get_MessageDrain

Retrieves the window set to receive messages from the video window.

get_BorderColor

Retrieves the border color for the video window.

put_BorderColor

Sets the border color for the video window.

get_FullScreenMode

Returns the full-screen rendering mode of the video renderer filter supporting this interface.

put_FullScreenMode

Sets the full-screen mode for the video renderer filter supporting this interface.

SetWindowForeground

Tells the renderer filter to become the foreground window.

NotifyOwnerMessage

Forwards messages that have been received by a parent window to a child window owned by a filter.

SetWindowPosition

Sets the video window position on the display.

GetWindowPosition

Retrieves the video window position.

GetMinIdealImageSize

Retrieves the ideal minimum image size for the video image playback (client) area.

GetMaxIdealImageSize

Retrieves the ideal maximum image size for the video image playback (client) area.

GetRestorePosition

Returns the normal restored window dimensions.

HideCursor

Hides the cursor.

IsCursorHidden

Determines if the cursor is hidden or showing.

 

ICreateDevEnum接口à创建设置枚举接口(视频采集用)

ICreateDevEnum::CreateClassEnumerator-àThe CreateClassEnumerator method creates an enumerator for a specified device category. (MSDN2001)

 

IEnumMoniker接口à枚举监视器接口(视频采集用)

IEnumMoniker::Clone-àThis method creates another enumerator that contains the same enumeration state as the current one.

Using this function, a client can record a particular point in the enumeration sequence and then return to that point at a later time. The new enumerator supports the same interface as the original one.

IEnumMoniker:IUnknown-àThis interface is used to enumerate the components of a moniker or to enumerate the monikers in a table of monikers.

IEnumMoniker has the same methods as all enumerator interfaces: Next, Skip, Reset, and Clone.

IEnumMoniker::Next-àThis method retrieves the next celt items in the enumeration sequence.

If there are fewer than the requested number of elements left in the sequence, it retrieves the remaining elements.

The number of elements retrieved is returned through pceltFetched (unless the caller passed in NULL for that parameter).

IEnumMoniker::Reset-àThis method resets the enumeration sequence to the beginning.

IEnumMoniker::Skip-àThis method skips over the next specified number of elements in the enumeration sequence.

 

IMoniker接口à监视接口(视频采集用)

IMoniker::BindToObject-àThis method binds to the object named by the moniker.

IMoniker::BindToStorage-àThis method binds to the object's storage.

IMoniker::CommonPrefixWith-àThis method finds the prefix that the moniker has in common with another moniker.

IMoniker::ComposeWith-àThis method composes with another moniker.

IMoniker::Enum-àThis method enumerates component monikers.

IMoniker::GetDisplayName-àThis method returns the display name.

IMoniker::GetTimeOfLastChange-àThis method returns the time the object was last changed.

IMoniker::Hash-àThis method returns a hash value.

IMoniker::Inverse-àThis method returns the inverse of the moniker.

IMoniker::IsEqual-àThis method compares one moniker with another moniker.

IMoniker::IsRunning-àThis method checks whether object is running.

IMoniker::IsSystemMoniker-àThis method checks whether moniker is one of the system-supplied types.

IMoniker::ParseDisplayName-àThis method converts a display name into a moniker.

IMoniker::Reduce-àThis method reduces the moniker to the simplest form.

IMoniker::RelativePathTo-àThis method constructs a relative moniker between the specified moniker and another.

 

IPropertyBag接口à属性页接口

IPropertyBag:IUnknown-àThis interface provides an object with a property bag in which the object can persistently save its properties.

IPropertyBag::Read-àThis method asks the property bag to read the named property into a caller-initialized VARIANT.

IPropertyBag::Write-àThis method asks the property bag to save the named property in a caller-initialized VARIANT.

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值