Microsoft Windows CE 3.0  

Movement of Data Through the Filter Graph

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Data flows in the form of media samples from the output pin of one filter to the input pin of the next filter downstream. Media samples are COM objects that support the IMediaSampleor IMediaSample2interface. All samples are time-stamped and the flow of all streams is synchronized to a common clock, typically the system's sound card. DirectShow uses a push model: all filters push against the renderer filter, which can block the flow if it is put into a stop or paused state. For this reason, renderers are the only filters that actually care what state they are in. The renderer filter also controls the data rate, except in cases where the incoming stream has a variable bit rate, such as Internet streaming.

Filters can have three states: stopped, paused or running. In the stopped state, no data is flowing. The filter should release as many resources as possible although this isn't always possible, especially if a filter is holding special hardware resources. The paused state is just like on a VCR; it is an intermediate state in which only the first frame in the video stream is processed, with no audio. Pause can also be used for prerollingor loading the filter graph's buffers with media samples that are ready to be rendered immediately once the filter goes into a running state. In the running state, the data is accepted from the input pin, processed, and sent to the output pin. All state transitions are valid: run to pause, pause to stop, stop to run, and so on. An application can call a filter's IMediaFilter::GetStatemethod to determine what state it is in, but this is rarely necessary since the Filter Graph Manager handles the state transitions of filters. There is an ordering dependency in which filters in a graph are paused, so that none throw away data.



 Last updated on Tuesday, May 18, 2004

© 2004 Microsoft Corporation. All rights reserved.