Resizing Texture before sending to SinkWriter SharpDX

心已入冬 提交于 2019-12-11 17:32:06

问题


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


来源:https://stackoverflow.com/questions/50828713/resizing-texture-before-sending-to-sinkwriter-sharpdx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!