天天看点

[DirectShow] 017 - Overview of Event Notification

A filter notifies the Filter Graph Manager about an event by posting an event notification. The event could be something expected, such as the end of a stream, or it could represent an error, such as a failure to render a stream. The Filter Graph Manager handles some filter events by itself, and it leaves others for the application to handle. If the Filter Graph Manager does not handle a filter event, it places the event notification into a queue. The filter graph can also queue its own event notifications for the application.

filter 通过发送通知事件告诉 Filter Graph Manager 一个事件。这个事件可以是预期的事情,例如播放结束;或者代表一个错误,就像演示流出错一样。 Filter Graph Manager 自己处理一些事件,并忽略一些事件交给应用程序处理。如果 Filter Graph Manager 没有处理事件,它会把通知时间放进队列。 filter graph 能为应用程序拥有自己的通知时间队列。

An application retrieves events from the queue and responds to them based on the type of event. Event notification in DirectShow is therefore similar to the Microsoft Windows message queuing scheme. An application can also cancel the Filter Graph Manager's default behavior for a given event type. The Filter Graph Manager then puts those events directly into the queue for the application to handle.

应用程序从队列中获得事件,并根据事件类型作出响应。 DirectShow 中的通知事件类似 Windows 消息队列机制。应用程序任然可以废除给定事件类型的默认行为。 Filter Graph Manager 直接把这些时间放进队列让应用程序处理。

This mechanism enables

·         The Filter Graph Manager to communicate with the application.

·         Filters to communicate with both the application and the Filter Graph Manager.

·         The application to determine its degree of involvement in handling events.

这种机制能使:

·         Filter Graph Manager 与应用程序通讯。

·         filter 与应用程序和 Filter Graph Manager 通讯。

·         应用程序参与处理事件的程度。

继续阅读