There are two steps to βresizing outputβ in your MFT.
1) You need to change the SetOutputType and GetOutputAvailableType procedures:
- If SetOutputType is currently checking the dimensions to verify that they are the same as the input (which you may or may not be able to do), you need to update this.
- When you request an enumeration of the output types that you support through GetOutputAvailableType (provided that you support the enumeration of types), your output media type must be of the correct size.
2) You need to change the processing of samples in ProcessInput / ProcessOutput in order to actually resize. Simply changing media types does not perform any automatic resizing. How you resize depends on the actual format of the video data (which you did not provide), as well as how you want to resize. Did you just want to chop off the extra lines? Above or below? Do you also need to maintain chopping width?
I have a C ++ class that handles all the overhead of creating an MFT, as well as a series of MFT examples that show how to use this class, available at http://www.LimeGreenSocks.com/MFT . It is still in beta at the time of this writing, but it should give you some ideas.
Probably the closest example to what you are trying to do is turn. When you rotate the video, 800x600 can become a 600x800 sized video camera. Rotation even allows you to change the rotation during streaming (see Format Changes in Asynchronous MFT). C ++ rotate mft - well-commented ~ 350 lines long.
source share