Filters

Filters are the basic building blocks of DirectShow. DirectShow separates the processing of multimedia data into discrete steps, and a filter represents one (or sometimes more than one) processing step. This enables applications to "mix and match" filters to perform many different kinds of operations on many different media formats using many different classes of hardware and software devices. For example, the File Source (Async) filter reads a file from a disk. Although each of these filters does something very unique internally, from the point of view of an application, each is just a DirectShow filter with certain standard characteristics: support for the IBaseFilter Interface and one or more input and/or output pins which represent its connections to one or more other DirectShow filters.

All DirectShow filters fall into one of these three categories: source filters, transform filters, and renderer filters.

Source Filters

Source filters present the raw multimedia data for processing. They may get it from a file on a hard disk (such as the File Source (Async) source filter), or from a CD or DVD drive, or they may get it from a "live" source such as a television receiver card. Some source filters simply pass on the raw data to a parser or splitter filter, while other source filters also perform the parsing step themselves.

Transform Filters

Transform filters accept either raw or partially processed data and process it further before passing it on. There are many types of transform filters including parsers that split raw byte streams into samples or frames, compressors and decompressors, and format converters. DirectShow includes many popular codecs. In the example described in The Filter Graph, the AVI Splitter and the AVI decompressor are both transform filters.

Renderer Filters

Renderer filters generally accept fully processed data and play it on the system's monitor or through the speakers or possibly through some external device. Also included in this category are "file-writer" filters that save data to disk or other persistent storage. The video renderer filters that come with DirectShow use DirectDraw to display video and the default audio renderer filter uses WaveOut to play audio.

Filters for playing, and converting many different media formats are supplied with DirectShow. Developers can also build their own custom filters for handling either custom or standard data formats.

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.