Saturday, December 5, 2009

DirectShow Filter Graph

The basic building block of the DirectShow is called Filter and it is a software component that performs some operation on a multimedia stream. Filter Graph is a set of connected filters and an application performs any task by connecting chains of filters together. DirectShow applications don’t need to manage all the data flow within the filters. Application make high level API calls such as run of stop to move or stop data between the filters. There is a high level component which controls the data flow in filters and it is called Filter Graph Manager. It provides methods for the application to build the filter graph by connecting the filters together. All the filters and the Filter Graph Manager are all COM objects.

Filters can be grouped in to several broad categories. But the distinctions between these categories are not obsolete and some filters can put in to several categories. According to the DirectShow MSDN filters can be categorized in to five main categories as below.

  • Source filters – Source filters introduces data in to the graph. The data might come from a file, camera, network or anywhere else. Each source filter handles a different type of data source.
Ex: RTP source filters, Video capture Filter.
  • Transform filters – Transform filters takes an input stream, process the data and creates an output stream.
Ex: Encoders, Decoders, Color Space Converters.
  • Renderer filters – Renderer filters sit at the end of the filter chain of the filter graph and they receive data and present it to the user.
Ex: Video Renderer , Audio Renderer, File Writer
  • Splitter filters- Splitter filters splits and input stream in to two or more outputs.
Ex:AVI splitter- parses a byte stream into separate video and audio streams.
  • MUX filters – MUX filters take multiple inputs and combine them in to a single stream.
Ex: AVI MUX – takes audio and video streams and produces an AVI formatted byte stream.

No comments:

Post a Comment