Microsoft Windows CE 3.0  

Write a Transform Filter

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.

Writing a transform filter can be broken into the following discrete steps.

  1. Determine if the filter must copy media samples or can handle them in place.

    The fewer copies in the media stream, the better. However, some filters require a copy operation; this influences the choice of base classes.

  2. Determine which base classes to use and derive the filter class (and pin classes, if necessary) from the base classes.

    In this step, create the header or headers for your filter. In many cases, you can use the transform base classes, derive your class from the correct transform filter class, and override a few member functions. In other cases, you can use the more generic base classes. These classes implement most of the connection and negotiation mechanism; but these classes also allow more flexibility at the cost of overriding more member functions.

  3. Add the code necessary to instantiate the filter.

    This step requires adding a static CreateInstancemember function to your derived class and also a global array that contains the name of the filter, a CLSID, and a pointer to that member function.

  4. Add a NonDelegatingQueryInterfacemember function to pass out any unique interfaces in your filter.

    This step addresses the Component Object Model (COM) aspects of implementing interfaces, other than those in the base classes.

  5. Override the appropriate base class member functions.

    This includes writing the transform function that is unique to your filter and overriding a few member functions that are necessary for the connection process, such as setting the allocator size or providing media types.

     Last updated on Tuesday, May 18, 2004

    © 2004 Microsoft Corporation. All rights reserved.