Need direction on setting up and invoking Resizer MFT RRS feed

  • Question

  • I have an application that is currently rendering frames from a webcam based on the MFCaptureD3D sample.  I'd now like to add a zooming feature.

    I think I can use the video resizing MFT (http://msdn.microsoft.com/en-us/library/ff819491%28VS.85%29.aspx) to accomplish this.  My idea is to call ProcessInput() and ProcessOutput() on a per frame basis from the OnReadSample callback before passing the cropped / zoomed frames along to be rendered, but I can't find a simple example or documentation describing how to set up the MFT (source and destination rectangles), how to manage buffers for the resized frames, polling for output being available, etc.

    Can anyone point me to a simple sample which shows the basics of setting up and invoking an image processing MFT?   Thanks!

    Friday, April 1, 2011 10:29 PM

All replies

  • There's a massive guide on MFT's in the online SDK for MF. As you've probably seen, the IMFTransform interface is designed to work within the confines of a pipeline. You'd have to abuse the mechanics of media type changes and event tokens, propvariants etc to get a message through to the inside of your MFT to adjust the zooming rectangle.

    It's not going to be a simple process and you'll have to write a custom MFT. The only other thing I could think of is using an EVR Mixer which supports visual rectangle manipulation by specifying source-destination rectangles oon an uncompressed media type.

    Thursday, April 7, 2011 8:00 AM
  • Thanks for your reply Nobby_.

    I actually got this to work roughly as described using the resizing MFT.  I figured out how to treat the MFT as a DMO and call ProcessInput() / ProcessOutput() manually on it.

    I'm stuck now on what I think should be a much simpler problem -- changing to a higher camera resolution.  I can't get this to work even in the vanilla MFCaptureD3D sample from the SDK; see http://social.msdn.microsoft.com/Forums/en-US/mediafoundationdevelopment/thread/5bb16020-7ad9-4f4d-af51-79d3a92977ca.

    Any ideas?




    Monday, April 11, 2011 9:08 PM