I am trying to get HW accelerated video decoding to work in an UWP app. When using D3D11, my decoder will return a ID3D11Texture2D and an index. The texture has an ArraySize of 28. For rendering samples into UWP, I need to convert the texture to a IDXGISurface, call CreateDirect3DSurface to get an IDirect3D11Surface, and finally create a sample using MediaStreamSample.CreateFromDirect3D11Surface().
The problem is now: A IDXGISurface, according to msdn docs, is only implicitly created for textures with ArraySize=1. Then I can QueryInterface the texture for IDXGISurface. But my texture has ArraySize=28, so I get E_NOINTERFACE. I tried to use CreateSubresourceSurface with an index. This gets me a IDXGISurface. But when I try to create a sample from it using MediaStreamSample.CreateFromDirect3D11Surface(), I get an exception, again E_NOINTERFACE. I guess this is because the IDXGISurface does not implement ID3D11Texture2D (this seems to be required, although not documented. I checked, this IDXGISurface really does not return ID3D11Texture2D on QueryInterface).
Is there any way to create a IDXGISurface from an array texture? Create a texture or surface that points to the sub area of the array texture? I cannot really change the decoder since it's a 3rd party library.