Filters and Pins


The two basic components used in the stream architecture are filters and pins. A filter is a COM object that performs a specific task, such as reading data from a disk. For each stream it handles, it exposes at least one pin. A pin is a COM object created by the filter, that represents a point of connection for a unidirectional data stream on the filter, as shown in the following illustration.

Pin illustration

Input pins accept data into the filter, and output pins provide data to other filters. A source filter provides one output pin for each stream of data in the file. A typical transform filter, such as a compression/decompression (codec) filter, provides one input pin and one output pin, while an audio output filter typically exposes only one input pin. More complex arrangements are also possible.

At a minimum, a filter exposes the IBaseFilter interface. This interface provides methods that allow the enumeration of the pins on the filter and return filter information. It also provides the inherited methods from IMediaFilter; these methods allow control of state processing (for example running, pausing, and stopping) and synchronization, and are called primarily by the filter graph manager.

In addition, a filter might expose several other interfaces, depending on the media types supported and tasks performed. For example, a filter can expose the ISpecifyPropertyPages interface to support a property page.

Pins are responsible for providing interfaces to connect with other pins and for transporting the data. The pin interfaces support the following:

Pin interfaces differ slightly, depending on whether they are output pins or input pins.

An output pin typically exposes the following interfaces.

An input pin typically exposes the following interfaces.

The standard transport interface, IMemInputPin, provides data transfer through shared memory buffers, although other transport interfaces can be used. For example, where two components are connected directly in hardware, they can connect to each other by using the IPin interface, and then seek a private interface that can manage the transfer of data directly between the two components.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.