Bewerken

Delen via


Event Handling in AVStream

AVStream filters and pins describe properties, events, and methods that they support by supplying a KSAUTOMATION_TABLE structure in the AutomationTable member of either a KSFILTER_DESCRIPTOR structure or a KSPIN_DESCRIPTOR_EX structure. For more information, see AVStream Descriptors.

To support events, an AVStream minidriver provides an array of KSEVENT_SET structures in an automation table. Each KSEVENT_SET structure contains an array of KSEVENT_ITEM structures. Each KSEVENT_ITEM structure describes how the minidriver supports a specific event.

The minidriver can customize event behavior by supplying AVStrMiniAddEvent and AVStrMiniRemoveEvent handlers in the KSEVENT_ITEM structures.

When AVStream receives an event enable request, it generates a KSEVENT_ENTRY structure. If the minidriver has provided an AVStrAddEvent handler, AVStream passes a pointer to the KSEVENT_ENTRY structure in the call to AVStrAddEvent.

If you do not provide an AVStrAddEvent handler, then by default AVStream adds the event to the object list. Your minidriver does not receive a KSEVENT_ENTRY pointer. Your minidriver can trigger the event by calling KsFilterGenerateEvents or KsPinGenerateEvents.