Quantcast
Channel: Media Foundation Development for Windows Desktop forum
Viewing all articles
Browse latest Browse all 1079

Creating VideoProcessor InputView with custom buffer.

$
0
0

I am writing a test application to test D3D11 VideoProcessing APIs.

I have a input buffer with NV12 data. I want to do a VideoProcessBlit on this buffer and receive the output in other buffer.

To do a VideoProcessBlit, i'm trying to create VideoProcessor InputView and OutputView with resources as textures, which are created with my input and output buffers. Is it possible to create such Input and Output views for VideoProcessor? 

Moreover when i try to create texture2D for input view the call fails with E_INVALIDARG error. the texture desc. i'm using is  

D3D11_TEXTURE2D_DESC sDesc;
ZeroMemory(&sDesc, sizeof(sDesc));
sDesc.Width = srcVideo.size.cx;
sDesc.Height = srcVideo.size.cy;
sDesc.MipLevels = 0;
sDesc.ArraySize = 1;
sDesc.Format = DXGI_FORMAT_NV12;
sDesc.SampleDesc.Count = 1;
sDesc.Usage = D3D11_USAGE_DEFAULT;
sDesc.BindFlags = D3D11_BIND_DECODER | D3D11_BIND_RENDER_TARGET;
sDesc.CPUAccessFlags = 0;
sDesc.MiscFlags = 0;

D3D11_SUBRESOURCE_DATA sInitData;
sInitData.pSysMem = pbBuffer; // NV12 buffer.
sInitData.SysMemPitch = srcVideo.size.cx;
sInitData.SysMemSlicePitch = 0;

hr = d3d11.pDevice->CreateTexture2D(&sDesc, &sInitData, &pTexture2D);

if I bind the texture to shader resource, with dynamic usage the texture is created successfully but CreateVideoProcessorInputView fails with E_INVALIDARG. Anyone faced similar issue for creating texture?

-Robin.



Viewing all articles
Browse latest Browse all 1079

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>