Microsoft DirectX 9.0

Step 1. Choose a Base Class

Assuming that you decide to write a filter and not a DMO, the first step is choosing which base class to use. The following classes are appropriate for transform filters:

Important   In-place video transforms can have a serious impact on rendering performance. In-place transforms require read-modify-write operations on the buffer. If the memory resides on a graphics card, read operations are significantly slower. Moreover, even a copy transform can cause unintended read operations if you do not implement it carefully. Therefore, you should always do performance testing if you write a video transform.

For the example RLE encoder, the best choice is either CTransformFilter or CVideoTransformFilter. In fact, the differences between them are largely internal, so it is easy to convert from one to the other. Because the media types must be different on the two pins, the CTransInPlaceFilter class is not appropriate for this filter. This example will use CTransformFilter.