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:
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:
- How to properly use a hardware accelerated Media Foundation Source Reader to decode a video?
- Video resizing with the Video Processor MFT