Event Notification Codes
[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
This sections lists the DirectShow events that are not specific to DVD. For events specific to DVD, see DVD Event Notification Codes.
Filters send events to the Filter Graph Manager by calling the IMediaEventSink::Notify method. The Filter Graph Manager handles some events and queues others for the application. The application retrieves them by calling the IMediaEvent::GetEvent method.
In the sections that follow, each entry lists the event code, the meaning of the event parameters, and the Filter Graph Manager's default action for the event, if any. To override the default action, call IMediaEvent::CancelDefaultHandling. Event codes are defined in the header files Evcode.h and Audevcod.h. If there is no default action, the Filter Graph Manager automatically forwards the event to the application (through the event queue).
Filters can define custom events with event codes in the range EC_USER and higher. The Filter Graph Manager will place these directly in the event queue. However, the following caveats apply:
- The Filter Graph Manager cannot free the event parameters using the normal IMediaEvent::FreeEventParams method. The application must free any memory or reference counts associated with the event parameters.
- The filter should only send the event from within an application that is prepared to handle the event. (Possibly the application can set a custom property on the filter to indicate that it is safe to send the event.)
|Event notification code
|A video window is being activated or deactivated.
|The graph is buffering data, or has stopped buffering data.
|Send by the Video Control when a graph has been built. Not forwarded to applications.
|The reference clock has changed.
|The clock provider was disconnected.
|Sent by an encoder to signal an encoding event.
|All data from a particular stream has been rendered.
|A Plug and Play device was removed or has become available again.
|The display mode has changed.
|The end of a segment has been reached.
|An asynchronous command to run the graph has failed.
|An operation was aborted because of an error.
|An operation was aborted because of an error.
|The source file was closed because of an unexpected event.
|The video renderer is switching out of full-screen mode.
|The filter graph has changed.
|The length of a source has changed.
|Notifies the application of progress when opening a network file.
|A filter is requesting that the graph be restarted.
|Notifies a filter of the video renderer's window.
|A filter is passing a text string to the application.
|The graph is opening a file, or has finished opening a file.
|The video palette has changed.
|A pause request has completed.
|The source file has changed.
|Sent by the WM ASF Writer filter when it completes the pre-processing for multipass encoding.
|Indicates the amount of time that a component is taking to process each sample.
|The graph is dropping samples, for quality control.
|A video renderer requires a repaint.
|Specifies how far behind schedule a component is for processing samples.
|Requests a new input sample from the Enhanced Video Renderer (EVR) filter.
|Specifies the time stamp for the most recent frame step.
|A new segment has started.
|The filter graph is shutting down, prior to being destroyed.
|A device error has occurred in an audio capture filter.
|A device error has occurred in an audio renderer filter.
|A filter is not receiving enough data.
|The filter graph has changed state.
|Contains two arbitrary status strings.
|A filter performing frame stepping has stepped the specified number of frames.
|A stream-control start command has taken effect.
|A stream-control stop command has taken effect.
|An error has occurred in a stream. The stream is still playing.
|A stream has stopped because of an error.
|Send by the Video Control when a graph has been torn down. Not forwarded to applications.
|The user has terminated playback.
|The native video size has changed.
|A video frame is ready for display.
|Sent by the VMR-7 and the VMR-9 when it was unable to accept a dynamic format change request from the upstream decoder.
|Sent when the VMR has selected its rendering mechanism.
|Sent when the VMR-7's allocator presenter has called the DirectDraw Flip method on the surface being presented.
|The video renderer was destroyed or removed from the graph.
|Sent by the WM ASF Reader filter when it reads ASF files protected by digital rights management (DRM).
|Sent when an application uses the WM ASF Writer to index Windows Media Video files.