天天看點

[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 通訊。

·         應用程式參與處理事件的程度。

繼續閱讀