I need to send some video stream from DirectShow into a DirectX11 application. Also it requires that all graphics must be in the video memory. I have an inteface member like this
public int PresentImage(IntPtr dwUserID, ref VMR9PresentationInfo lpPresInfo)
But lpPresInfo contains only a pointer to DirectX9 surface. And after it I don't know what to do with such surface. If I create some off-screen surface with a shared handle I can't copy the DirectShow image to it while it's in video memory. The following throws an exception
IntPtr sourceSharedHandle; Surface dx11Surface = Surface.CreateOffscreenPlain(p_device, 1280, 720, Format.A8B8G8R8, Pool.Default, out sourceSharedHandle); p_device.UpdateSurface(currentSurface, dx11Surface);
And also DirectX9 doesn't contain some method use a surface from DirectX11 shared handle.
This exmaple doesn't help for DirectX11. Tell me please how can I cope with it.