[DirectShow] 005 - About the Filter Graph Manager

来源:互联网 发布:深圳市软件企业协会 编辑:程序博客网 时间:2024/04/30 09:08

<!-- /* Font Definitions */ @font-face{font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-alt:SimSun;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;}@font-face{font-family:"Cambria Math";panose-1:0 0 0 0 0 0 0 0 0 0;mso-font-charset:1;mso-generic-font-family:roman;mso-font-format:other;mso-font-pitch:variable;mso-font-signature:0 0 0 0 0 0;}@font-face{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;mso-font-charset:0;mso-generic-font-family:swiss;mso-font-pitch:variable;mso-font-signature:-1610611985 1073750139 0 0 159 0;}@font-face{font-family:"/@宋体";panose-1:2 1 6 0 3 1 1 1 1 1;mso-font-charset:134;mso-generic-font-family:auto;mso-font-pitch:variable;mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal{mso-style-unhide:no;mso-style-qformat:yes;mso-style-parent:"";margin:0cm;margin-bottom:.0001pt;text-align:justify;text-justify:inter-ideograph;mso-pagination:none;font-size:10.5pt;mso-bidi-font-size:11.0pt;font-family:"Calibri","sans-serif";mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;mso-font-kerning:1.0pt;}a:link, span.MsoHyperlink{mso-style-priority:99;color:blue;text-decoration:underline;text-underline:single;}a:visited, span.MsoHyperlinkFollowed{mso-style-noshow:yes;mso-style-priority:99;color:purple;mso-themecolor:followedhyperlink;text-decoration:underline;text-underline:single;}.MsoChpDefault{mso-style-type:export-only;mso-default-props:yes;mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;} /* Page Definitions */ @page{mso-page-border-surround-header:no;mso-page-border-surround-footer:no;}@page Section1{size:595.3pt 841.9pt;margin:72.0pt 90.0pt 72.0pt 90.0pt;mso-header-margin:42.55pt;mso-footer-margin:49.6pt;mso-paper-source:0;layout-grid:15.6pt;}div.Section1{page:Section1;}-->

The FilterGraph Manager is a COM object that controls the filters in a filter graph.It performs many functions, including the following:

Coordinating state changes among the filters.

Establishing a referenceclock.

Communicating events back to the application.

Providing methods for applications to build the filter graph.

Filter Graph Manager 是一个COM对象,是filter graph中控制filters的对象。它执行许多功能,包括:

调整一类filters的状态变化。

建立一个引用时钟。

返回事件给应用程序。

提供方法给应用程序生成filter graph

Each of these functions is described briefly here. Details can befound elsewhere in the documentation.

State changes. State changes within filters must occur in a particular order.Therefore, the application does not issue state-change commands directly to thefilters. Instead, it gives a single command to the Filter Graph Manager, whichdistributes the command to each of the filters. Seeking works in a similarfashion: The application gives a seek command to the Filter Graph Manager,which distributes it to the filters.

Reference clock. All of the filters in the graph use the same clock, called areference clock. The reference clock ensures that all the streams aresynchronized. The time at which a video frame or audio sample should berendered is called the presentation time. The presentation time is measuredrelative to the reference clock. The Filter Graph Manager chooses a referenceclock, usually either the clock on the sound card, or the system clock.

Graph events. The Filter Graph Manager uses an event queue to inform theapplication of events that occur in the filter graph. This mechanism is similarto a Windows message loop.

Graph-building methods. The Filter Graph Manager provides methods for the application to addfilters to the graph, connect filters to other filters, and disconnect filters.

Statechanges. filters内的状态变化必须发生在特殊的命令中。因此,应用程序不直接像filters发送状态转化命令。而是给Filter Graph Manager一个单独的命令,由Filter Graph Manager给每一个filters分发命令。

Referenceclock. graph中的所有filter都使用相同的时钟,这个时钟叫做reference clock. referrence确保所有的流同步。The time at which a video frame or audio sampleshould be rendered is called the presentation time. The presentation time ismeasured relative to the reference clock. Filter Graph Manager选择声卡时钟或者系统时钟作为reference clock

Graphevents. Filter Graph Manager使用事件队列通知接收filter graph中产生消息的应用程序。这个机制类似Windows的消息循环。

Graph-buildingmethods. Filter Graph Manager为应用程序提供了添加filtergraph,连接两个filter,断开filter连接的方法。

One function the Filter Graph Manager does not handle is moving datafrom one filter to the next. This is done by the filters themselves, throughtheir pin connections. Processing always happens on a separate thread.

有一个功能是Filter Graph Manage没有处理的,那就是把数据从一个filter移动到下一个。这是由filter通过pin的连接来完成。处理过程总是发生在一个分离线程。