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. |
The derived filter class must provide a few member functions, typically to perform the following tasks:
- Determine if the filter accepts the media type.
- Specify the count and size of any required allocators (for copy
transforms only).
- Provide the transform functionality of the filter.
All derived filter classes must implement a static CFactoryTemplate::CreateInstancefunction.
You can also choose to override the CBaseFilter::GetSetupDatamember function to make your filter self-registering.
Beyond this, your classes must override a few member functions in the transform base classes.
For more information about instantiating the filter, see Creating a Transform Filter.
If your derived filter class is based on the CTransformFilterclass, you must override the following member functions.
Member function | Purpose |
---|---|
Implement transform. |
|
Verify support of media type. |
|
Verify support for transforming this type (for debugging builds only). |
|
Set size and count when copying. |
|
Suggest media types for the output pin. |
If your derived filter class is based on the CTransInPlaceFilterclass, override the following member functions.
Member function | Purpose |
---|---|
Implement transform. |
|
Verify support of media type. |
Beyond providing your transform filter with a default implementation by providing the minimum overrides, you can override other member functions to provide more specialized behavior.
The member functions you override depend on what you want your filter to do. For example, you must override the GetPinand GetPinCountmember functions if you want to have more than one input pin and one output pin on the filter.
Also, several base class member functions, such as BreakConnector CompleteConnect, are called as notifications to your filter through the pins. Typically, most of these member functions exist only on the pins.
In the classes based on CTransformFilter, the pin functions are implemented to call similarly named functions in the filter class.
This means that the member functions you most likely will want to override are all collected into one filter class, so you can leave the pin classes unchanged, making implementation smaller and easier.
The member functions are as follows.
Member function | Reason to override |
---|---|
To distribute any interfaces added in the derived class. |
|
If adding more pins to the transform filter. |
|
If adding more pins to the transform filter. |
|
To obtain extra interfaces at connect time or for other reasons. |
|
To release extra interfaces when connection is broken or for other reasons. |
|
To perform some action at the end of connection (such as reconnecting the input pin). |
|
To be notified when the media type has been set. |
|
To be notified when entering the streaming state. |
|
To be notified when exiting the streaming state. |
|
To do anything with quality control messages other than passing them on. |