diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-08-24 13:22:04 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-08-24 13:22:04 +0300 |
commit | 2de18acd61a64efc55faf58fabcdfb055e2ff4bd (patch) | |
tree | 53bc3341b24148a63d2b0d19bbf62333f7dc1ba9 /decoder/LAVVideo | |
parent | 4af437583897f0fe38b60ea23cdc9f71ee281b4d (diff) |
d3d11: test texture creation during PostConnect
This ensures the texture format (NV12 or P010) and dimensions are
supported.
Diffstat (limited to 'decoder/LAVVideo')
-rw-r--r-- | decoder/LAVVideo/decoders/d3d11va.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/decoder/LAVVideo/decoders/d3d11va.cpp b/decoder/LAVVideo/decoders/d3d11va.cpp index f0c08251..08ad5836 100644 --- a/decoder/LAVVideo/decoders/d3d11va.cpp +++ b/decoder/LAVVideo/decoders/d3d11va.cpp @@ -404,6 +404,26 @@ STDMETHODIMP CDecD3D11::PostConnect(IPin *pPin) { goto fail; } + + // test creating a texture + D3D11_TEXTURE2D_DESC texDesc = { 0 }; + texDesc.Width = m_pAVCtx->coded_width; + texDesc.Height = m_pAVCtx->coded_height; + texDesc.MipLevels = 1; + texDesc.ArraySize = 10; + texDesc.Format = m_SurfaceFormat; + texDesc.SampleDesc.Count = 1; + texDesc.Usage = D3D11_USAGE_DEFAULT; + texDesc.BindFlags = D3D11_BIND_DECODER | D3D11_BIND_SHADER_RESOURCE; + texDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED; + + ID3D11Texture2D *pTexture2D = nullptr; + hr = pD3D11Device->CreateTexture2D(&texDesc, nullptr, &pTexture2D); + if (FAILED(hr)) + { + goto fail; + } + SafeRelease(&pTexture2D); } // Notice the connected pin that we're sending D3D11 textures |