Windows Vista introduced helpful video and audio Digital Signal Processors (DSPs) in DMO form-factor, which however do not work smoothly with DMO Wrapper Filter and thus cannot be directly used in DirectShow.
There perhaps was no intent in first place to extend DirectShow functionality with these new components, and no effort was put into providing this mode of operation, however as long as the new classes are
DMOs, it is still possible to tune them up to work in DirectShow pipeline.
This sample code/application provides a code snippet on how Video Resizer DSP can be used in DirectShow. There were earlier some discussions on MSDN Forums and this complements the guidelines with code.
The idea is the following:
DMOand add it to
DMO Wrapper Filter
IWMResizerProps::SetFullCropRegionto initialize the
- Connect input pin
- Set output type via
The sample application takes a video file (note that for the brevity of the sample, not all files will be supported, there is an assumption that files are decoded into
VIDEOINFOHEADER media type, and we limit color spaces to 32-bit RGB only to avoid problems on the way in this tiny sample).
The application takes file path (I recommend
.WMV) creates DirectShow pipeline, adds Sample Grabber filter to force color space to be 32-bit RGB, adds resizer and sets it up to double video height, but not width, and plays the video.
The application’s filter graph looks like this:
And the video window is stretched twice in height: