I am trying to create a Media Foundation Transform that draws text on video using D2D and D3D11. I am trying to construct a D2D RenderTarget on top of D3D11 resources, but unfortunately, most means of D2D and D3D interop require D3D10, which is not available within this project.
The parameters I have to work with are as follows: ID3D11Device *pDevice, ID3D11Texture2D *pInput, UINT uiInIndex, ID3D11Texture2D *pOutput, and UINT uiOutIndex.
I attempted to follow the advice of this tutorial, but it turns out that it requires a ID3D10Texture2D object, which again is not an option for me.
Essentially you copy the frame from the input texture to the output texture, then do the following to retrieve an IDXGI surface:
IDXGISurface *surface;
pOutput->QueryInterface(&surface);
Then, follow the steps in this tutorial to turn the surface into a Direct2D render target. Once you have the render target, you can draw on it in a similar manner to how the tutorial draws the gradient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With