Introduction to the Filter Base Classes
This article describes the Microsoft DirectShow base class library. This library is intended for filter developers, but application writers might find some of the helper classes and debugging utilities useful. The base class library is not required for DirectShow programming, however.
The following sections summarize the most important base classes in the library.
COM Object Classes
The following classes support the creation of COM objects:
- CBaseObject: Most of the DirectShow classes derive from this class. It provides debugging assistance by keeping a count of all the active objects in the DLL at run time. In debug builds, the DLL will assert if it is unloaded while the object count is greater than zero. This makes it easier to track down leaks caused by reference-counting problems.
- CUnknown: Implements IUnknown. All of the base classes that support COM interfaces derive from this class. This class derives from CBaseObject. It supports reference counting, QueryInterface, and aggregration. For more information, see How to Implement IUnknown.
Filter and Pin Classes
The following classes support the creation of DirectShow filter and pin objects:
The following classes are useful for creating more specialized types of filters:
- CSource: Base class for source filters. This class is designed for creating push sources. It is not suitable for pull sources, such as file readers. To create output pins for this class, use the CSourceStream class.
- CTransformFilter: Base class for transform filters. This class performs a copy on the data. The pins for this class are CTransformInputPin and CTransformOutputPin.
- CTransInPlaceFilter: Base class for transform filters that do not copy data. This class performs the data processing directly on the input data before passing it downstream. The pins for this class are CTransInPlaceInputPin and CTransInPlaceOutputPin.
- CVideoTransformFilter: Base class for video transform filters. This class derives from CTransformFilter and adds support for quality control.
- CBaseRenderer: Base class for renderer filters. The input pin for this class is CRendererInputPin.
- CBaseVideoRenderer: Base class for video renderers. This class derives from CBaseRenderer.
To use these classes, you must derive your own class and write code to support the functionality that is specific to your filter. The more specialized the base class, the less code you will need to write in your derived class.
Helper Objects
The following classes implement helper objects that are used by filters and pins. For the most part, you can use these classes without deriving new classes from them: