0
votes

I'm working on Screen recording application. My problem is I need to resize the Texure2d before making sample using CreateDXGISurfaceBuffer. I'm new with Mediafoundation and upon reading the documentation I couldn't find any sample code from the website. I'm using IDXGIOutput1::DuplicateOutput to get the screen texture. Is there a better way to resize the texture without suffering the performance?

1
Do you mean texture content interpolation or just texture dimensions change?user7860670
This is the actual scenario. I grab a full screen desktop image and store it to a texture with the exact dimension of screen resolution. what I need to do now is resize the texture before making media foundation sample. Its like rasterizing the texture with a new dimension. Could be bigger than original or smaller. I believe Video Processor MFT is the solution but I don't know where to start because it is my first time working with Media Foundation.kripto

1 Answers

1
votes

Video Processor MFT can scale your textures. When you use it in Direct3D 11 enabled mode, it scales using GPU. You feed IMFSample with textures and obtain IMFSample with scaled textures.

Even though it's not complete sample, this code snippet might give an idea on interface methods involved.

You will also find related questions here on StackOverflow too: