[DirectShow] 013 - Transports

来源:互联网 发布:fun美玩软件 编辑:程序博客网 时间:2024/06/07 11:20

In order to move media data through the filter graph, a DirectShowfilter must support one of several possible protocols. These protocols arecalled transports. When two filters connect, they must support the same transport;otherwise they cannot exchange media data. Typically, a transport requires thatone of the pins support a particular interface. When the filters connect, onepin queries the other for the interface.

为了在filter graph中移动媒体数据,DirectShow filter 必须支持几种可能的协议中的一种。这些协议叫作transports。当两个filter连接,它们必须支持相同的transport。否则不能交换媒体数据。transport要求pin支持特殊的接口。当filter连接的时候,一个pin询问另外一个pin

Most DirectShow filters hold media data in main memory, anddeliver it to other filters across pin connections. This type of transport iscalled local memory transport. Although local memory transport is themost common transport in DirectShow, not all filters use it. For example, somefilters send media data along a hardware path, and use pins only to delivercontrol information. For example, see the IOverlayinterface.

大多数的filter把数据放在主存中,通过pin连接把数据传递给其他的filter。这种类型的transport叫作local memory transport。虽然local memory transport是最通用的transport,但不是所有的filter都使用它。例如,一些filter发送媒体数据到硬件路径,使用pin传送控制信息。例如Ioverlay接口。

DirectShow defines two mechanisms for local memory transport, the pushmodel and the pull model. In the push model, a source filter generatesdata and delivers it to the next filter downstream. That filter passivelyreceives the data, processes it, and sends it further downstream. In the pullmodel, the source filter is connected to a parser filter. The parser filterrequests data from the source filter. The source filter responds to therequests by delivering data. The push model uses the IMemInputPininterface, and the pull model uses the IAsyncReaderinterface.

DirectShow定义了两种localmemory transport机制,push 模式和pull模式。在push模式中,source filter产生数据并把数据传递到下游filter。下游filter被动接收数据并处理它,然后发送到其它的下游filter。在pull模式中,source filter被连接到parserfilterparserfiltersourcefilter请求数据。sourcefilter通过传递数据来响应请求。push模式使用IMemInputPin接口,pull模式使用IAsyncReader接口。

The push model is more common than the pull model. Therefore, thearticles that follow assume a push model. The last article in this section, Pull Model,describes how the IAsyncReader interface differs from IMemInputPin.

push模式用的比pull多。

 

 

 

原创粉丝点击