Microsoft DirectX 8.1 (C++)

End-of-Stream Notifications

When a source filter is done sending data, it calls the IPin::EndOfStream method on the downstream input pin. The downstream filter propagates the call to the next filter, and so on. When the EndOfStream call reaches the renderer, the renderer sends an EC_COMPLETE event to the Filter Graph Manager. A filter must serialize EndOfStream calls with other streaming calls, such as IMemInputPin::Receive. In other words, the downstream filter must always receive the calls in the correct order.

The Filter Graph Manager does not forward every EC_COMPLETE event to the application. Instead, it waits until all streams have signaled EC_COMPLETE. Then it sends one EC_COMPLETE event for the entire filter graph. In this way, the application only receives the event after every stream in the graph is complete. To determine how many streams are in the graph, the Filter Graph Manager counts the number of filters that support IMediaSeeking or IMediaPosition and have a rendered input pin, which is defined as an input pin with no corresponding outputs. The Filter Graph Manager determines whether a pin is rendered in one of two ways:

In an IAsyncReader connection, the source filter does not send an end-of-stream notification. Instread, this is done by the downstream filter, which is typically a parser filter. The parser sends the EndOfStream call downstream. It does not send one upstream to the source filter.